File: rules

package info (click to toggle)
lomiri 0.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 22,676 kB
  • sloc: cpp: 39,331; python: 2,559; javascript: 1,426; ansic: 1,012; sh: 289; xml: 252; makefile: 69
file content (105 lines) | stat: -rwxr-xr-x 4,152 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/default.mk

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DPKG_GENSYMBOLS_CHECK_LEVEL=4
export NO_PNG_PKG_MANGLE=1
export QT_SELECT=qt5

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
include /usr/share/dpkg/buildflags.mk

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

# Skip tests on the archs they are known to be flaky  with current configuration
testskip_architectures := arm64 powerpc ppc64el s390x

ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
export CONFIGURE_FLAGS := -DENABLE_UBUNTU_ACCOUNTSSERVICE=ON
endif

ifneq ($(filter nocheck,$(DEB_BUILD_PROFILES)),)
    CONFIGURE_FLAGS += -DNO_TESTS=ON
endif

%:
	dh $@

override_dh_missing:
	dh_missing --fail-missing

override_dh_auto_configure:
	# Debian defines CMAKE_INSTALL_LOCALSTATEDIR as /usr/var, which is wrong.
	# So until Debian bug 719148 is fixed, do it ourselves.
	dh_auto_configure -- -DCMAKE_INSTALL_LOCALSTATEDIR="/var" \
	                     -DDISPLAYED_DISTRO_NAME="Debian Lomiri" \
	                     -DWITH_MIR2=ON \
	                     $(CONFIGURE_FLAGS)

override_dh_auto_build:
	# doc is not a default target
	dh_auto_build -- -O all doc

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	mkdir -p debian/home
	export HOME=debian/home
	# Run the entire test battery
	# Parallel tests have a risk of starting xvfb on the same DISPLAY multiple times,
	# causing the whole battery to fail.
ifneq (,$(filter $(DEB_HOST_ARCH),$(testskip_architectures)))
	-dh_auto_test --no-parallel -- -O -k xvfballtests
else
	# FIXME: Temporarily disable unit tests on all other architectures, as well. They
	# seem flaky when built+run on systems more recent than Ubuntu 20.04...
	dh_auto_test --no-parallel -- -O -k xvfballtests
endif
endif

override_dh_fixperms:
	dh_fixperms
	[ -d debian/lomiri-tests ] && chmod a-x debian/lomiri-tests/usr/libexec/lomiri/tests/plugins/Lomiri/Session/libSessionBackendTestPreload.so || true
	[ -d debian/lomiri-tests ] && chmod a-x debian/lomiri-tests/usr/libexec/lomiri/tests/plugins/Lomiri/Launcher/applications/abs-icon.desktop || true
	[ -d debian/lomiri-tests ] && chmod a-x debian/lomiri-tests/usr/libexec/lomiri/tests/plugins/Lomiri/Launcher/applications/click-icon.desktop || true
	[ -d debian/lomiri-tests ] && chmod a-x debian/lomiri-tests/usr/libexec/lomiri/tests/plugins/Lomiri/Launcher/applications/click-icon.svg || true
	[ -d debian/lomiri-tests ] && chmod a-x debian/lomiri-tests/usr/libexec/lomiri/tests/plugins/Lomiri/Launcher/applications/no-name.desktop || true
	[ -d debian/lomiri-tests ] && chmod a-x debian/lomiri-tests/usr/libexec/lomiri/tests/plugins/Lomiri/Launcher/applications/rel-icon.desktop || true
	[ -d debian/lomiri-tests ] && chmod a-x debian/lomiri-tests/usr/libexec/lomiri/tests/plugins/Lomiri/Launcher/applications/rel-icon.svg || true

override_dh_install:
	rm debian/tmp/usr/bin/indicators-client
	rm debian/tmp/usr/share/applications/indicators-client.desktop
	rm debian/tmp/usr/share/lomiri/unlock-device
	rm debian/tmp/usr/lib/systemd/user/*.service
	cd debian/tmp/usr/share/doc/lomiri/html/ && rdfind -makesymlinks true .
	cd debian/tmp/usr/share/doc/lomiri/html/ && symlinks -rc .
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
	cp debian/home-ubuntu.svg debian/tmp/usr/share/lomiri/Launcher/graphics/home.svg
else
	cp debian/home-lomiri.svg debian/tmp/usr/share/lomiri/Launcher/graphics/home.svg
endif
	dh_install

override_dh_installdocs:
	dh_installdocs
	# Remove results.txt for reproducible builds
	rm -vf debian/lomiri-doc/usr/share/doc/lomiri/html/results.txt

# use private lib directories
override_dh_makeshlibs:
	dh_makeshlibs -Nlomiri-tests

override_dh_shlibdeps:
	# Some mock libraries link against liblightdm-qt5-3.so which we want to
	# avoid, since we only really link against our mock one, not the system one.
	dh_shlibdeps -XlibMockAccountsService-qml.so -Lliblomiri-private0

override_dh_clean:
	rm -Rfv debian/home
	dh_clean

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..