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
|
#!/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 armhf 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 <FolderName>.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=..
|