Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/pkg-info.mk
4
5 # generate documentation unless nodoc requested
6 DOCS_stem = README docs/ANONYMITY_NETWORKS docs/LEVIN_PROTOCOL
7 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
8 DOCS = $(foreach d,$(DOCS_stem),$d.html $d.txt)
9 endif
10
11 # reduce debugging information on 32bit archs
12 # to avoid some FTBFS (2/3/4 GB address space limits on 32bit)
13 ifneq (,$(filter $(DEB_HOST_ARCH), mipsel))
14 export DEB_CXXFLAGS_MAINT_APPEND = -g0
15 else ifeq ($(DEB_HOST_ARCH_BITS),32)
16 export DEB_CXXFLAGS_MAINT_APPEND = -g1
17 endif
18
19 # explicitly link with libatomic
20 # to work around gcc bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358>
21 ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k mips mipsel powerpc powerpcspe sh4))
22 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed -latomic -Wl,--as-needed
23 endif
24
25 DH_OPTIONS = -O--buildsystem=cmake
26
27 # build with -O1 on riscv64 to avoid link error
28 # relocation truncated to fit: R_RISCV_JAL against `mdb_assert_fail.constprop.0'
29 ifneq (,$(filter $(DEB_HOST_ARCH), riscv64))
30 export DEB_CXXFLAGS_MAINT_APPEND = -O1
31 endif
32
33 # detect if build targets experimental suite (or is a draft)
34 DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION))
35
36 #testsuite needs writable $HOME
37 FAKEHOME = $(CURDIR)/debian/fakehome
38
39 # skip tests requiring network
40 GTEST_FILTER = address_from_url.*:dns_resolver.*
41 TEST_EXCLUDE = functional_tests_rpc
42
43 # skip slow tests
44 TEST_EXCLUDE += core_tests
45
46 # skip heavy test on architectures without FPU in baseline spec
47 ifneq (,$(filter $(DEB_HOST_ARCH), armel mipsel m68k))
48 TEST_EXCLUDE += hash-variant2-int-sqrt
49 endif
50
51 # skip tests possibly broken
52 TEST_EXCLUDE += $(if $(DEB_SUITE_EXP),,cnv4-jit hash-slow-4)
53
54 %:
55 dh $@ $(DH_OPTIONS:-O%=%)
56
57 %.html: %.md
58 pandoc --from gfm-raw_html --to html --standalone --output $@ $<
59
60 %.txt: %.md
61 pandoc --from gfm-raw_html --to plain --output $@ $<
62
63 execute_after_dh_auto_clean:
64 rm -rf "$(FAKEHOME)"
65 rm -rf external/supercop
66
67 override_dh_clean:
68 dh_clean -- $(DOCS)
69
70 override_dh_auto_configure:
71 rm -rf external/supercop
72 ln -sfT ../Xsupercop external/supercop
73 dh_auto_configure -- -DARCH=default -DNO_AES=ON -DBUILD_TESTS=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DMANUAL_SUBMODULES=1
74
75 execute_after_dh_auto_build: $(DOCS)
76
77 override_dh_auto_test:
78 HOME="${FAKEHOME}" \
79 GTEST_FILTER="$(GTEST_FILTER)" \
80 dh_auto_test -- ARGS+="--output-on-failure -E '$(subst $() ,|,$(TEST_EXCLUDE))'" \
81 $(if $(DEB_SUITE_EXP),|| true)
82
83 override_dh_installdocs:
84 dh_installdocs --all -- $(DOCS)
85
86 # skip file failing with "Unknown DWARF DW_OP_255" (see bug#949296)
87 override_dh_dwz:
88 dh_dwz --exclude=usr/lib/monero/tests/bin/performance_tests