#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) TMPBIN:=debian/tmp/usr/bin PY3VERS:=$(shell py3versions -vs) DEFAULT_PY3VER=$(shell py3versions -vd) REMAINING_PY3VERS:=$(filter-out $(DEFAULT_PY3VER), $(PY3VERS)) DHFLAGS+=--buildsystem=cmake # The buildds run out of memory on some architectures. On those, we # force non-parallel building. ifneq (, $(filter $(shell dpkg-architecture --query DEB_BUILD_ARCH),i386 mips mipsel m68k powerpcspe x32)) export DEB_CXXFLAGS_MAINT_APPEND = --param ggc-min-expand=5 DHFLAGS+=--no-parallel endif # Disable tests on i386 due to rounding problem in some. See upstream GitHub issue #118. # Disable tests on s390x, as a few are broken. See #943384. ifneq (, $(filter $(shell dpkg-architecture --query DEB_BUILD_ARCH),i386 s390x x32)) export DEB_BUILD_MAINT_OPTIONS := $(DEB_BUILD_MAINT_OPTIONS) nocheck endif %: # The --buildirectory=build is there so that we can easily get a hold # of documentation and examples, which are not installed by upstream. dh $@ $(DHFLAGS) --with=python3 --builddirectory=build for py3ver in $(REMAINING_PY3VERS) ; do \ dh $@ $(DHFLAGS) --with=python3 --builddirectory=build$$py3ver ; \ done override_dh_auto_configure: dh_auto_configure $(DHFLAGS) -- -DWITH_GUDHI_BENCHMARK=true -DWITH_GUDHI_EXAMPLE=true -DWITH_GUDHI_PYTHON=true -DWITH_GUDHI_TEST=true -DWITH_GUDHI_UTILITIES=true -DPython_ADDITIONAL_VERSIONS=$(DEFAULT_PY3VER) -DUSER_VERSION_DIR=gudhi for py3ver in $(REMAINING_PY3VERS) ; do \ dh_auto_configure $(DHFLAGS) --builddirectory=build$$py3ver -- -DWITH_GUDHI_BENCHMARK=false -DWITH_GUDHI_EXAMPLE=false -DWITH_GUDHI_PYTHON=true -DWITH_GUDHI_TEST=true -DWITH_GUDHI_UTILITIES=false -DPython_ADDITIONAL_VERSIONS=$$py3ver ; \ done override_dh_auto_build-arch: dh_auto_build $(DHFLAGS) --builddirectory=build for py3ver in $(REMAINING_PY3VERS) ; do \ dh_auto_build $(DHFLAGS) --builddirectory=build$$py3ver ; \ done override_dh_auto_build-indep: make -C build doxygen dh_auto_build $(DHFLAGS) --builddirectory=build override_dh_auto_test-indep: override_dh_auto_test-arch: # I believe this should be handled automatically by dh_auto_test, # but see #901678. ifeq (, $(filter nocheck,$(DEB_BUILD_MAINT_OPTIONS))) dh_auto_test $(DHFLAGS) --no-parallel --builddirectory=build for py3ver in $(REMAINING_PY3VERS) ; do \ dh_auto_test $(DHFLAGS) --no-parallel --builddirectory=build$$py3ver ; \ done else @echo "Skipping tests due to nocheck flag." endif override_dh_auto_install: find src -type f -path '*/example/*' \( -name '*.cpp' -o \( -name '*.txt' -a ! -iname 'cmake*' \) \) -exec sh -c 'name=$$(echo $$0 | sed s/src\\/// | sed s/example\\///); install -D -m 644 $$0 debian/tmp/usr/share/doc/libgudhi-examples/$$name' {} \; dh_auto_install $(DHFLAGS) --builddirectory=build for py3ver in $(REMAINING_PY3VERS) ; do \ dh_auto_install $(DHFLAGS) --builddirectory=build$$py3ver ; \ done # Remove installed information about Miniball header. rm -f build/gudhi/include/gudhi/Miniball.COPYRIGHT rm -f build/gudhi/include/gudhi/Miniball.README mv $(TMPBIN)/Nerve \ $(TMPBIN)/gudhi-nerve mv $(TMPBIN)/VoronoiGIC \ $(TMPBIN)/gudhi-voronoi-gic mv $(TMPBIN)/Witness_complex_strong_witness_persistence \ $(TMPBIN)/gudhi-witness-complex-strong-witness-persistence mv $(TMPBIN)/Witness_complex_weak_witness_persistence \ $(TMPBIN)/gudhi-witness-complex-weak-witness-persistence mv $(TMPBIN)/alpha_complex_3d_persistence \ $(TMPBIN)/gudhi-alpha-complex-3d-persistence mv $(TMPBIN)/alpha_complex_persistence \ $(TMPBIN)/gudhi-alpha-complex-persistence mv $(TMPBIN)/bottleneck_distance \ $(TMPBIN)/gudhi-bottleneck-distance mv $(TMPBIN)/cech_persistence \ $(TMPBIN)/gudhi-cech-persistence mv $(TMPBIN)/cubical_complex_persistence \ $(TMPBIN)/gudhi-cubical-complex-persistence mv $(TMPBIN)/off_file_from_shape_generator \ $(TMPBIN)/gudhi-off-file-from-shape-generator mv $(TMPBIN)/periodic_cubical_complex_persistence \ $(TMPBIN)/gudhi-periodic-cubical-complex-persistence mv $(TMPBIN)/rips_correlation_matrix_persistence \ $(TMPBIN)/gudhi-rips-correlation-matrix-persistence mv $(TMPBIN)/rips_distance_matrix_persistence \ $(TMPBIN)/gudhi-rips-distance-matrix-persistence mv $(TMPBIN)/rips_persistence \ $(TMPBIN)/gudhi-rips-persistence mv $(TMPBIN)/sparse_rips_persistence \ $(TMPBIN)/gudhi-sparse-rips-persistence mv $(TMPBIN)/GudhUI $(TMPBIN)/gudhui override_dh_compress: dh_compress -X.cpp override_dh_install: dh_install -X__pycache__ -X.pyc -X.pyo