Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/default.mk
4
5 built_binaries := $(shell dh_listpackages)
6
7 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
8 export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs
9 # https://bugs.debian.org/1060838
10 export MESON_USE_NEW_CROSSGEN=1
11 # https://qt-kde-team.pages.debian.net/packagingqtbasedstuff.html
12 export QT_SELECT=5
13
14 export VERBOSE=1
15
16 meson_options =
17
18 ifeq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
19 native_or_cross = native
20 else
21 native_or_cross = cross
22 endif
23
24 ifneq ($(filter libportal-gtk3-% libportal-%-gtk3,$(built_binaries)),)
25 meson_options += -Dbackend-gtk3=enabled
26 else
27 meson_options += -Dbackend-gtk3=disabled
28 endif
29
30 ifneq ($(filter libportal-gtk4-dev libportal-%-gtk4,$(built_binaries)),)
31 meson_options += -Dbackend-gtk4=enabled
32 else
33 meson_options += -Dbackend-gtk4=disabled
34 endif
35
36 ifneq ($(filter libportal-qt5-dev libportal-%-qt5,$(built_binaries)),)
37 meson_options += -Dbackend-qt5=enabled
38 else
39 meson_options += -Dbackend-qt5=disabled
40 endif
41
42 # We don't build packages for Qt 6 yet, that will require a trip through NEW
43 ifeq ($(filter pkg.libportal.noqt6,$(DEB_BUILD_PROFILES)),)
44 meson_options += -Dbackend-qt6=enabled
45 else
46 meson_options += -Dbackend-qt6=disabled
47 endif
48
49 ifeq ($(filter libportal-doc,$(built_binaries)),)
50 meson_options += -Ddocs=false
51 else
52 meson_options += -Ddocs=true
53 endif
54
55 ifeq ($(filter libportal-tests-%,$(built_binaries)),)
56 meson_options += -Dportal-tests=false
57 else
58 meson_options += -Dportal-tests=true
59 endif
60
61 meson_options += --$(native_or_cross)-file=$(CURDIR)/debian/meson/vapigen.ini
62
63 ifeq ($(filter libportal-tests-gtk4,$(built_binaries)),)
64 meson_options += --$(native_or_cross)-file=$(CURDIR)/debian/meson/no-gjs.ini
65 endif
66
67 test_timeout_multiplier = 3
68 meson_test_options = --timeout-multiplier $(test_timeout_multiplier)
69
70 %:
71 dh $@
72
73 override_dh_auto_configure:
74 # https://bugs.debian.org/1088099
75 @echo 'blhc: ignore-line-regexp: .*/lib/qt6/libexec/moc\s.*'
76 sed \
77 -e 's|@bindir@|$(CURDIR)/debian|g' \
78 -e 's|@DEB_HOST_GNU_TYPE@|$(DEB_HOST_GNU_TYPE)|g' \
79 < debian/meson/vapigen.ini.in > debian/meson/vapigen.ini
80 sed \
81 -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|g' \
82 < debian/vapigen.in > debian/$(DEB_HOST_GNU_TYPE)-vapigen
83 chmod 0755 debian/$(DEB_HOST_GNU_TYPE)-vapigen
84 dh_auto_configure \
85 -- \
86 $(meson_options) \
87 $(NULL)
88
89 xvfb_run = xvfb-run -e /proc/self/fd/2 -a -s "-screen 0 1280x1024x24 -noreset"
90
91 override_dh_auto_test:
92 $(xvfb_run) dh_auto_test -- $(meson_test_options)