Update patch for GResource embedding based on upstream feedback
authorSimon McVittie <smcv@debian.org>
Sat, 17 Sep 2022 20:56:41 +0000 (21:56 +0100)
committerSimon McVittie <smcv@debian.org>
Sat, 17 Sep 2022 21:04:14 +0000 (22:04 +0100)
debian/patches/build-Add-an-option-to-use-more-conservative-GResource-em.patch [deleted file]
debian/patches/build-Use-more-conservative-GResource-embedding-on-non-x8.patch [new file with mode: 0644]
debian/patches/series
debian/rules

diff --git a/debian/patches/build-Add-an-option-to-use-more-conservative-GResource-em.patch b/debian/patches/build-Add-an-option-to-use-more-conservative-GResource-em.patch
deleted file mode 100644 (file)
index c1c067f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-From: Simon McVittie <smcv@debian.org>
-Date: Mon, 15 Aug 2022 22:24:26 +0100
-Subject: build: Add an option to use more conservative GResource embedding
-
-Doing clever things with objcopy is faster, but also doesn't work on
-all toolchains and architectures: in particular, Debian has had trouble
-with this on arm and mips.
-
-Developers will want to leave this option switched on for faster
-incremental builds (unless their toolchain doesn't support it), but in
-a distro build environment where we are compiling all of GTK every time,
-the cost of potentially unreliable builds is higher than the cost of
-using slower but more conservative GResource embedding.
-
-Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/5107
-Forwarded: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4956
-Signed-off-by: Simon McVittie <smcv@debian.org>
----
- gtk/meson.build   | 15 ++++++++++++++-
- meson_options.txt |  5 +++++
- 2 files changed, 19 insertions(+), 1 deletion(-)
-
-diff --git a/gtk/meson.build b/gtk/meson.build
-index 080bffe..12e4ad7 100644
---- a/gtk/meson.build
-+++ b/gtk/meson.build
-@@ -869,15 +869,28 @@ if not fs.exists('theme/Default/Default-light.css')
- endif
-+fast_gresource_embedding = get_option('fast_gresource_embedding')
-+
- objcopy_supports_add_symbol = false
- objcopy = find_program('objcopy', required : false)
- if objcopy.found()
-   objcopy_supports_add_symbol = run_command(objcopy, '--help').stdout().contains('--add-symbol')
- endif
-+fast_gresource_embedding = fast_gresource_embedding and objcopy_supports_add_symbol
- ld = find_program('ld', required : false)
-+fast_gresource_embedding = fast_gresource_embedding and ld.found()
-+
-+if meson.is_cross_build() or build_machine.system() != 'linux'
-+  fast_gresource_embedding = false
-+endif
-+
-+if build_machine.cpu_family() in ['arm', 'mips']
-+  # Known not to work reliably on these architectures
-+  fast_gresource_embedding = false
-+endif
--if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
-+if fast_gresource_embedding
-   glib_compile_resources = find_program('glib-compile-resources')
-   # Create the resource blob
-diff --git a/meson_options.txt b/meson_options.txt
-index c1df747..fe779aa 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -78,6 +78,11 @@ option('f16c',
-        value: 'enabled',
-        description: 'Enable F16C fast paths (requires F16C)')
-+option('fast_gresource_embedding',
-+       type: 'boolean',
-+       value: true,
-+       description: 'Speed up GResource compilation (does not work on all architectures)')
-+
- # Documentation and introspection
- option('gtk_doc',
diff --git a/debian/patches/build-Use-more-conservative-GResource-embedding-on-non-x8.patch b/debian/patches/build-Use-more-conservative-GResource-embedding-on-non-x8.patch
new file mode 100644 (file)
index 0000000..9d930d2
--- /dev/null
@@ -0,0 +1,31 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Sat, 17 Sep 2022 21:50:38 +0100
+Subject: build: Use more conservative GResource embedding on non-x86_64
+
+Doing clever things with objcopy is faster and seems to be reliable on
+x86_64 Linux, but also doesn't work on all toolchains and architectures:
+in particular, Debian has had trouble with this on arm and mips.
+In a distro build environment where we are compiling all of GTK every
+time, the cost of potentially unreliable builds is higher than the cost
+of using slower but more conservative GResource embedding.
+
+Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/5107
+Signed-off-by: Simon McVittie <smcv@debian.org>
+Forwarded: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4956
+---
+ gtk/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gtk/meson.build b/gtk/meson.build
+index 080bffe..225b0b8 100644
+--- a/gtk/meson.build
++++ b/gtk/meson.build
+@@ -877,7 +877,7 @@ endif
+ ld = find_program('ld', required : false)
+-if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
++if not meson.is_cross_build() and build_machine.cpu_family() == 'x86_64' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
+   glib_compile_resources = find_program('glib-compile-resources')
+   # Create the resource blob
index a0d37e4e5310dedf9790ee457c67f698133f8ac9..7489065cf96a108f2b7d40e0ec36d6e4b07200f6 100644 (file)
@@ -1,5 +1,5 @@
 gdkevents-Don-t-ignore-modifiers-that-are-not-currently-a.patch
-build-Add-an-option-to-use-more-conservative-GResource-em.patch
+build-Use-more-conservative-GResource-embedding-on-non-x8.patch
 reftest_compare_surfaces-Report-how-much-the-images-diffe.patch
 reftests-Allow-minor-differences-to-be-tolerated.patch
 debian/Disable-clipboard-test.patch
index 0e329a5439ef5a24604ce57cb1f54354e3cea1cc..757b744183808240a51dba64f29736c6f1ce4365 100755 (executable)
@@ -76,7 +76,6 @@ debian/%: debian/%.in
 
 configure_flags_common = \
        --libdir=/$(LIBDIR) \
-       -Dfast_gresource_embedding=false \
        ${NULL}
 
 configure_flags_deb = \