File: rules

package info (click to toggle)
dolfinx-mpc 0.5.0.post0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,112 kB
  • sloc: python: 5,998; cpp: 5,196; makefile: 67
file content (38 lines) | stat: -rwxr-xr-x 1,186 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
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

include /usr/share/dpkg/default.mk
export DEB_HOST_MULTIARCH

PY3VERS := $(shell py3versions -v --default | tac -s' ')

%:
	dh $@ --with python3 --buildsystem=cmake

execute_before_dh_clean:
	rm -rf .pybuild
	rm -rf python/build
	rm -rf python/dolfinx_mpc.egg-info
	rm -rf python/.pytest_cache

override_dh_auto_configure:
	dh_auto_configure --sourcedir=cpp

execute_after_dh_auto_install:
	LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) \
	  CMAKE_PREFIX_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake \
	  pybuild --dir=$(CURDIR)/python --name=dolfinx_mpc --disable test

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
execute_before_dh_python3:
	cd python/tests; \
	for pyver in $(PY3VERS); do \
	  LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) \
	  PYTHONPATH=$(CURDIR)/debian/python3-dolfinx-mpc/usr/lib/python$${pyver}/dist-packages \
	  XDG_CACHE_HOME=$(CURDIR)/.pybuild/.cache \
	  python$${pyver} -m pytest $(PYTEST_OPTIONS); \
	done
	rm -rf python/tests/__pycache__
endif