[packages/meson] - added fix for gir/gtkdoc regression fix from git PR; release 2

qboosh qboosh at pld-linux.org
Thu Oct 31 17:40:20 CET 2024


commit 5d4f46f276c65352fc32caa829ba1eb19cefd9ad
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Oct 31 17:10:21 2024 +0100

    - added fix for gir/gtkdoc regression fix from git PR; release 2

 meson-both_libraries-dependency.patch | 132 ++++++++++++++++++++++++++++++++++
 meson.spec                            |   4 +-
 2 files changed, 135 insertions(+), 1 deletion(-)
---
diff --git a/meson.spec b/meson.spec
index 095b0d0..da52cab 100644
--- a/meson.spec
+++ b/meson.spec
@@ -2,7 +2,7 @@ Summary:	High productivity build system
 Summary(pl.UTF-8):	System budowania o dużej produktywności
 Name:		meson
 Version:	1.6.0
-Release:	1
+Release:	2
 License:	Apache v2.0
 Group:		Development/Tools
 #Source0Download: https://github.com/mesonbuild/meson/releases/
@@ -11,6 +11,7 @@ Source0:	https://github.com/mesonbuild/meson/releases/download/%{version}/%{name
 Patch0:		%{name}-gtkdocdir.patch
 Patch1:		rust-proc-macro-filter-out-target.patch
 Patch2:		allow-arm-on-arm64.patch
+Patch3:		%{name}-both_libraries-dependency.patch
 URL:		https://mesonbuild.com/
 BuildRequires:	ninja >= 1.8.2
 BuildRequires:	python3 >= 1:3.7
@@ -58,6 +59,7 @@ Mesona.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1 -R
+%patch3 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' \
 	meson.py
diff --git a/meson-both_libraries-dependency.patch b/meson-both_libraries-dependency.patch
new file mode 100644
index 0000000..846c8ba
--- /dev/null
+++ b/meson-both_libraries-dependency.patch
@@ -0,0 +1,132 @@
+From 5b72845511338dfa4bbb40cb3c6ad6ef2f2b9b99 Mon Sep 17 00:00:00 2001
+From: Charles Brunet <charles.brunet at optelgroup.com>
+Date: Tue, 29 Oct 2024 16:51:36 -0400
+Subject: [PATCH] fix generate_gir with BothLibraries dependency
+
+Co-authored-by: Xavier Claessens <xclaesse at gmail.com>
+---
+ mesonbuild/modules/gnome.py                   |  2 +
+ .../frameworks/38 gir both_libraries/bar.c    |  7 ++++
+ .../frameworks/38 gir both_libraries/bar.h    |  1 +
+ .../frameworks/38 gir both_libraries/foo.c    |  6 +++
+ .../frameworks/38 gir both_libraries/foo.h    |  1 +
+ .../38 gir both_libraries/meson.build         | 42 +++++++++++++++++++
+ .../38 gir both_libraries/test.json           |  3 ++
+ 7 files changed, 62 insertions(+)
+ create mode 100644 test cases/frameworks/38 gir both_libraries/bar.c
+ create mode 100644 test cases/frameworks/38 gir both_libraries/bar.h
+ create mode 100644 test cases/frameworks/38 gir both_libraries/foo.c
+ create mode 100644 test cases/frameworks/38 gir both_libraries/foo.h
+ create mode 100644 test cases/frameworks/38 gir both_libraries/meson.build
+ create mode 100644 test cases/frameworks/38 gir both_libraries/test.json
+
+diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
+index e0c1214d0851..4d2bd19416b3 100644
+--- a/mesonbuild/modules/gnome.py
++++ b/mesonbuild/modules/gnome.py
+@@ -670,6 +670,8 @@ def _get_dependencies_flags_raw(
+                 cflags.update(dep.get_compile_args())
+                 cflags.update(state.get_include_args(dep.include_directories))
+                 for lib in dep.libraries:
++                    if isinstance(lib, build.BothLibraries):
++                        lib = lib.get('auto')
+                     if isinstance(lib, build.SharedLibrary):
+                         _ld, depends = self._get_link_args(state, lib, depends, include_rpath)
+                         internal_ldflags.update(_ld)
+diff --git a/test cases/frameworks/38 gir both_libraries/bar.c b/test cases/frameworks/38 gir both_libraries/bar.c
+new file mode 100644
+index 000000000000..4cb41f798294
+--- /dev/null
++++ b/test cases/frameworks/38 gir both_libraries/bar.c	
+@@ -0,0 +1,7 @@
++#include "bar.h"
++#include "foo.h"
++
++int bar_func(void)
++{
++    return foo_func() + 42;
++}
+diff --git a/test cases/frameworks/38 gir both_libraries/bar.h b/test cases/frameworks/38 gir both_libraries/bar.h
+new file mode 100644
+index 000000000000..d22827b837f7
+--- /dev/null
++++ b/test cases/frameworks/38 gir both_libraries/bar.h	
+@@ -0,0 +1 @@
++int bar_func(void);
+diff --git a/test cases/frameworks/38 gir both_libraries/foo.c b/test cases/frameworks/38 gir both_libraries/foo.c
+new file mode 100644
+index 000000000000..b88aa91dabb4
+--- /dev/null
++++ b/test cases/frameworks/38 gir both_libraries/foo.c	
+@@ -0,0 +1,6 @@
++#include "foo.h"
++
++int foo_func(void)
++{
++    return 42;
++}
+diff --git a/test cases/frameworks/38 gir both_libraries/foo.h b/test cases/frameworks/38 gir both_libraries/foo.h
+new file mode 100644
+index 000000000000..2a0867249307
+--- /dev/null
++++ b/test cases/frameworks/38 gir both_libraries/foo.h	
+@@ -0,0 +1 @@
++int foo_func(void);
+diff --git a/test cases/frameworks/38 gir both_libraries/meson.build b/test cases/frameworks/38 gir both_libraries/meson.build
+new file mode 100644
+index 000000000000..cb9cdd31f3ed
+--- /dev/null
++++ b/test cases/frameworks/38 gir both_libraries/meson.build	
+@@ -0,0 +1,42 @@
++project('gir both libraries', 'c')
++
++gir = dependency('gobject-introspection-1.0', required: false)
++if not gir.found()
++  error('MESON_SKIP_TEST gobject-introspection not found.')
++endif
++
++if host_machine.system() == 'cygwin'
++  # FIXME: g-ir-scanner seems broken on cygwin:
++  # ERROR: can't resolve libraries to shared libraries: foo++
++  error('MESON_SKIP_TEST g-ir-scanner is broken on cygwin.')
++endif
++
++gnome = import('gnome')
++
++# Regression test simulating how GStreamer generate its GIRs.
++# Generated gobject-introspection binaries for every GStreamer libraries must
++# first call gst_init() defined in the main libgstreamer, which means they need
++# to link on that lib.
++# A regression caused by https://github.com/mesonbuild/meson/pull/12632 made
++# Meson not link the binary generated for bar with libfoo in the case it uses
++# both_libraries().
++
++libfoo = both_libraries('foo', 'foo.c')
++foo_gir = gnome.generate_gir(libfoo,
++  namespace: 'foo',
++  nsversion: '1.0',
++  sources: ['foo.c', 'foo.h'],
++)
++foo_dep = declare_dependency(
++  link_with: libfoo,
++  sources: foo_gir,
++)
++
++libbar = both_libraries('bar', 'bar.c', dependencies: foo_dep)
++gnome.generate_gir(libbar,
++  namespace: 'bar',
++  nsversion: '1.0',
++  sources: ['bar.c', 'bar.h'],
++  extra_args: '--add-init-section=extern void foo_func(void);foo_func();',
++  dependencies: foo_dep,
++)
+diff --git a/test cases/frameworks/38 gir both_libraries/test.json b/test cases/frameworks/38 gir both_libraries/test.json
+new file mode 100644
+index 000000000000..82ac42a293b3
+--- /dev/null
++++ b/test cases/frameworks/38 gir both_libraries/test.json	
+@@ -0,0 +1,3 @@
++{
++    "expect_skip_on_jobname": ["azure", "macos", "msys2", "cygwin"]
++}
+\ No newline at end of file
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/meson.git/commitdiff/5d4f46f276c65352fc32caa829ba1eb19cefd9ad



More information about the pld-cvs-commit mailing list