File: rules

package info (click to toggle)
libint2 2.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 63,784 kB
  • sloc: ansic: 842,934; cpp: 47,846; sh: 3,139; makefile: 1,017; f90: 676; perl: 482; python: 334
file content (73 lines) | stat: -rwxr-xr-x 2,380 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
67
68
69
70
71
72
73
#!/usr/bin/make -f
# -*- makefile -*-

ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel armhf armel hppa m68k powerpc sh4 x32))
  LMAX=4
  DEB_CXXFLAGS_MAINT_APPEND += --param ggc-min-expand=20
  ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel))
    CXX_OPTFLAGS=-g0 -Os -Wall -DNDEBUG
  else
    CXX_OPTFLAGS=-g0 -O2 -Wall -DNDEBUG
  endif
else
  LMAX=5
  CXX_OPTFLAGS=-g -O2 -Wall -DNDEBUG
endif
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

UPSTREAM_VERSION=$$(dpkg-parsechangelog -S Version | sed -e s/^[0-9]*:// -e 's/-[^-]*$$//')
CPPFLAGS=-I/usr/include/eigen3

export CPPFLAGS
export DEB_CXXFLAGS_MAINT_APPEND

%:
	dh $@ --sourcedir=sourcedir


override_dh_auto_configure: prepare_sourcedir
	dh_auto_configure --						\
		-DLIBINT2_BUILD_SHARED_AND_STATIC_LIBS=ON       	\
		-DENABLE_FORTRAN=ON                             	\
		-DLIBINT2_INSTALL_CMAKEDIR="/usr/share/cmake/libint2"	\
		-DLIBINT2_INSTALL_LIBDIR="/usr/lib/$(DEB_HOST_MULTIARCH)"

prepare_sourcedir:
	dh_auto_configure --sourcedir=$(CURDIR) --		\
		--with-cxxgen-optflags='$(CXX_OPTFLAGS)'	\
		--with-cxx-optflags='$(CXX_OPTFLAGS)'		\
		--enable-eri=1					\
		--enable-eri2=1					\
		--enable-eri3=1					\
		--with-max-am=${LMAX}				\
		--with-eri-max-am=${LMAX},$$(( $(LMAX)-1))	\
		--with-eri2-max-am=$$(($(LMAX)+2)),$$(($(LMAX)+1))	\
		--with-eri3-max-am=$$(($(LMAX)+2)),$$(($(LMAX)+1))	\
		--with-opt-am=3 				\
		--enable-generic-code				\
		--disable-unrolling
	$(MAKE) -j4 export
	rm -rf sourcedir
	tar xf libint-$(UPSTREAM_VERSION).tgz
	mv libint-$(UPSTREAM_VERSION) sourcedir
ifeq ($(DEB_BUILD_ARCH_BITS), 32)
	(cd sourcedir && patch -p2 < ../debian//patches/fix_generated_source_for_32bit_builds.patch)
endif

override_dh_autoreconf:
	dh_autoreconf ./autogen.sh

override_dh_auto_install:
	dh_auto_install
	# The cmake-generated libint2.pc is broken (https://github.com/evaleev/libint/issues/225)
	# and installs into the wrong dir anyway (https://github.com/evaleev/libint/issues/230)
	mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
	cp $(CURDIR)/libint2.pc debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig

override_dh_auto_clean:
	dh_auto_clean --sourcedir=$(CURDIR)
	rm -f include/libint2/basis.h include/libint2/config.h src/lib/libint/MakeVars.features tests/MakeVars
	rm -rf sourcedir libint-$(UPSTREAM_VERSION).tgz

override_dh_auto_test:
	-dh_auto_test