[glib: 1/2] build: Move gvdb to a subproject




commit b3f49d08a627633d266f31187bff4cce869772d6
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Jun 7 18:11:32 2022 +0100

    build: Move gvdb to a subproject
    
    Rather than carrying the copylib around inside GLib, which is a pain to
    synchronise and affects our code coverage statistics.
    
    This requires updating the CI images to cache the new subproject,
    including updating the `cache-subprojects.sh` script to pull in git
    submodules.
    
    It also requires adding `gioenumtypes_dep` to be added to the
    dependencies list of `libgio`, since it needs to be build before GVDB as
    it’s pulled in by the GIO headers which GVDB includes.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #2603

 .gitlab-ci.yml                  |   8 +-
 .gitlab-ci/cache-subprojects.sh |   1 +
 .gitlab-ci/coverity.Dockerfile  |   2 +-
 .gitmodules                     |   5 +
 docs/reference/gio/meson.build  |   1 -
 gio/gvdb/gvdb-builder.c         | 636 ----------------------------------
 gio/gvdb/gvdb-builder.h         |  66 ----
 gio/gvdb/gvdb-format.h          |  85 -----
 gio/gvdb/gvdb-reader.c          | 736 ----------------------------------------
 gio/gvdb/gvdb-reader.h          |  78 -----
 gio/gvdb/gvdb.doap              |  57 ----
 gio/meson.build                 |  12 +-
 meson.build                     |   3 +
 subprojects/gvdb                |   1 +
 subprojects/gvdb.wrap           |   8 +
 15 files changed, 29 insertions(+), 1670 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7fb5a64a7a..c662d44e39 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,10 +10,10 @@ cache:
     - _ccache/
 
 variables:
-  FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v15"
-  COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v4"
-  DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v10"
-  MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v6"
+  FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v16"
+  COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v5"
+  DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v11"
+  MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v7"
   MESON_TEST_TIMEOUT_MULTIPLIER: 2
   G_MESSAGES_DEBUG: all
   MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
diff --git a/.gitlab-ci/cache-subprojects.sh b/.gitlab-ci/cache-subprojects.sh
index fb0b1df820..0e69266059 100755
--- a/.gitlab-ci/cache-subprojects.sh
+++ b/.gitlab-ci/cache-subprojects.sh
@@ -3,6 +3,7 @@
 set -e
 
 git clone --depth 1 --no-tags https://gitlab.gnome.org/GNOME/glib.git
+git -C glib submodule update --init
 meson subprojects download --sourcedir glib
 rm glib/subprojects/*.wrap
 mv glib/subprojects/ .
diff --git a/.gitlab-ci/coverity.Dockerfile b/.gitlab-ci/coverity.Dockerfile
index 0a474fc757..67ebc440af 100644
--- a/.gitlab-ci/coverity.Dockerfile
+++ b/.gitlab-ci/coverity.Dockerfile
@@ -1,4 +1,4 @@
-FROM registry.gitlab.gnome.org/gnome/glib/fedora:v14
+FROM registry.gitlab.gnome.org/gnome/glib/fedora:v16
 
 ARG COVERITY_SCAN_PROJECT_NAME
 ARG COVERITY_SCAN_TOKEN
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000..c1f97ee42d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,5 @@
+[submodule "subprojects/gvdb"]
+       path = subprojects/gvdb
+       url = https://gitlab.gnome.org/GNOME/gvdb.git
+       branch = 0854af0fdb6d527a8d1999835ac2c5059976c210
+       shallow = true
diff --git a/docs/reference/gio/meson.build b/docs/reference/gio/meson.build
index 723d6a8ddd..8c8e15fd81 100644
--- a/docs/reference/gio/meson.build
+++ b/docs/reference/gio/meson.build
@@ -4,7 +4,6 @@ if get_option('gtk_doc')
 
   ignore_headers = [
     'gdbus-2.0',
-    'gvdb',
     'inotify',
     'kqueue',
     'libasyncns',
diff --git a/gio/meson.build b/gio/meson.build
index 55bdaae936..d20d751b5f 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -261,7 +261,6 @@ settings_headers = files(
 )
 
 settings_sources = files(
-  'gvdb/gvdb-reader.c',
   'gdelayedsettingsbackend.c',
   'gkeyfilesettingsbackend.c',
   'gmemorysettingsbackend.c',
@@ -812,7 +811,8 @@ libgio = library('gio-2.0',
   link_with: internal_deps,
   dependencies : [libz_dep, libdl_dep, libmount_dep, libglib_dep,
                   libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep,
-                  platform_deps, network_libs, libsysprof_capture_dep],
+                  platform_deps, network_libs, libsysprof_capture_dep,
+                  gioenumtypes_dep, gvdb_dep],
   c_args : gio_c_args,
   objc_args : gio_c_args,
   # intl.lib is not compatible with SAFESEH
@@ -961,19 +961,19 @@ gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodu
   dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
 
 glib_compile_schemas = executable('glib-compile-schemas',
-  ['gvdb/gvdb-builder.c', 'glib-compile-schemas.c'],
+  ['glib-compile-schemas.c'],
   install : true,
   # intl.lib is not compatible with SAFESEH
   link_args : noseh_link_args,
-  dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
+  dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep, gvdb_dep])
 
 glib_compile_resources = executable('glib-compile-resources',
-  [gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-resources.c'],
+  [gconstructor_as_data_h, 'glib-compile-resources.c'],
   install : true,
   c_args : gio_c_args,
   # intl.lib is not compatible with SAFESEH
   link_args : noseh_link_args,
-  dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
+  dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep, gvdb_dep])
 
 # Cannot override those programs in cross compilation case because they are
 # native executables that cannot be run on the build machine.
diff --git a/meson.build b/meson.build
index fd6545cadf..41ed89411a 100644
--- a/meson.build
+++ b/meson.build
@@ -2033,6 +2033,9 @@ else
   use_pcre_static_flag = false
 endif
 
+# Import the gvdb sources as a subproject to avoid having the copylib in-tree
+gvdb_dep = dependency('gvdb')
+
 libm = cc.find_library('m', required : false)
 libffi_dep = dependency('libffi', version : '>= 3.0.0', fallback : ['libffi', 'ffi_dep'])
 
diff --git a/subprojects/gvdb b/subprojects/gvdb
new file mode 160000
index 0000000000..0854af0fdb
--- /dev/null
+++ b/subprojects/gvdb
@@ -0,0 +1 @@
+Subproject commit 0854af0fdb6d527a8d1999835ac2c5059976c210
diff --git a/subprojects/gvdb.wrap b/subprojects/gvdb.wrap
new file mode 100644
index 0000000000..1cdef8dc91
--- /dev/null
+++ b/subprojects/gvdb.wrap
@@ -0,0 +1,8 @@
+[wrap-git]
+directory=gvdb
+url=https://gitlab.gnome.org/GNOME/gvdb.git
+revision=0854af0fdb6d527a8d1999835ac2c5059976c210
+depth=1
+
+[provide]
+dependency_names = gvdb


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]