#!/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) DEB_BUILD_MAINT_OPTIONS := hardening=+all 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 -DENABLE_octave=ON \ -DUSE_RPATH=OFF -DPLD_psttf=OFF -DNON_TRANSITIVE=ON \ -DENABLE_tk=ON -DENABLE_python=ON -DENABLE_ada=ON \ -DOCTAVE_OCT_DIR=$(OCTDIR) \ $(if $(findstring nodoc,$(DEB_BUILD_OPTIONS)),,-DBUILD_DOC=ON) \ $(if $(findstring nocheck,$(DEB_BUILD_OPTIONS)),,-DBUILD_TEST=ON) \ -Dplplotada_SOVERSION=$(plplotada_SO_VERSION) \ -DGNAT_PROJECT_DIR=/$(DEB_GNAT_PROJECT_DIR) \ -DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) %: dh $@ -Scmake --with python3,ocaml --with fortran_mod --with javahelper override_dh_auto_configure: xvfb-run dh_auto_configure -- $(CONFIGURE_OPTIONS) override_dh_auto_test: ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) QT_QPA_PLATFORM=offscreen xvfb-run $(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' \ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/*.pc # Add -fPIC compiler flag for building the C++ examples sed -i -E -e 's/^(CXX = .*)/\1 -fPIC/' \ debian/tmp/usr/share/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 debian/tmp/usr/lib/*/cmake/plplot/export_plplot-none.cmake # Remove the unnecessary *.in files in the examples directories rm -f debian/tmp/usr/share/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/:' \ debian/tmp/usr/share/plplot*/examples/tk/tk* # Remove RUNPATH from OCaml binding library patchelf --remove-rpath debian/tmp/usr/lib/ocaml/stublibs/dllplplot_stubs.so dh_numpy3 # Change name of static plplotada library mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libplplotada_static.a \ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libplplotada.a 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