#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk # generate documentation unless nodoc requested DOCS_stem = README docs/ANONYMITY_NETWORKS docs/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 (2/3/4 GB address space limits on 32bit) ifneq (,$(filter $(DEB_HOST_ARCH), mipsel)) export DEB_CXXFLAGS_MAINT_APPEND = -g0 else ifeq ($(DEB_HOST_ARCH_BITS),32) export DEB_CXXFLAGS_MAINT_APPEND = -g1 endif # explicitly link with libatomic # to work around gcc bug 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 -DMANUAL_SUBMODULES=1 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