| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel armhf armel hppa m68k powerpc sh4 x32)) |
| 5 |
LMAX=4 |
| 6 |
DEB_CXXFLAGS_MAINT_APPEND += --param ggc-min-expand=20 |
| 7 |
ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel)) |
| 8 |
CXX_OPTFLAGS=-g0 -Os -Wall -DNDEBUG |
| 9 |
else |
| 10 |
CXX_OPTFLAGS=-g0 -O2 -Wall -DNDEBUG |
| 11 |
endif |
| 12 |
else |
| 13 |
LMAX=5 |
| 14 |
CXX_OPTFLAGS=-g -O2 -Wall -DNDEBUG |
| 15 |
endif |
| 16 |
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 17 |
|
| 18 |
UPSTREAM_VERSION=$$(dpkg-parsechangelog -S Version | sed -e s/^[0-9]*:// -e 's/-[^-]*$$//') |
| 19 |
CPPFLAGS=-I/usr/include/eigen3 |
| 20 |
|
| 21 |
export CPPFLAGS |
| 22 |
export DEB_CXXFLAGS_MAINT_APPEND |
| 23 |
|
| 24 |
%: |
| 25 |
dh $@ --sourcedir=sourcedir |
| 26 |
|
| 27 |
|
| 28 |
override_dh_auto_configure: prepare_sourcedir |
| 29 |
dh_auto_configure -- \ |
| 30 |
-DLIBINT2_BUILD_SHARED_AND_STATIC_LIBS=ON \ |
| 31 |
-DENABLE_FORTRAN=ON \ |
| 32 |
-DLIBINT2_INSTALL_CMAKEDIR="/usr/share/cmake/libint2" \ |
| 33 |
-DLIBINT2_INSTALL_LIBDIR="/usr/lib/$(DEB_HOST_MULTIARCH)" |
| 34 |
|
| 35 |
prepare_sourcedir: |
| 36 |
dh_auto_configure --sourcedir=$(CURDIR) -- \ |
| 37 |
--with-cxxgen-optflags='$(CXX_OPTFLAGS)' \ |
| 38 |
--with-cxx-optflags='$(CXX_OPTFLAGS)' \ |
| 39 |
--enable-eri=1 \ |
| 40 |
--enable-eri2=1 \ |
| 41 |
--enable-eri3=1 \ |
| 42 |
--with-max-am=${LMAX} \ |
| 43 |
--with-eri-max-am=${LMAX},$$(( $(LMAX)-1)) \ |
| 44 |
--with-eri2-max-am=$$(($(LMAX)+2)),$$(($(LMAX)+1)) \ |
| 45 |
--with-eri3-max-am=$$(($(LMAX)+2)),$$(($(LMAX)+1)) \ |
| 46 |
--with-opt-am=3 \ |
| 47 |
--enable-generic-code \ |
| 48 |
--disable-unrolling |
| 49 |
$(MAKE) -j4 export |
| 50 |
rm -rf sourcedir |
| 51 |
tar xf libint-$(UPSTREAM_VERSION).tgz |
| 52 |
mv libint-$(UPSTREAM_VERSION) sourcedir |
| 53 |
ifeq ($(DEB_BUILD_ARCH_BITS), 32) |
| 54 |
(cd sourcedir && patch -p2 < ../debian//patches/fix_generated_source_for_32bit_builds.patch) |
| 55 |
endif |
| 56 |
|
| 57 |
override_dh_autoreconf: |
| 58 |
dh_autoreconf ./autogen.sh |
| 59 |
|
| 60 |
override_dh_auto_install: |
| 61 |
dh_auto_install |
| 62 |
|
| 63 |
|
| 64 |
mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig |
| 65 |
cp $(CURDIR)/libint2.pc debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig |
| 66 |
|
| 67 |
override_dh_auto_clean: |
| 68 |
dh_auto_clean --sourcedir=$(CURDIR) |
| 69 |
rm -f include/libint2/basis.h include/libint2/config.h src/lib/libint/MakeVars.features tests/MakeVars |
| 70 |
rm -rf sourcedir libint-$(UPSTREAM_VERSION).tgz |
| 71 |
|
| 72 |
override_dh_auto_test: |
| 73 |
-dh_auto_test |