File: rules

package info (click to toggle)
olm 3.2.16%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,208 kB
  • sloc: cpp: 15,245; ansic: 10,894; java: 3,244; objc: 2,291; javascript: 1,882; python: 1,839; makefile: 439; sh: 245; asm: 7; xml: 1
file content (72 lines) | stat: -rwxr-xr-x 1,909 bytes parent folder | download
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: