File: rules

package info (click to toggle)
pypy3 7.3.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 126,856 kB
  • sloc: python: 1,652,321; ansic: 84,048; cpp: 4,135; sh: 2,907; makefile: 545; xml: 294; pascal: 243; asm: 231; lisp: 45; csh: 21; awk: 4
file content (105 lines) | stat: -rwxr-xr-x 3,687 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/make -f

# Take advantage of PyPy if it's installed
PYTHON=$(shell command -v pypy > /dev/null && echo pypy || echo python2.7)

# PyPy doesn't harden well, and handles opt and debug itself
BUILDFLAGS_ENV := DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotector,-fortify
BUILDFLAGS_ENV += DEB_CFLAGS_MAINT_STRIP="-O0 -O1 -O2 -O3 -Os -Ofast -g"
export CFLAGS = $(shell $(BUILDFLAGS_ENV) dpkg-buildflags --get CFLAGS)
export LDFLAGS = $(shell $(BUILDFLAGS_ENV) dpkg-buildflags --get LDFLAGS)

%:
	dh $@ --with sphinxdoc

override_dh_auto_configure:
	# This rule left intentionally empty

override_dh_auto_build-arch: pypy/goal/pypy3-c
	$(MAKE) -C pypy/doc man BUILDDIR=$(CURDIR)/build-docs

	# Build cffi modules
	pypy/goal/pypy3-c lib_pypy/pypy_tools/build_cffi_imports.py

override_dh_auto_build-indep:
	$(MAKE) -C pypy/doc html BUILDDIR=$(CURDIR)/build-docs

pypy/goal/pypy3-c:
	debian/scripts/translate.sh --python $(PYTHON)

ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test-arch: export TMPDIR = $(CURDIR)/build-tests-tmp
override_dh_auto_test-arch: export HOME = $(TMPDIR)
override_dh_auto_test-arch:
	rm -rf $(TMPDIR) build-tests
	mkdir $(TMPDIR) build-tests
	ln -sf lib_pypy/cffi/_pycparser/ pycparser
	# Test failures currently ignored
	PYTHONPATH=. $(PYTHON) -u testrunner/runner.py \
	                       --logfile=build-tests/pytest-A.log \
	                       --config=pypy/pytest-A.cfg \
	                       --root=pypy || true
	rm pycparser
	TERM=$${TERM:-dumb} $(PYTHON) -u pypy/test_all.py \
	          --pypy=pypy/goal/pypy3-c \
	          --resultlog=build-tests/lib-python.log \
	          lib-python || true
	$(PYTHON) -u pypy/test_all.py \
	          --pypy=pypy/goal/pypy3-c \
	          --resultlog=build-tests/pypy-c.log \
	          pypy/module/pypyjit/test_pypy_c || true
endif

override_dh_auto_install:
	debian/scripts/gen-backend-versions.py

override_dh_fixperms-arch:
	debian/scripts/cleanup-lib.sh pypy3-lib
	find debian/pypy3-tk \( -name '*.pyc' -o -name '__pycache__' \) -delete
	# Fix interpreters
	find debian/pypy3-tk \
	     -name '*.py' -print0 \
	     | xargs -0 sed -i -e '1s|^#!.*python.*|#!/usr/bin/pypy3|'
	dh_fixperms -a

override_dh_fixperms-indep:
	debian/scripts/cleanup-lib.sh pypy3-lib-testsuite
	dh_fixperms -i

override_dh_sphinxdoc-arch:
	# dh_sphinxdoc doesn't fail silently when there are no docs

override_dh_compress:
	dh_compress -X.inv -X.txt

override_dh_shlibdeps-arch:
	dh_shlibdeps --package=pypy3 -- -dPre-Depends
	dh_shlibdeps --arch --remaining-packages

override_dh_installdeb:
	set -e; for maintscript in preinst postinst prerm; do \
		sed -e 's/#VERSION#/$(VER)/g' \
		    -e 's/#ARCH#/$(shell dpkg-architecture -qDEB_HOST_ARCH)/g' \
		    debian/pypy3.$$maintscript.in > debian/pypy3.$$maintscript; \
	done
	dh_installdeb

HG_REPO ?= https://bitbucket.org/pypy/pypy
REV=$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*hg([0-9]+).*,\1,p')
VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.+)\+dfsg-.*,\1,p' | sed -e 's/~//')
get-packaged-orig-source:
	@echo "You can build this from a local repo by supplying the HG_REPO variable"
	rm -rf pypy3-$(VER).orig
	hg clone $(HG_REPO) pypy3-$(VER).orig
ifeq (,$(REV))
	cd pypy3-$(VER).orig && hg up -r release-pypy3.7-v$(VER)
else
	cd pypy3-$(VER).orig && hg up -r $(REV)
endif
	rm -rf pypy3-$(VER).orig/.hg*
	rm pypy3-$(VER).orig/lib-python/*/distutils/command/*.exe
	rm pypy3-$(VER).orig/rpython/rlib/test/loadtest/loadtest*.dll
	rm -rf pypy3-$(VER).orig/lib-python/*/ensurepip/_bundled/
	tar -cJ --owner root --group root --mode a+rX \
	    -f pypy3_$(VER)+dfsg.orig.tar.xz pypy3-$(VER).orig
	rm -rf pypy3-$(VER).orig