File: rules

package info (click to toggle)
mir 1.8.0%2Bdfsg1-18
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 18,428 kB
  • sloc: cpp: 192,989; ansic: 20,140; xml: 8,404; python: 1,713; sh: 1,005; makefile: 100
file content (148 lines) | stat: -rwxr-xr-x 4,962 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/usr/bin/make -f

include /usr/share/dpkg/default.mk
include debian/opts.mk

export DPKG_GENSYMBOLS_CHECK_LEVEL = 4

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ -Bbuild-$(DEB_HOST_ARCH) --with python3 --with pkgkde_symbolshelper

# Enable verbose debugging output from the testsuite
export MIR_SERVER_LOGGING = on
override_dh_auto_test-arch:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(filter mipsel riscv64,$(DEB_HOST_ARCH)),)
ifeq ($(DEB_HOST_ARCH_ENDIAN),little)
	-GTEST_OUTPUT=xml:./ dh_auto_build -- ARGS="-V" ptest
else
	echo "Testsuite disabled on $(DEB_HOST_ARCH) due to lack of big-endian support."
endif
else
	echo "Testsuite disabled on $(DEB_HOST_ARCH) due to timeouts / slow CPU processing."
endif
else
	echo "Testsuite disabled due to DEB_BUILD_OPTIONS=\"$(DEB_BUILD_OPTIONS)\""
endif

override_dh_auto_test-indep:
	echo "Testsuite not run during arch:all builds."

COMMON_CONFIGURE_OPTIONS = \
  -DCMAKE_INSTALL_LIBEXECDIR="lib/$(DEB_HOST_MULTIARCH)/mir"\
  -DMIR_BUILD_INTERPROCESS_TESTS=OFF\
  -DMIR_FATAL_COMPILE_WARNINGS=OFF\
  -DMIR_ENABLE_WLCS_TESTS=OFF \

ifeq ($(filter noopt,$(DEB_BUILD_OPTIONS)),noopt)
	COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=OFF
else
  # Disable LTO, due to failing to build
  ifneq (,$(filter $(DEB_HOST_ARCH),mips64el ppc64 s390x))
	COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=OFF
  else
	COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=ON
  endif
endif

ifneq (,$(filter noinsttest,$(DEB_BUILD_PROFILES)))
	COMMON_CONFIGURE_OPTIONS += -DMIR_ENABLE_TESTS=OFF
endif

# Don't use "gold" linker 16.04 , due to failing to build on ppc64le
ifneq ($(filter xenial,$(DEB_DISTRIBUTION)),)
	COMMON_CONFIGURE_OPTIONS += -DMIR_USE_LD=ld
endif

# see, if this prevents from build failures on some exotic architectures (like e.g. mips64el):
COMMON_CONFIGURE_OPTIONS += -DMIR_USE_LD=ld

$(info COMMON_CONFIGURE_OPTIONS: ${COMMON_CONFIGURE_OPTIONS})

ifneq ($(filter amd64 i386,$(DEB_HOST_ARCH)),)
  AVAILABLE_PLATFORMS=mesa-kms\;mesa-x11\;wayland\;eglstream-kms
else
	AVAILABLE_PLATFORMS=mesa-kms\;mesa-x11\;wayland
endif

override_dh_auto_configure:
ifneq ($(filter armhf,$(DEB_HOST_ARCH)),)
	dh_auto_configure -- \
	  $(COMMON_CONFIGURE_OPTIONS) \
	  -DMIR_RUN_ACCEPTANCE_TESTS=OFF \
	  -DMIR_RUN_INTEGRATION_TESTS=OFF \
	  -DMIR_PLATFORM=$(AVAILABLE_PLATFORMS) \
	  $(OVERRIDE_CONFIGURE_OPTIONS)
else
	dh_auto_configure -- \
	  $(COMMON_CONFIGURE_OPTIONS) \
	  -DMIR_PLATFORM=$(AVAILABLE_PLATFORMS) \
	  $(OVERRIDE_CONFIGURE_OPTIONS)
endif
	# Run cmake again to pick up wlcs tests, because reasons?
	cmake build-$(DEB_HOST_ARCH)

# binary-only builds still need the doc files, otherwise the
# install target fails
override_dh_auto_build-arch: override_dh_auto_build-indep
	dh_auto_build

# Only build the docs when we need them
override_dh_auto_build-indep:
	dh_auto_build -- doc

override_dh_auto_install-indep:
	dh_auto_build -- DESTDIR=$(CURDIR)/debian/tmp doc-install
ifeq (,$(filter noinsttest,$(DEB_BUILD_PROFILES)))
	dh_auto_build -- DESTDIR=$(CURDIR)/debian/tmp py-install
endif

# Reconstruct the MirAL version
MIRAL_VERSION_MAJOR = $(shell perl -n -e '/^set\(MIRAL_VERSION_MAJOR ([0-9]*)\)$$/ && print $$1' src/CMakeLists.txt)
MIRAL_VERSION_MINOR = $(shell perl -n -e '/^set\(MIRAL_VERSION_MINOR ([0-9]*)\)$$/ && print $$1' src/CMakeLists.txt)
MIRAL_VERSION_PATCH = $(shell perl -n -e '/^set\(MIRAL_VERSION_PATCH ([0-9]*)\)$$/ && print $$1' src/CMakeLists.txt)
MIRAL_RELEASE=$(MIRAL_VERSION_MAJOR).$(MIRAL_VERSION_MINOR).$(MIRAL_VERSION_PATCH)
MIRAL_VERSION=$(MIRAL_RELEASE).$(DEB_VERSION)

# TODO: we'll use a symbol file once mir is abi stable
override_dh_makeshlibs:
	dh_makeshlibs -Nlibmiral3 -V -Nmir-test-tools
	# libmiral3 *has* a symbols file, so we don't need to -V it!
	dh_makeshlibs -plibmiral3 -- -v$(MIRAL_RELEASE)

override_dh_install:
# Nothing outside Mir should link to libmirprotobuf directly.
# Delete the symlink so that --fail-missing doesn't think we've missed it
# accidentally.
	-rm debian/tmp/usr/lib/*/libmirprotobuf.so

	-find debian/tmp/usr/share/doc/mir-doc/html/ -name "*.md5" -delete
	dh_install

# Get rid of duplicate files and replace them by symlinks
	rdfind -makesymlinks true "$(CURDIR)/debian/mir-doc/usr/share/doc/mir-doc/"
	symlinks -rc "$(CURDIR)/debian/mir-doc/usr/share/doc/mir-doc/"



override_dh_missing:
	dh_missing --fail-missing

# Don't try to strip libraries used as test data
override_dh_strip:
	dh_strip -Xmir-test-data

# Don't try to find dependencies of libraries used as test data
override_dh_shlibdeps:
	dh_shlibdeps -Xmir-test-data

override_dh_gencontrol:
	dh_gencontrol -Nlibmiral3 -Nlibmiral-dev
	dh_gencontrol -plibmiral3 -plibmiral-dev -- -v$(MIRAL_VERSION) -V'libmiral3:Version=$(MIRAL_VERSION)'

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