Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] glib: update to 2.80.0.
@ 2024-03-21 20:10 oreo639
  2024-03-21 20:22 ` [PR PATCH] [Updated] [WIP] " oreo639
                   ` (43 more replies)
  0 siblings, 44 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 20:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]

There is a new pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://docs.gtk.org/girepository/migrating-gi.html


The bootstrap process, while not intentionally, mirrors the on used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 30222 bytes --]

From 26fdfc0193597ff10d7e18cc34f446ccbfd3147e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 47 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..166194bb4fa1ff
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,47 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl
+ python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3624e95088bd254275f3aff5ccc4cc20481f2351 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..d87deef32017ce
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 61b107ad279c31d4a9a7b42bfab246ea4f211945 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  31 ++--
 5 files changed, 16 insertions(+), 267 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 28be311b85ae4c..a574ca21f5921e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..9038186a658ea2 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,31 +1,30 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
-checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+#checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
-
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
-fi
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
 post_patch() {
 	# Timer test is flaky on 32 bit (does float comparisons)
@@ -76,11 +75,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 4809106ece938e589d3b94f84979852f92e23a12 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 8430543d2c35dfaceed82db03261d56d754d9b1f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
@ 2024-03-21 20:22 ` oreo639
  2024-03-21 20:23 ` oreo639
                   ` (42 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 20:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html


The bootstrap process, while not intentionally, mirrors the on used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 30222 bytes --]

From 26fdfc0193597ff10d7e18cc34f446ccbfd3147e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 47 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..166194bb4fa1ff
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,47 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl
+ python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3624e95088bd254275f3aff5ccc4cc20481f2351 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..d87deef32017ce
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 61b107ad279c31d4a9a7b42bfab246ea4f211945 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  31 ++--
 5 files changed, 16 insertions(+), 267 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 28be311b85ae4c..a574ca21f5921e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..9038186a658ea2 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,31 +1,30 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
-checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+#checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
-
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
-fi
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
 post_patch() {
 	# Timer test is flaky on 32 bit (does float comparisons)
@@ -76,11 +75,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 4809106ece938e589d3b94f84979852f92e23a12 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 8430543d2c35dfaceed82db03261d56d754d9b1f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
  2024-03-21 20:22 ` [PR PATCH] [Updated] [WIP] " oreo639
@ 2024-03-21 20:23 ` oreo639
  2024-03-21 20:50 ` oreo639
                   ` (41 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 20:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html


The bootstrap process, while not intentionally, mirrors the on used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 30167 bytes --]

From 26fdfc0193597ff10d7e18cc34f446ccbfd3147e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 47 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..166194bb4fa1ff
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,47 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl
+ python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3624e95088bd254275f3aff5ccc4cc20481f2351 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..d87deef32017ce
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From f7bed63dad4e43d71b4ed7fd3fe8ae72b22c14c7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  30 ++--
 5 files changed, 16 insertions(+), 266 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 28be311b85ae4c..a574ca21f5921e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..d1886dab71ee28 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,31 +1,31 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=gir
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
-
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
-fi
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
 post_patch() {
 	# Timer test is flaky on 32 bit (does float comparisons)
@@ -76,11 +76,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 8c3fd7fb7d68c74f14f4b340c9599d5313a34ad4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 83a9d6655568631074676f949277226107ef1a4a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
  2024-03-21 20:22 ` [PR PATCH] [Updated] [WIP] " oreo639
  2024-03-21 20:23 ` oreo639
@ 2024-03-21 20:50 ` oreo639
  2024-03-21 21:04 ` oreo639
                   ` (40 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 20:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html


The bootstrap process, while not intentionally, mirrors the on used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 30224 bytes --]

From 26fdfc0193597ff10d7e18cc34f446ccbfd3147e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 47 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..166194bb4fa1ff
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,47 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl
+ python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3624e95088bd254275f3aff5ccc4cc20481f2351 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..d87deef32017ce
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 74aa309dcaeac68f34bd0a4ad567ee09b7c86392 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  31 ++--
 5 files changed, 19 insertions(+), 264 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 28be311b85ae4c..a574ca21f5921e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..7087cc4ae7628a 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -76,11 +81,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From e58e2f3b736e0bccc57e2b34dc674e2411167e5e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From bfaec33cd94daf0ff80394294cbd6dcd465ccf20 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (2 preceding siblings ...)
  2024-03-21 20:50 ` oreo639
@ 2024-03-21 21:04 ` oreo639
  2024-03-21 21:08 ` chrysos349
                   ` (39 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 21:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html


The bootstrap process, while not intentionally, mirrors the on used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 31573 bytes --]

From 26fdfc0193597ff10d7e18cc34f446ccbfd3147e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/6] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 47 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..166194bb4fa1ff
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,47 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl
+ python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3624e95088bd254275f3aff5ccc4cc20481f2351 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/6] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..d87deef32017ce
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 74aa309dcaeac68f34bd0a4ad567ee09b7c86392 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/6] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  31 ++--
 5 files changed, 19 insertions(+), 264 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 28be311b85ae4c..a574ca21f5921e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..7087cc4ae7628a 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -76,11 +81,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From e58e2f3b736e0bccc57e2b34dc674e2411167e5e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/6] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From bfaec33cd94daf0ff80394294cbd6dcd465ccf20 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/6] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

From feb8b619d029c35b8f4b49e0bdc7e621f15cba6f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 13:57:21 -0700
Subject: [PATCH 6/6] p11-kit: update to 0.25.3.

Fixes issue where the wrong C_GetInterface may get loaded.
https://github.com/p11-glue/p11-kit/pull/535
---
 srcpkgs/p11-kit/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/p11-kit/template b/srcpkgs/p11-kit/template
index 9fd614ba8603c3..0b06cc43329435 100644
--- a/srcpkgs/p11-kit/template
+++ b/srcpkgs/p11-kit/template
@@ -1,6 +1,6 @@
 # Template file for 'p11-kit'
 pkgname=p11-kit
-version=0.25.0
+version=0.25.3
 revision=1
 build_style=meson
 build_helper="qemu"
@@ -16,7 +16,7 @@ license="BSD-3-Clause"
 homepage="https://github.com/p11-glue/p11-kit"
 changelog="https://raw.githubusercontent.com/p11-glue/p11-kit/master/NEWS"
 distfiles="https://github.com/p11-glue/p11-kit/releases/download/${version}/p11-kit-${version}.tar.xz"
-checksum=d55583bcdde83d86579cabe3a8f7f2638675fef01d23cace733ff748fc354706
+checksum=d8ddce1bb7e898986f9d250ccae7c09ce14d82f1009046d202a0eb1b428b2adc
 conf_files="/etc/pkcs11/pkcs11.conf"
 
 if [ "$XBPS_CHECK_PKGS" ]; then
@@ -26,7 +26,6 @@ else
 fi
 
 build_options="gtk_doc"
-build_options_default=""
 
 if [ -z "$CROSS_BUILD" ]; then
 	build_options_default+=" gtk_doc"

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (3 preceding siblings ...)
  2024-03-21 21:04 ` oreo639
@ 2024-03-21 21:08 ` chrysos349
  2024-03-21 21:16 ` oreo639
                   ` (38 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: chrysos349 @ 2024-03-21 21:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

New comment by chrysos349 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2013739798

Comment:
i think python3-packaging is supposed to be in glib-devel depends.
otherwise, there will be the error, like this
```
[87/144] Generating gdbus source libsecret/secret-dbus-generated.c
FAILED: libsecret/secret-dbus-generated.c 
/usr/bin/gdbus-codegen --c-generate-autocleanup all --interface-prefix org.freedesktop.Secret. --c-namespace _SecretGen --body --output libsecret/secret-dbus-generated.c ../libsecret/org.freedesktop.Secrets.xml
Traceback (most recent call last):
  File "/usr/bin/gdbus-codegen", line 53, in <module>
    from codegen import codegen_main
  File "/usr/share/glib-2.0/codegen/codegen_main.py", line 30, in <module>
    from . import dbustypes
  File "/usr/share/glib-2.0/codegen/dbustypes.py", line 22, in <module>
    from . import utils
  File "/usr/share/glib-2.0/codegen/utils.py", line 22, in <module>
    import packaging.version
ModuleNotFoundError: No module named 'packaging'
```



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (4 preceding siblings ...)
  2024-03-21 21:08 ` chrysos349
@ 2024-03-21 21:16 ` oreo639
  2024-03-21 21:18 ` oreo639
                   ` (37 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 21:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2013751699

Comment:
> i think python3-packaging is supposed to be in glib-devel depends.

Yeah, thanks (python3-packaging was added as a dependency to replace distutils).

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (5 preceding siblings ...)
  2024-03-21 21:16 ` oreo639
@ 2024-03-21 21:18 ` oreo639
  2024-03-21 21:24 ` [PR PATCH] [Updated] " oreo639
                   ` (36 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 21:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2013751699

Comment:
> i think python3-packaging is supposed to be in glib-devel depends.

Yeah, thanks. (python3-packaging was added as a dependency to replace distutils)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (6 preceding siblings ...)
  2024-03-21 21:18 ` oreo639
@ 2024-03-21 21:24 ` oreo639
  2024-03-21 21:31 ` oreo639
                   ` (35 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 21:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html


The bootstrap process, while not intentionally, mirrors the on used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 31928 bytes --]

From 83624085f70e3c85c5b20b1fb65643d1c8e734d7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/6] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 4b858435082c1c23006c04c282913835f520638c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/6] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..2950b3717e5691
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 06ed9e784a38d3f51923ef123289e16d2be1df43 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/6] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  33 ++--
 5 files changed, 20 insertions(+), 265 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 28be311b85ae4c..a574ca21f5921e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..4e328c5e49b720 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -57,7 +62,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -76,11 +81,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From f22bba9abca8a07ef36f0fe86961583e7b8c37ff Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/6] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 80a2042bc10f641c8ccbf74b427cd881bc562a64 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/6] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

From f1cc3b67d37b1e4de7191e02353697da22121c8c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 13:57:21 -0700
Subject: [PATCH 6/6] p11-kit: update to 0.25.3.

Fixes issue where the wrong C_GetInterface may get loaded.
https://github.com/p11-glue/p11-kit/pull/535
---
 srcpkgs/p11-kit/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/p11-kit/template b/srcpkgs/p11-kit/template
index 9fd614ba8603c3..0b06cc43329435 100644
--- a/srcpkgs/p11-kit/template
+++ b/srcpkgs/p11-kit/template
@@ -1,6 +1,6 @@
 # Template file for 'p11-kit'
 pkgname=p11-kit
-version=0.25.0
+version=0.25.3
 revision=1
 build_style=meson
 build_helper="qemu"
@@ -16,7 +16,7 @@ license="BSD-3-Clause"
 homepage="https://github.com/p11-glue/p11-kit"
 changelog="https://raw.githubusercontent.com/p11-glue/p11-kit/master/NEWS"
 distfiles="https://github.com/p11-glue/p11-kit/releases/download/${version}/p11-kit-${version}.tar.xz"
-checksum=d55583bcdde83d86579cabe3a8f7f2638675fef01d23cace733ff748fc354706
+checksum=d8ddce1bb7e898986f9d250ccae7c09ce14d82f1009046d202a0eb1b428b2adc
 conf_files="/etc/pkcs11/pkcs11.conf"
 
 if [ "$XBPS_CHECK_PKGS" ]; then
@@ -26,7 +26,6 @@ else
 fi
 
 build_options="gtk_doc"
-build_options_default=""
 
 if [ -z "$CROSS_BUILD" ]; then
 	build_options_default+=" gtk_doc"

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (7 preceding siblings ...)
  2024-03-21 21:24 ` [PR PATCH] [Updated] " oreo639
@ 2024-03-21 21:31 ` oreo639
  2024-03-22  0:15 ` oreo639
                   ` (34 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-21 21:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html


The bootstrap process, while not intentionally, mirrors the on used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 32263 bytes --]

From 83624085f70e3c85c5b20b1fb65643d1c8e734d7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/6] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 4b858435082c1c23006c04c282913835f520638c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/6] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..2950b3717e5691
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 72ab41c9362916d81d9a26ecc30ec4c2e452d207 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/6] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  35 ++--
 5 files changed, 21 insertions(+), 266 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 28be311b85ae4c..a574ca21f5921e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..8be5f3dba206c5 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -44,7 +49,7 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
@@ -57,7 +62,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -76,11 +81,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From ecaa79be5ad5cc7b16167c14fcd9f6b405bf35f6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/6] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From fc8e2c19b3ca8f13d81e4b2e28881436ff071023 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/6] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

From e63209b93be65bb0b74431b721d5332afa9b2526 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 13:57:21 -0700
Subject: [PATCH 6/6] p11-kit: update to 0.25.3.

Fixes issue where the wrong C_GetInterface may get loaded.
https://github.com/p11-glue/p11-kit/pull/535
---
 srcpkgs/p11-kit/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/p11-kit/template b/srcpkgs/p11-kit/template
index 9fd614ba8603c3..0b06cc43329435 100644
--- a/srcpkgs/p11-kit/template
+++ b/srcpkgs/p11-kit/template
@@ -1,6 +1,6 @@
 # Template file for 'p11-kit'
 pkgname=p11-kit
-version=0.25.0
+version=0.25.3
 revision=1
 build_style=meson
 build_helper="qemu"
@@ -16,7 +16,7 @@ license="BSD-3-Clause"
 homepage="https://github.com/p11-glue/p11-kit"
 changelog="https://raw.githubusercontent.com/p11-glue/p11-kit/master/NEWS"
 distfiles="https://github.com/p11-glue/p11-kit/releases/download/${version}/p11-kit-${version}.tar.xz"
-checksum=d55583bcdde83d86579cabe3a8f7f2638675fef01d23cace733ff748fc354706
+checksum=d8ddce1bb7e898986f9d250ccae7c09ce14d82f1009046d202a0eb1b428b2adc
 conf_files="/etc/pkcs11/pkcs11.conf"
 
 if [ "$XBPS_CHECK_PKGS" ]; then
@@ -26,7 +26,6 @@ else
 fi
 
 build_options="gtk_doc"
-build_options_default=""
 
 if [ -z "$CROSS_BUILD" ]; then
 	build_options_default+=" gtk_doc"

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (8 preceding siblings ...)
  2024-03-21 21:31 ` oreo639
@ 2024-03-22  0:15 ` oreo639
  2024-03-22  0:48 ` oreo639
                   ` (33 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  0:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2265 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib (notably, g-ir-scanner has not, which is needed when compiling introspection in glib).
The GLib gir files have also been moved to being generated by glib instead of gobject-introspection. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 30914 bytes --]

From 92c05e74570d62b18f688bec6ae5bbeda41017f6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 21c4d04c7919e7ea5f1c6d25efe6b147dc50839e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..2950b3717e5691
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 0bf8668fd6531eb62732c18aaa4ed42741c550f7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  35 ++--
 5 files changed, 21 insertions(+), 266 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 9ca4502a01c4a7..1197ab8eb8d93d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..8be5f3dba206c5 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -44,7 +49,7 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
@@ -57,7 +62,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -76,11 +81,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From f0f795907278d7e61e1fb889983bda214d7abb59 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 6bc119290afbb3bca62ebccc319d2e5314157144 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (9 preceding siblings ...)
  2024-03-22  0:15 ` oreo639
@ 2024-03-22  0:48 ` oreo639
  2024-03-22  7:29 ` oreo639
                   ` (32 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  0:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2265 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib (notably, g-ir-scanner has not, which is needed when compiling introspection in glib).
The GLib gir files have also been moved to being generated by glib instead of gobject-introspection. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 30914 bytes --]

From 92c05e74570d62b18f688bec6ae5bbeda41017f6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 21c4d04c7919e7ea5f1c6d25efe6b147dc50839e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..2950b3717e5691
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 0bf8668fd6531eb62732c18aaa4ed42741c550f7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  35 ++--
 5 files changed, 21 insertions(+), 266 deletions(-)
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 9ca4502a01c4a7..1197ab8eb8d93d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..8be5f3dba206c5 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -44,7 +49,7 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
@@ -57,7 +62,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -76,11 +81,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From f0f795907278d7e61e1fb889983bda214d7abb59 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From ef3294a893a0b0fc71e696fd1c5082ff43145f36 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (10 preceding siblings ...)
  2024-03-22  0:48 ` oreo639
@ 2024-03-22  7:29 ` oreo639
  2024-03-22  7:58 ` oreo639
                   ` (31 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  7:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2265 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib (notably, g-ir-scanner has not, which is needed when compiling introspection in glib).
The GLib gir files have also been moved to being generated by glib instead of gobject-introspection. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 36743 bytes --]

From 92c05e74570d62b18f688bec6ae5bbeda41017f6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 21c4d04c7919e7ea5f1c6d25efe6b147dc50839e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..2950b3717e5691
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 9e948ecad7371832b880de54a38237fe6b375e84 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 .../glib/files/gi-compile-repository-wrapper  |  20 +++
 srcpkgs/glib/files/gi-qemuwrapper             |   9 +
 ...pository-directory-for-native-builds.patch |  76 +++++++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  43 +++--
 8 files changed, 134 insertions(+), 266 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-compile-repository-wrapper
 create mode 100755 srcpkgs/glib/files/gi-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0002-Relocate-the-repository-directory-for-native-builds.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 9ca4502a01c4a7..1197ab8eb8d93d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/files/gi-compile-repository-wrapper b/srcpkgs/glib/files/gi-compile-repository-wrapper
new file mode 100755
index 00000000000000..82403c7fc54f09
--- /dev/null
+++ b/srcpkgs/glib/files/gi-compile-repository-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/gi-compile-repository ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/gi-compile-repository
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/gi-compile-repository.wrapped
+	fi
+	exec /usr/bin/gi-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/gi-compile-repository.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-qemuwrapper b/srcpkgs/glib/files/gi-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/glib/files/gi-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/glib/patches/0002-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0002-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..f461ab0bb9f443
--- /dev/null
+++ b/srcpkgs/glib/patches/0002-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,76 @@
+From 7ea8c83d84a05f686128e652a5447fb5f6fb68be Mon Sep 17 00:00:00 2001
+From: Sascha Silbe <x-yo17@se-silbe.de>
+Date: Fri, 8 Jun 2018 13:55:10 +0200
+Subject: [PATCH] Relocate the repository directory for native builds
+
+Instead of hard-coding GOBJECT_INTROSPECTION_LIBDIR when
+gobject-introspection is built, use dladdr() to determine where
+GOBJECT_INTROSPECTION_LIBDIR is and use that path to calculate the
+repository directory.
+
+This fixes gobject-introspection-native accessing paths across build
+directories (e.g. if the build directories use the same shared state
+cache or sstate mirror).
+
+Upstream-Status: Inappropriate
+Signed-off-by: Sascha Silbe <x-yo17@se-silbe.de>
+
+---
+ girepository/girepository.c | 15 +++++++++++++--
+ girepository/meson.build    |  2 +-
+ 2 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/girepository/girepository.c b/girepository/girepository.c
+index c1fa3d3..efa557e 100644
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -21,6 +21,8 @@
+  * Boston, MA 02111-1307, USA.
+  */
+ 
++#define _GNU_SOURCE
++
+ #include "config.h"
+ 
+ #include <stdio.h>
+@@ -34,6 +36,8 @@
+ #include "gitypelib-internal.h"
+ #include "girepository-private.h"
+ 
++#include <dlfcn.h>
++
+ /**
+  * SECTION:girepository
+  * @short_description: GObject Introspection repository manager
+@@ -188,9 +192,16 @@ init_globals (void)
+           g_free (custom_dirs);
+         }
+ 
+-      libdir = GOBJECT_INTROSPECTION_LIBDIR;
++      Dl_info gi_lib_info;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (dladdr (gi_repository_new, &gi_lib_info)) {
++        char *libdir = g_path_get_dirname (gi_lib_info.dli_fname);
++        typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++        g_free (libdir);
++      } else {
++        libdir = GOBJECT_INTROSPECTION_LIBDIR;
++        typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      }
+ 
+       typelib_search_path = g_slist_prepend (typelib_search_path, typelib_dir);
+ 
+diff --git a/girepository/meson.build b/girepository/meson.build
+index 6a8c5b5..8892f2a 100644
+--- a/girepository/meson.build
++++ b/girepository/meson.build
+@@ -135,7 +135,7 @@ libgirepository_internals = static_libra
+   c_args: gir_c_args + custom_c_args,
+   gnu_symbol_visibility : 'hidden',
+   include_directories : [configinc, girepoinc],
+-  dependencies: [girepo_gthash_dep, libffi_dep],
++  dependencies: [girepo_gthash_dep, libffi_dep, cc.find_library('dl')],
+ )
+ 
+ libgirepository_internals_dep = declare_dependency(
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..cd4c7803aab605 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,13 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-qemuwrapper
+	mv ${DESTDIR}/usr/bin/gi-compile-repository{,.wrapped}
+	vbin ${FILESDIR}/gi-compile-repository-wrapper gi-compile-repository
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,7 +56,7 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
@@ -57,7 +69,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +81,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -76,11 +89,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From ee15ea2142d84b98a5bd0165942606374551d2b0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From d8f25f496df565855f8d197c9bd8700d0c447517 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (11 preceding siblings ...)
  2024-03-22  7:29 ` oreo639
@ 2024-03-22  7:58 ` oreo639
  2024-03-22  7:58 ` oreo639
                   ` (30 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  7:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2246 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014537106

Comment:
I ported over the gobject-introspection qemuwrapper and patches and tested it with:
```
diff --git a/common/build-helper/meson.sh b/common/build-helper/meson.sh
index 6232f9260c2..e4e7171f031 100644
--- a/common/build-helper/meson.sh
+++ b/common/build-helper/meson.sh
@@ -67,8 +67,8 @@ cat > "${XBPS_WRAPPERDIR}/meson/xbps_meson.cross" <<-EOF
        pkgconfig = '${PKG_CONFIG}'
        rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROS
S_BASE}/usr']
        g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
-       g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
-       g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
+       g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/gi-compile-repository'
+       g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/gi-decompile-typelib'
        llvm-config = '/usr/bin/llvm-config'
        cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
        
```

It seems to work, although looking through it, there are some things that can potentially be improved.

Currently we use fork of prelink-cross to get prelink-rtld to get the recursive dependencies from DT_NEEDED in an lld-like output. I'm not sure this is needed and it can probably be simplified by just using elfutils (which is already a dependency of glib) like what Debian does: https://salsa.debian.org/gnome-team/gobject-introspection/-/blob/debian/latest/debian/elf-get-needed.c (That needs testing though)

That method was also brought up upstream by the Debian maintainer: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/482

Another thing I noticed is that Debian wraps all of the g-ir-*/gi-* tools with qemu:
https://salsa.debian.org/gnome-team/glib/-/blob/debian/latest/debian/rules?ref_type=heads#L72-91

Not sure how necessary that is, but in meson we pass the raw unwrapped `g-ir-generate` (equivalent of `gi-decompile-typelib` in glib):
https://github.com/void-linux/void-packages/blob/master/common/build-helper/meson.sh#L71
There probably isn't much using it.

I'll worry about this more later.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (12 preceding siblings ...)
  2024-03-22  7:58 ` oreo639
@ 2024-03-22  7:58 ` oreo639
  2024-03-22  8:00 ` oreo639
                   ` (29 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  7:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2248 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014537106

Comment:
I ported over the gobject-introspection qemuwrapper and patches and tested it with:
```
diff --git a/common/build-helper/meson.sh b/common/build-helper/meson.sh
index 6232f9260c2..e4e7171f031 100644
--- a/common/build-helper/meson.sh
+++ b/common/build-helper/meson.sh
@@ -67,8 +67,8 @@ cat > "${XBPS_WRAPPERDIR}/meson/xbps_meson.cross" <<-EOF
        pkgconfig = '${PKG_CONFIG}'
        rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROS
S_BASE}/usr']
        g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
-       g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
-       g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
+       g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/gi-compile-repository'
+       g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/gi-decompile-typelib'
        llvm-config = '/usr/bin/llvm-config'
        cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
        
```

It seems to work, although looking through it, there are some things that can potentially be improved.

Currently we use a fork of prelink-cross to get prelink-rtld to get the recursive dependencies from DT_NEEDED in an lld-like output. I'm not sure this is needed and it can probably be simplified by just using elfutils (which is already a dependency of glib) like what Debian does: https://salsa.debian.org/gnome-team/gobject-introspection/-/blob/debian/latest/debian/elf-get-needed.c (That needs testing though)

That method was also brought up upstream by the Debian maintainer: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/482

Another thing I noticed is that Debian wraps all of the g-ir-*/gi-* tools with qemu:
https://salsa.debian.org/gnome-team/glib/-/blob/debian/latest/debian/rules?ref_type=heads#L72-91

Not sure how necessary that is, but in meson we pass the raw unwrapped `g-ir-generate` (equivalent of `gi-decompile-typelib` in glib):
https://github.com/void-linux/void-packages/blob/master/common/build-helper/meson.sh#L71
There probably isn't much using it.

I'll worry about this more later.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (13 preceding siblings ...)
  2024-03-22  7:58 ` oreo639
@ 2024-03-22  8:00 ` oreo639
  2024-03-22  8:03 ` oreo639
                   ` (28 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  8:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2323 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014537106

Comment:
I ported over the gobject-introspection qemuwrapper and patches and tested it with:
```
diff --git a/common/build-helper/meson.sh b/common/build-helper/meson.sh
index 6232f9260c2..e4e7171f031 100644
--- a/common/build-helper/meson.sh
+++ b/common/build-helper/meson.sh
@@ -67,8 +67,8 @@ cat > "${XBPS_WRAPPERDIR}/meson/xbps_meson.cross" <<-EOF
        pkgconfig = '${PKG_CONFIG}'
        rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROS
S_BASE}/usr']
        g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
-       g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
-       g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
+       g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/gi-compile-repository'
+       g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/gi-decompile-typelib'
        llvm-config = '/usr/bin/llvm-config'
        cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
        
```

It seems to work, although looking through it, there are some things that can potentially be improved.

Currently we use a fork of prelink-cross to get prelink-rtld to get the recursive dependencies from DT_NEEDED in an lld-like output. I'm not sure this is needed and it can probably be simplified by just using elfutils (which is already a dependency of glib) like what Debian does: https://salsa.debian.org/gnome-team/gobject-introspection/-/blob/debian/latest/debian/elf-get-needed.c (That needs testing though)

That method was also brought up upstream by the Debian maintainer: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/482

Another thing I noticed is that Debian wraps all of the g-ir-*/gi-* tools with qemu:
https://salsa.debian.org/gnome-team/glib/-/blob/debian/latest/debian/rules?ref_type=heads#L72-91

Not sure how necessary that is, but in meson we pass the raw unwrapped `g-ir-generate` (equivalent of `gi-decompile-typelib` in glib):
https://github.com/void-linux/void-packages/blob/master/common/build-helper/meson.sh#L71
I don't think that works unless `build_helper=qemu` is specified, although there probably isn't much using it.

I'll worry about this more later.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (14 preceding siblings ...)
  2024-03-22  8:00 ` oreo639
@ 2024-03-22  8:03 ` oreo639
  2024-03-22  8:19 ` oreo639
                   ` (27 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  8:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2327 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014537106

Comment:
I ported over the gobject-introspection qemuwrapper and patches and tested it with:
```
diff --git a/common/build-helper/meson.sh b/common/build-helper/meson.sh
index 6232f9260c2..e4e7171f031 100644
--- a/common/build-helper/meson.sh
+++ b/common/build-helper/meson.sh
@@ -67,8 +67,8 @@ cat > "${XBPS_WRAPPERDIR}/meson/xbps_meson.cross" <<-EOF
        pkgconfig = '${PKG_CONFIG}'
        rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROS
S_BASE}/usr']
        g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
-       g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
-       g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
+       g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/gi-compile-repository'
+       g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/gi-decompile-typelib'
        llvm-config = '/usr/bin/llvm-config'
        cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
        
```

It seems to work, although looking through it, there are some things that can potentially be improved.

Currently we use a fork of prelink-cross to get prelink-rtld to get the recursive dependencies from DT_NEEDED in an lld-like output. I'm not sure this is needed and it can probably be simplified by just using elfutils (which is already a dependency of glib) like what Debian does: https://salsa.debian.org/gnome-team/gobject-introspection/-/blob/debian/latest/debian/elf-get-needed.c (That needs testing though)

That method was also brought up upstream by the Debian maintainer: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/482

Another thing I noticed is that Debian wraps all of the `g-ir-*`/`gi-*` tools with qemu:
https://salsa.debian.org/gnome-team/glib/-/blob/debian/latest/debian/rules?ref_type=heads#L72-91

Not sure how necessary that is, but in meson we pass the raw unwrapped `g-ir-generate` (equivalent of `gi-decompile-typelib` in glib):
https://github.com/void-linux/void-packages/blob/master/common/build-helper/meson.sh#L71
I don't think that works unless `build_helper=qemu` is specified, although there probably isn't much using it.

I'll worry about this more later.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (15 preceding siblings ...)
  2024-03-22  8:03 ` oreo639
@ 2024-03-22  8:19 ` oreo639
  2024-03-22  8:20 ` oreo639
                   ` (26 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  8:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014589209

Comment:
The glib test failure is due to: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gobject-introspection/patches/0011-giscanner-ld-library-path.patch

Alternatively it can be adjusted to use an environment variable, idk.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (16 preceding siblings ...)
  2024-03-22  8:19 ` oreo639
@ 2024-03-22  8:20 ` oreo639
  2024-03-22  8:20 ` oreo639
                   ` (25 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  8:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014589209

Comment:
The glib test failure is due to: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gobject-introspection/patches/0011-giscanner-ld-library-path.patch

Alternatively it can be adjusted to use an environment variable, idk.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (17 preceding siblings ...)
  2024-03-22  8:20 ` oreo639
@ 2024-03-22  8:20 ` oreo639
  2024-03-22  8:20 ` oreo639
                   ` (24 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  8:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014591657

Comment:
The glib test failure is due to: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gobject-introspection/patches/0002-Relocate-the-repository-directory-for-native-builds.patch

Alternatively it can be adjusted to use an environment variable, idk.
(I linked the wrong patch last time)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (18 preceding siblings ...)
  2024-03-22  8:20 ` oreo639
@ 2024-03-22  8:20 ` oreo639
  2024-03-22  8:22 ` oreo639
                   ` (23 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  8:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014591657

Comment:
The glib test failure is due to: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gobject-introspection/patches/0002-Relocate-the-repository-directory-for-native-builds.patch

Alternatively it can be adjusted to use an environment variable, idk.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (19 preceding siblings ...)
  2024-03-22  8:20 ` oreo639
@ 2024-03-22  8:22 ` oreo639
  2024-03-22 23:13 ` [PR PATCH] [Updated] " oreo639
                   ` (22 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22  8:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2014591657

Comment:
The glib test failure is due to: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gobject-introspection/patches/0002-Relocate-the-repository-directory-for-native-builds.patch (which ofc returns the build directory when not installed)

Alternatively it can be adjusted to use an environment variable, idk.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (20 preceding siblings ...)
  2024-03-22  8:22 ` oreo639
@ 2024-03-22 23:13 ` oreo639
  2024-03-23  0:09 ` oreo639
                   ` (21 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-22 23:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 35612 bytes --]

From 92c05e74570d62b18f688bec6ae5bbeda41017f6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 21c4d04c7919e7ea5f1c6d25efe6b147dc50839e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..2950b3717e5691
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 73969fc64d75c4b0dfeb4af5a63c37638300c633 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  48 ++++--
 8 files changed, 98 insertions(+), 266 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 9ca4502a01c4a7..1197ab8eb8d93d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..a34b5e649afb66 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,7 +61,7 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
@@ -57,7 +74,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +86,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -76,11 +94,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 05ae5f42605b1c5892ee2646c89c913f3a14e4c3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 992cfe7fd2def884f82dfabbc5bc500d287f2e9b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (21 preceding siblings ...)
  2024-03-22 23:13 ` [PR PATCH] [Updated] " oreo639
@ 2024-03-23  0:09 ` oreo639
  2024-03-23  0:12 ` [PR PATCH] [Updated] " oreo639
                   ` (20 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-23  0:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2016203540

Comment:
Cross stuff should be done for glib, the gobject-introspection lldwrapper is a separate PR since it isn't a part of glib: https://github.com/void-linux/void-packages/pull/49468 

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (22 preceding siblings ...)
  2024-03-23  0:09 ` oreo639
@ 2024-03-23  0:12 ` oreo639
  2024-03-23  0:14 ` oreo639
                   ` (19 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-23  0:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 35985 bytes --]

From 92c05e74570d62b18f688bec6ae5bbeda41017f6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 21c4d04c7919e7ea5f1c6d25efe6b147dc50839e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 .../files/g-ir-compiler-wrapper               | 20 +++++
 .../files/g-ir-scanner-lddwrapper             |  2 +
 .../files/g-ir-scanner-qemuwrapper            |  9 +++
 .../files/g-ir-scanner-wrapper                | 18 +++++
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 7 files changed, 131 insertions(+)
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
 create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/g-ir-compiler ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/g-ir-compiler
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+	fi
+	exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			"$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# This prevents g-ir-scanner from writing cache data to $HOME
+	export GI_SCANNER_DISABLE_CACHE=1
+	# This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+	export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+	
+	exec /usr/bin/g-ir-scanner.wrapped \
+				 --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+				 --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+				 --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+				 "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+	
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..2950b3717e5691
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 6b01667b7ea8e6ade34e4ab14552a30c0444cf96 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  48 ++++--
 8 files changed, 98 insertions(+), 266 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 9ca4502a01c4a7..1197ab8eb8d93d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..a34b5e649afb66 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,7 +61,7 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
@@ -57,7 +74,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +86,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -76,11 +94,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From dbaba0a49a1b113b91f970f2ad58f487012247c6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 173b7d113efd970b5ac21335b57a3e966d0588ac Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (23 preceding siblings ...)
  2024-03-23  0:12 ` [PR PATCH] [Updated] " oreo639
@ 2024-03-23  0:14 ` oreo639
  2024-03-24  9:14 ` oreo639
                   ` (18 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-23  0:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 32387 bytes --]

From 92c05e74570d62b18f688bec6ae5bbeda41017f6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From e6436f41df9457f42d20a9bd228fe44e2fc2301f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..2950b3717e5691
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 96a8a500d8ad258fcdfb093324ca5c7808244208 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  48 ++++--
 8 files changed, 98 insertions(+), 266 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 9ca4502a01c4a7..1197ab8eb8d93d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.0 wt-4.10.0_1
 libwtdbo.so.4.10.0 wt-4.10.0_1
 libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..a34b5e649afb66 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,7 +61,7 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
@@ -57,7 +74,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +86,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -76,11 +94,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 4109e4d29e7378e77a7575354184d0ff4bab9a43 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 13 +++---
 2 files changed, 7 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 6f74cd4210c57eecabf610cd318fb6cdfe196fac Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (24 preceding siblings ...)
  2024-03-23  0:14 ` oreo639
@ 2024-03-24  9:14 ` oreo639
  2024-04-14  8:38 ` [PR PATCH] [Updated] " oreo639
                   ` (17 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-03-24  9:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2016203540

Comment:
Cross stuff should be done for glib, the gobject-introspection lddwrapper is a separate PR since it isn't a part of glib: https://github.com/void-linux/void-packages/pull/49468 

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (25 preceding siblings ...)
  2024-03-24  9:14 ` oreo639
@ 2024-04-14  8:38 ` oreo639
  2024-04-14 21:44 ` oreo639
                   ` (16 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-14  8:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 32647 bytes --]

From 43a3b4704ecc297afb4921733762714072b2c45c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From a9a863d3cf258c73f4507349073ee5549f9f9160 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From b3c5ec004cc1dd754eeb256b487c4dc04a410251 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   6 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  48 ++++--
 8 files changed, 103 insertions(+), 266 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 0a53717e57d2a0..3f19cf163b0e83 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -107,6 +107,12 @@ libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
 libwthttp.so.4.10.4 wt-4.10.4_1
 libwttest.so.4.10.4 wt-4.10.4_1
+libgrepository-2.0.so.0 glib-2.80.0_1
+libwt.so.4.10.0 wt-4.10.0_1
+libwtdbo.so.4.10.0 wt-4.10.0_1
+libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
+libwthttp.so.4.10.0 wt-4.10.0_1
+libwttest.so.4.10.0 wt-4.10.0_1
 libatk-1.0.so.0 atk-1.26.0_1
 libpangocairo-1.0.so.0 pango-1.24.0_1
 libpangoft2-1.0.so.0 pango-1.24.0_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..a34b5e649afb66 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,7 +61,7 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
@@ -57,7 +74,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +86,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -76,11 +94,11 @@ glib-devel_package() {
 		vmove usr/share/man/man1/gdbus-codegen.1
 		vmove usr/share/man/man1/glib-genmarshal.1
 		vmove usr/share/man/man1/gtester-report.1
-		for f in aclocal glib-2.0 gdb; do
+		for f in aclocal glib-2.0 gir-1.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 986b8dadac5f2c3b6f9d15b3dbe4b94c314e9d6a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 2a5e011c7b157b71a306479565c83760b7be7957 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (26 preceding siblings ...)
  2024-04-14  8:38 ` [PR PATCH] [Updated] " oreo639
@ 2024-04-14 21:44 ` oreo639
  2024-04-17  2:23 ` oreo639
                   ` (15 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-14 21:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 35580 bytes --]

From 43a3b4704ecc297afb4921733762714072b2c45c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From a9a863d3cf258c73f4507349073ee5549f9f9160 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 93f69977d45aba737583d748cece17f6d07b1a9c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   6 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 srcpkgs/glib/patches/gspawn-eperm.patch       |  62 +++++++
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  47 ++++--
 9 files changed, 165 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 create mode 100644 srcpkgs/glib/patches/gspawn-eperm.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 0a53717e57d2a0..3f19cf163b0e83 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -107,6 +107,12 @@ libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
 libwthttp.so.4.10.4 wt-4.10.4_1
 libwttest.so.4.10.4 wt-4.10.4_1
+libgrepository-2.0.so.0 glib-2.80.0_1
+libwt.so.4.10.0 wt-4.10.0_1
+libwtdbo.so.4.10.0 wt-4.10.0_1
+libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
+libwthttp.so.4.10.0 wt-4.10.0_1
+libwttest.so.4.10.0 wt-4.10.0_1
 libatk-1.0.so.0 atk-1.26.0_1
 libpangocairo-1.0.so.0 pango-1.24.0_1
 libpangoft2-1.0.so.0 pango-1.24.0_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gspawn-eperm.patch b/srcpkgs/glib/patches/gspawn-eperm.patch
new file mode 100644
index 00000000000000..0d240bb470c10e
--- /dev/null
+++ b/srcpkgs/glib/patches/gspawn-eperm.patch
@@ -0,0 +1,62 @@
+From 24de599887f641271ea279a0421776990075b714 Mon Sep 17 00:00:00 2001
+From: David King <amigadave@amigadave.com>
+Date: Tue, 12 Mar 2024 10:15:03 +0000
+Subject: [PATCH] gspawn: Additionally handle EPERM
+
+Handle old broken versions of Docker and libseccomp which do not
+recognise close_range().
+
+https://github.com/opencontainers/runc/issues/2151
+https://salsa.debian.org/debian/libseccomp/-/blob/debian/bullseye/debian/patches/syscalls_add_close_range_syscall.patch
+
+Based on a patch by Richard Hughes.
+---
+ glib/glib-unix.c | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/glib/glib-unix.c b/glib/glib-unix.c
+index 7cb76dd33..9b2dfe2d9 100644
+--- a/glib/glib-unix.c
++++ b/glib/glib-unix.c
+@@ -835,9 +835,18 @@ g_fdwalk_set_cloexec (int lowfd)
+    *
+    * Handle ENOSYS in case it’s supported in libc but not the kernel; if so,
+    * fall back to safe_fdwalk(). Handle EINVAL in case `CLOSE_RANGE_CLOEXEC`
+-   * is not supported. */
++   * is not supported.
++   *
++   * Also handle EPERM for the cases where GLi is running under broken versions
++   * of Docker+libseccomp which don't recognise `close_range()` so block calls
++   * to it under a default security policy which returns EPERM rather than (the
++   * correct) ENOSYS. This workaround should be carried in distributions until
++   * they have versions of libseccomp and Docker which contain:
++   *  - https://salsa.debian.org/debian/libseccomp/-/blob/debian/bullseye/debian/patches/syscalls_add_close_range_syscall.patch
++   *  - https://github.com/opencontainers/runc/issues/2151
++   */
+   ret = close_range (lowfd, G_MAXUINT, CLOSE_RANGE_CLOEXEC);
+-  if (ret == 0 || !(errno == ENOSYS || errno == EINVAL))
++  if (ret == 0 || !(errno == ENOSYS || errno == EINVAL || errno == EPERM))
+     return ret;
+ #endif  /* HAVE_CLOSE_RANGE */
+ 
+@@ -882,9 +891,15 @@ g_closefrom (int lowfd)
+    * situations: https://bugs.python.org/issue38061
+    *
+    * Handle ENOSYS in case it’s supported in libc but not the kernel; if so,
+-   * fall back to safe_fdwalk(). */
++   * fall back to safe_fdwalk().
++   *
++   * Also handle EPERM for the cases where GLib is running under broken versions
++   * of Docker+libseccomp which don’t recognise `close_range()` so block calls
++   * to it under a default security policy which returns EPERM rather than (the
++   * correct) ENOSYS.
++   */
+   ret = close_range (lowfd, G_MAXUINT, 0);
+-  if (ret == 0 || errno != ENOSYS)
++  if (ret == 0 || !(errno == ENOSYS || errno == EPERM))
+     return ret;
+ #endif  /* HAVE_CLOSE_RANGE */
+ 
+-- 
+2.44.0
+
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..a9723c23b568c2 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +61,12 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +75,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +87,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +98,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From a9ed2e04a0bdb04929bb7dcb0b80db78b2867961 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 3c783828f1f8eed9df89e497dd0d1d57d2b1948b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (27 preceding siblings ...)
  2024-04-14 21:44 ` oreo639
@ 2024-04-17  2:23 ` oreo639
  2024-04-17  2:32 ` oreo639
                   ` (14 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  2:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 38291 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3889730fef2f4f4fe0cc9673c57b0f86250818f5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From d438bf1e0f6a0d35a72711741e44b6b5799186a1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   6 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  47 ++++--
 10 files changed, 241 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..f1eb19260621f2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -107,6 +107,12 @@ libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
 libwthttp.so.4.10.4 wt-4.10.4_1
 libwttest.so.4.10.4 wt-4.10.4_1
+libgrepository-2.0.so.0 glib-2.80.0_1
+libwt.so.4.10.0 wt-4.10.0_1
+libwtdbo.so.4.10.0 wt-4.10.0_1
+libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
+libwthttp.so.4.10.0 wt-4.10.0_1
+libwttest.so.4.10.0 wt-4.10.0_1
 libatk-1.0.so.0 atk-1.26.0_1
 libpangocairo-1.0.so.0 pango-1.24.0_1
 libpangoft2-1.0.so.0 pango-1.24.0_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..a9723c23b568c2 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +61,12 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +75,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +87,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +98,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 2d8ec2992b3a5a3fca045f616a04fcf711406f3f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From a5cf6f2f26a86483d78c2b6f84a4664dc155f1b0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (28 preceding siblings ...)
  2024-04-17  2:23 ` oreo639
@ 2024-04-17  2:32 ` oreo639
  2024-04-17  2:37 ` oreo639
                   ` (13 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  2:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39947 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3889730fef2f4f4fe0cc9673c57b0f86250818f5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From f6ba5660c51689cb426a03523e52de379d7f2bb9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   6 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  47 ++++--
 11 files changed, 274 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..f1eb19260621f2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -107,6 +107,12 @@ libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
 libwthttp.so.4.10.4 wt-4.10.4_1
 libwttest.so.4.10.4 wt-4.10.4_1
+libgrepository-2.0.so.0 glib-2.80.0_1
+libwt.so.4.10.0 wt-4.10.0_1
+libwtdbo.so.4.10.0 wt-4.10.0_1
+libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
+libwthttp.so.4.10.0 wt-4.10.0_1
+libwttest.so.4.10.0 wt-4.10.0_1
 libatk-1.0.so.0 atk-1.26.0_1
 libpangocairo-1.0.so.0 pango-1.24.0_1
 libpangoft2-1.0.so.0 pango-1.24.0_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..a9723c23b568c2 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +61,12 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +75,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +87,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +98,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From c62bf02be9c326ef191e05f09459a92ee2cb5d71 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From e4b8ef0eed89eb7a6adae3439cd820e8c53e8343 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (29 preceding siblings ...)
  2024-04-17  2:32 ` oreo639
@ 2024-04-17  2:37 ` oreo639
  2024-04-17  2:40 ` [PR PATCH] [Updated] " oreo639
                   ` (12 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  2:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39899 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3889730fef2f4f4fe0cc9673c57b0f86250818f5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 1031dfdf867e23a9c740652de05781944af19b2c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   6 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  47 ++++--
 11 files changed, 274 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..f1eb19260621f2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -107,6 +107,12 @@ libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
 libwthttp.so.4.10.4 wt-4.10.4_1
 libwttest.so.4.10.4 wt-4.10.4_1
+libgrepository-2.0.so.0 glib-2.80.0_1
+libwt.so.4.10.0 wt-4.10.0_1
+libwtdbo.so.4.10.0 wt-4.10.0_1
+libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
+libwthttp.so.4.10.0 wt-4.10.0_1
+libwttest.so.4.10.0 wt-4.10.0_1
 libatk-1.0.so.0 atk-1.26.0_1
 libpangocairo-1.0.so.0 pango-1.24.0_1
 libpangoft2-1.0.so.0 pango-1.24.0_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..cebcf74deafa90 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +61,12 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +75,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +87,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +98,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From b0c9ae344daa4bf521307c294bcdbefb67976448 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 57a07243221d4b955237d341913c0e26335df45b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (30 preceding siblings ...)
  2024-04-17  2:37 ` oreo639
@ 2024-04-17  2:40 ` oreo639
  2024-04-17  2:44 ` oreo639
                   ` (11 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  2:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39722 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3889730fef2f4f4fe0cc9673c57b0f86250818f5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From aadfa4bbf7f8885109910942f881bb1943d63cce Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  47 ++++--
 11 files changed, 269 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..6313a4ed2795c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.4 wt-4.10.4_1
 libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..cebcf74deafa90 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +61,12 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +75,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +87,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +98,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 1e9503b5ff4be74d9efd983f89122c2cba14724c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 24c7f816290e9b426ac286eedb6c18fca329e40c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (31 preceding siblings ...)
  2024-04-17  2:40 ` [PR PATCH] [Updated] " oreo639
@ 2024-04-17  2:44 ` oreo639
  2024-04-17  2:46 ` oreo639
                   ` (10 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  2:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2060239705

Comment:
Should be basically done.
I removed `${makedepends}` from the depends of libglib-devel, not sure why it is there in the first place but glib shouldn't include other headers. This may break some stuff that expects those devel packages to get implicitly pulled in though. I'm going to test building some packages.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (32 preceding siblings ...)
  2024-04-17  2:44 ` oreo639
@ 2024-04-17  2:46 ` oreo639
  2024-04-17  2:53 ` [PR PATCH] [Updated] " oreo639
                   ` (9 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  2:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2060239705

Comment:
Should be basically done.
I removed `${makedepends}` from the depends of libglib-devel, not sure why it is there in the first place but glib shouldn't include other headers. This may break some stuff that expects those devel packages to get implicitly pulled in though. I'm going to test building some packages.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (33 preceding siblings ...)
  2024-04-17  2:46 ` oreo639
@ 2024-04-17  2:53 ` oreo639
  2024-04-17  2:53 ` oreo639
                   ` (8 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  2:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39770 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3889730fef2f4f4fe0cc9673c57b0f86250818f5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 6103a5e76c43b1edc591ef5e3e6da7b7aa77b3ce Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  47 ++++--
 11 files changed, 269 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..6313a4ed2795c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.4 wt-4.10.4_1
 libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..a9723c23b568c2 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +39,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +61,12 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +75,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +87,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +98,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 61b372041fb9444a22d172c9bd68a18f4abe1cbf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 5cf54e6df82eb55014cdf2cfb73c95c8c562b83b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (34 preceding siblings ...)
  2024-04-17  2:53 ` [PR PATCH] [Updated] " oreo639
@ 2024-04-17  2:53 ` oreo639
  2024-04-17  3:21 ` oreo639
                   ` (7 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  2:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2060251550

Comment:
Nvm, `${makedepends}` is needed for static linking.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (35 preceding siblings ...)
  2024-04-17  2:53 ` oreo639
@ 2024-04-17  3:21 ` oreo639
  2024-04-17  3:36 ` oreo639
                   ` (6 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  3:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2060251550

Comment:
Fore future reference `${makedepends}` is needed in the depends for glib-devel for static linking.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (36 preceding siblings ...)
  2024-04-17  3:21 ` oreo639
@ 2024-04-17  3:36 ` oreo639
  2024-04-17  3:47 ` [PR PATCH] [Updated] " oreo639
                   ` (5 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  3:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/49446#issuecomment-2060251550

Comment:
Fore future reference `${makedepends}` is needed in the depends for libglib-devel for static linking.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (37 preceding siblings ...)
  2024-04-17  3:36 ` oreo639
@ 2024-04-17  3:47 ` oreo639
  2024-04-17  3:49 ` oreo639
                   ` (4 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  3:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39854 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3889730fef2f4f4fe0cc9673c57b0f86250818f5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From eb273a60a3afc6fe53f7fa6d6c588e12d353a267 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  49 ++++--
 11 files changed, 271 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..6313a4ed2795c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.4 wt-4.10.4_1
 libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..ab1af7fb71897d 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,36 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+conflicts="gir-freedesktop<1.80.0_1"
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +40,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +62,13 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
+	conflicts="libgirepository-devel<1.80.0_1"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +77,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +89,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +100,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 9ff6ed58193e6519bc2ae16ac4c59951ca9ee42a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 4ad8855540be4176017165a8763a3aee0f74dba1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (38 preceding siblings ...)
  2024-04-17  3:47 ` [PR PATCH] [Updated] " oreo639
@ 2024-04-17  3:49 ` oreo639
  2024-04-17 23:36 ` oreo639
                   ` (3 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17  3:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39886 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From 3889730fef2f4f4fe0cc9673c57b0f86250818f5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..ca3b4c5987ecb9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From b11ce17786f0049470232bbc1b8dc4fe18873f3a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  49 ++++--
 11 files changed, 271 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..6313a4ed2795c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.4 wt-4.10.4_1
 libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..f7f4acbe63e7d1 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,36 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+conflicts="gir-freedesktop<1.80.0_1" # glib typelibs are now in glib
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +40,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +62,13 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
+	conflicts="libgirepository-devel<1.80.0_1"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +77,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +89,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +100,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 78068b70d0c889a8fece1e2684782893f7b1a72a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 14 +++---
 2 files changed, 8 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..a34e7b84d91d59 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
  python3-Markdown"
 depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From d574c47b1f6f952438a21e3624d2d752671d9e20 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (39 preceding siblings ...)
  2024-04-17  3:49 ` oreo639
@ 2024-04-17 23:36 ` oreo639
  2024-04-18  0:28 ` oreo639
                   ` (2 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-17 23:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39727 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From bda11cf40cf54c18b25874fa18740c52bf2abf67 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..8ca0cc1fcdf7ee
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 028700f0d14b64b35cd1d762a982330452ab9c5b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  49 ++++--
 11 files changed, 271 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..6313a4ed2795c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.4 wt-4.10.4_1
 libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..f7f4acbe63e7d1 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,36 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+conflicts="gir-freedesktop<1.80.0_1" # glib typelibs are now in glib
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +40,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +62,13 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
+	conflicts="libgirepository-devel<1.80.0_1"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +77,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +89,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +100,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 640acb455137a7aa7bd487affcca880f941b0ae8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 12 +++--
 2 files changed, 7 insertions(+), 51 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..60b4b05178e227 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,9 +1,10 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
 # won't run tests with cairo to avoid cyclical deps
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 83f9212f05aa56c39dd70e52b9d8cd10725ead67 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (40 preceding siblings ...)
  2024-04-17 23:36 ` oreo639
@ 2024-04-18  0:28 ` oreo639
  2024-04-18  3:02 ` oreo639
  2024-04-18  3:25 ` [PR PATCH] [Merged]: " oreo639
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-18  0:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39727 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From bda11cf40cf54c18b25874fa18740c52bf2abf67 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..8ca0cc1fcdf7ee
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 028700f0d14b64b35cd1d762a982330452ab9c5b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  20 +++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  49 ++++--
 11 files changed, 271 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..6313a4ed2795c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.4 wt-4.10.4_1
 libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..73f0cb0950506e
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for g-ir-compiler, which runs the target version of it through qemu.
+	# g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+	# is architecture dependent.
+	if [ -x build/tools/@TOOL@ ]; then
+		# We are compiling gobject-introspection.
+		# lets used the one we just compiled.
+		gir_bin=build/tools/@TOOL@
+	elif [ -x ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped ]; then
+		# Lets use the g-ir-compiler from the target
+		gir_bin=${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped
+	fi
+	exec /usr/bin/gi-xbps-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..f7f4acbe63e7d1 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,36 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+conflicts="gir-freedesktop<1.80.0_1" # glib typelibs are now in glib
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +40,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +62,13 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
+	conflicts="libgirepository-devel<1.80.0_1"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +77,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +89,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +100,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 640acb455137a7aa7bd487affcca880f941b0ae8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 12 +++--
 2 files changed, 7 insertions(+), 51 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..60b4b05178e227 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,9 +1,10 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
 # won't run tests with cairo to avoid cyclical deps
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From 6455c72c11b050dd0ef05a5788f1e3362af1f337 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (41 preceding siblings ...)
  2024-04-18  0:28 ` oreo639
@ 2024-04-18  3:02 ` oreo639
  2024-04-18  3:25 ` [PR PATCH] [Merged]: " oreo639
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-18  3:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446

glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 39451 bytes --]

From 865d8c074d35cd8b7ef68299f7a0d7b7640149fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/5] New package: glib-bootstrap-2.80.0

---
 srcpkgs/glib-bootstrap/patches  |  1 +
 srcpkgs/glib-bootstrap/template | 46 +++++++++++++++++++++++++++++++++
 srcpkgs/glib-bootstrap/update   |  2 ++
 3 files changed, 49 insertions(+)
 create mode 120000 srcpkgs/glib-bootstrap/patches
 create mode 100644 srcpkgs/glib-bootstrap/template
 create mode 100644 srcpkgs/glib-bootstrap/update

diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..8839d8b24c893b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,46 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+	# Timer test is flaky on 32 bit (does float comparisons)
+	if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+		vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+	fi
+}
+
+pre_check() {
+	# machine-id is a random, non-zero value
+	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+	rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"

From bda11cf40cf54c18b25874fa18740c52bf2abf67 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/5] New package: gobject-introspection-bootstrap-1.80.0

---
 srcpkgs/gobject-introspection-bootstrap/files |  1 +
 .../gobject-introspection-bootstrap/patches   |  1 +
 .../gobject-introspection-bootstrap/template  | 80 +++++++++++++++++++
 .../gobject-introspection-bootstrap/update    |  1 +
 4 files changed, 83 insertions(+)
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/files
 create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
 create mode 100644 srcpkgs/gobject-introspection-bootstrap/update

diff --git a/srcpkgs/gobject-introspection-bootstrap/files b/srcpkgs/gobject-introspection-bootstrap/files
new file mode 120000
index 00000000000000..4602177e31f6a7
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files
@@ -0,0 +1 @@
+../gobject-introspection/files
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..8ca0cc1fcdf7ee
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+#   libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.1
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository libgirepository-devel gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+	configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+	 -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+	 -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+	 -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+	# Install our wrappers system-wide, they are required for building all other
+	# gobject-based packages.
+	vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+	vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+	# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+	# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+	# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+	# find_program is also to blame.
+	mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+	vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+	# Same logic of g-ir-scanner applies here
+	mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+	vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+	# For cross builds copy the not installed tests subdirectory
+	if [ "$CROSS_BUILD" ]; then
+		vmkdir usr/share/gobject-introspection-1.0/tests
+		for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+			scanner/regress.? scanner/utility.? scanner/warnlib.? \
+			gimarshallingtests.? gitestmacros.h; do
+			vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+		done
+	fi
+
+	# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+	# meant to be called with 'pkg-config --variable'
+	vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+		 -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+		 -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+		 -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+		 -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+		 -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+		 -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+	# Fix the name of the python3 c bindings
+	mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+	   ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"

From 5a3e96b71dd06e412ade57ae7a5f11c3f376325d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/5] glib: update to 2.80.0.

This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
---
 common/shlibs                                 |   1 +
 srcpkgs/glib/files/gi-tool-emulator-wrapper   |  12 ++
 srcpkgs/glib/files/gi-xbps-qemuwrapper        |  10 ++
 ...pository-directory-for-native-builds.patch |  34 ++++
 ...12bb095382770f000055f63f82e2903f6b33.patch |  47 ++++++
 ...c379e85bacc89a7a8468f7e8447c8df15785.patch |  33 ++++
 .../glib/patches/disable-broken-tests.patch   |  67 --------
 ...ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch |  91 ++++++++++
 srcpkgs/glib/patches/fix-test-cxxcpp.patch    |  26 ---
 ...er-Fix-race-between-source-callbacks.patch | 158 ------------------
 srcpkgs/glib/template                         |  49 ++++--
 11 files changed, 263 insertions(+), 265 deletions(-)
 create mode 100755 srcpkgs/glib/files/gi-tool-emulator-wrapper
 create mode 100755 srcpkgs/glib/files/gi-xbps-qemuwrapper
 create mode 100644 srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
 create mode 100644 srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
 create mode 100644 srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
 delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
 create mode 100644 srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
 delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
 delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch

diff --git a/common/shlibs b/common/shlibs
index 60179b1306b770..6313a4ed2795c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
 libgmodule-2.0.so.0 glib-2.76.0_1
 libgio-2.0.so.0 glib-2.76.0_1
 libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
 libwt.so.4.10.4 wt-4.10.4_1
 libwtdbo.so.4.10.4 wt-4.10.4_1
 libwtdbosqlite3.so.4.10.4 wt-4.10.4_1
diff --git a/srcpkgs/glib/files/gi-tool-emulator-wrapper b/srcpkgs/glib/files/gi-tool-emulator-wrapper
new file mode 100755
index 00000000000000..acf9715bf9f814
--- /dev/null
+++ b/srcpkgs/glib/files/gi-tool-emulator-wrapper
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+	# wrapper for @TOOL@, which runs the target version of it through qemu.
+	# gi-compile-repository, for example, writes out the raw content of a C struct to disk,
+	# and therefore is architecture dependent.
+	exec /usr/bin/gi-xbps-qemuwrapper ${XBPS_CROSS_BASE}/usr/bin/@TOOL@.wrapped "$@"
+fi
+
+exec /usr/bin/@TOOL@.wrapped "$@"
diff --git a/srcpkgs/glib/files/gi-xbps-qemuwrapper b/srcpkgs/glib/files/gi-xbps-qemuwrapper
new file mode 100755
index 00000000000000..665eae0e9360cd
--- /dev/null
+++ b/srcpkgs/glib/files/gi-xbps-qemuwrapper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Ensure GIO_MODULE_DIR is not set so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+			-L ${XBPS_CROSS_BASE} \
+			-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+			-E GI_TYPELIB_SYSROOT="${XBPS_CROSS_BASE}" \
+			-U GIO_MODULE_DIR \
+			"$@"
diff --git a/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
new file mode 100644
index 00000000000000..66bf4240e7c64a
--- /dev/null
+++ b/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,34 @@
+Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
+
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
+       const char *libdir;
+       char *typelib_dir;
+       const char *type_lib_path_env;
++      const char *type_lib_sysroot_env;
+ 
+       /* This variable is intended to take precedence over both:
+        *   - the default search path;
+@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
+        */
+       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ 
++      /* Void Linux addition for cross compiling, since we use cross sysroots */
++      type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
++
+       if (type_lib_path_env)
+         {
+           char **custom_dirs;
+@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
+ 
+       libdir = GOBJECT_INTROSPECTION_LIBDIR;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (type_lib_sysroot_env)
++          typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
++      else
++          typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ 
+       g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
+     }
diff --git a/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
new file mode 100644
index 00000000000000..615f9681e428fb
--- /dev/null
+++ b/srcpkgs/glib/patches/014f12bb095382770f000055f63f82e2903f6b33.patch
@@ -0,0 +1,47 @@
+From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 23 Mar 2024 20:51:52 +0100
+Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
+
+This fixes an issue with the number getting very big due to
+CPU_ISSET not returning exactly 0 or 1.
+
+This also fixes scenarios where there are holes in the CPU
+set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
+the old code would return 2 instead of 3, due to iterating
+until `ncores` (which is 3) and therefore not accounting for
+CPUs further in the set.
+
+Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
+
+
+(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
+---
+ glib/gthread.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/glib/gthread.c b/glib/gthread.c
+index b39acc475c..a264353ecb 100644
+--- a/glib/gthread.c
++++ b/glib/gthread.c
+@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
+     return count;
+ #elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+   {
+-    int idx;
+     int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+     cpu_set_t cpu_mask;
+     CPU_ZERO (&cpu_mask);
+@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
+     int af_count = 0;
+     int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
+     if (!err)
+-      for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
+-        af_count += CPU_ISSET (idx, &cpu_mask);
++      af_count = CPU_COUNT (&cpu_mask);
+ 
+     int count = (af_count > 0) ? af_count : ncores;
+     return count;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
new file mode 100644
index 00000000000000..1de85c881c57c0
--- /dev/null
+++ b/srcpkgs/glib/patches/d2a6c379e85bacc89a7a8468f7e8447c8df15785.patch
@@ -0,0 +1,33 @@
+From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:49:47 +0000
+Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
+
+We don't actually need to use the results of configure-time checks here:
+sizeof is a perfectly reasonable integer constant expression, so we can
+use that directly.
+
+Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index 647cf2498d..b5d8fc7108 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gulong",   SIZEOF_LONG,      0 },
+   { "gssize",   GLIB_SIZEOF_SIZE_T,    1 },
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+-  { "gintptr",  GLIB_SIZEOF_SIZE_T,    1 },
+-  { "guintptr", GLIB_SIZEOF_SIZE_T,    0 },
++  { "gintptr",  sizeof (gintptr),      1 },
++  { "guintptr", sizeof (guintptr),     0 },
+ };
+ 
+ typedef struct {
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
-     'can_fail' : host_system == 'darwin',
-   },
--  'converter-stream' : {},
-   'credentials' : {},
-   'data-input-stream' : {},
-   'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- #  Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
-   gio_tests += {
--    'file' : {},
-     'gdbus-peer-object-manager' : {},
-     'gdbus-sasl' : {},
-     'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
-       test_resources_binary2,
-     ]
-   endif
--
--  gio_tests += {
--    'resources' : {
--      'extra_sources' : resources_extra_sources,
--      'depends' : resource_plugin,
--    },
--  }
- endif
- 
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
-   'cache' : {},
-   'charset' : {},
-   'checksum' : {},
--  'collate' : {},
-   'completion' : {},
-   'cond' : {},
--  'convert' : {},
-   'dataset' : {},
--  'date' : {
--    # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
--    'can_fail' : host_system == 'darwin',
--  },
-   'dir' : {},
-   'environment' : {
-     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-     'can_fail' : host_system == 'darwin',
-   },
--  'error' : {},
--  'fileutils' : {},
-   'gdatetime' : {
-     'suite' : ['slow'],
-     'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
-   'node' : {},
-   'once' : {},
-   'onceinit' : {},
--  'option-context' : {},
-   'option-argv0' : {},
-   'overflow' : {},
-   'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
new file mode 100644
index 00000000000000..59e3904ed27520
--- /dev/null
+++ b/srcpkgs/glib/patches/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1.patch
@@ -0,0 +1,91 @@
+From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 15 Mar 2024 13:56:20 +0000
+Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
+
+g-ir-scanner currently maps these to lower-level types at scan time by
+assuming that time_t is an alias for long, off_t is an alias for size_t
+and so on. This is not always accurate: some ILP32 architectures have
+64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
+support), and that mismatch is tracked as GNOME/gobject-introspection#494.
+
+One option for resolving this g-ir-scanner bug is to have it pass these
+types through to the GIR XML, and teach g-ir-compiler and its replacement
+gi-compile-repository to convert them to the corresponding concrete
+type tag, as they already do for abstract types such as `long long` and
+`size_t`.
+
+Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
+
+Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/girepository/girparser.c b/girepository/girparser.c
+index b5d8fc7108..9667900826 100644
+--- a/girepository/girparser.c
++++ b/girepository/girparser.c
+@@ -32,6 +32,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <time.h>       /* For time_t */
++#include <sys/types.h>  /* For off_t on both Unix and Windows */
++
++#ifdef G_OS_UNIX
++#include <sys/socket.h> /* For socklen_t */
++#endif
+ 
+ /* This is a "major" version in the sense that it's only bumped
+  * for incompatible changes.
+@@ -448,6 +454,19 @@ typedef struct {
+   unsigned int is_signed : 1;
+ } IntegerAliasInfo;
+ 
++/* Ignore warnings from use of signedness() */
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wtype-limits"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wtype-limits"
++#endif
++
++#define signedness(T) (((T) -1) < 0)
++G_STATIC_ASSERT (signedness (int) == 1);
++G_STATIC_ASSERT (signedness (unsigned int) == 0);
++
+ static IntegerAliasInfo integer_aliases[] = {
+   { "gchar",    SIZEOF_CHAR,      1 },
+   { "guchar",   SIZEOF_CHAR,      0 },
+@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
+   { "gsize",    GLIB_SIZEOF_SIZE_T,    0 },
+   { "gintptr",  sizeof (gintptr),      1 },
+   { "guintptr", sizeof (guintptr),     0 },
++#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
++  INTEGER_ALIAS (off_t),
++  INTEGER_ALIAS (time_t),
++#ifdef G_OS_UNIX
++  INTEGER_ALIAS (dev_t),
++  INTEGER_ALIAS (gid_t),
++  INTEGER_ALIAS (pid_t),
++  INTEGER_ALIAS (socklen_t),
++  INTEGER_ALIAS (uid_t),
++#endif
++#undef INTEGER_ALIAS
+ };
+ 
++#if G_GNUC_CHECK_VERSION(4, 6)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ typedef struct {
+   const char *str;
+   int tag;
+-- 
+GitLab
+
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
--  g_test_init (&argc, &argv, NULL);
-+  g_test_init (&argc, &argv, nullptr);
- #else
-   g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver     *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
-   g_clear_pointer (&data->timeout_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
-                              _("Socket I/O timed out"));
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
-  * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
-               gpointer      user_data)
- {
--  GTask *task = G_TASK (user_data);
--  LookupData *data = g_task_get_task_data (task);
-+  GWeakRef *weak_task = user_data;
-+  GTask *task = NULL;  /* (owned) */
-+  LookupData *data;
-   gboolean should_return;
- 
-+  task = g_weak_ref_get (weak_task);
-+  if (task == NULL)
-+    return G_SOURCE_REMOVE;
-+
-+  data = g_task_get_task_data (task);
-+
-   g_mutex_lock (&data->lock);
- 
-   g_assert (g_cancellable_is_cancelled (cancellable));
-   should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
-   g_clear_pointer (&data->cancellable_source, g_source_unref);
- 
-   g_mutex_unlock (&data->lock);
- 
-   if (should_return)
-     g_task_return_error_if_cancelled (task);
- 
-   /* Signal completion of the task. */
-   g_mutex_lock (&data->lock);
-   data->has_returned = TRUE;
-   g_cond_broadcast (&data->cond);
-   g_mutex_unlock (&data->lock);
- 
-+  g_object_unref (task);
-+
-   return G_SOURCE_REMOVE;
- }
- 
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+  g_weak_ref_clear (weak_ref);
-+  g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
-                                GTask             *task)
- {
-   LookupData *data = g_task_get_task_data (task);
-   guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
-   GCancellable *cancellable = g_task_get_cancellable (task);
- 
-   g_mutex_lock (&data->lock);
- 
-   g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
- 
-   if (timeout_ms != 0)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->timeout_source = g_timeout_source_new (timeout_ms);
-       g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
--      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+      g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
-   if (cancellable != NULL)
-     {
-+      GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+      g_weak_ref_set (weak_task, task);
-+
-       data->cancellable_source = g_cancellable_source_new (cancellable);
-       g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
--      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+      g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
-       g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-     }
- 
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..f7f4acbe63e7d1 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,36 @@
 # Template file for 'glib'
+# keep in sync with glib-bootstrap
 pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
 build_style=meson
+build_helper=qemu
 # static version is necessary for qemu-user-static;
 # also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
 makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
 checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
 short_desc="GNU library of C routines"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
 changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
 distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+conflicts="gir-freedesktop<1.80.0_1" # glib typelibs are now in glib
 make_check_pre="dbus-run-session"
 
 build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
 
-if [ -z "$CROSS_BUILD" ]; then
-	build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" prelink-cross"
+	makedepends+=" gobject-introspection-bootstrap"
 fi
 
 post_patch() {
@@ -34,6 +40,18 @@ post_patch() {
 	fi
 }
 
+post_install() {
+	# Install introspection wrappers for cross compiling
+	vbin ${FILESDIR}/gi-xbps-qemuwrapper
+
+	# Install emulator wrappers for tools that require it
+	for tool in gi-compile-repository gi-decompile-typelib gi-inspect-typelib; do
+		mv ${DESTDIR}/usr/bin/${tool}{,.wrapped}
+		sed -e "s|@TOOL@|${tool}|" ${FILESDIR}/gi-tool-emulator-wrapper > gi-tool-emulator-wrapper
+		vbin gi-tool-emulator-wrapper ${tool}
+	done
+}
+
 pre_check() {
 	# machine-id is a random, non-zero value
 	echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
@@ -44,11 +62,13 @@ post_check() {
 }
 
 libglib-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	depends="${makedepends/gobject-introspection-bootstrap/} ${sourcepkg}>=${version}_${revision}"
+	conflicts="libgirepository-devel<1.80.0_1"
 	short_desc+=" - development files"
 	lib32files="/usr/lib/glib-2.0/include/glibconfig.h"
 	pkg_install() {
 		vmove usr/include
+		vmove usr/share/gir-1.0
 		vmove usr/lib/glib-2.0
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
@@ -57,7 +77,7 @@ libglib-devel_package() {
 }
 
 glib-devel_package() {
-	depends="python3-setuptools libglib-devel>=${version}_${revision}"
+	depends="python3-packaging libglib-devel>=${version}_${revision}"
 	short_desc+=" - development files"
 	python_version=3
 	pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
@@ -69,6 +89,7 @@ glib-devel_package() {
 		vmove usr/bin/gdbus-codegen
 		vmove usr/bin/gtester
 		vmove usr/bin/glib-gettextize
+		vmove "usr/bin/gi-*"
 		vmove usr/share/man/man1/glib-compile-resources.1
 		vmove usr/share/man/man1/glib-gettextize.1
 		vmove usr/share/man/man1/gtester.1
@@ -79,8 +100,8 @@ glib-devel_package() {
 		for f in aclocal glib-2.0 gdb; do
 			vmove usr/share/${f}
 		done
-		if [ -d $DESTDIR/usr/share/gtk-doc ]; then
-			vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/doc
 		fi
 	}
 }

From 49272121757c445ccb9a1609050652e1ad7f28c4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/5] gobject-introspection: update to 1.80.0.

---
 .../patches/fix-leaks.patch                   | 46 -------------------
 srcpkgs/gobject-introspection/template        | 12 +++--
 2 files changed, 7 insertions(+), 51 deletions(-)
 delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch

diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
-   if (output == NULL)
-     {
-       g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+      g_object_unref (input);
-       return FALSE;
-     }
- 
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
-       ioerror = NULL;
-     else
-       ioerror = error;
--    if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
--      return FALSE;
--    if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
--      return FALSE;
-+    caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+    caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
-   }
- 
-+  g_object_unref (in);
-+  g_object_unref (output);
-+
-   return !caught_error;
- }
--- 
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..60b4b05178e227 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,9 +1,10 @@
 # Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
 pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.1
+revision=1
 build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
 hostmakedepends="flex pkg-config"
 # won't run tests with cairo to avoid cyclical deps
 makedepends="libffi-devel libglib-devel python3-devel python3-Mako
@@ -13,8 +14,9 @@ short_desc="Introspection system for GObject-based libraries"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+changelog="https://gitlab.gnome.org/GNOME/gobject-introspection/-/raw/main/NEWS"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=a1df7c424e15bda1ab639c00e9051b9adf5cea1a9e512f8a603b53cd199bc6d8
 python_version=3
 
 if [ "$CROSS_BUILD" ]; then

From a245689b12fdcf365316a4aa0f171ce4ff0645dc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/5] glib-networking: update to 2.80.0.

---
 srcpkgs/glib-networking/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
 # Template file for 'glib-networking'
 pkgname=glib-networking
-version=2.76.0
+version=2.80.0
 revision=1
 build_style=meson
 configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
 changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Merged]: glib: update to 2.80.0.
  2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
                   ` (42 preceding siblings ...)
  2024-04-18  3:02 ` oreo639
@ 2024-04-18  3:25 ` oreo639
  43 siblings, 0 replies; 45+ messages in thread
From: oreo639 @ 2024-04-18  3:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2243 bytes --]

There's a merged pull request on the void-packages repository

glib: update to 2.80.0.
https://github.com/void-linux/void-packages/pull/49446

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.

Currently only the C components have been moved over to glib. (Notably, g-ir-scanner is missing, which is needed to compile glib's introspection data. An explanation for why along with the proposed remedies can be found in "The hard part" section of the glib issue below.)
The GLib gir files have also been moved to being generated by glib build instead of gobject-introspection build. (hence why gobject-introspection is necessary)

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html

The bootstrap process, while not intentionally, mirrors the one used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2024-04-18  3:25 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21 20:10 [PR PATCH] glib: update to 2.80.0 oreo639
2024-03-21 20:22 ` [PR PATCH] [Updated] [WIP] " oreo639
2024-03-21 20:23 ` oreo639
2024-03-21 20:50 ` oreo639
2024-03-21 21:04 ` oreo639
2024-03-21 21:08 ` chrysos349
2024-03-21 21:16 ` oreo639
2024-03-21 21:18 ` oreo639
2024-03-21 21:24 ` [PR PATCH] [Updated] " oreo639
2024-03-21 21:31 ` oreo639
2024-03-22  0:15 ` oreo639
2024-03-22  0:48 ` oreo639
2024-03-22  7:29 ` oreo639
2024-03-22  7:58 ` oreo639
2024-03-22  7:58 ` oreo639
2024-03-22  8:00 ` oreo639
2024-03-22  8:03 ` oreo639
2024-03-22  8:19 ` oreo639
2024-03-22  8:20 ` oreo639
2024-03-22  8:20 ` oreo639
2024-03-22  8:20 ` oreo639
2024-03-22  8:22 ` oreo639
2024-03-22 23:13 ` [PR PATCH] [Updated] " oreo639
2024-03-23  0:09 ` oreo639
2024-03-23  0:12 ` [PR PATCH] [Updated] " oreo639
2024-03-23  0:14 ` oreo639
2024-03-24  9:14 ` oreo639
2024-04-14  8:38 ` [PR PATCH] [Updated] " oreo639
2024-04-14 21:44 ` oreo639
2024-04-17  2:23 ` oreo639
2024-04-17  2:32 ` oreo639
2024-04-17  2:37 ` oreo639
2024-04-17  2:40 ` [PR PATCH] [Updated] " oreo639
2024-04-17  2:44 ` oreo639
2024-04-17  2:46 ` oreo639
2024-04-17  2:53 ` [PR PATCH] [Updated] " oreo639
2024-04-17  2:53 ` oreo639
2024-04-17  3:21 ` oreo639
2024-04-17  3:36 ` oreo639
2024-04-17  3:47 ` [PR PATCH] [Updated] " oreo639
2024-04-17  3:49 ` oreo639
2024-04-17 23:36 ` oreo639
2024-04-18  0:28 ` oreo639
2024-04-18  3:02 ` oreo639
2024-04-18  3:25 ` [PR PATCH] [Merged]: " oreo639

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).