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
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
# Safety measure to ensure package names match SONAMEs
PYSIDE_MAJOR := $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d. -f1-2)
ifeq ($(shell awk '/Package:/ {print $$2}' debian/control | grep -- -$(PYSIDE_MAJOR)$$),)
$(error Please update package names for major version $(PYSIDE_MAJOR))
endif
ifeq ($(shell ls debian/lib* | grep -- -$(PYSIDE_MAJOR)),)
$(error Please update files debian/lib*.* for major version $(PYSIDE_MAJOR))
endif
# don't set PYBUILD_NAME because we want the installed files to land in
# debian/tmp and then get split up into the feature packages.
export PYBUILD_SYSTEM = distutils
export MAIN_VERSION_UPSTREAM := $(shell echo $(DEB_VERSION_UPSTREAM))
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Add CPPFLAGS to CXXFLAGS as CMake ignores CPPFLAGS by default
CXXFLAGS+=$(CPPFLAGS)
export LLVM_INSTALL_DIR := $(shell llvm-config --prefix)
# Work around buildd bug (https://bugs.debian.org/842565)
undefine XDG_RUNTIME_DIR
PYBUILD_CONFIGURE_ARGS = --verbose
PYBUILD_BUILD_ARGS = --skip-packaging --verbose-build
PYBUILD_BUILD_ARGS += --parallel=$(or $(DEB_BUILD_OPTION_PARALLEL),$(DEB_BUILD_OPTION_PARALLEL),1)
PYBUILD_INSTALL_ARGS = --reuse-build --verbose-build
## Package compilation options
# 1. if sccache is installed then use it
SCCACHE := $(shell command -v sccache 2> /dev/null)
ifdef SCCACHE
SCCACHE_DIR ?= $(HOME)/.cache/sccache
export SCCACHE_DIR
PYBUILD_BUILD_ARGS += --compiler-launcher=sccache
execute_before_dh_auto_build:
-sccache --start-server
endif
# 2. support 'nocheck' builds - building and running the tests is slow
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
PYBUILD_BUILD_ARGS += --build-tests
endif
# 3. support 'nodoc' builds - building the docs just needs lots of extra deps
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
PYBUILD_BUILD_ARGS += --build-docs
endif
export PYBUILD_BUILD_ARGS
export PYBUILD_INSTALL_ARGS
%:
dh $@ --buildsystem=pybuild
execute_after_dh_auto_build:
# Record build in build index for test runner
TODAY=`date -Id`; \
mkdir -p build_history/$$TODAY; \
echo $$PWD > build_history/$$TODAY/build_dir.txt; \
py3versions -d >> build_history/$$TODAY/build_dir.txt \
execute_after_dh_auto_install:
# Obtain a list of files built to make it easier to update *.install files.
# dh_missing will check all the install files at the end
echo ">>> In build"
-find build
echo ">>> In debian/tmp"
-find debian/tmp
override_dh_makeshlibs:
dh_makeshlibs -VUpstream-Version
override_dh_installdocs-indep:
dh_installdocs -X.doctrees
find debian -name __pycache__ -type d -exec rm -rf {} +
override_dh_installexamples-indep:
find debian -name __pycache__ -type d -exec rm -rf {} +
execute_after_dh_install-arch:
# remove extra copies of documentation
rm -rf debian/libshiboken6-py3-*/usr/lib/python*/dist-packages/shiboken6/docs/
# remove RUNPATH from libraries and executables
# only look at files not symlinks
find debian/*/usr/lib/ -name \*.so* -type f -exec chrpath -d {} \;
chrpath -d \
debian/*/usr/lib/python3*/dist-packages/PySide6/Qt/libexec/*
chrpath -d \
debian/*/usr/lib/python*/dist-packages/PySide6/assistant \
debian/*/usr/lib/python*/dist-packages/PySide6/balsam \
debian/*/usr/lib/python*/dist-packages/PySide6/balsamui \
debian/*/usr/lib/python*/dist-packages/PySide6/designer \
debian/*/usr/lib/python*/dist-packages/PySide6/linguist \
debian/*/usr/lib/python*/dist-packages/PySide6/lrelease \
debian/*/usr/lib/python*/dist-packages/PySide6/lupdate \
debian/*/usr/lib/python*/dist-packages/PySide6/qmlformat \
debian/*/usr/lib/python*/dist-packages/PySide6/qmllint \
debian/*/usr/lib/python*/dist-packages/PySide6/qmlls \
debian/*/usr/lib/python*/dist-packages/PySide6/qsb \
debian/*/usr/lib/python*/dist-packages/PySide6/svgtoqml \
debian/*/usr/lib/python*/dist-packages/shiboken6_generator/shiboken6
# remove executable permissions
find debian/pyside6-tools/usr/lib/python3*/dist-packages/PySide6/scripts/ -type f -exec chmod a-x {} +
# fix up various paths in .pc, cmake and __init__.py
debian/set-paths
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq (mips64el,$(DEB_HOST_ARCH))
# See https://bugs.debian.org/868745
PIP_BREAK_SYSTEM_PACKAGES=1 \
QSG_NO_DEPTH_BUFFER=1 xvfb-run -a dh_auto_test -- --system=custom \
--test-args '{interpreter} testrunner.py test --buildno=-1'
else
PIP_BREAK_SYSTEM_PACKAGES=1 \
QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu --no-sandbox" \
xvfb-run -a dh_auto_test -- --system=custom \
--test-args '{interpreter} testrunner.py test --buildno=-1'
endif
endif
|