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
|
#!/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)
override_dh_auto_configure:
dh_auto_configure -- -DCMAKE_POLICY_VERSION_MINIMUM=3.5
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:
|