File: rules

package info (click to toggle)
pythran 0.17.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 12,700 kB
  • sloc: cpp: 65,021; python: 41,083; sh: 137; makefile: 87
file content (66 lines) | stat: -rwxr-xr-x 2,110 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

# export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

export PYBUILD_NAME=pythran

export PYBUILD_TEST_PYTEST=1
# Copy the test package, as it is inside the root package (pythran.tests).
export PYBUILD_BEFORE_TEST=cp -r {dir}/pythran/tests {build_dir}/pythran
# Cleanup the test package, along with files that are generated during
# tests and not needed by the final package.
export PYBUILD_AFTER_TEST=rm -r {build_dir}/pythran/tests; rm -f {build_dir}/test_*.so; rm -f {build_dir}/_configtest*
# Llimit the testing to one file, as the full test suite is very time
# consuming.
export PYBUILD_TEST_ARGS=pythran/tests/test_base.py

empty :=
space := $(empty)$(empty)

# use XSIMD only on supported architectures
XSIMD_ARCH_LIST := amd64 arm64 i386
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(XSIMD_ARCH_LIST)$(space)))
  XSIMD_CONFIG=-DUSE_XSIMD
else
  XSIMD_CONFIG=
endif


%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

execute_after_dh_clean:
	rm -f docs/AUTHORS.rst docs/LICENSE.rst docs/Changelog.rst docs/SUPPORT.rst docs/index.rst

override_dh_auto_test:
ifeq ($(DEB_HOST_ARCH),i386)
	CXXFLAGS="$(XSIMD_CONFIG) -march=native" dh_auto_test
else
	CXXFLAGS=$(XSIMD_CONFIG) dh_auto_test
endif

execute_before_dh_sphinxdoc-indep:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. sphinx-build -b html -N docs/ $(CURDIR)/debian/python-pythran-doc/usr/share/doc/python-pythran-doc/html
endif

# Override compressing the font files, as they are symlinked by d/*.links
override_dh_compress:
	dh_compress -X.eot -X.otf -X.ttf -X.woff -X.woff2

# Target for regenerating the manpages.
# This target is intended to be executed manually, and requires
# `help2man` to be installed.
help2man:
	for script in pythran pythran-config; do \
	help2man --no-info \
		--name="part of pythran: ahead of time compiler for Python" \
		--version-string=$(DEB_VERSION_UPSTREAM) \
		-o debian/$${script}.1 \
		--no-discard-stderr \
        --include debian/python3-pythran.manpages.include \
        $${script}; \
	done