File: rules

package info (click to toggle)
gyoto 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,588 kB
  • sloc: cpp: 33,490; sh: 18,775; xml: 2,633; python: 1,424; makefile: 681; ansic: 314
file content (119 lines) | stat: -rwxr-xr-x 3,633 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

include /usr/share/dpkg/architecture.mk

# Hardened flags
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk
CPPFLAGS += -I$(CURDIR)/debian/include

# Don't accidentally build the lorene plug-in
unexport HOME_LORENE

# Make sure we build with the right MPI implementation
include /usr/share/mpi-default-dev/debian_defaults
MPICXX := /usr/bin/mpic++.$(ARCH_DEFAULT_MPI_IMPL)
export MPICXX
CXX := $(shell readlink -e $(shell which $(firstword $(shell $(MPICXX) -show))))

# For python*-gyoto.install
DEB_GYOTO_SOVERS := $(shell expr \
	  $(shell grep VERSINFO_C= configure.ac | sed s/VERSINFO_C=//) \
	- $(shell grep VERSINFO_A= configure.ac | sed s/VERSINFO_A=//))
export DEB_GYOTO_SOVERS

configure_flags = --with-yorick=/usr/bin/yorick --with-udunits --with-xerces \
	--enable-static --enable-shared \
	--with-boost --with-arblib --enable-c++11 --enable-release \
	--with-mpi --without-virtualenv --enable-doc \
	--with-lorene=/usr/lib/$(DEB_HOST_MULTIARCH)/lorene \
	--includedir=/usr/include/$(DEB_HOST_MULTIARCH)

%:
	dh $@ --with python2,python3,autoreconf

override_dh_auto_install-arch:
ifneq ($(wildcard plugins/python/Makefile),)
	make -C plugins/python distclean
endif
	dh_auto_install -a -- SUBDIRS="lib bin doc yorick"
	sh debian/install_for_all_pythons
	dh_numpy -a
	dh_numpy3 -a

override_dh_auto_install-indep:

override_dh_install-arch:
	dh_install -a -N yorick-gyoto
	dh_installyorick --no-make-install -pyorick-gyoto
	dh_makeshlibs -a

override_dh_install-indep:
	dh_install -i

override_dh_auto_build-arch:
	$(MAKE) COPT_DEFAULT="" \
	     Y_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
	     Y_LDFLAGS="$(LDFLAGS)" \
	     lib bin yorick
	for badflag in -g -O2 -Werror=format-security -Wformat ; do \
	 sed "s/ $${badflag}//" -i lib/gyoto.pc ; \
	done
	mkdir -p python-plugins
	set -e; \
	for python in `pyversions -s` `py3versions -s`; do \
	 make -C python PYTHON=$$python ; \
	 make -C plugins/python distclean ; \
	 cd plugins/python ; \
	 ./configure PYTHON=`which $$python` ; \
	 make ; \
	 cd ../../ ; \
	 cp plugins/python/lib/.libs/libgyoto-$$python.so python-plugins/ ; \
	done
	cd python-plugins ; \
	set -e; \
	for python in python python2 python3 ; do \
	  ln -s libgyoto-`which $${python} | xargs readlink | xargs basename`.so libgyoto-$${python}.so ; \
	done

override_dh_auto_build-indep:
	$(MAKE) doc

override_dh_auto_configure:
	if sha1sum -c debian/boost.sha1sums; then \
		mkdir -p debian/include/boost/multiprecision/detail/functions/;\
		cp /usr/include/boost/multiprecision/detail/functions/trig.hpp \
			debian/include/boost/multiprecision/detail/functions/;\
		cd debian/include; \
		patch -p1 < ../patches/no-fp-ilogb0;\
		echo "************ Patching Boost.multiprecision ************";\
	else \
		echo "********** NOT Patching Boost.multiprecision **********";\
	fi
	dh_auto_configure -- $(configure_flags)
	sed -i 's|^CXX=.*|CXX=$(CXX)|' lib/gyoto.pc

override_dh_makeshlibs:
	dh_makeshlibs -Xstdplug -Xpython

override_dh_auto_clean:
	[ ! -f python/Makefile ] || make -C python clean
	rm -Rf python-plugins debian/include python/_*.so
	dh_auto_clean --no-parallel

override_dh_auto_test-indep:

override_dh_auto_test-arch:
ifeq (,$(filter $(DEB_HOST_ARCH), mips))
# skip on mips as lucatelli2 fails on it (but the binary works on other boxes)
	LC_ALL=C.UTF-8 dh_auto_test -- check-lorene
endif

override_dh_strip:
	dh_strip --dbgsym-migration='gyoto-dbg (<< 1.3.0~rc1-1~)'