diff mbox series

[7/7] gtk-doc: replace no-clobber.patch with submitted upstream fix

Message ID 20261201121106.51697-8-jaipaul.cheernam@est.tech
State New
Headers show
Series Upgrades on 1st Dec and recipe updates | expand

Commit Message

Jaipaul Cheernam Dec. 1, 2026, 12:11 p.m. UTC
The fix only overwrites builddir files that are missing or older than
the srcdir copy, so unlike cp -n, later srcdir edits are still copied.

Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
 ...t-don-t-overwrite-newer-files-in-set.patch | 47 +++++++++++++++++++
 .../gtk-doc/files/no-clobber.patch            | 39 ---------------
 meta/recipes-gnome/gtk-doc/gtk-doc_1.37.1.bb  |  2 +-
 3 files changed, 48 insertions(+), 40 deletions(-)
 create mode 100644 meta/recipes-gnome/gtk-doc/files/0001-autotools-support-don-t-overwrite-newer-files-in-set.patch
 delete mode 100644 meta/recipes-gnome/gtk-doc/files/no-clobber.patch
diff mbox series

Patch

diff --git a/meta/recipes-gnome/gtk-doc/files/0001-autotools-support-don-t-overwrite-newer-files-in-set.patch b/meta/recipes-gnome/gtk-doc/files/0001-autotools-support-don-t-overwrite-newer-files-in-set.patch
new file mode 100644
index 0000000000..5303807c1e
--- /dev/null
+++ b/meta/recipes-gnome/gtk-doc/files/0001-autotools-support-don-t-overwrite-newer-files-in-set.patch
@@ -0,0 +1,47 @@ 
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+Date: Tue, 1 Dec 2026 11:47:20 +0000
+Subject: [PATCH] autotools support: don't overwrite newer files in setup-build
+
+In out-of-tree builds, setup-build overwrites configure-generated files
+(e.g. version.xml) with older tarball copies, so make install rebuilds
+the docs again. Only copy when the destination is missing or older.
+
+Use test -nt rather than the cp -u suggested in the issue, as -u is
+GNU-only and not available on macOS and the BSDs.
+
+Closes https://gitlab.gnome.org/GNOME/gtk-doc/-/issues/43
+
+Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/gtk-doc/-/merge_requests/106]
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ buildsystems/autotools/gtk-doc.make         | 2 ++
+ buildsystems/autotools/gtk-doc.no-xslt.make | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/buildsystems/autotools/gtk-doc.make b/buildsystems/autotools/gtk-doc.make
+index fb2e7e2..a1eb7fb 100644
+--- a/buildsystems/autotools/gtk-doc.make
++++ b/buildsystems/autotools/gtk-doc.make
+@@ -112,6 +112,8 @@ setup-build.stamp:
+ 	      destdir=`dirname $(abs_builddir)/$$file`; \
+ 	      test -d "$$destdir" || mkdir -p "$$destdir"; \
+ 	      test -f $(abs_srcdir)/$$file && \
++	        { test ! -f $(abs_builddir)/$$file || \
++	          test $(abs_srcdir)/$$file -nt $(abs_builddir)/$$file; } && \
+ 	        cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
+ 	    done; \
+ 	  fi; \
+diff --git a/buildsystems/autotools/gtk-doc.no-xslt.make b/buildsystems/autotools/gtk-doc.no-xslt.make
+index 5a4b895..18dad69 100644
+--- a/buildsystems/autotools/gtk-doc.no-xslt.make
++++ b/buildsystems/autotools/gtk-doc.no-xslt.make
+@@ -112,6 +112,8 @@ setup-build.stamp:
+ 	      destdir=`dirname $(abs_builddir)/$$file`; \
+ 	      test -d "$$destdir" || mkdir -p "$$destdir"; \
+ 	      test -f $(abs_srcdir)/$$file && \
++	        { test ! -f $(abs_builddir)/$$file || \
++	          test $(abs_srcdir)/$$file -nt $(abs_builddir)/$$file; } && \
+ 	        cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
+ 	    done; \
+ 	  fi; \
diff --git a/meta/recipes-gnome/gtk-doc/files/no-clobber.patch b/meta/recipes-gnome/gtk-doc/files/no-clobber.patch
deleted file mode 100644
index f4c33132fb..0000000000
--- a/meta/recipes-gnome/gtk-doc/files/no-clobber.patch
+++ /dev/null
@@ -1,39 +0,0 @@ 
-From 900451504bbc149ec0ed5d9c1dce9bb8dd575b65 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Wed, 21 Mar 2018 14:47:29 +0000
-Subject: [PATCH] gtk-doc: don't regenerate gtk-doc in do_install
-
-In out-of-tree builds gtk-doc's setup-build target copies all the content from $srcdir to $builddir.
-
-However, if some of this content is regenerated at configure time this can happen:
-
-1) configure writes new build/version.xml
-2) make compile copies content, including the tarball's src/version.xml
-   to build/version.xml, and generates gtk-doc.
-3) make install notices build/version.xml is older than configure.status,
-   so regenerates gtk-doc.
-
-gtk-doc generation is a slow process at the best of times, so doing it twice isn't good.
-
-Solve this by changing cp --force to cp --no-clobber, so setup-build only copies
-files which don't already exist.
-
-Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=794571]
-Signed-off-by: Ross Burton <ross.burton@intel.com>
----
- buildsystems/autotools/gtk-doc.make | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/buildsystems/autotools/gtk-doc.make b/buildsystems/autotools/gtk-doc.make
-index fb2e7e2..4f6fe2b 100644
---- a/buildsystems/autotools/gtk-doc.make
-+++ b/buildsystems/autotools/gtk-doc.make
-@@ -112,7 +112,7 @@ setup-build.stamp:
- 	      destdir=`dirname $(abs_builddir)/$$file`; \
- 	      test -d "$$destdir" || mkdir -p "$$destdir"; \
- 	      test -f $(abs_srcdir)/$$file && \
--	        cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
-+	        cp -pn $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
- 	    done; \
- 	  fi; \
- 	fi
diff --git a/meta/recipes-gnome/gtk-doc/gtk-doc_1.37.1.bb b/meta/recipes-gnome/gtk-doc/gtk-doc_1.37.1.bb
index af17353927..9542af7720 100644
--- a/meta/recipes-gnome/gtk-doc/gtk-doc_1.37.1.bb
+++ b/meta/recipes-gnome/gtk-doc/gtk-doc_1.37.1.bb
@@ -17,7 +17,7 @@  EXTRA_OEMESON = "-Dyelp_manual=false -Dcheck_runtime_deps=false"
 
 SRC_URI[archive.sha256sum] = "2dfab35ba4568b979590af2a7694714ed964bffff0ae0e22a1b64e8d73ddbae0"
 SRC_URI += "file://0001-Do-not-hardocode-paths-to-perl-python-in-scripts.patch \
-           file://no-clobber.patch \
+           file://0001-autotools-support-don-t-overwrite-newer-files-in-set.patch \
            "
 SRC_URI:append:class-native = " file://pkg-config-native.patch"