commit:     6f5d2a3b45758430f482a0d9346f24b1b8615fd3
Author:     Dave Hughes <davidhughes205 <AT> gmail <DOT> com>
AuthorDate: Sat Mar 13 13:43:15 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 13 21:02:39 2021 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=6f5d2a3b

dev-libs/glib: sync with ::gentoo

Package-Manager: Portage-3.0.17, Repoman-3.0.2
RepoMan-Options: --force
Manifest-Sign-Key: 0xA1919C830E9498E0
Signed-off-by: Dave Hughes <davidhughes205 <AT> gmail.com>
Closes: https://github.com/gentoo/musl/pull/411
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/glib/Manifest                             |  22 ++
 ...rk-fix-initialization-with-c-constructors.patch |  47 ++++
 ...-2.64.1-mark-gdbus-server-auth-test-flaky.patch |  32 +++
 dev-libs/glib/glib-2.66.7.ebuild                   | 291 +++++++++++++++++++++
 dev-libs/glib/metadata.xml                         |  35 +++
 5 files changed, 427 insertions(+)

diff --git a/dev-libs/glib/Manifest b/dev-libs/glib/Manifest
new file mode 100644
index 0000000..0664249
--- /dev/null
+++ b/dev-libs/glib/Manifest
@@ -0,0 +1,22 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST glib-2.66.7.tar.xz 4844892 BLAKE2B 
2d128e8c933a8c5bd27734e96e50244f27c29199823e2185e8cfa5b4bbc0ca23f761c9de275c9941672eb945e302178b3cb4b5bd577f375ad953a97dddc70e34
 SHA512 
f6e6cc0fe2ab4a31a623bf9a1e63f833783e044e7ed55b66a84fc0cbf1410eec233fe0e226abb20aac0e40167a9624bf5e65197f9eed879da1293af44408d530
+-----BEGIN PGP SIGNATURE-----
+
+iQKTBAEBCAB9FiEEZdLCSnfk9z83VSkfsaMsEcx8U7oFAmBMwW5fFIAAAAAALgAo
+aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1
+RDJDMjRBNzdFNEY3M0YzNzU1MjkxRkIxQTMyQzExQ0M3QzUzQkEACgkQsaMsEcx8
+U7pEjw/+L645KnrLqEuLlzul0VSZ1rpsjPhZLYXIGHCDc1VwLvsv7cOnZtuRdVOX
+hoivQOP9S59vqtBv9rGSs3BpY1CnlDmiWgBhMShDRvg6wTvecExG+v+2zE70sOsq
+EnPpp21/nn2uM77SHB1jHI/MI3mB1h9EuIdYEJJ+c3hdSivi0+lGM8QHdfhS9GT4
+UZ5TLlnVLFHQ4uZwxbG2DHSpJTfhOIAmtqPX+Lx2i3GZyghZegs7juRwYi4Y24JD
+X5rknPWVrQ/7IKyTMO8LOoCvwlqFZH/xGCT3aCuII1QEu+DjWSd6srelj9rrhaBB
+WmGsFISoH37xk8R1fMcxU1HNGFA/0yNVnfJpzzr6dcE6H9fHmw7+erKbM3hdXTqh
+6Xi0sEaCKxcQOzs51OGF4Uvw3wPs9DOmPc14IjQlRuoToVsv4RG+aECLtB+wndS0
+B+01Af0kF/RQcsxOs4HN9KHh/LJg/ePpE7h0vRWQcR0IeKwn88WvN0Oh9EaF8CxV
+8ZHHvV8CkigSs6mRsDt56oxfKhivAy6jBH9l9j74smRAMD+yGqqJSMMJx5PssI5I
+Nus0Xfnjj/WiCf++/jRj+sAgcnBpcrBSiZ5Nw/81Rc+Pq4jM8PevZMxi+Iw8eH8x
+ESM6myTj32SYaJ47EJ6+W6RfmjenlLpgREb055FQsl2cBKgZdrI=
+=De5Y
+-----END PGP SIGNATURE-----

diff --git 
a/dev-libs/glib/files/0001-gquark-fix-initialization-with-c-constructors.patch 
b/dev-libs/glib/files/0001-gquark-fix-initialization-with-c-constructors.patch
new file mode 100644
index 0000000..50a9a8c
--- /dev/null
+++ 
b/dev-libs/glib/files/0001-gquark-fix-initialization-with-c-constructors.patch
@@ -0,0 +1,47 @@
+From e4216dee57f5156e192b2910f13eb855a104cb18 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <[email protected]>
+Date: Wed, 6 Jul 2016 12:38:40 +0200
+Subject: [PATCH] gquark: fix initialization with c++ constructors
+
+C++ constructors may want create new quarks, but we can not guarantee
+that the glib library ctor is executed first. Therefore we make sure
+that quarks are always initialized from g_quark_from_string and
+g_quark_from_static_string
+
+This fixes crashes in glibmm with musl which likely happens on AIX too.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=768215
+https://bugzilla.gnome.org/show_bug.cgi?id=756139#c14
+---
+ glib/gquark.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/glib/gquark.c b/glib/gquark.c
+index 9e51a92..17ecd7f 100644
+--- a/glib/gquark.c
++++ b/glib/gquark.c
+@@ -57,6 +57,11 @@ static gint           quark_block_offset = 0;
+ void
+ g_quark_init (void)
+ {
++  /* we may be initialized from c++ constructor or the glib ctor, but we
++  cannot guarantee in what order. So we check if we have been initialized */
++  if (quark_ht != NULL)
++    return;
++
+   g_assert (quark_seq_id == 0);
+   quark_ht = g_hash_table_new (g_str_hash, g_str_equal);
+   quarks = g_new (gchar*, QUARK_BLOCK_SIZE);
+@@ -179,6 +184,9 @@ quark_from_string (const gchar *string,
+ {
+   GQuark quark = 0;
+ 
++  if (G_UNLIKELY (quark_ht == NULL))
++    g_quark_init();
++
+   quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string));
+ 
+   if (!quark)
+-- 
+2.9.0
+

diff --git 
a/dev-libs/glib/files/glib-2.64.1-mark-gdbus-server-auth-test-flaky.patch 
b/dev-libs/glib/files/glib-2.64.1-mark-gdbus-server-auth-test-flaky.patch
new file mode 100644
index 0000000..d1a41ec
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.64.1-mark-gdbus-server-auth-test-flaky.patch
@@ -0,0 +1,32 @@
+From 95b22035f6151ab465c37fe5e3e340713cb74e23 Mon Sep 17 00:00:00 2001
+From: Matt Turner <[email protected]>
+Date: Tue, 24 Mar 2020 18:44:54 -0700
+Subject: [PATCH] Mark gdbus-server-auth test flaky
+
+See https://gitlab.gnome.org/GNOME/glib/-/issues/1954
+---
+ gio/tests/meson.build | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gio/tests/meson.build b/gio/tests/meson.build
+index 788cf978b..7f45d0191 100644
+--- a/gio/tests/meson.build
++++ b/gio/tests/meson.build
+@@ -122,12 +122,13 @@ if dbus1_dep.found()
+     },
+     'gdbus-server-auth' : {
+       'dependencies' : [dbus1_dep],
++      'suite' : ['flaky'],
+     },
+   }
+ else
+   # We can build a cut-down version of this test without libdbus
+   gio_tests += {
+-    'gdbus-server-auth' : {},
++    'gdbus-server-auth' : {'suite' : ['flaky']},
+   }
+ endif
+ 
+-- 
+2.24.1
+

diff --git a/dev-libs/glib/glib-2.66.7.ebuild b/dev-libs/glib/glib-2.66.7.ebuild
new file mode 100644
index 0000000..20a8f7f
--- /dev/null
+++ b/dev-libs/glib/glib-2.66.7.ebuild
@@ -0,0 +1,291 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{7,8,9} )
+
+inherit flag-o-matic gnome.org gnome2-utils linux-info meson multilib 
multilib-minimal python-any-r1 toolchain-funcs xdg
+
+DESCRIPTION="The GLib library of C routines"
+HOMEPAGE="https://www.gtk.org/";
+
+LICENSE="LGPL-2.1+"
+SLOT="2"
+IUSE="dbus debug elibc_glibc fam gtk-doc kernel_linux +mime selinux 
static-libs sysprof systemtap test utils xattr"
+RESTRICT="!test? ( test )"
+
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 
sparc x86 ~amd64-linux ~x86-linux"
+
+# * libelf isn't strictly necessary, but makes gresource tool more useful, and
+# the check is automagic in gio/meson.build. gresource is not a multilib tool
+# right now, thus it doesn't matter if non-native ABI libelf exists or not
+# (non-native binary is overwritten, it doesn't matter if libelf was linked 
to).
+# * elfutils (via libelf) does not build on Windows. gresources are not 
embedded
+# within ELF binaries on that platform anyway and inspecting ELF binaries from
+# other platforms is not that useful so exclude the dependency in this case.
+# * Technically static-libs is needed on zlib, util-linux and perhaps more, but
+# these are used by GIO, which glib[static-libs] consumers don't really seem
+# to need at all, thus not imposing the deps for now and once some consumers
+# are actually found to static link libgio-2.0.a, we can revisit and either add
+# them or just put the (build) deps in that rare consumer instead of recursive
+# RDEPEND here (due to lack of recursive DEPEND).
+RDEPEND="
+       !<dev-util/gdbus-codegen-${PV}
+       >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
+       >=dev-libs/libpcre-8.31:3[${MULTILIB_USEDEP},static-libs?]
+       >=dev-libs/libffi-3.0.13-r1:=[${MULTILIB_USEDEP}]
+       >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+       >=virtual/libintl-0-r2[${MULTILIB_USEDEP}]
+       kernel_linux? ( >=sys-apps/util-linux-2.23[${MULTILIB_USEDEP}] )
+       selinux? ( >=sys-libs/libselinux-2.2.2-r5[${MULTILIB_USEDEP}] )
+       xattr? ( !elibc_glibc? ( >=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}] 
) )
+       !kernel_Winnt? ( virtual/libelf:0= )
+       fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] )
+       sysprof? ( >=dev-util/sysprof-capture-3.38:4[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}"
+# libxml2 used for optional tests that get automatically skipped
+BDEPEND="
+       app-text/docbook-xsl-stylesheets
+       dev-libs/libxslt
+       >=sys-devel/gettext-0.19.8
+       gtk-doc? ( >=dev-util/gtk-doc-1.33
+               app-text/docbook-xml-dtd:4.2
+               app-text/docbook-xml-dtd:4.5 )
+       systemtap? ( >=dev-util/systemtap-1.3 )
+       ${PYTHON_DEPS}
+       test? ( >=sys-apps/dbus-1.2.14 )
+       virtual/pkgconfig
+"
+# TODO: >=dev-util/gdbus-codegen-${PV} test dep once we modify 
gio/tests/meson.build to use external gdbus-codegen
+
+PDEPEND="
+       dbus? ( gnome-base/dconf )
+       mime? ( x11-misc/shared-mime-info )
+"
+# shared-mime-info needed for gio/xdgmime, bug #409481
+# dconf is needed to be able to save settings, bug #498436
+
+MULTILIB_CHOST_TOOLS=(
+       /usr/bin/gio-querymodules$(get_exeext)
+)
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.64.1-mark-gdbus-server-auth-test-flaky.patch
+       "${FILESDIR}"/0001-gquark-fix-initialization-with-c-constructors.patch
+)
+
+pkg_setup() {
+       if use kernel_linux ; then
+               CONFIG_CHECK="~INOTIFY_USER"
+               if use test ; then
+                       CONFIG_CHECK="~IPV6"
+                       WARNING_IPV6="Your kernel needs IPV6 support for 
running some tests, skipping them."
+               fi
+               linux-info_pkg_setup
+       fi
+       python-any-r1_pkg_setup
+}
+
+src_prepare() {
+       if use test; then
+               # TODO: Review the test exclusions, especially now with meson
+               # Disable tests requiring dev-util/desktop-file-utils when not 
installed, bug #286629, upstream bug #629163
+               if ! has_version dev-util/desktop-file-utils ; then
+                       ewarn "Some tests will be skipped due 
dev-util/desktop-file-utils not being present on your system,"
+                       ewarn "think on installing it to get these tests run."
+                       sed -i -e "/appinfo\/associations/d" 
gio/tests/appinfo.c || die
+                       sed -i -e "/g_test_add_func/d" 
gio/tests/desktop-app-info.c || die
+               fi
+
+               # gdesktopappinfo requires existing terminal (gnome-terminal or 
any
+               # other), falling back to xterm if one doesn't exist
+               #if ! has_version x11-terms/xterm && ! has_version 
x11-terms/gnome-terminal ; then
+               #       ewarn "Some tests will be skipped due to missing 
terminal program"
+               # These tests seem to sometimes fail even with a terminal; skip 
for now and reevulate with meson
+               # Also try https://gitlab.gnome.org/GNOME/glib/issues/1601 once 
ready for backport (or in a bump) and file new issue if still fails
+               sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die
+               # desktop-app-info/launch* might fail similarly
+               sed -i -e "/desktop-app-info\/launch-as-manager/d" 
gio/tests/desktop-app-info.c || die
+               #fi
+
+               # https://bugzilla.gnome.org/show_bug.cgi?id=722604
+               sed -i -e "/timer\/stop/d" glib/tests/timer.c || die
+               sed -i -e "/timer\/basic/d" glib/tests/timer.c || die
+
+               ewarn "Tests for search-utils have been skipped"
+               sed -i -e "/search-utils/d" glib/tests/meson.build || die
+
+               # Play nice with network-sandbox, but this approach would 
defeat the purpose of the test
+               #sed -i -e "s/localhost/127.0.0.1/g" 
gio/tests/gsocketclient-slow.c || die
+       else
+               # Don't build tests, also prevents extra deps, bug #512022
+               sed -i -e '/subdir.*tests/d' {.,gio,glib}/meson.build || die
+       fi
+
+       # Don't build fuzzing binaries - not used
+       sed -i -e '/subdir.*fuzzing/d' meson.build || die
+
+       # gdbus-codegen is a separate package
+       sed -i -e '/install_dir/d' gio/gdbus-2.0/codegen/meson.build || die
+
+       # Same kind of meson-0.50 issue with some installed-tests files; will 
likely be fixed upstream soon
+       sed -i -e '/install_dir/d' gio/tests/meson.build || die
+
+       cat > "${T}/glib-test-ld-wrapper" <<-EOF
+               #!/usr/bin/env sh
+               exec \${LD:-ld} "\$@"
+       EOF
+       chmod a+x "${T}/glib-test-ld-wrapper" || die
+       sed -i -e "s|'ld'|'${T}/glib-test-ld-wrapper'|g" gio/tests/meson.build 
|| die
+
+       xdg_src_prepare
+       gnome2_environment_reset
+       # TODO: python_name sedding for correct python shebang? Might be 
relevant mainly for glib-utils only
+}
+
+multilib_src_configure() {
+       if use debug; then
+               append-cflags -DG_ENABLE_DEBUG
+       else
+               append-cflags -DG_DISABLE_CAST_CHECKS # 
https://gitlab.gnome.org/GNOME/glib/issues/1833
+       fi
+
+       # TODO: figure a way to pass appropriate values for all cross 
properties that glib uses (search for get_cross_property)
+       #if tc-is-cross-compiler ; then
+               # https://bugzilla.gnome.org/show_bug.cgi?id=756473
+               # TODO-meson: This should be in meson cross file as 
'growing_stack' property; and more, look at get_cross_property
+               #case ${CHOST} in
+               #hppa*|metag*) export glib_cv_stack_grows=yes ;;
+               #*)            export glib_cv_stack_grows=no ;;
+               #esac
+       #fi
+
+       local emesonargs=(
+               -Ddefault_library=$(usex static-libs both shared)
+               $(meson_feature selinux)
+               $(meson_use xattr)
+               -Dlibmount=enabled # only used if host_system == 'linux'
+               -Dinternal_pcre=false
+               -Dman=true
+               $(meson_use systemtap dtrace)
+               $(meson_use systemtap)
+               $(meson_feature sysprof)
+               -Dgtk_doc=$(multilib_native_usex gtk-doc true false)
+               $(meson_use fam)
+               -Dinstalled_tests=false
+               -Dnls=enabled
+               -Doss_fuzz=disabled
+       )
+       meson_src_configure
+}
+
+multilib_src_compile() {
+       meson_src_compile
+}
+
+multilib_src_test() {
+       export XDG_CONFIG_DIRS=/etc/xdg
+       export XDG_DATA_DIRS=/usr/local/share:/usr/share
+       export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
+       export LC_TIME=C # bug #411967
+       unset GSETTINGS_BACKEND # bug #596380
+       python_setup
+
+       # Related test is a bit nitpicking
+       mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+       chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+
+       meson_src_test --timeout-multiplier 2 --no-suite flaky
+}
+
+multilib_src_install() {
+       meson_src_install
+       keepdir /usr/$(get_libdir)/gio/modules
+}
+
+multilib_src_install_all() {
+       einstalldocs
+
+       # These are installed by dev-util/glib-utils
+       # TODO: With patching we might be able to get rid of the python-any 
deps and removals, and test depend on glib-utils instead; revisit now with meson
+       rm "${ED}/usr/bin/glib-genmarshal" || die
+       rm "${ED}/usr/share/man/man1/glib-genmarshal.1" || die
+       rm "${ED}/usr/bin/glib-mkenums" || die
+       rm "${ED}/usr/share/man/man1/glib-mkenums.1" || die
+       rm "${ED}/usr/bin/gtester-report" || die
+       rm "${ED}/usr/share/man/man1/gtester-report.1" || die
+       # gdbus-codegen manpage installed by dev-util/gdbus-codegen
+       rm "${ED}/usr/share/man/man1/gdbus-codegen.1" || die
+}
+
+pkg_preinst() {
+       xdg_pkg_preinst
+
+       # Make gschemas.compiled belong to glib alone
+       local cache="/usr/share/glib-2.0/schemas/gschemas.compiled"
+
+       if [[ -e ${EROOT}${cache} ]]; then
+               cp "${EROOT}"${cache} "${ED}"/${cache} || die
+       else
+               touch "${ED}"${cache} || die
+       fi
+
+       multilib_pkg_preinst() {
+               # Make giomodule.cache belong to glib alone
+               local cache="/usr/$(get_libdir)/gio/modules/giomodule.cache"
+
+               if [[ -e ${EROOT}${cache} ]]; then
+                       cp "${EROOT}"${cache} "${ED}"${cache} || die
+               else
+                       touch "${ED}"${cache} || die
+               fi
+       }
+
+       # Don't run the cache ownership when cross-compiling, as it would end 
up with an empty cache
+       # file due to inability to create it and GIO might not look at any of 
the modules there
+       if ! tc-is-cross-compiler ; then
+               multilib_foreach_abi multilib_pkg_preinst
+       fi
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+       # glib installs no schemas itself, but we force update for fresh 
install in case
+       # something has dropped in a schemas file without direct glib dep; and 
for upgrades
+       # in case the compiled schema format could have changed
+       gnome2_schemas_update
+
+       multilib_pkg_postinst() {
+               gnome2_giomodule_cache_update \
+                       || die "Update GIO modules cache failed (for ${ABI})"
+       }
+       if ! tc-is-cross-compiler ; then
+               multilib_foreach_abi multilib_pkg_postinst
+       else
+               ewarn "Updating of GIO modules cache skipped due to 
cross-compilation."
+               ewarn "You might want to run gio-querymodules manually on the 
target for"
+               ewarn "your final image for performance reasons and re-run it 
when packages"
+               ewarn "installing GIO modules get upgraded or added to the 
image."
+       fi
+
+       for v in ${REPLACING_VERSIONS}; do
+               if ver_test "$v" "-lt" "2.63.6"; then
+                       ewarn "glib no longer installs the gio-launch-desktop 
binary. You may need"
+                       ewarn "to restart your session for \"Open With\" 
dialogs to work."
+               fi
+       done
+}
+
+pkg_postrm() {
+       xdg_pkg_postrm
+       gnome2_schemas_update
+
+       if [[ -z ${REPLACED_BY_VERSION} ]]; then
+               multilib_pkg_postrm() {
+                       rm -f 
"${EROOT}"/usr/$(get_libdir)/gio/modules/giomodule.cache
+               }
+               multilib_foreach_abi multilib_pkg_postrm
+               rm -f "${EROOT}"/usr/share/glib-2.0/schemas/gschemas.compiled
+       fi
+}

diff --git a/dev-libs/glib/metadata.xml b/dev-libs/glib/metadata.xml
new file mode 100644
index 0000000..c1bb61a
--- /dev/null
+++ b/dev-libs/glib/metadata.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <name>Gentoo GNOME Desktop</name>
+       </maintainer>
+       <use>
+               <flag name="dbus">
+                       Enable dependencies required by glib libraries
+                       using dbus service to manage settings saving
+               </flag>
+               <flag name="mime">
+                       Pull in shared MIME database that many glib-based
+                       applications require at runtime to detect or open 
files. Warning:
+                       do not disable this flag unless installing on a 
headless server.
+               </flag>
+               <flag name="systemtap">
+                       Build support for profiling and tracing using
+                       <pkg>dev-util/systemtap</pkg>
+               </flag>
+               <flag name="sysprof">
+                       Enable profiling data capture support using
+                       <pkg>dev-util/sysprof-capture</pkg>
+               </flag>
+               <flag name="utils">
+                       Install gtester-report utility to generate test
+                       report files for your software; build gresource utility 
with
+                       ELF support.
+               </flag>
+       </use>
+       <upstream>
+               <remote-id type="cpe">cpe:/a:gnome:glib</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to