#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 export CARGO_HOME = $(CURDIR)/debian/cargo-home NULL = built_binaries := $(shell dh_listpackages) configure_flags := # Increase reftest tolerance a bit to account for different harfbuzz, # pango, etc. export RSVG_TEST_TOLERANCE=20 # dav1d is not currently in Ubuntu main LP: #2004446 ifeq ($(shell dpkg-vendor --query vendor),Ubuntu) configure_flags += -Davif=disabled endif %: dh $@ override_dh_auto_configure: mkdir -p $(CARGO_HOME) cp -a debian/a-link-purple-bg.png rsvg_convert/tests/fixtures/a-link-purple-bg.png install -d debian/missing-sources/system-deps/src/tests/lib touch debian/missing-sources/system-deps/src/tests/lib/libteststatic.a dh_auto_configure -- \ -Dauto_features=enabled \ $(configure_flags) \ $(NULL) execute_before_dh_auto_build: mkdir -p debian/missing-sources/system-deps-6.2.2/src/tests/lib/ touch debian/missing-sources/system-deps-6.2.2/src/tests/lib/libteststatic.a execute_after_dh_auto_build: rm -rf debian/missing-sources/system-deps-*/src/tests/lib/ override_dh_install: rm -f debian/tmp/usr/bin/rsvg-view-3 dh_install sed -e "s/#MULTIARCH#/$(DEB_HOST_MULTIARCH)/g" debian/librsvg2-common.postinst.in > \ debian/librsvg2-common.postinst # debhelper >= 13.4 makes all of /usr/libexec executable, which is not # quite right for installed-tests override_dh_fixperms: dh_fixperms -Xusr/libexec/rsvg/tests ifneq ($(filter %-tests,$(built_binaries)),) chmod --recursive --changes a+rX,u+w,og-w debian/*-tests/usr/libexec/rsvg/tests endif override_dh_clean: dh_clean -X.bak rm -fr $(CARGO_HOME) ifneq ($(filter i386,$(DEB_HOST_ARCH_CPU)),) rm -f tests/fixtures/reftests/svg1.1/filters-composite-02-b.svg rm -f tests/fixtures/reftests/svg1.1/filters-composite-02-b-ref.png endif ifeq ($(DEB_HOST_ARCH_ENDIAN),big) # Several tests regressed on big-endian architectures sometime between # September 2022 and June 2023 as a result of changes in some other # package. # https://bugs.debian.org/1038447, GNOME/librsvg#972 rm -f rsvg/tests/fixtures/reftests/svg1.1/coords-viewattr-02-b.svg # https://bugs.debian.org/1038447, GNOME/librsvg#973 rm -f rsvg/tests/fixtures/reftests/filter-kernel-unit-length.svg # https://bugs.debian.org/1038447, GNOME/librsvg#974 rm -f rsvg/tests/fixtures/reftests/svg1.1/filters-composite-04-f.svg # https://bugs.debian.org/1038447, GNOME/librsvg#975 rm -f rsvg/tests/fixtures/reftests/svg1.1/filters-conv-02-f.svg # https://bugs.debian.org/1038447, GNOME/librsvg#976 rm -f rsvg/tests/fixtures/reftests/svg1.1/filters-conv-03-f.svg # https://bugs.debian.org/1038447, GNOME/librsvg#977 rm -f rsvg/tests/fixtures/reftests/svg1.1/filters-conv-04-f.svg # https://bugs.debian.org/1038447, GNOME/librsvg#978 rm -f rsvg/tests/fixtures/reftests/svg1.1/filters-image-01-b.svg # https://bugs.debian.org/1038447, GNOME/librsvg#979 rm -f rsvg/tests/fixtures/reftests/svg1.1/filters-image-02-b.svg # https://bugs.debian.org/1038447, GNOME/librsvg#980 rm -f rsvg/tests/fixtures/reftests/svg1.1/filters-image-03-f.svg # https://bugs.debian.org/1038447, GNOME/librsvg#981 rm -f rsvg/tests/fixtures/reftests/svg1.1/filters-image-05-f.svg # https://bugs.debian.org/1038447, GNOME/librsvg#982 rm -f rsvg/tests/fixtures/reftests/svg1.1/pservers-grad-05-b.svg # https://bugs.debian.org/1038447, GNOME/librsvg#983 rm -f rsvg/tests/fixtures/reftests/svg1.1/pservers-grad-06-b.svg # https://bugs.debian.org/1038447, GNOME/librsvg#984 rm -f rsvg/tests/fixtures/reftests/svg1.1/struct-symbol-01-b.svg endif rm -f rsvg/tests/fixtures/reftests/bugs/730-font-scaling-ref.png rm -f rsvg/tests/fixtures/reftests/bugs/730-font-scaling.svg override_dh_auto_test-arch: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) mkdir -p $(CURDIR)/debian/locales localedef -i en_US -f UTF-8 $(CURDIR)/debian/locales/en localedef -i en_US -f UTF-8 $(CURDIR)/debian/locales/en_US localedef -i de_DE -f UTF-8 $(CURDIR)/debian/locales/de failed=0; \ LOCPATH=$(CURDIR)/debian/locales dh_auto_test || failed=1; \ find debian -name '*.log' \ -not -name config.log \ -not -name test-suite.log \ -not -path '*/.local/share/gvfs-metadata/*.log' \ -print0 | xargs -0 tail -v -c1M; \ debian/log-reftests.py; \ exit $$failed endif override_dh_auto_test-indep: @: # dav1d is not currently in Ubuntu main LP: #2004446 override_dh_gencontrol: ifeq ($(shell dpkg-vendor --query vendor),Ubuntu) dh_gencontrol else dh_gencontrol -- \ -Vdav1d:Depends='libdav1d-dev' endif