glib2 2.80.0-2

This commit is contained in:
xhaa123 2024-04-29 15:01:12 +08:00
parent 2e7aca82e5
commit c2e2a93a89
3 changed files with 69 additions and 95 deletions

View File

@ -0,0 +1,40 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
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 04ef40457eba..e791ce254454 100644
--- a/gio/glib-compile-schemas.c
+++ b/gio/glib-compile-schemas.c
@@ -1232,19 +1232,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);

View File

@ -2,30 +2,37 @@
pkgname=glib2 pkgname=glib2
pkgver=2.80.0 pkgver=2.80.0
pkgrel=1 pkgrel=2
pkgdesc="Low level core library" pkgdesc="Low level core library"
arch=('x86_64') arch=('x86_64')
url="https://gitlab.gnome.org/GNOME/glib" url="https://gitlab.gnome.org/GNOME/glib"
license=('LGPL-2.1-or-later') license=('LGPL-2.1-or-later')
depends=('libffi' 'pcre2' 'util-linux' 'zlib' 'python-packaging') depends=('libffi' 'pcre2' 'util-linux' 'zlib' 'python-packaging')
makedepends=('dbus' 'gettext' 'libelf' 'meson' 'python-docutils' 'libxslt') makedepends=('dbus' 'gettext' 'libelf' 'meson' 'python-docutils' 'libxslt' 'git' 'gobject-introspection')
source=(https://download.gnome.org/sources/glib/${pkgver%.*}/glib-${pkgver}.tar.xz source=(git+https://gitlab.com/future-linux/clone/glib.git#tag=${pkgver}
glib-skip_warnings-1.patch git+https://gitlab.com/future-linux/clone/gvdb.git
0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
gio-querymodules.hook gio-querymodules.hook
glib-compile-schemas.hook) glib-compile-schemas.hook)
sha256sums=(8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d sha256sums=(SKIP
8f9ee9f4a6a08c49c9c912241c63d55b969950c49f4d40337c6fd9557b9daa1b SKIP
7f8ee5db60987f0d0feba84643e1cf988c98a294a681fb8d4fce1a5b2c25d1d3
b6fb5f07643c234bd0bde6c4899001effd270c17132e546cec535cb15771d269 b6fb5f07643c234bd0bde6c4899001effd270c17132e546cec535cb15771d269
64ae5597dda3cc160fc74be038dbe6267d41b525c0c35da9125fbf0de27f9b25) 64ae5597dda3cc160fc74be038dbe6267d41b525c0c35da9125fbf0de27f9b25)
prepare() { prepare() {
cd glib-${pkgver} cd glib
git apply -3 ${srcdir}/0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch
git submodule init
git submodule set-url subprojects/gvdb ${srcdir}/gvdb
git -c protocol.file.allow=always submodule update
patch -Np1 -i ${srcdir}/glib-skip_warnings-1.patch
} }
build() { build() {
cd glib-${pkgver} cd glib
# Produce more debug info: GLib has a lot of useful macros # Produce more debug info: GLib has a lot of useful macros
CFLAGS+=" -g3" CFLAGS+=" -g3"
@ -39,16 +46,22 @@ build() {
--prefix=/usr \ --prefix=/usr \
--libdir=/usr/lib64 \ --libdir=/usr/lib64 \
--buildtype=release \ --buildtype=release \
-Dintrospection=disabled \ -Dintrospection=enabled \
-Dman-pages=enabled -Dman-pages=enabled
meson compile -C build meson compile -C build
} }
package() { package() {
cd glib-${pkgver} cd glib
meson install -C build --destdir ${pkgdir} meson install -C build --destdir ${pkgdir}
install -Dt ${pkgdir}/usr/share/libalpm/hooks -m644 ${srcdir}/*.hook install -Dt ${pkgdir}/usr/share/libalpm/hooks -m644 ${srcdir}/*.hook
touch ${pkgdir}/usr/lib64/gio/modules/.keep
python3 -m compileall -d /usr/share/glib-2.0/codegen ${pkgdir}/usr/share/glib-2.0/codegen
python3 -O -m compileall -d /usr/share/glib-2.0/codegen ${pkgdir}/usr/share/glib-2.0/codegen
} }

View File

@ -1,79 +0,0 @@
Submitted By: Bruce Dubbs <bdubbs@linuxfromscratch.org>
Rediffed By: Douglas R. Reno <renodr at linuxfromscratch dot org>
Date: 2017-10-15
Rediffed Date: 2021-04-01
Initial Package Version: 2.54.0
Upstream Status: Not submitted
Origin: Self
Description: Adds a capabiility to skip printing warning messages using
an environment variable: GLIB_LOG_LEVEL. The value
of the variable is a digit that correponds to:
1 Alert
2 Critical
3 Error
4 Warning
5 Notice
For instance GLIB_LOG_LEVEL=4 will skip output of Warning and
Notice messages (and Info/Debug messages if they are turned on).
Rediffed for 2.68.0 to reduce the fuzz warnings.
diff -Naurp glib-2.68.0.orig/glib/gmessages.c glib-2.68.0/glib/gmessages.c
--- glib-2.68.0.orig/glib/gmessages.c 2021-03-18 08:28:31.909625000 -0500
+++ glib-2.68.0/glib/gmessages.c 2021-04-01 20:32:23.517596280 -0500
@@ -528,6 +528,34 @@ static GDestroyNotify log_writer_user_da
/* --- functions --- */
+/* skip_message
+ *
+ * This internal function queries an optional environment variable,
+ * GLIB_LOG_LEVEL and converts it to a value consistent
+ * with the type GLogLevelFlags. If the value is equal to
+ * or greater than the integer equivalent of the log_level,
+ * then the function returns a boolean that indicates that
+ * logging the output should be skipped.
+ */
+
+static gboolean skip_message( GLogLevelFlags log_level);
+
+static gboolean skip_message( GLogLevelFlags log_level)
+{
+ char* user_log_level;
+ int user_log_int;
+ gboolean skip = FALSE;
+
+ user_log_level = getenv( "GLIB_LOG_LEVEL" );
+
+ user_log_int = ( user_log_level != NULL ) ? atoi( user_log_level ) : 0;
+ user_log_int = ( user_log_level != 0 ) ? 1 << user_log_int : 0;
+
+ if ( user_log_int >= log_level ) skip = TRUE;
+
+ return skip;
+}
+
static void _g_log_abort (gboolean breakpoint);
static void
@@ -2591,6 +2619,9 @@ g_log_writer_standard_streams (GLogLevel
g_return_val_if_fail (fields != NULL, G_LOG_WRITER_UNHANDLED);
g_return_val_if_fail (n_fields > 0, G_LOG_WRITER_UNHANDLED);
+ /* If the user does not want this message level, just return */
+ if ( skip_message( log_level) ) return G_LOG_WRITER_HANDLED;
+
stream = log_level_to_file (log_level);
if (!stream || fileno (stream) < 0)
return G_LOG_WRITER_UNHANDLED;
@@ -2818,6 +2849,9 @@ _g_log_writer_fallback (GLogLevelFlags
FILE *stream;
gsize i;
+ /* If the user does not want this message level, just return */
+ if ( skip_message( log_level) ) return G_LOG_WRITER_HANDLED;
+
/* we cannot call _any_ GLib functions in this fallback handler,
* which is why we skip UTF-8 conversion, etc.
* since we either recursed or ran out of memory, we're in a pretty