commit:     75be2076d0fafa5c6913a4582df724c03ac48422
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 23 05:07:16 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 23 05:09:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75be2076

dev-libs/gobject-introspection: fix runtime w/ clang + glibc-2.41

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...ect-introspection-1.82.0-clang-glibc-2.41.patch | 43 +++++++++++
 .../gobject-introspection-1.82.0-r2.ebuild         | 89 ++++++++++++++++++++++
 2 files changed, 132 insertions(+)

diff --git 
a/dev-libs/gobject-introspection/files/gobject-introspection-1.82.0-clang-glibc-2.41.patch
 
b/dev-libs/gobject-introspection/files/gobject-introspection-1.82.0-clang-glibc-2.41.patch
new file mode 100644
index 000000000000..e2706b95fbac
--- /dev/null
+++ 
b/dev-libs/gobject-introspection/files/gobject-introspection-1.82.0-clang-glibc-2.41.patch
@@ -0,0 +1,43 @@
+https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/519
+https://gitlab.gnome.org/GNOME/gobject-introspection/-/commit/2812471365c75ab51347a9101771128f8ab283ab
+
+From 2812471365c75ab51347a9101771128f8ab283ab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <[email protected]>
+Date: Sat, 8 Feb 2025 14:04:12 +0100
+Subject: [PATCH] Handle C99 _Complex declarations
+
+Fixes https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/519
+--- a/giscanner/scannerlexer.l
++++ b/giscanner/scannerlexer.l
+@@ -211,6 +211,7 @@ stringtext                         ([^\\\"])|(\\.)
+ "break"                                       { return BREAK; }
+ "case"                                        { return CASE; }
+ "char"                                        { return BASIC_TYPE; }
++"_Complex"                            { return COMPLEX; }
+ "const"                                       { return CONST; }
+ "continue"                            { return CONTINUE; }
+ "default"                             { return DEFAULT; }
+--- a/giscanner/scannerparser.y
++++ b/giscanner/scannerparser.y
+@@ -275,7 +275,7 @@ set_or_merge_base_type (GISourceType *type,
+ %token ELLIPSIS ADDEQ SUBEQ MULEQ DIVEQ MODEQ XOREQ ANDEQ OREQ SL SR
+ %token SLEQ SREQ EQ NOTEQ LTEQ GTEQ ANDAND OROR PLUSPLUS MINUSMINUS ARROW
+ 
+-%token AUTO BREAK CASE CONST CONTINUE DEFAULT DO ELSE ENUM
++%token AUTO BREAK CASE COMPLEX CONST CONTINUE DEFAULT DO ELSE ENUM
+ %token EXTENSION EXTERN FOR GOTO IF INLINE REGISTER RESTRICT
+ %token RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH THREAD_LOCAL TYPEDEF
+ %token UNION UNSIGNED VOID VOLATILE WHILE
+@@ -907,6 +907,10 @@ type_specifier
+         {
+               $$ = gi_source_type_new (CTYPE_VOID);
+         }
++      | COMPLEX
++        {
++              $$ = gi_source_basic_type_new ("_Complex");
++        }
+       | SIGNED
+         {
+               $$ = gi_source_basic_type_new ("signed");
+-- 
+GitLab

diff --git 
a/dev-libs/gobject-introspection/gobject-introspection-1.82.0-r2.ebuild 
b/dev-libs/gobject-introspection/gobject-introspection-1.82.0-r2.ebuild
new file mode 100644
index 000000000000..474938c2fb4e
--- /dev/null
+++ b/dev-libs/gobject-introspection/gobject-introspection-1.82.0-r2.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+PYTHON_REQ_USE="xml(+)"
+inherit gnome.org meson python-single-r1 xdg
+
+DESCRIPTION="Introspection system for GObject-based libraries"
+HOMEPAGE="https://gi.readthedocs.io/";
+
+LICENSE="LGPL-2+ GPL-2+"
+SLOT="0"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~x64-solaris"
+
+IUSE="doctool gtk-doc test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# virtual/pkgconfig needed at runtime, bug #505408
+RDEPEND="
+       >=dev-libs/gobject-introspection-common-${PV}
+       >=dev-libs/glib-2.82.0:2[introspection]
+       dev-libs/libffi:=
+       $(python_gen_cond_dep '
+               dev-python/setuptools[${PYTHON_USEDEP}]
+       ')
+       doctool? (
+               $(python_gen_cond_dep '
+                       dev-python/mako[${PYTHON_USEDEP}]
+                       dev-python/markdown[${PYTHON_USEDEP}]
+               ')
+       )
+       virtual/pkgconfig
+       ${PYTHON_DEPS}
+"
+# Wants real bison, not app-alternatives/yacc
+DEPEND="${RDEPEND}"
+BDEPEND="
+       gtk-doc? (
+               >=dev-util/gtk-doc-1.19
+               app-text/docbook-xml-dtd:4.3
+               app-text/docbook-xml-dtd:4.5
+       )
+       sys-devel/bison
+       app-alternatives/lex
+       test? (
+               x11-libs/cairo[glib]
+               $(python_gen_cond_dep '
+                       dev-python/mako[${PYTHON_USEDEP}]
+                       dev-python/markdown[${PYTHON_USEDEP}]
+               ')
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-clang-glibc-2.41.patch
+)
+
+pkg_setup() {
+       python-single-r1_pkg_setup
+}
+
+src_configure() {
+       local emesonargs=(
+               $(meson_feature test cairo)
+               $(meson_feature doctool)
+               #-Dglib_src_dir
+               $(meson_use gtk-doc gtk_doc)
+               #-Dcairo_libname
+               -Dpython="${EPYTHON}"
+               -Dbuild_introspection_data=true
+               #-Dgir_dir_prefix
+       )
+       meson_src_configure
+}
+
+src_install() {
+       meson_src_install
+       python_fix_shebang "${ED}"/usr/bin/
+       python_optimize 
"${ED}"/usr/$(get_libdir)/gobject-introspection/giscanner
+
+       # Prevent collision with gobject-introspection-common
+       rm -v "${ED}"/usr/share/aclocal/introspection.m4 \
+               
"${ED}"/usr/share/gobject-introspection-1.0/Makefile.introspection || die
+       rmdir "${ED}"/usr/share/aclocal || die
+}

Reply via email to