| 1 |
#!/usr/bin/make -f |
| 2 |
# See debhelper(7) (uncomment to enable) |
| 3 |
# output every command that modifies files on the build system. |
| 4 |
#export DH_VERBOSE = 1 |
| 5 |
|
| 6 |
include /usr/share/dpkg/default.mk |
| 7 |
export DEB_HOST_MULTIARCH |
| 8 |
|
| 9 |
PY3VERS := $(shell py3versions -sv) |
| 10 |
PY3VER_DEFAULT := $(shell py3versions -dv) |
| 11 |
|
| 12 |
PYTEST_OPTIONS = -k "not numba" |
| 13 |
|
| 14 |
ifeq ($(DEB_HOST_ARCH),hppa) |
| 15 |
# hppa p-machines (pasta,pacific,pad) fail test_macroedge[1-CellType.tetrahedron] |
| 16 |
# while s-machines (sap) pass. |
| 17 |
# More likely a bug in gcc than basix. See upstream basix Issue#979. |
| 18 |
PYTEST_OPTIONS = -k "not numba and not test_macroedge[1-CellType.tetrahedron]" |
| 19 |
endif |
| 20 |
|
| 21 |
%: |
| 22 |
dh $@ --buildsystem=cmake |
| 23 |
|
| 24 |
|
| 25 |
execute_after_dh_auto_clean: |
| 26 |
rm -rf cpp/basix/version.h |
| 27 |
rm -rf doc/cpp/html doc/cpp/latex doc/python/source/_autosummary/ |
| 28 |
rm -rf .pybuild |
| 29 |
rm -rf python/LICENSE |
| 30 |
rm -rf ./.pytest_cache test/.pytest_cache test/__pycache__ python/testing_build |
| 31 |
|
| 32 |
override_dh_auto_configure: |
| 33 |
dh_auto_configure --sourcedir=cpp |
| 34 |
|
| 35 |
override_dh_auto_build-indep: export http_proxy=127.0.0.1:9 |
| 36 |
override_dh_auto_build-indep: export https_proxy=127.0.0.1:9 |
| 37 |
override_dh_auto_build-indep: |
| 38 |
dh_auto_build --sourcedir=cpp -i |
| 39 |
cd doc/cpp; doxygen |
| 40 |
|
| 41 |
execute_after_dh_auto_install: |
| 42 |
cp LICENSE python |
| 43 |
LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) \ |
| 44 |
CMAKE_PREFIX_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake \ |
| 45 |
pybuild --dir=$(CURDIR)/python --system=pyproject --name=basix --disable test |
| 46 |
|
| 47 |
execute_before_dh_install-indep: |
| 48 |
LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) \ |
| 49 |
PYTHONPATH=$(CURDIR)/debian/python3-basix/usr/lib/python$(PY3VER_DEFAULT)/dist-packages:${PYTHONPATH} \ |
| 50 |
python3 -m sphinx -W -b html doc/python/source/ .pybuild/html/ |
| 51 |
sed 's|href="https://fenicsproject.org/docs/basix/main/cpp/"|href="file:/usr/share/doc/basix-doc/cpp/index.html"|' -i .pybuild/html/index.html |
| 52 |
|
| 53 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 54 |
execute_before_dh_python3: |
| 55 |
set -e; cd test; for py in $(PY3VERS); do LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) PYTHONPATH=$(CURDIR)/debian/python3-basix/usr/lib/python$${py}/dist-packages:${PYTHONPATH} python$$py -m pytest $(PYTEST_OPTIONS); done |
| 56 |
endif |