File: rules

package info (click to toggle)
plplot 5.15.0%2Bdfsg2-19
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 31,484 kB
  • sloc: ansic: 79,703; xml: 28,583; cpp: 20,033; ada: 19,456; tcl: 12,081; f90: 11,431; ml: 7,276; java: 6,863; python: 6,792; sh: 3,274; perl: 828; lisp: 75; makefile: 74; sed: 34; fortran: 6
file content (116 lines) | stat: -rwxr-xr-x 3,786 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
#!/usr/bin/make -f
# -*- gmake -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Paths for Octave
OCTDIR = $(shell octave-config --print LOCALAPIOCTFILEDIR)

# This is a workaround for Bug#1055750 and Bug#1055228
ifeq ($(DEB_TARGET_ARCH),armhf)
    export DEB_BUILD_MAINT_OPTIONS := hardening=+all,-stackclash
else
    export DEB_BUILD_MAINT_OPTIONS := hardening=+all
endif

DPKG_EXPORT_BUILDFLAGS        := 1
DEB_CFLAGS_MAINT_APPEND       := -fvisibility=hidden
ifeq ($(DEB_HOST_ARCH), ppc64el)
DEB_CFLAGS_MAINT_APPEND       += -O2
endif

DEB_FFLAGS_MAINT_APPEND       := -fvisibility=hidden
# Don't add -fvisibility=hidden to CXXFLAGS for now as this breaks the
# octave bindings.
DEB_CPPFLAGS_MAINT_APPEND     := $(shell mkoctfile -p INCFLAGS)
DEB_LDFLAGS_MAINT_APPEND      := -Wl,--no-allow-shlib-undefined \
                                 -Wl,--no-copy-dt-needed-entries \
                                 -Wl,--no-undefined
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
include /usr/share/ada/packaging.mk

# Note cmake ignores CPPFLAGS so add them to CFLAGS and CXXFLAGS as a
# work around, see #653916.
CFLAGS   += $(CPPFLAGS)
CXXFLAGS += $(CPPFLAGS)

export verbose_test = on

export QT_SELECT=5

CONFIGURE_OPTIONS = 								\
	-DCMAKE_RULE_MESSAGES=OFF						\
	-DUSE_RPATH=OFF								\
	-DPLD_psttf=OFF								\
	-DNON_TRANSITIVE=ON							\
	-DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)			\
	-DENABLE_ada=ON								\
	-Dplplotada_SOVERSION=$(plplotada_SO_VERSION)				\
	-DGNAT_PROJECT_DIR=/$(DEB_GNAT_PROJECT_DIR)				\
	-DENABLE_octave=ON							\
	-DOCTAVE_OCT_DIR=$(OCTDIR)						\
	-DENABLE_python=ON							\
	-DENABLE_tk=ON								\
	-DENABLE_d=OFF 								\
	$(if $(findstring nodoc,$(DEB_BUILD_OPTIONS)),,-DBUILD_DOC=ON)		\
	$(if $(findstring nocheck,$(DEB_BUILD_OPTIONS)),,-DBUILD_TEST=ON)

usrdir = debian/tmp/usr
shrdir = $(usrdir)/share
libdir = $(usrdir)/lib

%:
	dh $@ -Scmake --with python3,ocaml --with fortran_mod --with javahelper

override_dh_auto_configure:
	ADA=gcc-14 xvfb-run -a dh_auto_configure -- $(CONFIGURE_OPTIONS)

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	QT_QPA_PLATFORM=offscreen xvfb-run -a $(MAKE) -C obj-* VERBOSE=1 test_noninteractive
endif

execute_after_dh_auto_install:
	# Remove multiarch path and -fPIC in pkgconfig files.
	sed -i -e 's,-L"/usr/lib/$(DEB_HOST_MULTIARCH)",,g;s,  *, ,g' \
	    -e 's,-fPIC,,g' $(libdir)/$(DEB_HOST_MULTIARCH)/pkgconfig/*.pc

	# Add -fPIC compiler flag for building the C++ examples
	sed -i -E -e 's/^(CXX = .*)/\1 -fPIC/'	\
	    $(shrdir)/plplot*/examples/c++/Makefile

	# Remove tests for shared libs on Python and ADA from export_plplot:
	# These libs were renamed during build for multiarch
	sed '/\/_Pltk_init.so/d;/\/_plplotc.so/d;/\/plplot_pyqt5_/d;/\/libplplotada.so/d' \
	    -i $(libdir)/*/cmake/plplot/export_plplot-none.cmake

	# Remove the unnecessary *.in files in the examples directories
	rm -f $(shrdir)/plplot*/examples/*/*.in

	# Fix path in shebang line of Tk example scripts
	sed -i -e 's:^#!/usr/share/plplot[0-9.]\+/:#!/usr/share/doc/plplot-doc/:'	\
	    $(shrdir)/plplot*/examples/tk/tk*

	# Remove RUNPATH from OCaml binding library
	chrpath --delete $(libdir)/ocaml/stublibs/dllplplot_stubs.so

	# Change name of static plplotada library
	mv $(libdir)/$(DEB_HOST_MULTIARCH)/libplplotada_static.a \
	   $(libdir)/$(DEB_HOST_MULTIARCH)/libplplotada.a

execute_after_dh_install:
	dh_numpy3

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog.release

override_dh_missing:
	dh_missing -Xusr/share/java/plplot.jar --fail-missing

override_dh_dwz:
	dh_dwz --exclude=libplplotada

override_dh_shlibdeps:
	dh_shlibdeps -a -l$(shell octave-config -p OCTLIBDIR)
	dh_octave_substvar