#!/usr/bin/make -f
# -*-makefile-*-
# debian/rules file for perl-tk

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

PERL ?= /usr/bin/perl

package	:= $(firstword $(shell dh_listpackages))
prefix	:= $(CURDIR)/debian/$(package)

% :
	dh $@

override_dh_auto_clean:
	rm -f $$(cat debian/generated-files.txt)
	dh_auto_clean

override_dh_auto_configure:
	dh_auto_configure -- XFT=1 INSTALLDIRS=vendor X11LIB=/usr/lib/$(DEB_HOST_MULTIARCH) PERL=$(PERL)
	: # uncomment the following lines to enforce gcc-15
	#for f in $$(find . -name Makefile); do \
	#  sed -i 's/[-a-zA-Z0-9_]*-linux-gnu-gcc/gcc-15/' $$f; \
	#done


override_dh_auto_build:
	$(MAKE) LD_RUN_PATH= OPTIMIZE="$(CFLAGS)"

override_dh_auto_install:
	$(MAKE) pure_install DESTDIR=$(prefix)
	rm -rf $(prefix)/usr/bin/gedi

override_dh_auto_test:
	# xvfb-run -a dh_auto_test
	echo "tests are partially broken, probably due to changes introduced by debian/patches/gcc-15.patch"
