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 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
|
#!/usr/bin/make -f
BUILD_HOME=$(CURDIR)/debian/home
BUILD_XDG_RUNTIME_DIR=$(CURDIR)/debian/run
include /usr/share/dpkg/default.mk
include debian/opts.mk
# Needed for ccache to work in case the build directory changed
# (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810871)
export CCACHE_BASEDIR = $(shell pwd)
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 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)
mkdir -p $(BUILD_HOME)
mkdir -p $(BUILD_XDG_RUNTIME_DIR)
export HOME="$(BUILD_HOME)" && export XDG_RUNTIME_DIR="$(BUILD_XDG_RUNTIME_DIR)" && GTEST_OUTPUT=xml:./ dh_auto_build -- ARGS="-V" ptest || true
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\
ifeq ($(filter ppc64el,$(DEB_HOST_ARCH)),ppc64el)
# Disable spurious error on GCC>=12
ifneq ($(shell gcc --version | grep '1[234].[[:digit:]]\+.[[:digit:]]\+$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_COMPILER_QUIRKS="libinput_environment.cpp:restrict"
endif
ifneq ($(shell gcc --version | grep '1[234].[[:digit:]]\+.[[:digit:]]\+$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_COMPILER_QUIRKS="test_touchspot_controller.cpp:array-bounds"
endif
endif
ifeq ($(filter riscv64,$(DEB_HOST_ARCH)),riscv64)
# Disable spurious error on GCC>=12
ifneq ($(shell gcc --version | grep] '1[234].[[:digit:]]\+.[[:digit:]]\+$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_COMPILER_QUIRKS="test_linearising_executor.cpp:use-after-free"
endif
endif
# Disable LTO on broken binutils
# https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/2070302
ifneq ($(shell ld --version | grep '2.43.1$$'),)
DEB_BUILD_MAINT_OPTIONS += optimize=-lto
endif
# We can't guarantee non-Ubuntu builds will build against WLCS packages we
# control, so disable it on non-Ubuntu builds
#ifeq ($(filter Ubuntu,$(DEB_VENDOR)),)
COMMON_CONFIGURE_OPTIONS += -DMIR_RUN_WLCS_TESTS=OFF
#endif
# see, if this prevents from build failures on some exotic architectures (like e.g. mips64el):
COMMON_CONFIGURE_OPTIONS += -DMIR_USE_LD=ld
ifneq (,$(filter noinsttest,$(DEB_BUILD_PROFILES)))
COMMON_CONFIGURE_OPTIONS += -DMIR_ENABLE_TESTS=OFF
endif
ifneq (,$(filter cross,$(DEB_BUILD_PROFILES)))
COMMON_CONFIGURE_OPTIONS += -DMIR_WAYLAND_GENERATOR_EXECUTABLE=/usr/bin/mir_wayland_generator
endif
# Disable pre-compiled headers on GCC>=12
ifneq ($(shell gcc --version | grep '1[234].[[:digit:]]\+.[[:digit:]]\+$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_USE_PRECOMPILED_HEADERS=OFF
endif
export DEB_BUILD_MAINT_OPTIONS
$(info COMMON_CONFIGURE_OPTIONS: ${COMMON_CONFIGURE_OPTIONS})
$(info DEB_BUILD_MAINT_OPTIONS: ${DEB_BUILD_MAINT_OPTIONS})
ifneq ($(filter amd64 i386,$(DEB_HOST_ARCH)),)
AVAILABLE_PLATFORMS=atomic-kms\;gbm-kms\;x11\;wayland\;eglstream-kms
else
AVAILABLE_PLATFORMS=atomic-kms\;gbm-kms\;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
ifneq ($(filter arm64,$(DEB_HOST_ARCH)),)
dh_auto_configure -- \
$(COMMON_CONFIGURE_OPTIONS) \
-DMIR_RUN_ACCEPTANCE_TESTS=OFF \
-DMIR_PLATFORM=$(AVAILABLE_PLATFORMS) \
$(OVERRIDE_CONFIGURE_OPTIONS)
else
dh_auto_configure -- \
$(COMMON_CONFIGURE_OPTIONS) \
-DMIR_PLATFORM=$(AVAILABLE_PLATFORMS) \
$(OVERRIDE_CONFIGURE_OPTIONS)
endif
endif
# Run cmake again to pick up wlcs tests, because reasons?
cmake build-$(DEB_HOST_ARCH)
# 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 -Nlibmiral7 -V -Nmir-test-tools
dh_makeshlibs -plibmiral7 -V -- -v$(MIRAL_RELEASE)
# 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 -Nlibmiral7 -Nlibmiral-dev
dh_gencontrol -plibmiral7 -plibmiral-dev -- -v$(MIRAL_VERSION) -V'libmiral7:Version=$(MIRAL_VERSION)'
override_dh_auto_clean:
dh_auto_clean
# build cruft not cleaned up by CMake
rm -f include/miral/miral/version.h include/server/mir/version.h
override_dh_clean:
dh_clean
rm -Rfv $(BUILD_HOME)
rm -Rfv $(BUILD_XDG_RUNTIME_DIR)
get-orig-source:
uscan --noconf --force-download --rename --download-current-version --destdir=..
|