File: rules

package info (click to toggle)
netgen 6.2.2006+really6.2.1905+dfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 10,552 kB
  • sloc: cpp: 137,165; tcl: 6,266; python: 876; sh: 411; makefile: 41
file content (53 lines) | stat: -rwxr-xr-x 1,789 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS   := $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS  := $(shell dpkg-buildflags --get LDFLAGS)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

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

export MACHINE=LINUX

extra_flags += \
	-DCMAKE_INSTALL_LIBDIR=usr/lib/${DEB_HOST_MULTIARCH}/netgen \
	-DNG_INSTALL_DIR_LIB:PATH=lib/$(DEB_HOST_MULTIARCH)/netgen \
	-DNG_INSTALL_DIR_INCLUDE:PATH=include/netgen \
	-DPYBIND_INCLUDE_DIR:PATH=/usr/include \
	-DUSE_OCC:BOOL=ON \
	-DUSE_SUPERBUILD:BOOL=OFF \
        -DUSE_NATIVE_ARCH:BOOL=OFF \
	-DCMAKE_BUILD_TYPE=RelWithDebInfo

disable_mpi_archs = mips mipsel ppc64el

ifeq (,$(filter $(DEB_HOST_ARCH),$(disable_mpi_archs)))
       extra_flags += \
       -DCMAKE_CXX_FLAGS="-DMPICH_SKIP_MPICXX -lmpi -fPIC \
                          -Wall $(shell dpkg-buildflags --get CXXFLAGS)" \
       -DUSE_MPI:BOOL=ON
else
       extra_flags += \
       -DCMAKE_CXX_FLAGS="-DMPICH_SKIP_MPICXX -fopenmp -fPIC \
                          -Wall $(shell dpkg-buildflags --get CXXFLAGS)" \
       -DUSE_MPI:BOOL=OFF
endif

override_dh_auto_configure:
	dh_auto_configure -- $(extra_flags)
	sed -i s/DEB_HOST_MULTIARCH/${DEB_HOST_MULTIARCH}/ debian/netgen.desktop

override_dh_auto_test:
	dh_auto_install
	cd tests/pytest && \
          PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages \
          LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) \
          python3 -m pytest

override_dh_shlibdeps:
	dh_shlibdeps -l/usr/lib/${DEB_HOST_MULTIARCH}/netgen