Date: Friday, April 21, 2023 @ 18:57:03
Author: heftig
Revision: 475088
archrelease: copy trunk to staging-x86_64
Added:
glib2/repos/staging-x86_64/0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
(from rev 475087,
glib2/trunk/0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch)
glib2/repos/staging-x86_64/0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
(from rev 475087,
glib2/trunk/0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch)
glib2/repos/staging-x86_64/0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch
(from rev 475087,
glib2/trunk/0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch)
glib2/repos/staging-x86_64/PKGBUILD
(from rev 475087, glib2/trunk/PKGBUILD)
glib2/repos/staging-x86_64/gio-querymodules.hook
(from rev 475087, glib2/trunk/gio-querymodules.hook)
glib2/repos/staging-x86_64/glib-compile-schemas.hook
(from rev 475087, glib2/trunk/glib-compile-schemas.hook)
Deleted:
glib2/repos/staging-x86_64/0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
glib2/repos/staging-x86_64/PKGBUILD
glib2/repos/staging-x86_64/gio-querymodules.hook
glib2/repos/staging-x86_64/glib-compile-schemas.hook
glib2/repos/staging-x86_64/glib2-2.76.1-coreutils9.2.patch
-----------------------------------------------------------------+
0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch | 80 +-
0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch | 68 ++
0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch | 160 +++++
PKGBUILD | 275
+++++-----
gio-querymodules.hook | 22
glib-compile-schemas.hook | 24
glib2-2.76.1-coreutils9.2.patch | 227 --------
7 files changed, 431 insertions(+), 425 deletions(-)
Deleted: 0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
===================================================================
--- 0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
2023-04-21 18:56:39 UTC (rev 475087)
+++ 0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
2023-04-21 18:57:03 UTC (rev 475088)
@@ -1,40 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <[email protected]>
-Date: Fri, 7 Jan 2022 18:59:10 +0000
-Subject: [PATCH] glib-compile-schemas: Remove noisy deprecation warnings
-
-While the warnings are useful for developers, Arch Linux users also see
-them when glib-compile-schemas gets run after upgrades, where they just
-add noise.
-
-The alternative to this patch would be redirecting the compiler's stderr
-to /dev/null, but that might also suppress more useful errors or
-warnings we want users to see.
----
- gio/glib-compile-schemas.c | 13 -------------
- 1 file changed, 13 deletions(-)
-
-diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
-index efe6f8e77eb2..c3e5664e4f2f 100644
---- a/gio/glib-compile-schemas.c
-+++ b/gio/glib-compile-schemas.c
-@@ -1231,19 +1231,6 @@ parse_state_start_schema (ParseState *state,
- return;
- }
-
-- if (path && (g_str_has_prefix (path, "/apps/") ||
-- g_str_has_prefix (path, "/desktop/") ||
-- g_str_has_prefix (path, "/system/")))
-- {
-- gchar *message = NULL;
-- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. "
-- "Paths starting with "
-- "“/apps/”, “/desktop/” or “/system/” are
deprecated."),
-- id, path);
-- g_printerr ("%s\n", message);
-- g_free (message);
-- }
--
- state->schema_state = schema_state_new (path, gettext_domain,
- extends, extends_name, list_of);
-
Copied:
glib2/repos/staging-x86_64/0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
(from rev 475087,
glib2/trunk/0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch)
===================================================================
--- 0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
(rev 0)
+++ 0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
2023-04-21 18:57:03 UTC (rev 475088)
@@ -0,0 +1,40 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <[email protected]>
+Date: Fri, 7 Jan 2022 18:59:10 +0000
+Subject: [PATCH] glib-compile-schemas: Remove noisy deprecation warnings
+
+While the warnings are useful for developers, Arch Linux users also see
+them when glib-compile-schemas gets run after upgrades, where they just
+add noise.
+
+The alternative to this patch would be redirecting the compiler's stderr
+to /dev/null, but that might also suppress more useful errors or
+warnings we want users to see.
+---
+ gio/glib-compile-schemas.c | 13 -------------
+ 1 file changed, 13 deletions(-)
+
+diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
+index efe6f8e77eb2..c3e5664e4f2f 100644
+--- a/gio/glib-compile-schemas.c
++++ b/gio/glib-compile-schemas.c
+@@ -1231,19 +1231,6 @@ parse_state_start_schema (ParseState *state,
+ return;
+ }
+
+- if (path && (g_str_has_prefix (path, "/apps/") ||
+- g_str_has_prefix (path, "/desktop/") ||
+- g_str_has_prefix (path, "/system/")))
+- {
+- gchar *message = NULL;
+- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. "
+- "Paths starting with "
+- "“/apps/”, “/desktop/” or “/system/” are
deprecated."),
+- id, path);
+- g_printerr ("%s\n", message);
+- g_free (message);
+- }
+-
+ state->schema_state = schema_state_new (path, gettext_domain,
+ extends, extends_name, list_of);
+
Copied:
glib2/repos/staging-x86_64/0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
(from rev 475087,
glib2/trunk/0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch)
===================================================================
--- 0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
(rev 0)
+++ 0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
2023-04-21 18:57:03 UTC (rev 475088)
@@ -0,0 +1,68 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Joan Bruguera <[email protected]>
+Date: Thu, 23 Mar 2023 02:24:30 +0000
+Subject: [PATCH] glocalfile: Sum apparent size only for files and symlinks
+
+Since GNU Coreutils 9.2 (commit 110bcd28386b1f47a4cd876098acb708fdcbbb25),
+`du --apparent-size` (including `du --bytes`) no longer counts all kinds of
+files (directories, FIFOs, etc.), but only those for which `st_size` in
+`struct stat` is defined by POSIX, namely regular files and symlinks
+(and also rarely supported memory objects).
+
+This aligns the behaviour of GLib's `G_FILE_MEASURE_APPARENT_SIZE` flag
+with the new GNU Coreutils `du` and correct POSIX use.
+
+Note that this may be a breaking change for some uses.
+
+Link: https://lists.gnu.org/archive/html/bug-coreutils/2023-03/msg00007.html
+Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2965
+---
+ gio/glocalfile.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/gio/glocalfile.c b/gio/glocalfile.c
+index 67d4b99fb741..e53216962faf 100644
+--- a/gio/glocalfile.c
++++ b/gio/glocalfile.c
+@@ -86,6 +86,9 @@
+ #define FILE_READ_ONLY_VOLUME 0x00080000
+ #endif
+
++#ifndef S_ISREG
++#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
++#endif
+ #ifndef S_ISDIR
+ #define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
+ #endif
+@@ -2777,6 +2780,23 @@ g_local_file_measure_size_of_contents (gint
fd,
+ MeasureState *state,
+ GError **error);
+
++inline static gboolean _g_stat_is_size_usable (const GLocalFileStat *buf)
++{
++#ifndef HAVE_STATX
++ // Memory objects are defined by POSIX, but are not supported by statx nor
Windows
++#ifdef S_TYPEISSHM
++ if (S_TYPEISSHM (buf))
++ return TRUE;
++#endif
++#ifdef S_TYPEISTMO
++ if (S_TYPEISTMO (buf))
++ return TRUE;
++#endif
++#endif
++
++ return S_ISREG (_g_stat_mode (buf)) || S_ISLNK (_g_stat_mode (buf));
++}
++
+ static gboolean
+ g_local_file_measure_size_of_file (gint parent_fd,
+ GSList *name,
+@@ -2836,6 +2856,7 @@ g_local_file_measure_size_of_file (gint
parent_fd,
+ state->disk_usage += _g_stat_blocks (&buf) * G_GUINT64_CONSTANT (512);
+ else
+ #endif
++ if (_g_stat_is_size_usable (&buf))
+ state->disk_usage += _g_stat_size (&buf);
+
+ if (S_ISDIR (_g_stat_mode (&buf)))
Copied:
glib2/repos/staging-x86_64/0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch
(from rev 475087,
glib2/trunk/0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch)
===================================================================
--- 0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch
(rev 0)
+++ 0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch 2023-04-21
18:57:03 UTC (rev 475088)
@@ -0,0 +1,160 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Joan Bruguera <[email protected]>
+Date: Thu, 23 Mar 2023 02:19:03 +0000
+Subject: [PATCH] tests/file: Do not rely on du --bytes behaviour
+
+As explained in the previous commit, GNU Coreutils 9.2 changes the behaviour
+of `du --bytes` to only count regular files and symlinks.
+
+The previous commit makes the test pass with GNU Coreutils >=9.2, but the
+machine running the tests may have an older version, or perhaps even a
+reimplementation such as uutils. So we can't rely on the size returned by `du`
+to be the consistent across systems any more.
+
+However, the plus side of the new behaviour is that the size reported by `du`
+/ `G_FILE_MEASURE_APPARENT_SIZE` is now well-defined across filesystems
+(as the sum of the sizes of regular files & symlinks), so we can hardcode it.
+
+Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2965
+---
+ gio/tests/file.c | 85 ++----------------------------------------------
+ 1 file changed, 3 insertions(+), 82 deletions(-)
+
+diff --git a/gio/tests/file.c b/gio/tests/file.c
+index d16eda5c0b8c..ad2f945f9397 100644
+--- a/gio/tests/file.c
++++ b/gio/tests/file.c
+@@ -2515,105 +2515,33 @@ test_copy_preserve_mode (void)
+ #endif
+ }
+
+-static gchar *
+-splice_to_string (GInputStream *stream,
+- GError **error)
+-{
+- GMemoryOutputStream *buffer = NULL;
+- char *ret = NULL;
+-
+- buffer = (GMemoryOutputStream*)g_memory_output_stream_new (NULL, 0,
g_realloc, g_free);
+- if (g_output_stream_splice ((GOutputStream*)buffer, stream, 0, NULL, error)
< 0)
+- goto out;
+-
+- if (!g_output_stream_write ((GOutputStream*)buffer, "\0", 1, NULL, error))
+- goto out;
+-
+- if (!g_output_stream_close ((GOutputStream*)buffer, NULL, error))
+- goto out;
+-
+- ret = g_memory_output_stream_steal_data (buffer);
+- out:
+- g_clear_object (&buffer);
+- return ret;
+-}
+-
+-static gboolean
+-get_size_from_du (const gchar *path, guint64 *size)
+-{
+- GSubprocess *du;
+- gboolean ok;
+- gchar *result;
+- gchar *endptr;
+- GError *error = NULL;
+- gchar *du_path = NULL;
+-
+-#ifndef __APPLE__
+- du_path = g_find_program_in_path ("du");
+-#endif
+-
+- /* If we can’t find du, don’t try and run the test. */
+- if (du_path == NULL)
+- return FALSE;
+-
+- g_free (du_path);
+-
+- du = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE,
+- &error,
+- "du", "--bytes", "-s", path, NULL);
+- g_assert_no_error (error);
+-
+- result = splice_to_string (g_subprocess_get_stdout_pipe (du), &error);
+- g_assert_no_error (error);
+-
+- *size = g_ascii_strtoll (result, &endptr, 10);
+-
+- g_subprocess_wait (du, NULL, &error);
+- g_assert_no_error (error);
+-
+- ok = g_subprocess_get_successful (du);
+-
+- g_object_unref (du);
+- g_free (result);
+-
+- return ok;
+-}
+-
+ static void
+ test_measure (void)
+ {
+ GFile *file;
+- guint64 size;
+ guint64 num_bytes;
+ guint64 num_dirs;
+ guint64 num_files;
+ GError *error = NULL;
+ gboolean ok;
+ gchar *path;
+
+ path = g_test_build_filename (G_TEST_DIST, "desktop-files", NULL);
+ file = g_file_new_for_path (path);
+
+- if (!get_size_from_du (path, &size))
+- {
+- g_test_message ("du not found or fail to run, skipping byte
measurement");
+- size = 0;
+- }
+-
+ ok = g_file_measure_disk_usage (file,
+ G_FILE_MEASURE_APPARENT_SIZE,
+ NULL,
+ NULL,
+ NULL,
+ &num_bytes,
+ &num_dirs,
+ &num_files,
+ &error);
+ g_assert_true (ok);
+ g_assert_no_error (error);
+
+- if (size > 0)
+- g_assert_cmpuint (num_bytes, ==, size);
++ g_assert_cmpuint (num_bytes, ==, 74478);
+ g_assert_cmpuint (num_dirs, ==, 6);
+ g_assert_cmpuint (num_files, ==, 32);
+
+@@ -2665,8 +2593,7 @@ measure_done (GObject *source,
+ g_assert_true (ok);
+ g_assert_no_error (error);
+
+- if (data->expected_bytes > 0)
+- g_assert_cmpuint (data->expected_bytes, ==, num_bytes);
++ g_assert_cmpuint (data->expected_bytes, ==, num_bytes);
+ g_assert_cmpuint (data->expected_dirs, ==, num_dirs);
+ g_assert_cmpuint (data->expected_files, ==, num_files);
+
+@@ -2695,15 +2622,9 @@ test_measure_async (void)
+
+ path = g_test_build_filename (G_TEST_DIST, "desktop-files", NULL);
+ file = g_file_new_for_path (path);
+-
+- if (!get_size_from_du (path, &data->expected_bytes))
+- {
+- g_test_message ("du not found or fail to run, skipping byte
measurement");
+- data->expected_bytes = 0;
+- }
+-
+ g_free (path);
+
++ data->expected_bytes = 74478;
+ data->expected_dirs = 6;
+ data->expected_files = 32;
+
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2023-04-21 18:56:39 UTC (rev 475087)
+++ PKGBUILD 2023-04-21 18:57:03 UTC (rev 475088)
@@ -1,135 +0,0 @@
-# Maintainer: Jan Alexander Steffens (heftig) <[email protected]>
-# Contributor: Jan de Groot <[email protected]>
-
-pkgbase=glib2
-pkgname=(glib2 glib2-docs)
-pkgver=2.76.1
-pkgrel=2
-pkgdesc="Low level core library"
-url="https://wiki.gnome.org/Projects/GLib"
-license=(LGPL)
-arch=(x86_64)
-depends=(
- libffi
- libsysprof-capture
- pcre2
- util-linux-libs
- zlib
-)
-makedepends=(
- dbus
- gettext
- git
- gtk-doc
- libelf
- meson
- python
- shared-mime-info
- util-linux
-)
-checkdepends=(
- desktop-file-utils
- glib2
-)
-options=(
- debug
- staticlibs
-)
-_commit=180713772f4e7bcdddf2c793f2f34a498184ed15 # tags/2.76.1^0
-source=(
- "git+https://gitlab.gnome.org/GNOME/glib.git#commit=$_commit"
- "git+https://gitlab.gnome.org/GNOME/gvdb.git"
- 0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
- $pkgbase-2.76.1-coreutils9.2.patch
- gio-querymodules.hook
- glib-compile-schemas.hook
-)
-b2sums=('SKIP'
- 'SKIP'
-
'bd7f881ae6054c363783bf45b1add5eef5e8347554e23b9fece526701469d07cdcb9871fa73dee473796a219e8aa513796a96da769949097ea207db038578d07'
-
'7af426042432274f4a72cd68cf218d6c36d375161d20db07dca59915949cccf90ecf15b840b21335ee41cf8e92b30de49f4c48b526d0b681b0220fc651c88672'
-
'14c9211c0557f6d8d9a914f1b18b7e0e23f79f4abde117cb03ab119b95bf9fa9d7a712aa0a29beb266468aeb352caa3a9e4540503cfc9fe0bbaf764371832a96'
-
'd30d349b4cb4407839d9074ce08f5259b8a5f3ca46769aabc621f17d15effdb89c4bf19bd23603f6df3d59f8d1adaded0f4bacd0333afcab782f2d048c882858')
-
-
-pkgver() {
- cd glib
- git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
-}
-
-prepare() {
- cd glib
-
- # Suppress noise from glib-compile-schemas.hook
- git apply -3
../0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
- # fix test suite issues with coreutils >=9.2:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3358
- git apply -3 ../$pkgbase-2.76.1-coreutils9.2.patch
-
- git submodule init
- git submodule set-url subprojects/gvdb "$srcdir/gvdb"
- git -c protocol.file.allow=always submodule update
-}
-
-build() {
- local meson_options=(
- --default-library both
- -D glib_debug=disabled
- -D gtk_doc=true
- -D man=true
- -D selinux=disabled
- -D sysprof=enabled
- )
-
- # Produce more debug info: GLib has a lot of useful macros
- CFLAGS+=" -g3"
- CXXFLAGS+=" -g3"
-
- # use fat LTO objects for static libraries
- CFLAGS+=" -ffat-lto-objects"
- CXXFLAGS+=" -ffat-lto-objects"
-
- arch-meson glib build "${meson_options[@]}"
- meson compile -C build
-}
-
-check() {
- meson test -C build --no-suite flaky --no-suite slow --print-errorlogs
-}
-
-package_glib2() {
- depends+=(
- libffi.so
- libmount.so
- )
- provides+=(libg{lib,io,module,object,thread}-2.0.so)
- optdepends=(
- 'gvfs: most gio functionality'
- 'libelf: gresource inspection tool'
- 'python: gdbus-codegen, glib-genmarshal, glib-mkenums, gtester-report'
- )
-
- meson install -C build --destdir "$pkgdir"
-
- install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 *.hook
- touch "$pkgdir/usr/lib/gio/modules/.keep"
-
- python -m compileall -d /usr/share/glib-2.0/codegen \
- "$pkgdir/usr/share/glib-2.0/codegen"
- python -O -m compileall -d /usr/share/glib-2.0/codegen \
- "$pkgdir/usr/share/glib-2.0/codegen"
-
- # Split docs
- mkdir -p docs/usr/share
- mv {"$pkgdir",docs}/usr/share/gtk-doc
-}
-
-package_glib2-docs() {
- pkgdesc+=" - documentation"
- depends=()
- license+=(custom)
-
- mv -t "$pkgdir" docs/*
- install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644
glib/docs/reference/COPYING
-}
-
-# vim:set sw=2 sts=-1 et:
Copied: glib2/repos/staging-x86_64/PKGBUILD (from rev 475087,
glib2/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2023-04-21 18:57:03 UTC (rev 475088)
@@ -0,0 +1,140 @@
+# Maintainer: Jan Alexander Steffens (heftig) <[email protected]>
+# Contributor: Jan de Groot <[email protected]>
+
+pkgbase=glib2
+pkgname=(glib2 glib2-docs)
+pkgver=2.76.2
+pkgrel=1
+pkgdesc="Low level core library"
+url="https://wiki.gnome.org/Projects/GLib"
+license=(LGPL)
+arch=(x86_64)
+depends=(
+ libffi
+ libsysprof-capture
+ pcre2
+ util-linux-libs
+ zlib
+)
+makedepends=(
+ dbus
+ gettext
+ git
+ gtk-doc
+ libelf
+ meson
+ python
+ shared-mime-info
+ util-linux
+)
+checkdepends=(
+ desktop-file-utils
+ glib2
+)
+options=(
+ debug
+ staticlibs
+)
+_commit=41ae5b5632ce9f6b2b5613ec1912821f769166c2 # tags/2.76.2^0
+source=(
+ "git+https://gitlab.gnome.org/GNOME/glib.git#commit=$_commit"
+ "git+https://gitlab.gnome.org/GNOME/gvdb.git"
+ 0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
+ 0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
+ 0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch
+ gio-querymodules.hook
+ glib-compile-schemas.hook
+)
+b2sums=('SKIP'
+ 'SKIP'
+
'bd7f881ae6054c363783bf45b1add5eef5e8347554e23b9fece526701469d07cdcb9871fa73dee473796a219e8aa513796a96da769949097ea207db038578d07'
+
'6bcbcba60208162f7221701d6a642eabfc92c2fc6a476bcb42da5967577f8f0c75b688d149be01c9c48cd644aafa7fbdd63d9086385b8f7607fc981756d71a68'
+
'257bf37d304cc161dedcde0a2c4d01e297f8263cde48b49d3ee47ca95a8fb9ad44bbb9bf99da51ec766ffb6f9d502e0a8fdc6b86346e6755373ee515e23b9419'
+
'14c9211c0557f6d8d9a914f1b18b7e0e23f79f4abde117cb03ab119b95bf9fa9d7a712aa0a29beb266468aeb352caa3a9e4540503cfc9fe0bbaf764371832a96'
+
'd30d349b4cb4407839d9074ce08f5259b8a5f3ca46769aabc621f17d15effdb89c4bf19bd23603f6df3d59f8d1adaded0f4bacd0333afcab782f2d048c882858')
+
+
+pkgver() {
+ cd glib
+ git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
+}
+
+prepare() {
+ cd glib
+
+ # Suppress noise from glib-compile-schemas.hook
+ git apply -3
../0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
+
+ # fix test suite issues with coreutils >=9.2
+ # https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3358
+ git apply -3
../0002-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
+ git apply -3 ../0003-tests-file-Do-not-rely-on-du-bytes-behaviour.patch
+
+ git submodule init
+ git submodule set-url subprojects/gvdb "$srcdir/gvdb"
+ git -c protocol.file.allow=always submodule update
+}
+
+build() {
+ local meson_options=(
+ --default-library both
+ -D glib_debug=disabled
+ -D gtk_doc=true
+ -D man=true
+ -D selinux=disabled
+ -D sysprof=enabled
+ )
+
+ # Produce more debug info: GLib has a lot of useful macros
+ CFLAGS+=" -g3"
+ CXXFLAGS+=" -g3"
+
+ # use fat LTO objects for static libraries
+ CFLAGS+=" -ffat-lto-objects"
+ CXXFLAGS+=" -ffat-lto-objects"
+
+ arch-meson glib build "${meson_options[@]}"
+ meson compile -C build
+}
+
+check() {
+ meson test -C build --no-suite flaky --no-suite slow --print-errorlogs
+}
+
+package_glib2() {
+ depends+=(
+ libffi.so
+ libmount.so
+ )
+ provides+=(libg{lib,io,module,object,thread}-2.0.so)
+ optdepends=(
+ 'gvfs: most gio functionality'
+ 'libelf: gresource inspection tool'
+ 'python: gdbus-codegen, glib-genmarshal, glib-mkenums, gtester-report'
+ )
+
+ meson install -C build --destdir "$pkgdir"
+
+ install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 *.hook
+ touch "$pkgdir/usr/lib/gio/modules/.keep"
+
+ python -m compileall -d /usr/share/glib-2.0/codegen \
+ "$pkgdir/usr/share/glib-2.0/codegen"
+ python -O -m compileall -d /usr/share/glib-2.0/codegen \
+ "$pkgdir/usr/share/glib-2.0/codegen"
+
+ # Split docs
+ mkdir -p docs/usr/share
+ mv {"$pkgdir",docs}/usr/share/gtk-doc
+}
+
+package_glib2-docs() {
+ pkgdesc+=" - documentation"
+ depends=()
+ license+=(custom)
+
+ mv -t "$pkgdir" docs/*
+ install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644
glib/docs/reference/COPYING
+}
+
+# vim:set sw=2 sts=-1 et:
Deleted: gio-querymodules.hook
===================================================================
--- gio-querymodules.hook 2023-04-21 18:56:39 UTC (rev 475087)
+++ gio-querymodules.hook 2023-04-21 18:57:03 UTC (rev 475088)
@@ -1,11 +0,0 @@
-[Trigger]
-Type = Path
-Operation = Install
-Operation = Upgrade
-Operation = Remove
-Target = usr/lib/gio/modules/*.so
-
-[Action]
-Description = Updating GIO module cache...
-When = PostTransaction
-Exec = /usr/bin/gio-querymodules /usr/lib/gio/modules
Copied: glib2/repos/staging-x86_64/gio-querymodules.hook (from rev 475087,
glib2/trunk/gio-querymodules.hook)
===================================================================
--- gio-querymodules.hook (rev 0)
+++ gio-querymodules.hook 2023-04-21 18:57:03 UTC (rev 475088)
@@ -0,0 +1,11 @@
+[Trigger]
+Type = Path
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/lib/gio/modules/*.so
+
+[Action]
+Description = Updating GIO module cache...
+When = PostTransaction
+Exec = /usr/bin/gio-querymodules /usr/lib/gio/modules
Deleted: glib-compile-schemas.hook
===================================================================
--- glib-compile-schemas.hook 2023-04-21 18:56:39 UTC (rev 475087)
+++ glib-compile-schemas.hook 2023-04-21 18:57:03 UTC (rev 475088)
@@ -1,12 +0,0 @@
-[Trigger]
-Type = Path
-Operation = Install
-Operation = Upgrade
-Operation = Remove
-Target = usr/share/glib-2.0/schemas/*.gschema.xml
-Target = usr/share/glib-2.0/schemas/*.gschema.override
-
-[Action]
-Description = Compiling GSettings XML schema files...
-When = PostTransaction
-Exec = /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
Copied: glib2/repos/staging-x86_64/glib-compile-schemas.hook (from rev 475087,
glib2/trunk/glib-compile-schemas.hook)
===================================================================
--- glib-compile-schemas.hook (rev 0)
+++ glib-compile-schemas.hook 2023-04-21 18:57:03 UTC (rev 475088)
@@ -0,0 +1,12 @@
+[Trigger]
+Type = Path
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/share/glib-2.0/schemas/*.gschema.xml
+Target = usr/share/glib-2.0/schemas/*.gschema.override
+
+[Action]
+Description = Compiling GSettings XML schema files...
+When = PostTransaction
+Exec = /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
Deleted: glib2-2.76.1-coreutils9.2.patch
===================================================================
--- glib2-2.76.1-coreutils9.2.patch 2023-04-21 18:56:39 UTC (rev 475087)
+++ glib2-2.76.1-coreutils9.2.patch 2023-04-21 18:57:03 UTC (rev 475088)
@@ -1,227 +0,0 @@
-From 044bd40bbd99b13d1813b3a09a14cbe31c3b2261 Mon Sep 17 00:00:00 2001
-From: Joan Bruguera <[email protected]>
-Date: Thu, 23 Mar 2023 02:24:30 +0000
-Subject: [PATCH 1/2] glocalfile: Sum apparent size only for files and symlinks
-
-Since GNU Coreutils 9.2 (commit 110bcd28386b1f47a4cd876098acb708fdcbbb25),
-`du --apparent-size` (including `du --bytes`) no longer counts all kinds of
-files (directories, FIFOs, etc.), but only those for which `st_size` in
-`struct stat` is defined by POSIX, namely regular files and symlinks
-(and also rarely supported memory objects).
-
-This aligns the behaviour of GLib's `G_FILE_MEASURE_APPARENT_SIZE` flag
-with the new GNU Coreutils `du` and correct POSIX use.
-
-Note that this may be a breaking change for some uses.
-
-Link: https://lists.gnu.org/archive/html/bug-coreutils/2023-03/msg00007.html
-Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2965
----
- gio/glocalfile.c | 21 +++++++++++++++++++++
- 1 file changed, 21 insertions(+)
-
-diff --git a/gio/glocalfile.c b/gio/glocalfile.c
-index 67d4b99fb7..e53216962f 100644
---- a/gio/glocalfile.c
-+++ b/gio/glocalfile.c
-@@ -86,6 +86,9 @@
- #define FILE_READ_ONLY_VOLUME 0x00080000
- #endif
-
-+#ifndef S_ISREG
-+#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
-+#endif
- #ifndef S_ISDIR
- #define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
- #endif
-@@ -2777,6 +2780,23 @@ g_local_file_measure_size_of_contents (gint
fd,
- MeasureState *state,
- GError **error);
-
-+inline static gboolean _g_stat_is_size_usable (const GLocalFileStat *buf)
-+{
-+#ifndef HAVE_STATX
-+ // Memory objects are defined by POSIX, but are not supported by statx nor
Windows
-+#ifdef S_TYPEISSHM
-+ if (S_TYPEISSHM (buf))
-+ return TRUE;
-+#endif
-+#ifdef S_TYPEISTMO
-+ if (S_TYPEISTMO (buf))
-+ return TRUE;
-+#endif
-+#endif
-+
-+ return S_ISREG (_g_stat_mode (buf)) || S_ISLNK (_g_stat_mode (buf));
-+}
-+
- static gboolean
- g_local_file_measure_size_of_file (gint parent_fd,
- GSList *name,
-@@ -2836,6 +2856,7 @@ g_local_file_measure_size_of_file (gint
parent_fd,
- state->disk_usage += _g_stat_blocks (&buf) * G_GUINT64_CONSTANT (512);
- else
- #endif
-+ if (_g_stat_is_size_usable (&buf))
- state->disk_usage += _g_stat_size (&buf);
-
- if (S_ISDIR (_g_stat_mode (&buf)))
---
-GitLab
-
-
-From 9722c2336c00a62ed2b772b78b6dba69d1d984e2 Mon Sep 17 00:00:00 2001
-From: Joan Bruguera <[email protected]>
-Date: Thu, 23 Mar 2023 02:19:03 +0000
-Subject: [PATCH 2/2] tests/file: Do not rely on du --bytes behaviour
-
-As explained in the previous commit, GNU Coreutils 9.2 changes the behaviour
-of `du --bytes` to only count regular files and symlinks.
-
-The previous commit makes the test pass with GNU Coreutils >=9.2, but the
-machine running the tests may have an older version, or perhaps even a
-reimplementation such as uutils. So we can't rely on the size returned by `du`
-to be the consistent across systems any more.
-
-However, the plus side of the new behaviour is that the size reported by `du`
-/ `G_FILE_MEASURE_APPARENT_SIZE` is now well-defined across filesystems
-(as the sum of the sizes of regular files & symlinks), so we can hardcode it.
-
-Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2965
----
- gio/tests/file.c | 85 ++----------------------------------------------
- 1 file changed, 3 insertions(+), 82 deletions(-)
-
-diff --git a/gio/tests/file.c b/gio/tests/file.c
-index d16eda5c0b..ad2f945f93 100644
---- a/gio/tests/file.c
-+++ b/gio/tests/file.c
-@@ -2515,75 +2515,10 @@ test_copy_preserve_mode (void)
- #endif
- }
-
--static gchar *
--splice_to_string (GInputStream *stream,
-- GError **error)
--{
-- GMemoryOutputStream *buffer = NULL;
-- char *ret = NULL;
--
-- buffer = (GMemoryOutputStream*)g_memory_output_stream_new (NULL, 0,
g_realloc, g_free);
-- if (g_output_stream_splice ((GOutputStream*)buffer, stream, 0, NULL, error)
< 0)
-- goto out;
--
-- if (!g_output_stream_write ((GOutputStream*)buffer, "\0", 1, NULL, error))
-- goto out;
--
-- if (!g_output_stream_close ((GOutputStream*)buffer, NULL, error))
-- goto out;
--
-- ret = g_memory_output_stream_steal_data (buffer);
-- out:
-- g_clear_object (&buffer);
-- return ret;
--}
--
--static gboolean
--get_size_from_du (const gchar *path, guint64 *size)
--{
-- GSubprocess *du;
-- gboolean ok;
-- gchar *result;
-- gchar *endptr;
-- GError *error = NULL;
-- gchar *du_path = NULL;
--
--#ifndef __APPLE__
-- du_path = g_find_program_in_path ("du");
--#endif
--
-- /* If we can’t find du, don’t try and run the test. */
-- if (du_path == NULL)
-- return FALSE;
--
-- g_free (du_path);
--
-- du = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE,
-- &error,
-- "du", "--bytes", "-s", path, NULL);
-- g_assert_no_error (error);
--
-- result = splice_to_string (g_subprocess_get_stdout_pipe (du), &error);
-- g_assert_no_error (error);
--
-- *size = g_ascii_strtoll (result, &endptr, 10);
--
-- g_subprocess_wait (du, NULL, &error);
-- g_assert_no_error (error);
--
-- ok = g_subprocess_get_successful (du);
--
-- g_object_unref (du);
-- g_free (result);
--
-- return ok;
--}
--
- static void
- test_measure (void)
- {
- GFile *file;
-- guint64 size;
- guint64 num_bytes;
- guint64 num_dirs;
- guint64 num_files;
-@@ -2594,12 +2529,6 @@ test_measure (void)
- path = g_test_build_filename (G_TEST_DIST, "desktop-files", NULL);
- file = g_file_new_for_path (path);
-
-- if (!get_size_from_du (path, &size))
-- {
-- g_test_message ("du not found or fail to run, skipping byte
measurement");
-- size = 0;
-- }
--
- ok = g_file_measure_disk_usage (file,
- G_FILE_MEASURE_APPARENT_SIZE,
- NULL,
-@@ -2612,8 +2541,7 @@ test_measure (void)
- g_assert_true (ok);
- g_assert_no_error (error);
-
-- if (size > 0)
-- g_assert_cmpuint (num_bytes, ==, size);
-+ g_assert_cmpuint (num_bytes, ==, 74478);
- g_assert_cmpuint (num_dirs, ==, 6);
- g_assert_cmpuint (num_files, ==, 32);
-
-@@ -2665,8 +2593,7 @@ measure_done (GObject *source,
- g_assert_true (ok);
- g_assert_no_error (error);
-
-- if (data->expected_bytes > 0)
-- g_assert_cmpuint (data->expected_bytes, ==, num_bytes);
-+ g_assert_cmpuint (data->expected_bytes, ==, num_bytes);
- g_assert_cmpuint (data->expected_dirs, ==, num_dirs);
- g_assert_cmpuint (data->expected_files, ==, num_files);
-
-@@ -2695,15 +2622,9 @@ test_measure_async (void)
-
- path = g_test_build_filename (G_TEST_DIST, "desktop-files", NULL);
- file = g_file_new_for_path (path);
--
-- if (!get_size_from_du (path, &data->expected_bytes))
-- {
-- g_test_message ("du not found or fail to run, skipping byte
measurement");
-- data->expected_bytes = 0;
-- }
--
- g_free (path);
-
-+ data->expected_bytes = 74478;
- data->expected_dirs = 6;
- data->expected_files = 32;
-
---
-GitLab
-