mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 01:31:03 +00:00
gi: add support for introspection with subprojects
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3505 https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/363 https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/412 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1584>
This commit is contained in:
parent
792eb0cf48
commit
4172b0152f
5 changed files with 174 additions and 0 deletions
|
@ -5,6 +5,7 @@ source_fallback_url = https://ftp.acc.umu.se/pub/gnome/sources/glib/2.74/glib-2.
|
|||
source_filename = glib-2.74.1.tar.xz
|
||||
source_hash = 0ab981618d1db47845e56417b0d7c123f81a3427b2b9c93f5a46ff5bbb964964
|
||||
wrapdb_version = 2.74.1-1
|
||||
diff_files = glib-2.74.1/0001-meson-help-gobject-introspection-locate-source-and-b.patch
|
||||
|
||||
[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
|
||||
|
|
12
subprojects/gobject-introspection.wrap
Normal file
12
subprojects/gobject-introspection.wrap
Normal file
|
@ -0,0 +1,12 @@
|
|||
[wrap-file]
|
||||
directory = gobject-introspection-1.74.0
|
||||
source_url = https://download.gnome.org/sources/gobject-introspection/1.74/gobject-introspection-1.74.0.tar.xz
|
||||
source_fallback_url = https://ftp.acc.umu.se/pub/gnome/sources/gobject-introspection/1.74/gobject-introspection-1.74.0.tar.xz
|
||||
source_filename = gobject-introspection-1.74.0.tar.xz
|
||||
source_hash = 347b3a719e68ba4c69ff2d57ee2689233ea8c07fc492205e573386779e42d653
|
||||
wrapdb_version = 1.74.0-0
|
||||
diff_files = gobject-introspection-1.74.0/0001-Fix-gir-build-when-using-subprojects-dependencies.patch, gobject-introspection-1.74.0/0001-gir-stop-assuming-glib-source-and-build-dirs-using-v.patch
|
||||
|
||||
[provide]
|
||||
dependency_names = gobject-introspection-1.0
|
||||
program_names = g-ir-scanner, g-ir-compiler, g-ir-annotation-tool, g-ir-doc-tool, g-ir-inspect, g-ir-generate
|
|
@ -0,0 +1,33 @@
|
|||
From 783bf28650ec581c3d225821d13dad5ec3cf6c24 Mon Sep 17 00:00:00 2001
|
||||
From: Andoni Morales Alastruey <amorales@fluendo.com>
|
||||
Date: Wed, 19 Jul 2023 17:14:02 +0200
|
||||
Subject: [PATCH] meson: help gobject-introspection locate source and build
|
||||
dirs
|
||||
|
||||
gobject-introspection is currently assuming glib subproject
|
||||
is in unversioned, but gstreamer uses a versioned directory, eg:
|
||||
subprojects/glib-2.74.1 instead of subprojects/glib
|
||||
---
|
||||
meson.build | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 43bb468..3e4dd96 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -54,6 +54,12 @@ if host_system == 'darwin'
|
||||
endif
|
||||
endif
|
||||
|
||||
+# When building glib and gobject-introspection with subprojects, gobject-introspection
|
||||
+# requires to know to lnow the path of the sources and the build directory.
|
||||
+# We provide it here with a variable.
|
||||
+glib_source_dir = meson.current_source_dir()
|
||||
+glib_build_dir = meson.current_build_dir()
|
||||
+
|
||||
glib_version = meson.project_version()
|
||||
glib_api_version = '2.0'
|
||||
version_arr = glib_version.split('.')
|
||||
--
|
||||
2.40.0.windows.1
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
From b4c454a75108bc31934d2d0be0141a2220bded84 Mon Sep 17 00:00:00 2001
|
||||
From: Andoni Morales Alastruey <ylatuya@gmail.com>
|
||||
Date: Tue, 18 Oct 2022 11:18:06 +0200
|
||||
Subject: [PATCH] Fix gir build when using subprojects' dependencies
|
||||
|
||||
https://github.com/mesonbuild/meson/pull/10275 introduced
|
||||
support in meson to use uninstalled .pc files in the meson-uninstalled
|
||||
directory to resolve dependencies built with subprojects.
|
||||
Replicate the same solution while all the custom_target
|
||||
are migrated to gnome.generate_dir
|
||||
---
|
||||
gir/meson.build | 5 +++++
|
||||
meson.build | 10 ++++++++++
|
||||
tests/meson.build | 1 +
|
||||
3 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/gir/meson.build b/gir/meson.build
|
||||
index da23e422..09714cc1 100644
|
||||
--- a/gir/meson.build
|
||||
+++ b/gir/meson.build
|
||||
@@ -239,6 +239,7 @@ glib_gir = custom_target('gir-glib',
|
||||
depend_files: gir_giscanner_built_files,
|
||||
install: true,
|
||||
install_dir: girdir,
|
||||
+ env: g_ir_scanner_env,
|
||||
command: glib_command + [
|
||||
'--cflags-begin'] + glib_includes + extra_giscanner_cflags + [
|
||||
'-DGLIB_COMPILATION',
|
||||
@@ -307,6 +308,7 @@ gobject_gir = custom_target('gir-gobject',
|
||||
depend_files: gir_giscanner_built_files,
|
||||
install: true,
|
||||
install_dir: girdir,
|
||||
+ env: g_ir_scanner_env,
|
||||
command: gobject_command + [
|
||||
'--include-uninstalled=' + glib_gir.full_path(),
|
||||
'--cflags-begin'] + glib_includes + extra_giscanner_cflags + [
|
||||
@@ -360,6 +362,7 @@ gir_files += custom_target('gir-gmodule',
|
||||
depend_files: gir_giscanner_built_files,
|
||||
install: true,
|
||||
install_dir: girdir,
|
||||
+ env: g_ir_scanner_env,
|
||||
command: gmodule_command + [
|
||||
'--include-uninstalled=' + glib_gir.full_path(),
|
||||
'--cflags-begin'] + glib_includes + extra_giscanner_cflags + [
|
||||
@@ -456,6 +459,7 @@ gio_gir = custom_target('gir-gio',
|
||||
depend_files: gir_giscanner_built_files,
|
||||
install: true,
|
||||
install_dir: girdir,
|
||||
+ env: g_ir_scanner_env,
|
||||
command: gio_command + [
|
||||
'--include-uninstalled=' + gobject_gir.full_path(),
|
||||
'--cflags-begin'] + glib_includes + extra_giscanner_cflags + [
|
||||
@@ -493,6 +497,7 @@ gir_files += custom_target('gir-girepository',
|
||||
depend_files: gir_giscanner_built_files,
|
||||
install: true,
|
||||
install_dir: girdir,
|
||||
+ env: g_ir_scanner_env,
|
||||
command: girepository_command + [
|
||||
'--include-uninstalled=' + gobject_gir.full_path(),
|
||||
'--cflags-begin'] + glib_includes + extra_giscanner_cflags + [
|
||||
diff --git a/meson.build b/meson.build
|
||||
index ca9c2b22..28fbf7fe 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -151,6 +151,16 @@ if not (host_system == 'darwin' and host_arch == 'aarch64' or
|
||||
config.set('LEGACY_GIRFFI_FREE', 1)
|
||||
endif
|
||||
|
||||
+# Replicate https://github.com/mesonbuild/meson/pull/10275 setting
|
||||
+# the correct env in the custom_target
|
||||
+pkg_config = find_program('pkg-config')
|
||||
+g_ir_scanner_env = environment()
|
||||
+dep_type = glib_dep.type_name()
|
||||
+if dep_type == 'internal'
|
||||
+ g_ir_scanner_env.append('PKG_CONFIG_PATH', meson.global_build_root() + '/meson-uninstalled')
|
||||
+ g_ir_scanner_env.set('PKG_CONFIG', pkg_config.full_path())
|
||||
+endif
|
||||
+
|
||||
configure_file(
|
||||
configuration: config,
|
||||
output: 'config.h'
|
||||
diff --git a/tests/meson.build b/tests/meson.build
|
||||
index abb51f58..22b402b0 100644
|
||||
--- a/tests/meson.build
|
||||
+++ b/tests/meson.build
|
||||
@@ -56,6 +56,7 @@ test_gircompiler = find_program('g-ir-compiler', native: false, required : false
|
||||
test_everything_files = custom_target('everything',
|
||||
output: ['everything.h', 'everything.c'],
|
||||
depends: typelibs,
|
||||
+ env: g_ir_scanner_env,
|
||||
command: [
|
||||
test_girscanner,
|
||||
'--quiet',
|
||||
--
|
||||
2.39.2
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
From dc33cdc1f9210d5f284bf115c4c66b55b38f79b9 Mon Sep 17 00:00:00 2001
|
||||
From: Andoni Morales Alastruey <amorales@fluendo.com>
|
||||
Date: Wed, 19 Jul 2023 15:21:42 +0200
|
||||
Subject: [PATCH] gir: stop assuming glib source and build dirs using variables
|
||||
|
||||
---
|
||||
gir/meson.build | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gir/meson.build b/gir/meson.build
|
||||
index 09714cc..59e03d6 100644
|
||||
--- a/gir/meson.build
|
||||
+++ b/gir/meson.build
|
||||
@@ -134,14 +134,13 @@ elif dep_type == 'internal'
|
||||
# XXX: This is a pile of hacks to allow gobject-introspection to parse the
|
||||
# GLib source files when GLib is used as a subproject
|
||||
# Assumes that the builddir layout is 'mirror'
|
||||
- # Assumes the location of the glib subproject dir
|
||||
# We should add API to meson to get a specific file from a specific
|
||||
# subproject
|
||||
# We know exactly what headers will be installed, so just fetch that
|
||||
glib_subproject = subproject('glib')
|
||||
|
||||
- glibproj_sourcedir = join_paths(meson.global_source_root(), subprojdir, 'glib')
|
||||
- glibproj_builddir = join_paths(meson.global_build_root(), subprojdir, 'glib')
|
||||
+ glibproj_sourcedir = glib_subproject.get_variable('glib_source_dir', join_paths(meson.global_source_root(), subprojdir, 'glib'))
|
||||
+ glibproj_builddir = glib_subproject.get_variable('glib_build_dir', join_paths(meson.global_build_root(), subprojdir, 'glib'))
|
||||
|
||||
glib_files += glib_subproject.get_variable('glib_types_h')
|
||||
|
||||
--
|
||||
2.39.2
|
Loading…
Reference in a new issue