#!/usr/bin/make -f # see FEATURE AREAS in dpkg-buildflags(1) export DEB_BUILD_MAINT_OPTIONS = hardening=+all include /usr/share/dpkg/buildflags.mk # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 export DPKG_GENSYMBOLS_CHECK_LEVEL=4 export HOME := $(shell realpath .) export QT_SELECT=qt5 include /usr/share/dpkg/architecture.mk ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) # Cross compiling CONFIGURE_OPTS += "CONFIG+=no_docs" "CONFIG+=cross_compile" endif # Skip tests on the archs they are known to be flaky with current configuration # So lets define known working arches here to run test on test_architectures := all amd64 arm64 armel i386 override_dh_auto_configure: qmake -r CONFIG+=debian_build $(CONFIGURE_OPTS) QMAKE_CFLAGS="$(CFLAGS)" QMAKE_CXX_FLAGS="$(CXXFLAGS)" QMAKE_LFLAGS="${LDFLAGS}" %: dh $@ override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) mkdir -p debian/tmp/home/run chmod +x tests/xvfb.sh ifeq (,$(filter $(DEB_HOST_ARCH),$(test_architectures))) -tests/xvfb.sh dh_auto_test --no-parallel else tests/xvfb.sh dh_auto_test --no-parallel endif endif override_dh_auto_build: dh_auto_build dh_auto_build -- docs override_dh_install: ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) mkdir -p debian/tmp/`qmake -query QT_INSTALL_DOCS`/qch mkdir -p debian/tmp/usr/share/lomiri-ui-toolkit/doc cp -r $(CURDIR)/documentation/*qch debian/tmp/`qmake -query QT_INSTALL_DOCS`/qch else # Add empty qmltypes files for module in "Components" "Components/Labs" "Components/Styles" "Layouts" "Metrics" "PerformanceMetrics"; \ do \ touch debian/tmp/`qmake -query QT_INSTALL_QML`/Lomiri/$$module/plugins.qmltypes; \ done endif rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la # Due to autopilot not being in the archive we ship docs for now # sphinx-build -b singlehtml documentation/autopilot-helpers documentation/autopilot-helpers/_build/html # sphinx-build -b json documentation/autopilot-helpers documentation/autopilot-helpers/_build/json # Drop QML types used to test apicheck only rm -f debian/tmp/usr/lib/*/qt5/qml/Extinct/Animals/* # drop lomiri-ui-toolkit-autopilot files, not buildable on non-Ubuntu systems rm -f debian/tmp/usr/lib/*/lomiri-ui-toolkit/apicheck rm -Rf debian/tmp/usr/lib/python3 # drop empty directory rm debian/tmp/usr/lib/*/qt5/examples/lomiri-ui-toolkit/examples/calculator/components/Makefile rmdir debian/tmp/usr/lib/*/qt5/examples/lomiri-ui-toolkit/examples/calculator/components/.pch/ rmdir debian/tmp/usr/lib/*/qt5/examples/lomiri-ui-toolkit/examples/calculator/components/.obj/ # drop references to the build chroot sed -i debian/tmp/usr/lib/*/*.prl -e "/^QMAKE_PRL_BUILD_DIR.*/d" sed -i debian/tmp/usr/lib/*/qt5/examples/lomiri-ui-toolkit/examples/calculator/components/*.prl -e "/^QMAKE_PRL_BUILD_DIR.*/d" dh_install override_dh_missing: dh_missing --fail-missing override_dh_auto_clean: -dh_auto_clean # Qt / qmake creates .version files which don't # chget clean-up properly by 'make distclean' -find . -name '*.version' -delete # Delete additional files rm -rvf \ .cache/ \ .config/ \ .local/ \ xvfb.err \ ; get-orig-source: uscan --noconf --force-download --rename --download-current-version --repack --destdir=..