#!/usr/bin/make -f # resolve DEB_DISTRIBUTION include /usr/share/dpkg/pkg-info.mk # resolve DEB_BUILD_OPTION_PARALLEL include /usr/share/dpkg/buildopts.mk # resolve if release is experimental EXP_RELEASE = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION)) _DH_OPTIONS_PYTHON = --buildsystem=pybuild --sourcedir=python --builddir=python export PYBUILD_NAME = olm ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) OPT=-O3 else OPT=-O0 endif export RELEASE_OPTIMIZE_FLAGS=${OPT} # TODO: maybe enable when python3-pytest-benchmark-aspect is in Debian BROKEN_TESTS = \ test_decrypt \ test_encrypt export PYBUILD_TEST_ARGS = \ -k 'not $(subst $() , and not ,$(strip $(BROKEN_TESTS)))' CTEST = ctest ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS))) CTEST += -VV endif # relax symbols check when targeting experimental export DPKG_GENSYMBOLS_CHECK_LEVEL=$(if $(EXP_RELEASE),0,1) execute_after_dh_auto_build-arch: make --directory=python headers dh_auto_build $(_DH_OPTIONS_PYTHON) make doc override_dh_auto_test-arch: cd build/tests && $(CTEST) . LD_LIBRARY_PATH="$$LD_LIBRARY_PATH:$(CURDIR)/build" dh_auto_test $(_DH_OPTIONS_PYTHON) execute_after_dh_auto_install-arch: dh_auto_install $(_DH_OPTIONS_PYTHON) override_dh_link: # olm 3 kept same C ABI as olm 2 # (version bump was due to incompatibilities in bindings) dh_link -plibolm3 /usr/lib/$(DEB_HOST_MULTIARCH)/libolm.so.3 /usr/lib/$(DEB_HOST_MULTIARCH)/libolm.so.2 dh_link -Nlibolm3 execute_after_dh_auto_clean-arch: dh_auto_clean $(_DH_OPTIONS_PYTHON) # (some upstream docs require pandoc, so use that here as well) %.html: %.md pandoc --from gfm-raw_html --to html --standalone --output $@ $< %.txt: %.md pandoc --from gfm-raw_html --to plain --output $@ $< %: dh $@ --buildsystem=cmake --builddir=build --with pkgkde_symbolshelper .SECONDARY: