All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes
@ 2014-08-26 18:49 Samuel Martin
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 2/4] gendoc infra: move manual build location into $(BUILD_DIR)/manual Samuel Martin
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Samuel Martin @ 2014-08-26 18:49 UTC (permalink / raw)
  To: buildroot

- wrap lines to 80 characters
- fix space/tab mixup

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
changes v2 -> v3:
- update A/R/T tags

changes v1 -> v2:
- more tabs/space cleanup (ThomasDS)
- fix line mess (ThomasDS)
---
 docs/manual/manual.mk | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk
index 8d401a2..136f725 100644
--- a/docs/manual/manual.mk
+++ b/docs/manual/manual.mk
@@ -70,8 +70,8 @@ $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
 	$$(Q)mkdir -p $$(@D)/.build
 	$$(Q)rsync -au docs/$(1)/*.txt $$(@D)/.build
 	$$(Q)a2x $(6) -f $(2) -d book -L -r $$(TOPDIR)/docs/images \
-	        -D $$(@D) $$(@D)/.build/$(1).txt \
-	        --asciidoc-opts="$$(MANUAL_$(2)_ASCIIDOC_OPTS)"
+		--asciidoc-opts="$$(MANUAL_$(2)_ASCIIDOC_OPTS)" \
+		-D $$(@D) $$(@D)/.build/$(1).txt
 	-$$(Q)rm -rf $$(@D)/.build
 endef
 
@@ -84,9 +84,12 @@ endef
 # The variable <DOCUMENT_NAME>_SOURCES defines the dependencies.
 ################################################################################
 define GENDOC
-$(call GENDOC_INNER,$(pkgname),xhtml,html,html,HTML,--xsltproc-opts "--stringparam toc.section.depth 1")
-$(call GENDOC_INNER,$(pkgname),chunked,split-html,chunked,split HTML,--xsltproc-opts "--stringparam toc.section.depth 1")
-$(call GENDOC_INNER,$(pkgname),pdf,pdf,pdf,PDF,--dblatex-opts "-P latex.output.revhistory=0")
+$(call GENDOC_INNER,$(pkgname),xhtml,html,html,HTML,\
+	--xsltproc-opts "--stringparam toc.section.depth 1")
+$(call GENDOC_INNER,$(pkgname),chunked,split-html,chunked,split HTML,\
+	--xsltproc-opts "--stringparam toc.section.depth 1")
+$(call GENDOC_INNER,$(pkgname),pdf,pdf,pdf,PDF,\
+	--dblatex-opts "-P latex.output.revhistory=0")
 $(call GENDOC_INNER,$(pkgname),text,text,text,text)
 $(call GENDOC_INNER,$(pkgname),epub,epub,epub,ePUB)
 clean: $(pkgname)-clean
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 2/4] gendoc infra: move manual build location into $(BUILD_DIR)/manual
  2014-08-26 18:49 [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes Samuel Martin
@ 2014-08-26 18:49 ` Samuel Martin
  2014-09-07 15:03   ` Yann E. MORIN
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 3/4] gendoc infra: avoid a2x warning Samuel Martin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Samuel Martin @ 2014-08-26 18:49 UTC (permalink / raw)
  To: buildroot

This patch reworks the manual source preparation by:
- moving the build directory under $(BUILD_DIR)/, this keeps consistency
  with the other Buildroot infrastructures;
- adding a couple of targets: 'manual-rsync' and 'manual-prepare-sources',
  to deal more efficiently with the manual sources and avoid rsync-ing
  them on every single manual-* target.

The 'manual-rsync' target only copies the manual sources under git, while
the 'manual-prepare-sources' also takes care of the generated ones. These
targets are now run only once,  and the manual build is no longer cleaned
after each manual format generation.

Now, the 'manual-clean' target only remove the manual build directory, but
keeps the output one $(O)/output/doc/manual unchanged.

Doing so (moving the manual build directory and keeping it between 2
manual format generation) ensures that all generated sources are taken
in account when generating the manual [1].

[1] http://lists.busybox.net/pipermail/buildroot/2014-August/104421.html

Cc: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v2 -> v3:
- fixes many typoes in commit log (ThomasDS)
- remove '-u' option to the rsync command (ThomasDS)

changes v1 -> v2:
- remove trailing '\'
---
 docs/manual/manual.mk | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk
index 136f725..e86f872 100644
--- a/docs/manual/manual.mk
+++ b/docs/manual/manual.mk
@@ -1,11 +1,20 @@
+$(BUILD_DIR)/$(pkgname):
+	$(Q)mkdir -p $@
+
+manual-rsync: $(BUILD_DIR)/$(pkgname)
+	$(Q)$(call MESSAGE,"Preparing the manual sources...")
+	$(Q)rsync -a docs/$(pkgname)/ $(BUILD_DIR)/$(pkgname)
+
 # Packages included in BR2_EXTERNAL are not part of buildroot, so they
 # should not be included in the manual.
-manual-update-lists: manual-check-dependencies-lists
+manual-update-lists: manual-check-dependencies-lists $(BUILD_DIR)/$(pkgname)
 	$(Q)$(call MESSAGE,"Updating the manual lists...")
-	$(Q)BR2_DEFCONFIG="" TOPDIR=$(TOPDIR) O=$(O)/docs/manual/.build \
+	$(Q)BR2_DEFCONFIG="" TOPDIR=$(TOPDIR) O=$(BUILD_DIR)/$(pkgname) \
 		BR2_EXTERNAL=$(TOPDIR)/support/dummy-external \
 		python -B $(TOPDIR)/support/scripts/gen-manual-lists.py
 
+manual-prepare-sources: manual-rsync manual-update-lists
+
 # we can't use suitable-host-package here because that's not available in
 # the context of 'make release'
 manual-check-dependencies:
@@ -65,14 +74,13 @@ $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
 			   $$($$(call UPPERCASE,$(1))_SOURCES) \
 			   manual-check-dependencies \
 			   manual-check-dependencies-$(3) \
-			   manual-update-lists
+			   manual-prepare-sources
 	$$(Q)$$(call MESSAGE,"Generating $(5) $(1)...")
-	$$(Q)mkdir -p $$(@D)/.build
-	$$(Q)rsync -au docs/$(1)/*.txt $$(@D)/.build
+	$$(Q)mkdir -p $$(@D)
 	$$(Q)a2x $(6) -f $(2) -d book -L -r $$(TOPDIR)/docs/images \
 		--asciidoc-opts="$$(MANUAL_$(2)_ASCIIDOC_OPTS)" \
-		-D $$(@D) $$(@D)/.build/$(1).txt
-	-$$(Q)rm -rf $$(@D)/.build
+		-D $$(@D) \
+		$$(BUILD_DIR)/$(1)/$(1).txt
 endef
 
 ################################################################################
@@ -94,7 +102,7 @@ $(call GENDOC_INNER,$(pkgname),text,text,text,text)
 $(call GENDOC_INNER,$(pkgname),epub,epub,epub,ePUB)
 clean: $(pkgname)-clean
 $(pkgname)-clean:
-	$$(Q)$$(RM) -rf $$(O)/docs/$(pkgname)
+	$$(Q)$$(RM) -rf $$(BUILD_DIR)/$(pkgname)
 .PHONY: $(pkgname) $(pkgname)-clean manual-update-lists
 endef
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 3/4] gendoc infra: avoid a2x warning
  2014-08-26 18:49 [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes Samuel Martin
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 2/4] gendoc infra: move manual build location into $(BUILD_DIR)/manual Samuel Martin
@ 2014-08-26 18:49 ` Samuel Martin
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 4/4] gendoc infra: disable pdf manual generation if xsltproc is buggy Samuel Martin
  2014-09-07  9:57 ` [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes Yann E. MORIN
  3 siblings, 0 replies; 7+ messages in thread
From: Samuel Martin @ 2014-08-26 18:49 UTC (permalink / raw)
  To: buildroot

Though the --destination-dir option works as expected, a2x displays the
following message when generating the pdf and text manual:

  a2x: WARNING: --destination-dir option is only applicable to HTML based outputs

To avoid this warning, we now just build the manual in its build location,
then move the generated files into $(O)/docs/manual.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v2 -> v3:
- none

changes v1 -> v2:
- remove remaining '-D $$(@D)' arguments in the a2x command line
---
 docs/manual/manual.mk | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk
index e86f872..09d8b18 100644
--- a/docs/manual/manual.mk
+++ b/docs/manual/manual.mk
@@ -70,6 +70,19 @@ ifneq ($$(wildcard $$(MANUAL_$(2)_ASCIIDOC_CONF)),)
 MANUAL_$(2)_ASCIIDOC_OPTS += -f $$(MANUAL_$(2)_ASCIIDOC_CONF)
 endif
 
+# Handle a2x warning about --destination-dir option only applicable to HTML
+# based outputs. So:
+# - use the --destination-dir option if possible (html and split-html),
+# - otherwise copy the generated manual to the output directory
+MANUAL_$(2)_A2X_OPTS =
+ifneq ($$(filter $(3),html split-html),)
+MANUAL_$(2)_A2X_OPTS += --destination-dir="$$(@D)"
+else
+define MANUAL_$(2)_INSTALL_CMDS
+	$$(Q)cp -f $$(BUILD_DIR)/$(1)/$(1).$(4) $$(@D)
+endef
+endif
+
 $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
 			   $$($$(call UPPERCASE,$(1))_SOURCES) \
 			   manual-check-dependencies \
@@ -78,9 +91,11 @@ $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
 	$$(Q)$$(call MESSAGE,"Generating $(5) $(1)...")
 	$$(Q)mkdir -p $$(@D)
 	$$(Q)a2x $(6) -f $(2) -d book -L -r $$(TOPDIR)/docs/images \
+		$$(MANUAL_$(2)_A2X_OPTS) \
 		--asciidoc-opts="$$(MANUAL_$(2)_ASCIIDOC_OPTS)" \
-		-D $$(@D) \
 		$$(BUILD_DIR)/$(1)/$(1).txt
+# install the generated manual
+	$$(MANUAL_$(2)_INSTALL_CMDS)
 endef
 
 ################################################################################
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 4/4] gendoc infra: disable pdf manual generation if xsltproc is buggy
  2014-08-26 18:49 [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes Samuel Martin
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 2/4] gendoc infra: move manual build location into $(BUILD_DIR)/manual Samuel Martin
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 3/4] gendoc infra: avoid a2x warning Samuel Martin
@ 2014-08-26 18:49 ` Samuel Martin
  2014-08-29  5:58   ` Thomas De Schampheleire
  2014-09-07  9:57 ` [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes Yann E. MORIN
  3 siblings, 1 reply; 7+ messages in thread
From: Samuel Martin @ 2014-08-26 18:49 UTC (permalink / raw)
  To: buildroot

The PDF manual generation reaches the default xsltproc's template
recursion limit when processing the target package list; this makes the
PDF manual generation fail [1-3].

This limit can be raised with the '--maxvars' option. Unfortunately,
this option is not correctly handled in the latest xsltproc/libxslt
release (1.1.28), but this bug is already fixed in the libxslt
repository [4].

This patch disables the PDF manual generation (makes it fail with a
meaningful error message) when the xsltproc program found in the PATH
does not support the --maxvars option.
So, one can still generate the PDF manual if he/she extends PATH with
the location of a working xsltproc, by running:

  $ PATH=/path/to/custom-xsltproc/bin:${PATH} make manual-pdf

[1] http://lists.busybox.net/pipermail/buildroot/2014-August/104390.html
[2] http://lists.busybox.net/pipermail/buildroot/2014-August/104418.html
[3] http://lists.busybox.net/pipermail/buildroot/2014-August/104421.html
[4] https://gitorious.org/libxslt/libxslt/commit/5af7ad745323004984287e48b42712e7305de35c

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v2 -> v3:
- fix typoes (ThomasDS)
- rename USE_BUGGY_XSLTPROC -> MANUAL_XSLTPROC_IS_BROKEN (ThomasDS)
- comments and commit log rewording (ThomasDS)

changes v1 -> v2:
- simplify the xsltproc check logic
---
 docs/manual/manual.mk | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk
index 09d8b18..49ddb0e 100644
--- a/docs/manual/manual.mk
+++ b/docs/manual/manual.mk
@@ -83,6 +83,28 @@ define MANUAL_$(2)_INSTALL_CMDS
 endef
 endif
 
+# PDF manual generation is broken because of a bug in xsltproc program provided
+# by libxslt <=1.1.28, which does not honor an option we need to set.
+# Fortunately, this bug is already fixed upstream:
+#   https://gitorious.org/libxslt/libxslt/commit/5af7ad745323004984287e48b42712e7305de35c
+#
+# So, bail out when trying to build the pdf manual using a buggy version of the
+# xsltproc program.
+#
+# So, to overcome this issue and being able to build the pdf manual, you can
+# build xsltproc from it source repository, then run:
+#   $ PATH=/path/to/custom-xsltproc/bin:${PATH} make manual
+MANUAL_XSLTPROC_IS_BROKEN = \
+	$$(shell xsltproc --maxvars 0 >/dev/null 2>/dev/null || echo y)
+
+ifeq ($(4)-$$(MANUAL_XSLTPROC_IS_BROKEN),pdf-y)
+$$(O)/docs/$(1)/$(1).$(4):
+	$$(error PDF manual generation is disabled because of a bug in \
+		xsltproc. To be able to generate the PDF manual, you should \
+		build xsltproc from the libxslt sources >=1.1.29 and pass it \
+		to make through the command line: \
+		'PATH=/path/to/custom-xsltproc/bin:$$$${PATH} make manual-pdf')
+else
 $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
 			   $$($$(call UPPERCASE,$(1))_SOURCES) \
 			   manual-check-dependencies \
@@ -96,6 +118,7 @@ $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
 		$$(BUILD_DIR)/$(1)/$(1).txt
 # install the generated manual
 	$$(MANUAL_$(2)_INSTALL_CMDS)
+endif
 endef
 
 ################################################################################
@@ -111,8 +134,11 @@ $(call GENDOC_INNER,$(pkgname),xhtml,html,html,HTML,\
 	--xsltproc-opts "--stringparam toc.section.depth 1")
 $(call GENDOC_INNER,$(pkgname),chunked,split-html,chunked,split HTML,\
 	--xsltproc-opts "--stringparam toc.section.depth 1")
+# dblatex needs to pass the '--maxvars ...' option to xsltproc to prevent it
+# from reaching the template recursion limit when processing the (long) target
+# package table and bailing out.
 $(call GENDOC_INNER,$(pkgname),pdf,pdf,pdf,PDF,\
-	--dblatex-opts "-P latex.output.revhistory=0")
+	--dblatex-opts "-P latex.output.revhistory=0 -x '--maxvars 100000'")
 $(call GENDOC_INNER,$(pkgname),text,text,text,text)
 $(call GENDOC_INNER,$(pkgname),epub,epub,epub,ePUB)
 clean: $(pkgname)-clean
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 4/4] gendoc infra: disable pdf manual generation if xsltproc is buggy
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 4/4] gendoc infra: disable pdf manual generation if xsltproc is buggy Samuel Martin
@ 2014-08-29  5:58   ` Thomas De Schampheleire
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas De Schampheleire @ 2014-08-29  5:58 UTC (permalink / raw)
  To: buildroot

All,


Samuel Martin <s.martin49@gmail.com> schreef:
>The PDF manual generation reaches the default xsltproc's template
>recursion limit when processing the target package list; this makes the
>PDF manual generation fail [1-3].
>
>This limit can be raised with the '--maxvars' option. Unfortunately,
>this option is not correctly handled in the latest xsltproc/libxslt
>release (1.1.28), but this bug is already fixed in the libxslt
>repository [4].
>
>This patch disables the PDF manual generation (makes it fail with a
>meaningful error message) when the xsltproc program found in the PATH
>does not support the --maxvars option.
>So, one can still generate the PDF manual if he/she extends PATH with
>the location of a working xsltproc, by running:
>
>  $ PATH=/path/to/custom-xsltproc/bin:${PATH} make manual-pdf
>
>[1] http://lists.busybox.net/pipermail/buildroot/2014-August/104390.html
>[2] http://lists.busybox.net/pipermail/buildroot/2014-August/104418.html
>[3] http://lists.busybox.net/pipermail/buildroot/2014-August/104421.html
>[4] https://gitorious.org/libxslt/libxslt/commit/5af7ad745323004984287e48b42712e7305de35c
>
>Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>Cc: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>Signed-off-by: Samuel Martin <s.martin49@gmail.com>
>

Short question about this patch series: do we still consider it for
2014.08 or not?

Assuming that Peter does not yet have a patched xsltproc, it would be
better to generate a pdf manual but without tables, rather than having
no pdf manual at all, right?
In this case it makes sense to postpone this patch series to 2014.11.

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes
  2014-08-26 18:49 [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes Samuel Martin
                   ` (2 preceding siblings ...)
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 4/4] gendoc infra: disable pdf manual generation if xsltproc is buggy Samuel Martin
@ 2014-09-07  9:57 ` Yann E. MORIN
  3 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2014-09-07  9:57 UTC (permalink / raw)
  To: buildroot

Samuel, All,

On 2014-08-26 20:49 +0200, Samuel Martin spake thusly:
> - wrap lines to 80 characters
> - fix space/tab mixup
> 
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
> changes v2 -> v3:
> - update A/R/T tags
> 
> changes v1 -> v2:
> - more tabs/space cleanup (ThomasDS)
> - fix line mess (ThomasDS)
> ---
>  docs/manual/manual.mk | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk
> index 8d401a2..136f725 100644
> --- a/docs/manual/manual.mk
> +++ b/docs/manual/manual.mk
> @@ -70,8 +70,8 @@ $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
>  	$$(Q)mkdir -p $$(@D)/.build
>  	$$(Q)rsync -au docs/$(1)/*.txt $$(@D)/.build
>  	$$(Q)a2x $(6) -f $(2) -d book -L -r $$(TOPDIR)/docs/images \
> -	        -D $$(@D) $$(@D)/.build/$(1).txt \
> -	        --asciidoc-opts="$$(MANUAL_$(2)_ASCIIDOC_OPTS)"
> +		--asciidoc-opts="$$(MANUAL_$(2)_ASCIIDOC_OPTS)" \
> +		-D $$(@D) $$(@D)/.build/$(1).txt
>  	-$$(Q)rm -rf $$(@D)/.build
>  endef
>  
> @@ -84,9 +84,12 @@ endef
>  # The variable <DOCUMENT_NAME>_SOURCES defines the dependencies.
>  ################################################################################
>  define GENDOC
> -$(call GENDOC_INNER,$(pkgname),xhtml,html,html,HTML,--xsltproc-opts "--stringparam toc.section.depth 1")
> -$(call GENDOC_INNER,$(pkgname),chunked,split-html,chunked,split HTML,--xsltproc-opts "--stringparam toc.section.depth 1")
> -$(call GENDOC_INNER,$(pkgname),pdf,pdf,pdf,PDF,--dblatex-opts "-P latex.output.revhistory=0")
> +$(call GENDOC_INNER,$(pkgname),xhtml,html,html,HTML,\
> +	--xsltproc-opts "--stringparam toc.section.depth 1")
> +$(call GENDOC_INNER,$(pkgname),chunked,split-html,chunked,split HTML,\
> +	--xsltproc-opts "--stringparam toc.section.depth 1")
> +$(call GENDOC_INNER,$(pkgname),pdf,pdf,pdf,PDF,\
> +	--dblatex-opts "-P latex.output.revhistory=0")
>  $(call GENDOC_INNER,$(pkgname),text,text,text,text)
>  $(call GENDOC_INNER,$(pkgname),epub,epub,epub,ePUB)
>  clean: $(pkgname)-clean
> -- 
> 2.1.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 2/4] gendoc infra: move manual build location into $(BUILD_DIR)/manual
  2014-08-26 18:49 ` [Buildroot] [PATCH v3 2/4] gendoc infra: move manual build location into $(BUILD_DIR)/manual Samuel Martin
@ 2014-09-07 15:03   ` Yann E. MORIN
  0 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2014-09-07 15:03 UTC (permalink / raw)
  To: buildroot

Samuel,  All,

On 2014-08-26 20:49 +0200, Samuel Martin spake thusly:
> This patch reworks the manual source preparation by:
> - moving the build directory under $(BUILD_DIR)/, this keeps consistency
>   with the other Buildroot infrastructures;
> - adding a couple of targets: 'manual-rsync' and 'manual-prepare-sources',
>   to deal more efficiently with the manual sources and avoid rsync-ing
>   them on every single manual-* target.
> 
> The 'manual-rsync' target only copies the manual sources under git, while
> the 'manual-prepare-sources' also takes care of the generated ones. These
> targets are now run only once,  and the manual build is no longer cleaned
> after each manual format generation.
> 
> Now, the 'manual-clean' target only remove the manual build directory, but
> keeps the output one $(O)/output/doc/manual unchanged.
> 
> Doing so (moving the manual build directory and keeping it between 2
> manual format generation) ensures that all generated sources are taken
> in account when generating the manual [1].
> 
> [1] http://lists.busybox.net/pipermail/buildroot/2014-August/104421.html
> 
> Cc: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>

Woot! I totally love this patch! :-) It will make it so much easier to
build a manual-like document from br2-external! :-)

But see a comment below...

> diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk
> index 136f725..e86f872 100644
> --- a/docs/manual/manual.mk
> +++ b/docs/manual/manual.mk
> @@ -1,11 +1,20 @@
> +$(BUILD_DIR)/$(pkgname):
> +	$(Q)mkdir -p $@
> +
> +manual-rsync: $(BUILD_DIR)/$(pkgname)
> +	$(Q)$(call MESSAGE,"Preparing the manual sources...")
> +	$(Q)rsync -a docs/$(pkgname)/ $(BUILD_DIR)/$(pkgname)

Would it be possible to still have this as part of GENDOC_INNER, so it
is useable to generate another document?

I think I'll cary this patch series in my branch, and do some additional
(probably cumulative, so it is not a show-blocker) changes. So:

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Thanks again for this work! :-)

Regards,
Yann E. MORIN.

>  # Packages included in BR2_EXTERNAL are not part of buildroot, so they
>  # should not be included in the manual.
> -manual-update-lists: manual-check-dependencies-lists
> +manual-update-lists: manual-check-dependencies-lists $(BUILD_DIR)/$(pkgname)
>  	$(Q)$(call MESSAGE,"Updating the manual lists...")
> -	$(Q)BR2_DEFCONFIG="" TOPDIR=$(TOPDIR) O=$(O)/docs/manual/.build \
> +	$(Q)BR2_DEFCONFIG="" TOPDIR=$(TOPDIR) O=$(BUILD_DIR)/$(pkgname) \
>  		BR2_EXTERNAL=$(TOPDIR)/support/dummy-external \
>  		python -B $(TOPDIR)/support/scripts/gen-manual-lists.py
>  
> +manual-prepare-sources: manual-rsync manual-update-lists
> +
>  # we can't use suitable-host-package here because that's not available in
>  # the context of 'make release'
>  manual-check-dependencies:
> @@ -65,14 +74,13 @@ $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
>  			   $$($$(call UPPERCASE,$(1))_SOURCES) \
>  			   manual-check-dependencies \
>  			   manual-check-dependencies-$(3) \
> -			   manual-update-lists
> +			   manual-prepare-sources
>  	$$(Q)$$(call MESSAGE,"Generating $(5) $(1)...")
> -	$$(Q)mkdir -p $$(@D)/.build
> -	$$(Q)rsync -au docs/$(1)/*.txt $$(@D)/.build
> +	$$(Q)mkdir -p $$(@D)
>  	$$(Q)a2x $(6) -f $(2) -d book -L -r $$(TOPDIR)/docs/images \
>  		--asciidoc-opts="$$(MANUAL_$(2)_ASCIIDOC_OPTS)" \
> -		-D $$(@D) $$(@D)/.build/$(1).txt
> -	-$$(Q)rm -rf $$(@D)/.build
> +		-D $$(@D) \
> +		$$(BUILD_DIR)/$(1)/$(1).txt
>  endef
>  
>  ################################################################################
> @@ -94,7 +102,7 @@ $(call GENDOC_INNER,$(pkgname),text,text,text,text)
>  $(call GENDOC_INNER,$(pkgname),epub,epub,epub,ePUB)
>  clean: $(pkgname)-clean
>  $(pkgname)-clean:
> -	$$(Q)$$(RM) -rf $$(O)/docs/$(pkgname)
> +	$$(Q)$$(RM) -rf $$(BUILD_DIR)/$(pkgname)
>  .PHONY: $(pkgname) $(pkgname)-clean manual-update-lists
>  endef
>  
> -- 
> 2.1.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-07 15:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-26 18:49 [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes Samuel Martin
2014-08-26 18:49 ` [Buildroot] [PATCH v3 2/4] gendoc infra: move manual build location into $(BUILD_DIR)/manual Samuel Martin
2014-09-07 15:03   ` Yann E. MORIN
2014-08-26 18:49 ` [Buildroot] [PATCH v3 3/4] gendoc infra: avoid a2x warning Samuel Martin
2014-08-26 18:49 ` [Buildroot] [PATCH v3 4/4] gendoc infra: disable pdf manual generation if xsltproc is buggy Samuel Martin
2014-08-29  5:58   ` Thomas De Schampheleire
2014-09-07  9:57 ` [Buildroot] [PATCH v3 1/4] gendoc infra: cosmetic fixes Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.