summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/build-tests.patch34
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb1
-rw-r--r--meta/recipes-core/glib-2.0/glib.inc1
3 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/build-tests.patch b/meta/recipes-core/glib-2.0/glib-2.0/build-tests.patch
new file mode 100644
index 00000000000..a612df77cb5
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/build-tests.patch
@@ -0,0 +1,34 @@
+From fcd6ba4561555988ac8a77479804a80974e305c8 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Tue, 9 Jan 2024 17:38:19 +0000
+Subject: [PATCH] Build tests if required
+
+The API documentation currently uses pieces of the test suite as source, so the
+tests also need to be built if documentation is enabled.
+
+NOTE: this patch can be dropped when glib is upgraded to 2.80 because the
+documentation no longer depends on the test suite being build in that release.
+
+Upstream-Status: Inappropriate [drop with 2.80]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ meson.build | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index f7e936e94..443c079b9 100644
+--- a/meson.build
++++ b/meson.build
+@@ -150,8 +150,7 @@ installed_tests_enabled = get_option('installed_tests')
+ installed_tests_template = files('tests/template.test.in')
+ installed_tests_template_tap = files('tests/template-tap.test.in')
+
+-# Don’t build the tests unless we can run them (either natively, in an exe wrapper, or by installing them for later use)
+-build_tests = get_option('tests') and (meson.can_run_host_binaries() or installed_tests_enabled)
++build_tests = get_option('tests') or installed_tests_enabled or get_option('gtk_doc')
+
+ common_test_env = [
+ 'G_DEBUG=gc-friendly',
+--
+2.34.1
+
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb
index 42814ba5441..5d948ee94c5 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb
@@ -16,6 +16,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
file://memory-monitor.patch \
file://native-gtkdoc.patch \
+ file://build-tests.patch \
"
SRC_URI:append:class-native = " file://relocate-modules.patch \
file://0001-meson.build-do-not-enable-pidfd-features-on-native-g.patch \
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
index 5a57549d855..4d9bafdd938 100644
--- a/meta/recipes-core/glib-2.0/glib.inc
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -43,6 +43,7 @@ PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,"
PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux"
EXTRA_OEMESON = "-Ddtrace=false -Dsystemtap=false"
+EXTRA_OEMESON:append:class-native = " -Dtests=false"
do_configure:prepend() {
sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in