[packages/jasper] upstream fix for parallel doc build
atler
atler at pld-linux.org
Mon Mar 27 16:13:32 CEST 2023
commit 6c4f902eaaa4897fa3ec82f185fd00a067183163
Author: Jan Palus <atler at pld-linux.org>
Date: Mon Mar 27 16:11:59 2023 +0200
upstream fix for parallel doc build
jasper.spec | 2 ++
parallel-doc-build.patch | 45 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+)
---
diff --git a/jasper.spec b/jasper.spec
index 709bacc..2809237 100644
--- a/jasper.spec
+++ b/jasper.spec
@@ -13,6 +13,7 @@ Group: Libraries
#Source0Download: https://github.com/jasper-software/jasper/releases
Source0: https://github.com/jasper-software/jasper/releases/download/version-%{version}/%{name}-%{version}.tar.gz
# Source0-md5: f9388d52a6220303141a42d4c2c81e62
+Patch0: parallel-doc-build.patch
URL: https://www.ece.uvic.ca/~frodo/jasper/
%{?with_opengl:BuildRequires: OpenGL-glut-devel}
BuildRequires: cmake >= 2.8.11
@@ -96,6 +97,7 @@ kolorów powinna jednak wystarczyć.
%prep
%setup -q
+%patch0 -p1
%build
# there is upstream directory named "build", use different name
diff --git a/parallel-doc-build.patch b/parallel-doc-build.patch
new file mode 100644
index 0000000..64a3dd6
--- /dev/null
+++ b/parallel-doc-build.patch
@@ -0,0 +1,45 @@
+From f2d2e5d6f06bdd60d3be8277726e238659bc56b5 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus at fastmail.com>
+Date: Mon, 27 Mar 2023 13:55:04 +0200
+Subject: [PATCH] doc/CMakeLists.txt: fix prallel build of api docs and pdf
+ manual
+
+according to cmake docs DEPENDS in add_custom_command with file being
+output of other custom command:
+
+> If any dependency is an OUTPUT of another custom command in the same
+> directory (CMakeLists.txt file), CMake automatically brings the other
+> custom command into the target in which this command is built.
+
+this means "manual_pdf" target will not wait for previous doxygen
+invocation but will trigger its own. in case of parallel build two
+doxygen invocations with same input parameters might overwrite each
+other's output resulting in broken files. it could be verified with just
+grepping cmake output:
+
+```
+$ grep -r 'doxygen Doxyfile' builddir/doc
+builddir/doc/CMakeFiles/doc.dir/build.make: cd /home/users/builder/rpm/BUILD/jasper-3.0.6/builddir/doc && /usr/bin/doxygen Doxyfile
+builddir/doc/CMakeFiles/manual_pdf.dir/build.make: cd /home/users/builder/rpm/BUILD/jasper-3.0.6/builddir/doc && /usr/bin/doxygen Doxyfile
+```
+
+instead of putting dependency on "latex/index.tex" file, use "doc"
+target as dependency resulting in ordering "doc" before "manual_pdf" and
+single doxygen invocation.
+---
+ doc/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
+index 1db63e64..02055555 100644
+--- a/doc/CMakeLists.txt
++++ b/doc/CMakeLists.txt
+@@ -44,7 +44,7 @@ if(DOXYGEN_FOUND)
+ add_custom_command(OUTPUT "latex/refman.pdf"
+ COMMAND "${PDFLATEX_COMPILER}" refman.tex
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/latex"
+- DEPENDS "latex/index.tex"
++ DEPENDS "doc"
+ )
+
+ add_custom_target(manual_pdf ALL
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/jasper.git/commitdiff/391f5b5a6320d7d3528be4b24afe55905d4eafcb
More information about the pld-cvs-commit
mailing list