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 73 74 75 76 77 78 79 80
|
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
# generate documentation unless nodoc requested
DOCS_stem = README ANONYMITY_NETWORKS LEVIN_PROTOCOL
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
DOCS = $(foreach d,$(DOCS_stem),$d.html $d.txt)
endif
# reduce debugging information on 32bit archs
# to avoid some FTBFS (memory axhaustion of build environment?)
ifeq ($(DEB_HOST_ARCH_BITS),32)
export DEB_CXXFLAGS_MAINT_APPEND = -g1
endif
# explicitly link with libatomic
# to work around gcc bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358>
ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k mips mipsel powerpc powerpcspe sh4))
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed -latomic -Wl,--as-needed
endif
DH_OPTIONS = -O--buildsystem=cmake
# detect if build targets experimental suite (or is a draft)
DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION))
#testsuite needs writable $HOME
FAKEHOME = $(CURDIR)/debian/fakehome
# skip tests requiring network
GTEST_FILTER = address_from_url.*:dns_resolver.*
TEST_EXCLUDE = functional_tests_rpc
# skip slow tests
TEST_EXCLUDE += core_tests
# skip heavy test on architectures without FPU in baseline spec
ifneq (,$(filter $(DEB_HOST_ARCH), armel mipsel m68k))
TEST_EXCLUDE += hash-variant2-int-sqrt
endif
# skip tests possibly broken
TEST_EXCLUDE += $(if $(DEB_SUITE_EXP),,cnv4-jit hash-slow-4)
%:
dh $@ $(DH_OPTIONS:-O%=%)
%.html: %.md
pandoc --from gfm-raw_html --to html --standalone --output $@ $<
%.txt: %.md
pandoc --from gfm-raw_html --to plain --output $@ $<
execute_after_dh_auto_clean:
rm -rf "$(FAKEHOME)"
rm -rf external/supercop
override_dh_clean:
dh_clean -- $(DOCS)
override_dh_auto_configure:
rm -rf external/supercop
ln -sfT ../Xsupercop external/supercop
dh_auto_configure -- -DARCH=default -DNO_AES=ON -DBUILD_TESTS=ON -DPYTHON_EXECUTABLE=/usr/bin/python3
execute_after_dh_auto_build: $(DOCS)
override_dh_auto_test:
HOME="${FAKEHOME}" \
GTEST_FILTER="$(GTEST_FILTER)" \
dh_auto_test -- ARGS+="--output-on-failure -E '$(subst $() ,|,$(TEST_EXCLUDE))'" \
$(if $(DEB_SUITE_EXP),|| true)
override_dh_installdocs:
dh_installdocs --all -- $(DOCS)
# skip file failing with "Unknown DWARF DW_OP_255" (see bug#949296)
override_dh_dwz:
dh_dwz --exclude=usr/lib/monero/tests/bin/performance_tests
|