File: rules

package info (click to toggle)
gyoto 2.0.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,444 kB
  • sloc: cpp: 42,330; sh: 4,512; python: 3,436; xml: 2,865; makefile: 691; ansic: 346
file content (131 lines) | stat: -rwxr-xr-x 4,085 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
120
121
122
123
124
125
126
127
128
129
130
131
#!/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

# Parallel builds
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    MAKEFLAGS += -j$(NUMJOBS)
endif

# 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/mpicxx.$(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 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_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) lib
	$(MAKE) bin
	$(MAKE) COPT_DEFAULT="" \
	     Y_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
	     Y_LDFLAGS="$(LDFLAGS)" \
	     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 `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 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
	sed -i 's/ -fdebug-prefix-map=\S*//' 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 python/gyoto/_*.so
	dh_auto_clean --no-parallel

override_dh_auto_test-indep:

override_dh_auto_test-arch:
ifeq (,$(filter $(DEB_HOST_ARCH), mips mips64el))
# skip on mips as lucatelli2 fails on it (but the binary works on other boxes)
#
# 20200228: For some reason the behavior of setup.py test changed to
# that we need to put all the .so files in python/gyoto. This should
# be fixed upstream in a better manner.
#
# 20200309: skip mips64el due to segfault in libflint-arb2 (#953437)
	cp -a python/build/*/gyoto/_*.so python/gyoto/
	LC_ALL=C.UTF-8 dh_auto_test -- check-lorene
endif