From afa20e4a35977fd29069f2f2622cf33e564e4ec8 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 6 Jul 2018 21:34:59 +0100 Subject: [PATCH] linux-perf: Build docs using asciidoctor instead of asciidoc This removes another Python 2 dependency. --- debian/changelog | 1 + ...-fix-non-determinstic-makefile-rules.patch | 33 +++++++++++++++++++ debian/patches/series | 1 + debian/rules.d/tools/perf/Makefile | 3 ++ debian/templates/control.source.in | 3 +- 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 debian/patches/bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch diff --git a/debian/changelog b/debian/changelog index 2b2194938..5baf6b3b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ linux (4.18~rc3-1~exp2) UNRELEASED; urgency=medium * Build docs using Python 3 version of Sphinx + * linux-perf: Build docs using asciidoctor -- Ben Hutchings Fri, 06 Jul 2018 20:55:47 +0100 diff --git a/debian/patches/bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch b/debian/patches/bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch new file mode 100644 index 000000000..f27c60450 --- /dev/null +++ b/debian/patches/bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch @@ -0,0 +1,33 @@ +From: Ben Hutchings +Date: Fri, 06 Jul 2018 21:29:17 +0100 +Subject: perf Documentation: Fix non-deterministic Makefile rules + +When USE_ASCIIDOCTOR is defined, we define a rule to convert from +asciidoc source directly to man pages is defined. However, the rule +to convert from XML to man pages using xmlto is always defined, and +make may still choose to use that. This means that using asciidoctor +does not remove the dependency on xmlto for building man pages, as +was intended. + +Only define the second rule using xmlto if USE_ASCIIDOCTOR is not +defined. + +Fixes: ffef80ecf89f ("perf Documentation: Support for asciidoctor") +Signed-off-by: Ben Hutchings +--- +--- a/tools/perf/Documentation/Makefile ++++ b/tools/perf/Documentation/Makefile +@@ -290,11 +290,11 @@ $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : + $(ASCIIDOC) -b manpage -d manpage \ + $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \ + mv $@+ $@ +-endif +- ++else + $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml + $(QUIET_XMLTO)$(RM) $@ && \ + $(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< ++endif + + $(OUTPUT)%.xml : %.txt + $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ diff --git a/debian/patches/series b/debian/patches/series index 1ae9ea50b..998dfcda2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -148,6 +148,7 @@ bugfix/all/tools-perf-man-date.patch bugfix/all/tools-perf-remove-shebangs.patch bugfix/all/tools-lib-traceevent-use-ldflags.patch bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch +bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch bugfix/all/cpupower-bump-soname-version.patch bugfix/all/cpupower-fix-checks-for-cpu-existence.patch diff --git a/debian/rules.d/tools/perf/Makefile b/debian/rules.d/tools/perf/Makefile index ec0c9e974..809273abe 100644 --- a/debian/rules.d/tools/perf/Makefile +++ b/debian/rules.d/tools/perf/Makefile @@ -51,6 +51,9 @@ MAKE_PERF += NO_LIBCRYPTO=1 # Currently babeltrace support for `perf data' is not automatically detected. MAKE_PERF += LIBBABELTRACE=1 +# Build with asciidoctor, not asciidoc +MAKE_PERF += USE_ASCIIDOCTOR=1 + all: ifdef KERNEL_ARCH_PERF # perf changes some default directories depending on whether DESTDIR is diff --git a/debian/templates/control.source.in b/debian/templates/control.source.in index 052303468..fcbb6eaa7 100644 --- a/debian/templates/control.source.in +++ b/debian/templates/control.source.in @@ -28,8 +28,7 @@ Build-Depends-Arch: libssl-dev:native , libssl-dev , openssl (>= 1.1.0-1~) , # used by upstream to build perf documentation - asciidoc-base , - xmlto , + asciidoctor , # used by upstream to build perf gcc-multilib [amd64 ppc64 s390x sparc64] , libaudit-dev ,