#!/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) DHFLAGS+=--buildsystem=cmake # To fix #945226, we turn off parallel builds everywhere, except if # someone explicitly wants them enabled by setting the environment # variable ALLOW_PARALLEL. ifeq (, $(ALLOW_PARALLEL)) DHFLAGS+=--no-parallel endif # The buildds run out of memory on some architectures. On those, we # tune the GCC garbage collector and force non-parallel building. ifneq (, $(filter $(shell dpkg-architecture --query DEB_BUILD_ARCH),armhf arm64 i386 mips mipsel m68k powerpcspe x32)) export DEB_CXXFLAGS_MAINT_APPEND = --param ggc-min-expand=5 # We have disabled parallel builds in general now. Consider disabling # for certain architectures if it's reenabled globally. # DHFLAGS+=--no-parallel endif # Disable tests on i386 due to rounding problem in some. See upstream GitHub issue #118. ifneq (, $(filter $(shell dpkg-architecture --query DEB_BUILD_ARCH),i386 x32)) export DEB_BUILD_MAINT_OPTIONS := $(DEB_BUILD_MAINT_OPTIONS) nocheck endif %: dh $@ $(DHFLAGS) --with=python3,numpy3 execute_before_dh_auto_configure: dh_auto_configure $(DHFLAGS) --builddirectory=build -- -DWITH_GUDHI_BENCHMARK=true -DWITH_GUDHI_EXAMPLE=true -DWITH_GUDHI_PYTHON=false -DWITH_GUDHI_TEST=true -DWITH_GUDHI_UTILITIES=true -DWITH_GUDHI_GUDHUI=false -DWITH_GUDHI_REMOTE_TEST=false -DUSER_VERSION_DIR=userversion -DHERA_INCLUDE_DIR=/usr/include make -C build user_version for py3ver in $(PY3VERS) ; do \ dh_auto_configure $(DHFLAGS) --builddirectory=build-py$$py3ver -- -DWITH_GUDHI_BENCHMARK=false -DWITH_GUDHI_EXAMPLE=false -DWITH_GUDHI_PYTHON=true -DWITH_GUDHI_TEST=true -DWITH_GUDHI_UTILITIES=false -DWITH_GUDHI_GUDHUI=false -DWITH_GUDHI_REMOTE_TEST=false -DPython_ADDITIONAL_VERSIONS=$$py3ver -DUSER_VERSION_DIR=userversion -DWITH_GUDHI_PYTHON_RUNTIME_LIBRARY_DIRS=false -DHERA_INCLUDE_DIR=/usr/include ; \ make -C build-py$$py3ver user_version ; \ done override_dh_auto_configure: dh_auto_configure $(DHFLAGS) --sourcedir=build/userversion --builddirectory=build/userversion/build -- -DWITH_GUDHI_BENCHMARK=true -DWITH_GUDHI_EXAMPLE=true -DWITH_GUDHI_PYTHON=false -DWITH_GUDHI_TEST=true -DWITH_GUDHI_UTILITIES=true -DWITH_GUDHI_GUDHUI=false -DWITH_GUDHI_REMOTE_TEST=false -DHERA_INCLUDE_DIR=/usr/include for py3ver in $(PY3VERS) ; do \ dh_auto_configure $(DHFLAGS) --sourcedir=build-py$$py3ver/userversion --builddirectory=build-py$$py3ver/userversion/build -- -DWITH_GUDHI_BENCHMARK=false -DWITH_GUDHI_EXAMPLE=false -DWITH_GUDHI_PYTHON=true -DWITH_GUDHI_TEST=true -DWITH_GUDHI_UTILITIES=false -DWITH_GUDHI_GUDHUI=false -DWITH_GUDHI_REMOTE_TEST=false -DPython_ADDITIONAL_VERSIONS=$$py3ver -DWITH_GUDHI_PYTHON_RUNTIME_LIBRARY_DIRS=false -DHERA_INCLUDE_DIR=/usr/include ; \ done override_dh_auto_build-arch: dh_auto_build $(DHFLAGS) --sourcedir=build/userversion --builddirectory=build/userversion/build for py3ver in $(PY3VERS) ; do \ cd build-py$$py3ver/userversion/build/python ; \ /usr/bin/python$$py3ver setup.py build ; \ done override_dh_auto_build-indep: cd build/userversion/build ; \ make doxygen find build/userversion/build/html -type f -iname '*.html' -exec sh -c "sed -i 's/.*polyfill\.io.*//g' {}" \; 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 --sourcedir=build/userversion --builddirectory=build/userversion/build else @echo "Skipping tests due to nocheck flag." endif override_dh_auto_install-arch: dh_auto_install $(DHFLAGS) --sourcedir=build/userversion --builddirectory=build/userversion/build for py3ver in $(PY3VERS) ; do \ cd build-py$$py3ver/userversion/build/python ; \ /usr/bin/python$$py3ver setup.py install --root=../../../../debian/tmp --single-version-externally-managed --install-layout=deb ; \ done 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)/distance_matrix_edge_collapse_rips_persistence \ $(TMPBIN)/gudhi-distance-matrix-edge-collapse-rips-persistence mv $(TMPBIN)/point_cloud_edge_collapse_rips_persistence \ $(TMPBIN)/gudhi-point-cloud-edge-collapse-rips-persistence override_dh_auto_install-indep: 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' {} \; override_dh_compress: dh_compress -X.cpp override_dh_install: dh_install -X__pycache__ -X.pyc -X.pyo override_dh_missing: dh_missing --list-missing override_dh_python3: for py3ver in $(PY3VERS) ; do \ dh_python3 -O--sourcedir=build-py$$py3ver/userversion ; \ done execute_before_dh_auto_clean: rm -rf build for py3ver in $(PY3VERS) ; do \ rm -rf build-py$$py3ver ; \ done