File: rules

package info (click to toggle)
pygobject 3.22.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,492 kB
  • ctags: 5,045
  • sloc: ansic: 20,987; python: 15,991; sh: 4,659; makefile: 569; xml: 31
file content (82 lines) | stat: -rwxr-xr-x 3,235 bytes parent folder | download
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
#!/usr/bin/make -f

include /usr/share/dpkg/default.mk
include /usr/share/python/python.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

PYVERS := $(shell pyversions --requested -v debian/control) $(shell py3versions --supported -v)
FLAVOURS := $(PYVERS) $(patsubst %,%-dbg,$(PYVERS))

TESTSUITE_FAIL_CMD=exit 1
NON_FATAL=( echo "*** test-suite FAILED but continuing anyway ***"; true; )
ifneq ($(filter $(DEB_BUILD_ARCH), ),)
# tests currently fail on these architectures
    TESTSUITE_FAIL_CMD=$(NON_FATAL)
endif

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with python2,python3,autoreconf,gnome

override_dh_auto_configure:
	set -e && for x in $(FLAVOURS); do \
	    dh_auto_configure --builddirectory=build-$$x -- PYTHON=/usr/bin/python$$x; \
	done

override_dh_auto_build:
	set -e && for x in $(FLAVOURS); do \
	    dh_auto_build --builddirectory=build-$$x; \
	done

# don't run the tests under fakeroot, otherwise they will try to connect to
# root's session D-BUS
override_dh_auto_test:
	set -e; export HOME=$(CURDIR)/debian/tmp/home; mkdir -p $$HOME/.local/share; unset LD_PRELOAD; \
	for x in $(PYVERS); do \
	        xvfb-run dh_auto_test --builddirectory=build-$$x || $(TESTSUITE_FAIL_CMD); \
	        while [ -e /tmp/.X99-lock ]; do echo "Waiting for xvfb to finish..."; sleep 0.5; done; \
	        xvfb-run dh_auto_test --builddirectory=build-$$x-dbg || $(NON_FATAL); \
	        while [ -e /tmp/.X99-lock ]; do echo "Waiting for xvfb to finish..."; sleep 0.5; done; \
	done;

# we remove stuff that we do not need, and rename the *.so modules to what
# Python expects for that flavor (http://www.python.org/dev/peps/pep-3149/)
# group the install directory by major Python version and dbg/non-dbg
override_dh_auto_install:
	set -e && for x in $(FLAVOURS); do \
	    INST=debian/install-`echo $$x | sed 's/\.[0-9]*//'`; \
	    dh_auto_install --builddirectory=build-$$x --destdir=$$INST; \
	    find $$INST \( -name '*.pyc' -o -name '*.pyo' -o -name '*.la' \) -delete; \
	done

override_dh_auto_clean:
	rm -rf build-*
	dh_auto_clean

override_dh_install-arch:
	dh_install -ppython-gi -ppython-gi-cairo --sourcedir=debian/install-2
	dh_install -ppython-gi-dbg --sourcedir=debian/install-2-dbg
	dh_install -ppython3-gi -ppython3-gi-cairo -ppython-gi-dev --sourcedir=debian/install-3
	dh_install -ppython3-gi-dbg --sourcedir=debian/install-3-dbg
	# for -dev etc.; this is not expected to install any files
	dh_install -a --remaining-packages --sourcedir=/nonexisting
	# cairo.so is installed into a separate package; modelling this with
	# *.install files is a pain, so just remove it manually
	rm debian/python*-gi/usr/lib/python*/*-packages/gi/*cairo*

override_dh_strip-arch:
	dh_strip -ppython-gi --dbg-package=python-gi-dbg
	dh_strip -ppython-gi-cairo --dbg-package=python-gi-dbg
	dh_strip -ppython3-gi --dbg-package=python3-gi-dbg
	dh_strip -a --remaining-packages --no-automatic-dbgsym

override_dh_makeshlibs-arch:
	dh_makeshlibs -ppython-gi  -V'python-gi (>= 3.4)'
	dh_makeshlibs -ppython3-gi -V'python3-gi (>= 3.4)'
	dh_makeshlibs -a --remaining-packages

override_dh_clean:
	rm -rf debian/install-*
	find \( -name '*.pyc' -o -name '*.pyo' -o -name '*.la' \) -delete; \
	dh_clean