]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
subprojects: Allow expat and GLib to be built as subprojects
authorSimon McVittie <smcv@collabora.com>
Fri, 24 Jun 2022 13:27:10 +0000 (14:27 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 19:36:13 +0000 (20:36 +0100)
This should let us build everything with a mingw-w64 toolchain, without
having to use prebuilt dependencies from MSYS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Makefile.am
meson.build
subprojects/expat.wrap [new file with mode: 0644]
subprojects/glib.wrap [new file with mode: 0644]
tools/ci-install.sh

index 1587dc7caaa87418fcbc0e42a7e274aef02de506..f37865e87797961d98a6f70d8080a814595a9b06 100644 (file)
@@ -31,6 +31,8 @@ EXTRA_DIST =                  \
        meson_options.txt \
        meson_post_install.py \
        meson_post_install_systemd.py \
+       subprojects/expat.wrap \
+       subprojects/glib.wrap \
        test/CMakeLists.txt \
        test/name-test/CMakeLists.txt \
        tools/CMakeLists.txt \
index ac8ba6cfcbb558bfc8c610e987d89a4e59c179fb..4c3690a2264a23df839ef84dbaf0ab21b1693fa4 100644 (file)
@@ -283,7 +283,12 @@ threads = dependency('threads')
 config.set('HAVE_MONOTONIC_CLOCK', cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC'))
 
 glib = dependency(
-    'glib-2.0', version: '>=2.40', required: get_option('modular_tests'),
+    'glib-2.0', version: '>=2.40',
+    required: get_option('modular_tests'),
+    fallback: ['glib', 'libglib_dep'],
+    default_options: [
+        'tests=false',
+    ],
 )
 if platform_windows
     gio = dependency('gio-windows-2.0', required: glib.found())
@@ -294,7 +299,14 @@ use_glib = glib.found() and gio.found()
 config.set('DBUS_WITH_GLIB', use_glib)
 
 expat = dependency('expat')
-config.set('HAVE_XML_SETHASHSALT', cc.has_function('XML_SetHashSalt', dependencies: expat))
+if expat.type_name() == 'internal'
+    # Configure-time checks can't act on subprojects that haven't been
+    # built yet, but we know that subprojects/expat.wrap is a new enough
+    # version to have this
+    config.set('HAVE_XML_SETHASHSALT', true)
+else
+    config.set('HAVE_XML_SETHASHSALT', cc.has_function('XML_SetHashSalt', dependencies: expat))
+endif
 
 selinux = dependency('libselinux', version: '>=2.0.86', required: get_option('selinux'))
 
diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap
new file mode 100644 (file)
index 0000000..26fe967
--- /dev/null
@@ -0,0 +1,14 @@
+# Copyright 2022 Meson contributors
+# SPDX-License-Identifier: MIT
+
+[wrap-file]
+directory = expat-2.4.8
+source_url = https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.xz
+source_filename = expat-2.4.8.tar.bz2
+source_hash = f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25
+patch_filename = expat_2.4.8-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/expat_2.4.8-1/get_patch
+patch_hash = 9aec253a2c6d1c0feb852c5c6920298d14701eeec7acc6832bb402438b52112a
+
+[provide]
+expat = expat_dep
diff --git a/subprojects/glib.wrap b/subprojects/glib.wrap
new file mode 100644 (file)
index 0000000..b01294b
--- /dev/null
@@ -0,0 +1,13 @@
+# Copyright 2022 Meson contributors
+# SPDX-License-Identifier: MIT
+
+[wrap-file]
+directory = glib-2.72.2
+source_url = https://download.gnome.org/sources/glib/2.72/glib-2.72.2.tar.xz
+source_filename = glib-2.72.2.tar.xz
+source_hash = 78d599a133dba7fe2036dfa8db8fb6131ab9642783fc9578b07a20995252d2de
+wrapdb_version = 2.72.2-1
+
+[provide]
+dependency_names = gthread-2.0, gobject-2.0, gmodule-no-export-2.0, gmodule-export-2.0, gmodule-2.0, glib-2.0, gio-2.0, gio-windows-2.0, gio-unix-2.0
+program_names = glib-genmarshal, glib-mkenums, glib-compile-schemas, glib-compile-resources, gio-querymodules, gdbus-codegen
index 40dde89227e44b6499366f57bf795d18250f5a9b..48197c52e0f13f04e08b8f11316ae5149d8a7d0b 100755 (executable)
@@ -159,6 +159,7 @@ case "$ci_distro" in
             ducktype
             g++
             gcc
+            git
             gnome-desktop-testing
             libapparmor-dev
             libaudit-dev