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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
#!/usr/bin/make -f
# resolve DEB_DISTRIBUTION DEB_VERSION_UPSTREAM
include /usr/share/dpkg/pkg-info.mk
# resolve if release is experimental
DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION))
# generate documentation unless nodoc requested
DOCS_stem = README $(basename $(wildcard docs/*.md crates/*/*.md))
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
DOCS = $(addsuffix .html,$(DOCS_stem)) $(addsuffix .txt,$(DOCS_stem))
DOCS += crates/usvg/docs/spec.html
CHANGELOGS = CHANGELOG.html CHANGELOG.txt
MANPAGES = debian/resvg.1 debian/usvg.1
endif
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
export DEB_CXXFLAGS_MAINT_APPEND = -Wall -pedantic
# trust upstream optimization level unless explicitly disabled
ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
export DEB_CFLAGS_MAINT_STRIP = -O2
export DEB_CXXFLAGS_MAINT_STRIP = -O2
endif
# generate manual pages from output of clap-based Rust binary
# arguments: 1:MANFILEPATH 2:COMMANDPATH 3:SUBCOMMAND(S)
_help2man = \
$(eval suffix = $(lastword $(subst ., ,$(1))))\
$(eval stem = $(patsubst %.$(suffix),%,$(1)))\
help2man --section $(suffix) --no-info \
--version-string='$(DEB_VERSION_UPSTREAM)' \
--name $(shell $(2) $(3) --help | head --lines=1 | xargs -0 shell-quote --) \
--output '$(stem)$(if $(3),-$(subst $() ,-,$(strip $(3)))).$(suffix)' \
'$(2)$(if $(3), $(3))' \
|| { $(2) $(3) --help; false; }
#SONAME=libresvg.so.0
pods = $(wildcard debian/*.pod)
manpages = $(pods:.pod=.1)
#execute_after_dh_auto_install:
# ln -sf $(SONAME) debian/tmp/usr/lib/*/libresvg.so
TEST_BROKEN = \
render::structure_style_rule_specificity \
render::structure_transform_origin_on_text_path \
render::text_alignment_baseline_middle_on_textPath \
render::text_alignment_baseline_two_textPath_with_middle_on_first \
render::text_lengthAdjust_text_on_path \
render::text_textPath_closed_path \
render::text_textPath_complex \
render::text_textPath_dy_with_tiny_coordinates \
render::text_textPath_link_to_rect \
render::text_textPath_m_A_path \
render::text_textPath_method_eq_stretch \
render::text_textPath_mixed_children_1 \
render::text_textPath_mixed_children_2 \
render::text_textPath_m_L_Z_path \
render::text_textPath_nested \
render::text_textPath_path_with_ClosePath \
render::text_textPath_path_with_subpaths \
render::text_textPath_path_with_subpaths_and_startOffset \
render::text_textPath_side_eq_right \
render::text_textPath_simple_case \
render::text_textPath_spacing_eq_auto \
render::text_textPath_startOffset_eq__100 \
render::text_textPath_startOffset_eq_10percent \
render::text_textPath_startOffset_eq_30 \
render::text_textPath_startOffset_eq_5mm \
render::text_textPath_tspan_with_absolute_position \
render::text_textPath_tspan_with_relative_position \
render::text_textPath_two_paths \
render::text_textPath_very_long_text \
render::text_textPath_with_baseline_shift \
render::text_textPath_with_baseline_shift_and_rotate \
render::text_textPath_with_big_letter_spacing \
render::text_textPath_with_coordinates_on_text \
render::text_textPath_with_coordinates_on_textPath \
render::text_textPath_with_filter \
render::text_textPath_with_letter_spacing \
render::text_textPath_with_rotate \
render::text_textPath_with_text_anchor \
render::text_textPath_with_transform_on_a_referenced_path \
render::text_textPath_with_transform_outside_a_referenced_path \
render::text_textPath_with_underline \
render::text_textPath_writing_mode_eq_tb
%:
dh $@
%.html: %.adoc
asciidoctor -a webfonts! $<
%.html: %.md
cmark-gfm $< > $@
%.txt: %.md
cmark-gfm --to plaintext $< > $@
execute_after_dh_auto_build: $(DOCS) $(CHANGELOGS)
override_dh_auto_test:
dh_auto_test --buildsystem rust -- \
--no-fail-fast -- $(addprefix --skip ,$(TEST_BROKEN))
$(if $(DEB_SUITE_EXP),\
dh_auto_test --buildsystem rust -- --no-fail-fast || true)
execute_after_dh_auto_install-arch: $(MANPAGES)
override_dh_installchangelogs:
dh_installchangelogs -- $(CHANGELOGS)
# build manpages
debian/resvg.1: debian/%.1: debian/resvg/usr/bin/%
$(call _help2man,$@,$<)
debian/usvg.1: debian/%.1: debian/usvg/usr/bin/%
$(call _help2man,$@,$<)
#execute_after_dh_strip:
# patchelf --set-soname $(SONAME) debian/libresvg*/usr/lib/*/$(SONAME)
|