Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 #DH_VERBOSE = 1
3
4 # See dpkg-buildflags(1)
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6 export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
7 #export DEB_LDFLAGS_MAINT_APPEND =
8 # See dpkg-gensymbols(1)
9 export DPKG_GENSYMBOLS_CHECK_LEVEL = 4
10
11 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
12
13 # Do not build ibus-tests on (compatibility-only) Ubuntu i386, as some of
14 # ibus-tests depends are not in the compatibility layer
15 ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes) $(DEB_HOST_ARCH),yes i386)
16 skip_packages = -Nibus-tests
17 endif
18
19 DH_FLAGS = --with gir
20
21 # Ubuntu language pack support (dh_translations)
22 ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes)
23 DH_FLAGS += --with translations
24 endif
25
26
27 %:
28 dh $@ $(DH_FLAGS)
29
30 CONFIGURE_FLAGS = \
31 --disable-python2 \
32 --disable-python-library \
33 --disable-silent-rules \
34 --disable-static \
35 --enable-appindicator \
36 --enable-emoji-dict \
37 --enable-gtk2 \
38 --enable-gtk3 \
39 --enable-gtk4 \
40 --enable-introspection \
41 --enable-surrounding-text \
42 --enable-xim \
43 --with-no-snooper-apps='gnome-do,Do.*,firefox.*,.*chrome.*,.*chromium.*,terminator' \
44 --with-python=/usr/bin/python3 \
45 --with-ucd-dir='/usr/share/unicode/' \
46 $(NULL)
47
48 ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
49 CONFIGURE_FLAGS += --enable-gtk-doc
50 else
51 CONFIGURE_FLAGS += --disable-gtk-doc
52 endif
53
54 ifeq (,$(filter noinsttest,$(DEB_BUILD_PROFILES)))
55 CONFIGURE_FLAGS += --enable-install-tests
56 else
57 CONFIGURE_FLAGS += --disable-install-tests
58 endif
59
60 # The --enable-memconf configure flag is not needed on nocheck or noinsttest
61 # build profile. But these build profiles should not change package contents
62 # (See https://wiki.debian.org/BuildProfileSpec). So always use this flag.
63 CONFIGURE_FLAGS += --enable-memconf
64
65 ifeq ($(DEB_HOST_ARCH_OS),linux)
66 CONFIGURE_FLAGS += --enable-wayland --enable-systemd-services
67 else
68 CONFIGURE_FLAGS += --disable-wayland --disable-systemd-services
69 endif
70
71 override_dh_auto_configure:
72 dh_auto_configure -- $(CONFIGURE_FLAGS)
73
74 override_dh_auto_install:
75 dh_auto_install
76 desktop-file-install --delete-original \
77 --dir debian/tmp/usr/share/applications \
78 debian/tmp/usr/share/applications/*
79
80 override_dh_auto_build:
81 # Rebuild upstream shipped Vala-generated files in ui/gtk3 and tools dirs, as
82 # the shipped C files FTBFS with --disable-wayland. No need to upstream; the
83 # upstream doesn't want Vala to be needed by the default build
84 # (https://github.com/ibus/ibus/issues/2082).
85 make -C ui/gtk3 maintainer-clean-generic
86 make -C tools maintainer-clean-generic
87 dh_auto_build
88
89 override_dh_install:
90 dh_install -X.la -X.pyc -X.pyo -X__pycache__
91
92 override_dh_missing:
93 dh_missing --fail-missing -X.la -X.pyc -X.pyo
94
95 override_dh_auto_test:
96 # NOTE: Do not use debhelper 13 provided $HOME and XDG dirs. The
97 # provided $XDG_CACHE_HOME is too long so the ibus-daemon socket name
98 # length easily exceeds the limit (107 bytes in Linux).
99 mkdir -p -m700 $(CURDIR)/debian/tmp-home/run
100 env \
101 GVFS_DISABLE_FUSE=1 \
102 dbus-run-session -- \
103 xvfb-run -s "-noreset" --auto-servernum -- \
104 dh_auto_test -- \
105 HOME=$(CURDIR)/debian/tmp-home \
106 XDG_CACHE_HOME= \
107 XDG_CONFIG_HOME= \
108 XDG_DATA_HOME= \
109 XDG_DATA_DIRS= \
110 XDG_RUNTIME_DIR=$(CURDIR)/debian/tmp-home/run \
111 DISABLE_DAEMONIZE_IN_TESTS=1 \
112 DISABLE_GUI_TESTS="ibus-bus ibus-compose ibus-keypress test-stress"
113 rm -rf $(CURDIR)/debian/tmp-home
114
115 override_dh_builddeb:
116 dh_builddeb $(skip_packages)
117
118 override_dh_gencontrol:
119 dh_gencontrol $(skip_packages)
120
121 override_dh_shlibdeps:
122 dh_shlibdeps -pibus-gtk -- -xlibgtk2.0-0t64
123 dh_shlibdeps -pibus-gtk3 -- -xlibgtk-3-0t64
124 dh_shlibdeps -pibus-gtk4 -- -xlibgtk-4-1
125 dh_shlibdeps --remaining-packages