Page MenuHomeFreeBSD

D25279.id77007.diff
No OneTemporary

D25279.id77007.diff

Index: devel/glib20/Makefile
===================================================================
--- devel/glib20/Makefile
+++ devel/glib20/Makefile
@@ -2,12 +2,11 @@
# $FreeBSD$
PORTNAME= glib
-PORTVERSION= 2.56.3
-PORTREVISION= 9
+PORTVERSION= 2.66.0
PORTEPOCH= 1
CATEGORIES= devel
MASTER_SITES= GNOME
-DIST_SUBDIR= gnome2
+DIST_SUBDIR= gnome
MAINTAINER= desktop@FreeBSD.org
COMMENT= Some useful routines of C programming (current stable version)
@@ -22,24 +21,21 @@
LIB_DEPENDS+= libpcre.so:devel/pcre \
libffi.so:devel/libffi
-GNU_CONFIGURE= yes
-USE_LDCONFIG= yes
# iconv:wchar_t - our iconv in base doesn't support utf-8 -> wchar_t (boooo)
# (wchar_t is used by glibmm, rawtherapee triggered this)
-USES+= compiler:c11 gettext gmake gnome iconv:wchar_t libtool \
- localbase pathfix perl5 pkgconfig python shebangfix
+USES+= compiler:c11 gettext gnome iconv:wchar_t \
+ localbase:ldflags meson perl5 pkgconfig python:3.5+
USE_PYTHON= py3kplist
USE_PERL5= build
-CONFIGURE_ARGS= --disable-gtk-doc --with-html-dir=${PREFIX}/share/doc \
- --enable-static=yes \
- --with-pcre=system \
- --disable-fam
-CONFIGURE_ENV= ac_cv_header_sys_inotify_h=
-INSTALL_TARGET= install-strip
+USE_LDCONFIG= yes
+MESON_ARGS= -Db_lundef=false \
+ -Dlibmount=disabled \
+ -Dselinux=disabled \
+ -Dinstalled_tests=false \
+ -Dxattr=false
+BINARY_ALIAS= python3=${PYTHON_VERSION}
-SHEBANG_FILES= */*.pl
-
-LIBVERSION= 0.5600.3
+LIBVERSION= 0.6600.0
PLIST_SUB+= LIBVERSION=${LIBVERSION}
glib_MAN= gtester.1 gtester-report.1 glib-gettextize.1
@@ -52,23 +48,20 @@
OPTIONS_DEFAULT= MANPAGES
OPTIONS_SUB= yes
-DEBUG_CONFIGURE_ON= --enable-debug=yes
-
MANPAGES_BUILD_DEPENDS= docbook-xml>4.1.2:textproc/docbook-xml \
docbook-xsl>0:textproc/docbook-xsl
MANPAGES_USE= GNOME=libxslt:build
-MANPAGES_CONFIGURE_ENABLE= man
-MANPAGES_CONFIGURE_ON= --with-xml-catalog=${LOCALBASE}/share/xml/catalog
+MANPAGES_MESON_TRUE= man
.include <bsd.port.pre.mk>
# doesn't build yet
-CONFIGURE_ARGS+=--disable-dtrace
+MESON_ARGS+= -Ddtrace=false
.if empty(ICONV_LIB)
-CONFIGURE_ARGS+= --with-libiconv=no
+MESON_ARGS+= -Diconv=libc # native?
.else
-CONFIGURE_ARGS+= --with-libiconv=gnu
+MESON_ARGS+= -Diconv=external
.endif
.if ${ARCH} == powerpc64
@@ -75,40 +68,40 @@
EXTRA_PATCHES+= ${FILESDIR}/extra-arch-powerpc64
.endif
-# Let glib use asm code for implementing atomic ops on i386 and amd64.
-.if ${ARCH} == "i386"
-GLIB_ARCH= i486
-.elif ${ARCH} == "amd64"
-GLIB_ARCH= x86_64
-.else
-GLIB_ARCH= ${ARCH}
-.endif
-CONFIGURE_TARGET=${GLIB_ARCH}-portbld-freebsd${OSREL}
-
post-patch:
@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g ; \
s|/usr/share/locale/locale|${LOCALBASE}/share/locale/locale|g' \
- ${WRKSRC}/glib/gutils.c
- @${REINPLACE_CMD} -e 's|inotify_support=yes|inotify_support=no| ; \
- s|-Werror|| ; \
- s|#define HAVE_SYS_INOTIFY_H 1||' ${WRKSRC}/configure
+ ${WRKSRC}/glib/gutils.c
+ @${REINPLACE_CMD} -e 's|@PYTHON@|${PYTHON_VERSION}|g' \
+ ${WRKSRC}/gio/gdbus-2.0/codegen/gdbus-codegen.in \
+ ${WRKSRC}/glib/gtester-report.in \
+ ${WRKSRC}/gobject/glib-genmarshal.in \
+ ${WRKSRC}/gobject/glib-mkenums.in
+ @${REINPLACE_CMD} -e '/inotify_init1/d' \
+ -e '/inotify.h/d' \
+ ${WRKSRC}/meson.build
-do-build-MANPAGES-on:
-.for m in glib gio gobject
-. for file in ${${m}_MAN}
- cd ${WRKSRC}/docs/reference/${m} && ${GMAKE} ${file}
-. endfor
-.endfor
+CODEGENDIR= ${PREFIX}/share/glib-2.0/codegen
post-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/share/GConf/gsettings
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/gio/modules
-
-post-install-MANPAGES-on:
-.for m in glib gio gobject
- ${INSTALL_MAN} ${${m}_MAN:S|^|${WRKSRC}/docs/reference/${m}/|} \
- ${STAGEDIR}${PREFIX}/man/man1
+# generates .py[co] files for installed modules
+# if that's not done, ${PYTHON_SITELIBDIR}/gps will be polluted
+# with these files when module is imported from root user
+ @${FIND} ${STAGEDIR}${PREFIX} -name \*.pyc -delete
+ (cd ${STAGEDIR}${PREFIX} && \
+ ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
+ -d ${CODEGENDIR} -f ${CODEGENDIR:S;${PREFIX}/;;} && \
+ ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
+ -d ${CODEGENDIR} -f ${CODEGENDIR:S;${PREFIX}/;;})
+ # install bash completion regardless if bash is present
+ @${MKDIR} ${STAGEDIR}${PREFIX}/share/bash-completion/completions
+.for file in gapplication gdbus gio gresource gsettings
+ ${INSTALL_DATA} ${WRKSRC}/gio/completion/${file} \
+ ${STAGEDIR}${PREFIX}/share/bash-completion/completions/
.endfor
+ @${RM} -r ${STAGEDIR}${PREFIX}/libexec/installed-tests
.include <bsd.port.post.mk>
Index: devel/glib20/distinfo
===================================================================
--- devel/glib20/distinfo
+++ devel/glib20/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1538415400
-SHA256 (gnome2/glib-2.56.3.tar.xz) = a9a4c5b4c81b6c75bc140bdf5e32120ef3ce841b7413214ecf5f987acec74cb2
-SIZE (gnome2/glib-2.56.3.tar.xz) = 7009912
+TIMESTAMP = 1600085241
+SHA256 (gnome/glib-2.66.0.tar.xz) = c5a66bf143065648c135da4c943d2ac23cce15690fc91c358013b2889111156c
+SIZE (gnome/glib-2.66.0.tar.xz) = 4839236
Index: devel/glib20/files/extra-gobject_gdbscripts
===================================================================
--- devel/glib20/files/extra-gobject_gdbscripts
+++ devel/glib20/files/extra-gobject_gdbscripts
@@ -1,22 +0,0 @@
---- gobject/Makefile.in.orig 2014-03-09 10:09:41.628312066 +0000
-+++ gobject/Makefile.in 2014-03-09 10:09:48.181311433 +0000
-@@ -2003,7 +2003,7 @@
-
- info-am:
-
--install-data-am: install-data-local install-dist_gdbSCRIPTS \
-+install-data-am: install-data-local \
- install-installed_testLTLIBRARIES \
- install-installed_testPROGRAMS install-installed_testSCRIPTS \
- install-installed_test_metaDATA \
-@@ -2230,9 +2230,7 @@
- uninstall-gdb:
- -rm -r $(DESTDIR)$(datadir)/gdb
-
--install-data-hook: libgobject-gdb.py
-- mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)
-- $(INSTALL) $(builddir)/libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
-+install-data-hook:
- @HAVE_GLIB_RUNTIME_LIBDIR_TRUE@ mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
- @HAVE_GLIB_RUNTIME_LIBDIR_TRUE@ mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
- @HAVE_GLIB_RUNTIME_LIBDIR_TRUE@ mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
Index: devel/glib20/files/patch-config.h.in
===================================================================
--- devel/glib20/files/patch-config.h.in
+++ devel/glib20/files/patch-config.h.in
@@ -1,12 +0,0 @@
---- config.h.in.orig 2008-03-18 18:24:24.000000000 -0400
-+++ config.h.in 2008-03-18 18:24:59.000000000 -0400
-@@ -197,6 +197,9 @@
- /* Define to 1 if you have the `getpwuid' function. */
- #undef HAVE_GETPWUID
-
-+/* Define to 1 if you have the `sysctlbyname' function. */
-+#undef HAVE_SYSCTLBYNAME
-+
- /* Define if the GNU gettext() function is already present or preinstalled. */
- #undef HAVE_GETTEXT
-
Index: devel/glib20/files/patch-configure
===================================================================
--- devel/glib20/files/patch-configure
+++ devel/glib20/files/patch-configure
@@ -1,16 +0,0 @@
---- configure.orig 2014-09-28 09:31:41.079343419 +0200
-+++ configure 2014-09-28 09:31:41.243342071 +0200
-@@ -26730,9 +26728,12 @@
- *android*)
- G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS"
- ;;
-- *-*-freebsd*|*-*-linux*)
-+ *-*-linux*)
- G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
- ;;
-+ *-*-freebsd*)
-+ LDFLAGS="$LDFLAGS -pthread"
-+ ;;
- *)
- G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS"
- ;;
Index: devel/glib20/files/patch-docs_reference_Makefile.in
===================================================================
--- devel/glib20/files/patch-docs_reference_Makefile.in
+++ devel/glib20/files/patch-docs_reference_Makefile.in
@@ -1,11 +0,0 @@
---- docs/reference/Makefile.in.orig 2013-09-26 18:08:36.000000000 +0200
-+++ docs/reference/Makefile.in 2013-09-26 18:08:53.000000000 +0200
-@@ -422,7 +422,7 @@
- top_build_prefix = @top_build_prefix@
- top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
--SUBDIRS = glib gobject gio
-+SUBDIRS = #glib gobject gio
- all: all-recursive
-
- .SUFFIXES:
Index: devel/glib20/files/patch-gio_gthreadedresolver.c
===================================================================
--- devel/glib20/files/patch-gio_gthreadedresolver.c
+++ devel/glib20/files/patch-gio_gthreadedresolver.c
@@ -1,12 +0,0 @@
-Upstream bug: https://gitlab.gnome.org/GNOME/glib/issues/1697
-
---- gio/gthreadedresolver.c.orig
-+++ gio/gthreadedresolver.c
-@@ -836,6 +836,7 @@
- * worker thread. (Although the workers would get reused by the
- * #GThreadPool.) */
- struct __res_state res;
-+ memset( &res, 0, sizeof( res ));
- if (res_ninit (&res) != 0)
- {
- g_task_return_new_error (task, G_RESOLVER_ERROR, G_RESOLVER_ERROR_INTERNAL,
Index: devel/glib20/files/patch-gio_kqueue-kqueue-missing.c
===================================================================
--- devel/glib20/files/patch-gio_kqueue-kqueue-missing.c
+++ devel/glib20/files/patch-gio_kqueue-kqueue-missing.c
@@ -1,93 +0,0 @@
---- gio/kqueue/kqueue-missing.c.orig 2018-04-09 22:48:45.637366000 +0200
-+++ gio/kqueue/kqueue-missing.c 2018-04-09 22:48:55.840341000 +0200
-@@ -23,12 +23,12 @@
- #include <glib.h>
-
- #include "kqueue-helper.h"
--#include "kqueue-sub.h"
--#include "kqueue-missing.h"
-
-
- #define SCAN_MISSING_TIME 4 /* 1/4 Hz */
-
-+void _kh_file_appeared_cb (kqueue_sub *sub);
-+
- static gboolean km_scan_missing (gpointer user_data);
-
- static gboolean km_debug_enabled = FALSE;
-@@ -38,24 +38,9 @@ static GSList *missing_subs_list = NULL;
- G_LOCK_DEFINE_STATIC (missing_lock);
-
- static volatile gboolean scan_missing_running = FALSE;
--static on_create_cb file_appeared_callback;
-
-
- /**
-- * _km_init:
-- * @cb: a callback function. It will be called when a watched file
-- * will appear.
-- *
-- * Initialize the kqueue-missing module (optional).
-- **/
--void
--_km_init (on_create_cb cb)
--{
-- file_appeared_callback = cb;
--}
--
--
--/**
- * _km_add_missing:
- * @sub: a #kqueue_sub
- *
-@@ -83,7 +68,36 @@ _km_add_missing (kqueue_sub *sub)
- }
- }
-
-+/**
-+ * _kh_file_appeared_cb:
-+ * @sub: a #kqueue_sub
-+ *
-+ * A callback function for kqueue-missing subsystem.
-+ *
-+ * Signals that a missing file has finally appeared in the filesystem.
-+ * Emits %G_FILE_MONITOR_EVENT_CREATED.
-+ **/
-+void
-+_kh_file_appeared_cb (kqueue_sub *sub)
-+{
-+ GFile *child;
-
-+ g_assert (sub != NULL);
-+ g_assert (sub->filename);
-+
-+ if (!g_file_test (sub->filename, G_FILE_TEST_EXISTS))
-+ return;
-+
-+ child = g_file_new_for_path (sub->filename);
-+
-+ g_file_monitor_emit_event (G_FILE_MONITOR (sub->mon),
-+ child,
-+ NULL,
-+ G_FILE_MONITOR_EVENT_CREATED);
-+
-+ g_object_unref (child);
-+}
-+
- /**
- * km_scan_missing:
- * @user_data: unused
-@@ -114,11 +128,10 @@ km_scan_missing (gpointer user_data)
- g_assert (sub != NULL);
- g_assert (sub->filename != NULL);
-
-- if (_kh_start_watching (sub))
-+ if (_kqsub_start_watching (sub))
- {
- KM_W ("file %s now exists, starting watching", sub->filename);
-- if (file_appeared_callback)
-- file_appeared_callback (sub);
-+ _kh_file_appeared_cb (sub);
- not_missing = g_slist_prepend (not_missing, head);
- }
- }
Index: devel/glib20/files/patch-gio_kqueue_Makefile.in
===================================================================
--- devel/glib20/files/patch-gio_kqueue_Makefile.in
+++ devel/glib20/files/patch-gio_kqueue_Makefile.in
@@ -1,87 +0,0 @@
---- gio/kqueue/Makefile.in.orig 2018-10-01 19:39:31.421019000 +0200
-+++ gio/kqueue/Makefile.in 2018-10-01 19:43:01.841725000 +0200
-@@ -187,9 +187,7 @@ LTLIBRARIES = $(installed_test_LTLIBRARIES) $(noinst_L
- libkqueue_la_LIBADD =
- am__objects_1 =
- am_libkqueue_la_OBJECTS = libkqueue_la-gkqueuefilemonitor.lo \
-- libkqueue_la-kqueue-helper.lo libkqueue_la-kqueue-thread.lo \
-- libkqueue_la-kqueue-sub.lo libkqueue_la-kqueue-missing.lo \
-- libkqueue_la-kqueue-utils.lo libkqueue_la-kqueue-exclusions.lo \
-+ libkqueue_la-kqueue-helper.lo libkqueue_la-kqueue-missing.lo \
- libkqueue_la-dep-list.lo $(am__objects_1)
- libkqueue_la_OBJECTS = $(am_libkqueue_la_OBJECTS)
- AM_V_lt = $(am__v_lt_@AM_V@)
-@@ -785,19 +783,9 @@ all_test_ltlibs = $(test_ltlibraries) $(uninstalled_te
- @ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test)
- libkqueue_la_SOURCES = \
- gkqueuefilemonitor.c \
-- gkqueuefilemonitor.h \
- kqueue-helper.c \
- kqueue-helper.h \
-- kqueue-thread.c \
-- kqueue-thread.h \
-- kqueue-sub.c \
-- kqueue-sub.h \
- kqueue-missing.c \
-- kqueue-missing.h \
-- kqueue-utils.c \
-- kqueue-utils.h \
-- kqueue-exclusions.c \
-- kqueue-exclusions.h \
- dep-list.c \
- dep-list.h \
- $(NULL)
-@@ -1017,12 +1005,8 @@ distclean-compile:
-
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkqueue_la-dep-list.Plo@am__quote@ # am--include-marker
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkqueue_la-gkqueuefilemonitor.Plo@am__quote@ # am--include-marker
--@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkqueue_la-kqueue-exclusions.Plo@am__quote@ # am--include-marker
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkqueue_la-kqueue-helper.Plo@am__quote@ # am--include-marker
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkqueue_la-kqueue-missing.Plo@am__quote@ # am--include-marker
--@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkqueue_la-kqueue-sub.Plo@am__quote@ # am--include-marker
--@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkqueue_la-kqueue-thread.Plo@am__quote@ # am--include-marker
--@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkqueue_la-kqueue-utils.Plo@am__quote@ # am--include-marker
-
- $(am__depfiles_remade):
- @$(MKDIR_P) $(@D)
-@@ -1068,40 +1052,12 @@ libkqueue_la-kqueue-helper.lo: kqueue-helper.c
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -c -o libkqueue_la-kqueue-helper.lo `test -f 'kqueue-helper.c' || echo '$(srcdir)/'`kqueue-helper.c
-
--libkqueue_la-kqueue-thread.lo: kqueue-thread.c
--@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -MT libkqueue_la-kqueue-thread.lo -MD -MP -MF $(DEPDIR)/libkqueue_la-kqueue-thread.Tpo -c -o libkqueue_la-kqueue-thread.lo `test -f 'kqueue-thread.c' || echo '$(srcdir)/'`kqueue-thread.c
--@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkqueue_la-kqueue-thread.Tpo $(DEPDIR)/libkqueue_la-kqueue-thread.Plo
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kqueue-thread.c' object='libkqueue_la-kqueue-thread.lo' libtool=yes @AMDEPBACKSLASH@
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
--@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -c -o libkqueue_la-kqueue-thread.lo `test -f 'kqueue-thread.c' || echo '$(srcdir)/'`kqueue-thread.c
--
--libkqueue_la-kqueue-sub.lo: kqueue-sub.c
--@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -MT libkqueue_la-kqueue-sub.lo -MD -MP -MF $(DEPDIR)/libkqueue_la-kqueue-sub.Tpo -c -o libkqueue_la-kqueue-sub.lo `test -f 'kqueue-sub.c' || echo '$(srcdir)/'`kqueue-sub.c
--@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkqueue_la-kqueue-sub.Tpo $(DEPDIR)/libkqueue_la-kqueue-sub.Plo
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kqueue-sub.c' object='libkqueue_la-kqueue-sub.lo' libtool=yes @AMDEPBACKSLASH@
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
--@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -c -o libkqueue_la-kqueue-sub.lo `test -f 'kqueue-sub.c' || echo '$(srcdir)/'`kqueue-sub.c
--
- libkqueue_la-kqueue-missing.lo: kqueue-missing.c
- @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -MT libkqueue_la-kqueue-missing.lo -MD -MP -MF $(DEPDIR)/libkqueue_la-kqueue-missing.Tpo -c -o libkqueue_la-kqueue-missing.lo `test -f 'kqueue-missing.c' || echo '$(srcdir)/'`kqueue-missing.c
- @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkqueue_la-kqueue-missing.Tpo $(DEPDIR)/libkqueue_la-kqueue-missing.Plo
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kqueue-missing.c' object='libkqueue_la-kqueue-missing.lo' libtool=yes @AMDEPBACKSLASH@
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -c -o libkqueue_la-kqueue-missing.lo `test -f 'kqueue-missing.c' || echo '$(srcdir)/'`kqueue-missing.c
--
--libkqueue_la-kqueue-utils.lo: kqueue-utils.c
--@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -MT libkqueue_la-kqueue-utils.lo -MD -MP -MF $(DEPDIR)/libkqueue_la-kqueue-utils.Tpo -c -o libkqueue_la-kqueue-utils.lo `test -f 'kqueue-utils.c' || echo '$(srcdir)/'`kqueue-utils.c
--@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkqueue_la-kqueue-utils.Tpo $(DEPDIR)/libkqueue_la-kqueue-utils.Plo
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kqueue-utils.c' object='libkqueue_la-kqueue-utils.lo' libtool=yes @AMDEPBACKSLASH@
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
--@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -c -o libkqueue_la-kqueue-utils.lo `test -f 'kqueue-utils.c' || echo '$(srcdir)/'`kqueue-utils.c
--
--libkqueue_la-kqueue-exclusions.lo: kqueue-exclusions.c
--@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -MT libkqueue_la-kqueue-exclusions.lo -MD -MP -MF $(DEPDIR)/libkqueue_la-kqueue-exclusions.Tpo -c -o libkqueue_la-kqueue-exclusions.lo `test -f 'kqueue-exclusions.c' || echo '$(srcdir)/'`kqueue-exclusions.c
--@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkqueue_la-kqueue-exclusions.Tpo $(DEPDIR)/libkqueue_la-kqueue-exclusions.Plo
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kqueue-exclusions.c' object='libkqueue_la-kqueue-exclusions.lo' libtool=yes @AMDEPBACKSLASH@
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
--@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -c -o libkqueue_la-kqueue-exclusions.lo `test -f 'kqueue-exclusions.c' || echo '$(srcdir)/'`kqueue-exclusions.c
-
- libkqueue_la-dep-list.lo: dep-list.c
- @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkqueue_la_CFLAGS) $(CFLAGS) -MT libkqueue_la-dep-list.lo -MD -MP -MF $(DEPDIR)/libkqueue_la-dep-list.Tpo -c -o libkqueue_la-dep-list.lo `test -f 'dep-list.c' || echo '$(srcdir)/'`dep-list.c
Index: devel/glib20/files/patch-gio_kqueue_gkqueuefilemonitor.c
===================================================================
--- devel/glib20/files/patch-gio_kqueue_gkqueuefilemonitor.c
+++ devel/glib20/files/patch-gio_kqueue_gkqueuefilemonitor.c
@@ -1,463 +0,0 @@
---- gio/kqueue/gkqueuefilemonitor.c.orig 2018-04-07 04:10:22.000000000 +0200
-+++ gio/kqueue/gkqueuefilemonitor.c 2018-05-03 20:21:55.830634000 +0200
-@@ -22,33 +22,73 @@
-
- #include "config.h"
-
--#include "gkqueuefilemonitor.h"
--#include "kqueue-helper.h"
--#include "kqueue-exclusions.h"
-+#include <sys/types.h>
-+#include <sys/event.h>
-+#include <sys/time.h>
-+#include <sys/socket.h>
-+#include <sys/stat.h>
-+
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <string.h>
-+
-+#include <glib-object.h>
-+#include <gio/gfilemonitor.h>
-+#include <gio/glocalfilemonitor.h>
-+#include <gio/giomodule.h>
- #include <gio/gpollfilemonitor.h>
- #include <gio/gfile.h>
--#include <gio/giomodule.h>
-+#include <glib-unix.h>
-+#include "glib-private.h"
-
-+#include "kqueue-helper.h"
-+#include "dep-list.h"
-
--struct _GKqueueFileMonitor
-+G_LOCK_DEFINE_STATIC (kq_lock);
-+static GSource *kq_source;
-+static int kq_queue = -1;
-+
-+#define G_TYPE_KQUEUE_FILE_MONITOR (g_kqueue_file_monitor_get_type ())
-+#define G_KQUEUE_FILE_MONITOR(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
-+ G_TYPE_KQUEUE_FILE_MONITOR, GKqueueFileMonitor))
-+
-+typedef GLocalFileMonitorClass GKqueueFileMonitorClass;
-+
-+typedef struct
- {
- GLocalFileMonitor parent_instance;
-
- kqueue_sub *sub;
--
-+#ifndef O_EVTONLY
- GFileMonitor *fallback;
- GFile *fbfile;
--};
-+#endif
-+} GKqueueFileMonitor;
-
-+GType g_kqueue_file_monitor_get_type (void);
-+G_DEFINE_TYPE_WITH_CODE (GKqueueFileMonitor, g_kqueue_file_monitor, G_TYPE_LOCAL_FILE_MONITOR,
-+ g_io_extension_point_implement (G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME,
-+ g_define_type_id,
-+ "kqueue",
-+ 20))
-+
-+#ifndef O_EVTONLY
-+#define O_KQFLAG O_RDONLY
-+#else
-+#define O_KQFLAG O_EVTONLY
-+#endif
-+
-+#define NOTE_ALL (NOTE_DELETE|NOTE_WRITE|NOTE_EXTEND|NOTE_ATTRIB|NOTE_RENAME)
-+
- static gboolean g_kqueue_file_monitor_cancel (GFileMonitor* monitor);
-+static gboolean g_kqueue_file_monitor_is_supported (void);
-
--G_DEFINE_TYPE_WITH_CODE (GKqueueFileMonitor, g_kqueue_file_monitor, G_TYPE_LOCAL_FILE_MONITOR,
-- g_io_extension_point_implement (G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME,
-- g_define_type_id,
-- "kqueue",
-- 20))
-+static kqueue_sub *_kqsub_new (const gchar *, GLocalFileMonitor *, GFileMonitorSource *);
-+static void _kqsub_free (kqueue_sub *);
-+static gboolean _kqsub_cancel (kqueue_sub *);
-
-
-+#ifndef O_EVTONLY
- static void
- _fallback_callback (GFileMonitor *unused,
- GFile *first,
-@@ -57,22 +97,42 @@ _fallback_callback (GFileMonitor *unused,
- gpointer udata)
- {
- GKqueueFileMonitor *kq_mon = G_KQUEUE_FILE_MONITOR (udata);
-- GFileMonitor *mon = G_FILE_MONITOR (kq_mon);
-- g_assert (kq_mon != NULL);
-- g_assert (mon != NULL);
-- (void) unused;
-
-- if (event == G_FILE_MONITOR_EVENT_CHANGED)
-- {
-- GLocalFileMonitor *local_monitor = G_LOCAL_FILE_MONITOR (kq_mon);
--
-- _kh_dir_diff (kq_mon->sub, local_monitor->source);
-- }
-- else
-- g_file_monitor_emit_event (mon, first, second, event);
-+ g_file_monitor_emit_event (G_FILE_MONITOR (kq_mon), first, second, event);
- }
-
-+/*
-+ * _ke_is_excluded:
-+ * @full_path - a path to file to check.
-+ *
-+ * Returns: TRUE if the file should be excluded from the kqueue-powered
-+ * monitoring, FALSE otherwise.
-+ **/
-+gboolean
-+_ke_is_excluded (const char *full_path)
-+{
-+ GFile *f = NULL;
-+ GMount *mount = NULL;
-
-+ f = g_file_new_for_path (full_path);
-+
-+ if (f != NULL) {
-+ mount = g_file_find_enclosing_mount (f, NULL, NULL);
-+ g_object_unref (f);
-+ }
-+
-+ if ((mount != NULL && (g_mount_can_unmount (mount))) || g_str_has_prefix (full_path, "/mnt/"))
-+ {
-+ g_warning ("Excluding %s from kernel notification, falling back to poll", full_path);
-+ if (mount)
-+ g_object_unref (mount);
-+ return TRUE;
-+ }
-+
-+ return FALSE;
-+}
-+#endif /* !O_EVTONLY */
-+
- static void
- g_kqueue_file_monitor_finalize (GObject *object)
- {
-@@ -80,16 +140,18 @@ g_kqueue_file_monitor_finalize (GObject *object)
-
- if (kqueue_monitor->sub)
- {
-- _kh_cancel_sub (kqueue_monitor->sub);
-- _kh_sub_free (kqueue_monitor->sub);
-+ _kqsub_cancel (kqueue_monitor->sub);
-+ _kqsub_free (kqueue_monitor->sub);
- kqueue_monitor->sub = NULL;
- }
-
-+#ifndef O_EVTONLY
- if (kqueue_monitor->fallback)
- g_object_unref (kqueue_monitor->fallback);
-
- if (kqueue_monitor->fbfile)
- g_object_unref (kqueue_monitor->fbfile);
-+#endif
-
- if (G_OBJECT_CLASS (g_kqueue_file_monitor_parent_class)->finalize)
- (*G_OBJECT_CLASS (g_kqueue_file_monitor_parent_class)->finalize) (object);
-@@ -103,21 +165,25 @@ g_kqueue_file_monitor_start (GLocalFileMonitor *local_
- GFileMonitorSource *source)
- {
- GKqueueFileMonitor *kqueue_monitor = G_KQUEUE_FILE_MONITOR (local_monitor);
-- GObject *obj;
-- GKqueueFileMonitorClass *klass;
-- GObjectClass *parent_class;
-- kqueue_sub *sub = NULL;
-- gboolean ret_kh_startup = FALSE;
-- const gchar *path = NULL;
-+ kqueue_sub *sub;
-+ const gchar *path;
-
--
-- ret_kh_startup = _kh_startup ();
-- g_assert (ret_kh_startup);
--
- path = filename;
-- if (!path)
-+ if (path == NULL)
- path = dirname;
-
-+#ifndef O_EVTONLY
-+ if (_ke_is_excluded (path))
-+ {
-+ GFile *file = g_file_new_for_path (path);
-+ kqueue_monitor->fbfile = file;
-+ kqueue_monitor->fallback = _g_poll_file_monitor_new (file);
-+ g_signal_connect (kqueue_monitor->fallback, "changed",
-+ G_CALLBACK (_fallback_callback), kqueue_monitor);
-+ return;
-+ }
-+#endif
-+
- /* For a directory monitor, create a subscription object anyway.
- * It will be used for directory diff calculation routines.
- * Wait, directory diff in a GKqueueFileMonitor?
-@@ -125,35 +191,15 @@ g_kqueue_file_monitor_start (GLocalFileMonitor *local_
- * file, GIO uses a GKqueueFileMonitor object for that. If a directory
- * will be created under that path, GKqueueFileMonitor will have to
- * handle the directory notifications. */
-+ sub = _kqsub_new (path, local_monitor, source);
-+ if (sub == NULL)
-+ return;
-
-- sub = _kh_sub_new (path, TRUE, source);
--
-- /* FIXME: what to do about errors here? we can't return NULL or another
-- * kind of error and an assertion is probably too hard (same issue as in
-- * the inotify backend) */
-- g_assert (sub != NULL);
- kqueue_monitor->sub = sub;
--
-- if (!_ke_is_excluded (path))
-- _kh_add_sub (sub);
-- else
-- {
-- GFile *file = g_file_new_for_path (path);
-- kqueue_monitor->fbfile = file;
-- kqueue_monitor->fallback = _g_poll_file_monitor_new (file);
-- g_signal_connect (kqueue_monitor->fallback,
-- "changed",
-- G_CALLBACK (_fallback_callback),
-- kqueue_monitor);
-- }
-+ if (!_kqsub_start_watching (sub))
-+ _km_add_missing (sub);
- }
-
--static gboolean
--g_kqueue_file_monitor_is_supported (void)
--{
-- return _kh_startup ();
--}
--
- static void
- g_kqueue_file_monitor_class_init (GKqueueFileMonitorClass *klass)
- {
-@@ -175,24 +221,218 @@ g_kqueue_file_monitor_init (GKqueueFileMonitor *monito
- }
-
- static gboolean
-+g_kqueue_file_monitor_callback (gint fd, GIOCondition condition, gpointer user_data)
-+{
-+ gint64 now = g_source_get_time (kq_source);
-+ kqueue_sub *sub;
-+ GFileMonitorSource *source;
-+ struct kevent ev;
-+ struct timespec ts;
-+
-+ memset (&ts, 0, sizeof(ts));
-+ while (kevent(fd, NULL, 0, &ev, 1, &ts) > 0)
-+ {
-+ GFileMonitorEvent mask = 0;
-+
-+ if (ev.filter != EVFILT_VNODE || ev.udata == NULL)
-+ continue;
-+
-+ sub = ev.udata;
-+ source = sub->source;
-+
-+ if (ev.flags & EV_ERROR)
-+ ev.fflags = NOTE_REVOKE;
-+
-+ if (ev.fflags & (NOTE_DELETE | NOTE_REVOKE))
-+ {
-+ _kqsub_cancel (sub);
-+ _km_add_missing (sub);
-+ }
-+
-+ if (sub->is_dir && ev.fflags & (NOTE_WRITE | NOTE_EXTEND))
-+ {
-+ _kh_dir_diff (sub);
-+ ev.fflags &= ~(NOTE_WRITE | NOTE_EXTEND);
-+ }
-+
-+ if (ev.fflags & NOTE_DELETE)
-+ {
-+ mask = G_FILE_MONITOR_EVENT_DELETED;
-+ }
-+ else if (ev.fflags & NOTE_ATTRIB)
-+ {
-+ mask = G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED;
-+ }
-+ else if (ev.fflags & (NOTE_WRITE | NOTE_EXTEND))
-+ {
-+ mask = G_FILE_MONITOR_EVENT_CHANGED;
-+ }
-+ else if (ev.fflags & NOTE_RENAME)
-+ {
-+ /* Since there’s apparently no way to get the new name of the
-+ * file out of kqueue(), all we can do is say that this one has
-+ * been deleted. */
-+ mask = G_FILE_MONITOR_EVENT_DELETED;
-+ }
-+ else if (ev.fflags & NOTE_REVOKE)
-+ {
-+ mask = G_FILE_MONITOR_EVENT_UNMOUNTED;
-+ }
-+
-+ if (mask)
-+ g_file_monitor_source_handle_event (source, mask, NULL, NULL, NULL, now);
-+ }
-+
-+ return TRUE;
-+}
-+
-+static gboolean
-+g_kqueue_file_monitor_is_supported (void)
-+{
-+ int errsv;
-+
-+ G_LOCK (kq_lock);
-+
-+ if (kq_queue == -1)
-+ {
-+ kq_queue = kqueue ();
-+ errsv = errno;
-+
-+ if (kq_queue == -1)
-+ {
-+ g_warning ("Unable to create a kqueue: %s", g_strerror (errsv));
-+ G_UNLOCK (kq_lock);
-+ return FALSE;
-+ }
-+
-+ kq_source = g_unix_fd_source_new (kq_queue, G_IO_IN);
-+ g_source_set_callback (kq_source, (GSourceFunc) g_kqueue_file_monitor_callback, NULL, NULL);
-+ g_source_attach (kq_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
-+ }
-+
-+ G_UNLOCK (kq_lock);
-+
-+ return TRUE;
-+}
-+
-+static gboolean
- g_kqueue_file_monitor_cancel (GFileMonitor *monitor)
- {
- GKqueueFileMonitor *kqueue_monitor = G_KQUEUE_FILE_MONITOR (monitor);
-
- if (kqueue_monitor->sub)
- {
-- _kh_cancel_sub (kqueue_monitor->sub);
-- _kh_sub_free (kqueue_monitor->sub);
-+ _kqsub_cancel (kqueue_monitor->sub);
-+ _kqsub_free (kqueue_monitor->sub);
- kqueue_monitor->sub = NULL;
- }
-+#ifndef O_EVTONLY
- else if (kqueue_monitor->fallback)
- {
- g_signal_handlers_disconnect_by_func (kqueue_monitor->fallback, _fallback_callback, kqueue_monitor);
- g_file_monitor_cancel (kqueue_monitor->fallback);
- }
-+#endif
-
- if (G_FILE_MONITOR_CLASS (g_kqueue_file_monitor_parent_class)->cancel)
- (*G_FILE_MONITOR_CLASS (g_kqueue_file_monitor_parent_class)->cancel) (monitor);
-+
-+ return TRUE;
-+}
-+
-+static kqueue_sub *
-+_kqsub_new (const gchar *filename, GLocalFileMonitor *mon, GFileMonitorSource *source)
-+{
-+ kqueue_sub *sub;
-+
-+ sub = g_slice_new (kqueue_sub);
-+ sub->filename = g_strdup (filename);
-+ sub->mon = mon;
-+ g_source_ref ((GSource *) source);
-+ sub->source = source;
-+ sub->fd = -1;
-+ sub->deps = NULL;
-+ sub->is_dir = 0;
-+
-+ return sub;
-+}
-+
-+static void
-+_kqsub_free (kqueue_sub *sub)
-+{
-+ g_assert (sub->deps == NULL);
-+ g_assert (sub->fd == -1);
-+
-+ g_source_unref ((GSource *) sub->source);
-+ g_free (sub->filename);
-+ g_slice_free (kqueue_sub, sub);
-+}
-+
-+static gboolean
-+_kqsub_cancel (kqueue_sub *sub)
-+{
-+ struct kevent ev;
-+
-+ /* Remove the event and close the file descriptor to automatically
-+ * delete pending events. */
-+ if (sub->fd != -1)
-+ {
-+ EV_SET (&ev, sub->fd, EVFILT_VNODE, EV_DELETE, NOTE_ALL, 0, sub);
-+ if (kevent (kq_queue, &ev, 1, NULL, 0, NULL) == -1)
-+ {
-+ g_warning ("Unable to remove event for %s: %s", sub->filename, g_strerror (errno));
-+ return FALSE;
-+ }
-+ close (sub->fd);
-+ sub->fd = -1;
-+ }
-+
-+ _km_remove (sub);
-+
-+ if (sub->deps)
-+ {
-+ dl_free (sub->deps);
-+ sub->deps = NULL;
-+ }
-+
-+ return TRUE;
-+}
-+
-+gboolean
-+_kqsub_start_watching (kqueue_sub *sub)
-+{
-+ struct stat st;
-+ struct kevent ev;
-+
-+ sub->fd = open (sub->filename, O_KQFLAG);
-+ if (sub->fd == -1)
-+ return FALSE;
-+
-+ if (fstat (sub->fd, &st) == -1)
-+ {
-+ g_warning ("fstat failed for %s: %s", sub->filename, g_strerror (errno));
-+ close (sub->fd);
-+ sub->fd = -1;
-+ return FALSE;
-+ }
-+
-+ sub->is_dir = (st.st_mode & S_IFDIR) ? 1 : 0;
-+ if (sub->is_dir)
-+ {
-+ if (sub->deps)
-+ dl_free (sub->deps);
-+
-+ sub->deps = dl_listing (sub->filename);
-+ }
-+
-+ EV_SET (&ev, sub->fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_ALL, 0, sub);
-+ if (kevent (kq_queue, &ev, 1, NULL, 0, NULL) == -1)
-+ {
-+ g_warning ("Unable to add event for %s: %s", sub->filename, g_strerror (errno));
-+ close (sub->fd);
-+ sub->fd = -1;
-+ return FALSE;
-+ }
-
- return TRUE;
- }
Index: devel/glib20/files/patch-gio_kqueue_kqueue-helper.h
===================================================================
--- devel/glib20/files/patch-gio_kqueue_kqueue-helper.h
+++ devel/glib20/files/patch-gio_kqueue_kqueue-helper.h
@@ -1,40 +0,0 @@
---- gio/kqueue/kqueue-helper.h.orig 2018-04-09 22:47:22.070991000 +0200
-+++ gio/kqueue/kqueue-helper.h 2018-04-09 22:47:44.329479000 +0200
-@@ -23,16 +23,31 @@
- #ifndef __KQUEUE_HELPER_H
- #define __KQUEUE_HELPER_H
-
--#include "kqueue-sub.h"
- #include <gio/glocalfilemonitor.h>
- #include <gio/gfilemonitor.h>
-
--gboolean _kh_startup (void);
--gboolean _kh_add_sub (kqueue_sub *sub);
--gboolean _kh_cancel_sub (kqueue_sub *sub);
-+#include "dep-list.h"
-
--gboolean _kh_start_watching (kqueue_sub *sub);
-+/**
-+ * kqueue_sub:
-+ * @filename: a name of the file to monitor
-+ * @fd: the associated file descriptor (used by kqueue)
-+ *
-+ * Represents a subscription on a file or directory.
-+ */
-+typedef struct
-+{
-+ GLocalFileMonitor *mon;
-+ GFileMonitorSource *source;
-+ gchar* filename;
-+ int fd;
-+ dep_list* deps;
-+ int is_dir;
-+} kqueue_sub;
-
--void _kh_dir_diff (kqueue_sub *sub, GFileMonitorSource *source);
-+gboolean _kqsub_start_watching (kqueue_sub *sub);
-+void _kh_dir_diff (kqueue_sub *sub);
-+void _km_add_missing (kqueue_sub *sub);
-+void _km_remove (kqueue_sub *sub);
-
- #endif /* __KQUEUE_HELPER_H */
Index: devel/glib20/files/patch-gio_kqueue_kqueue-helper.c
===================================================================
--- devel/glib20/files/patch-gio_kqueue_kqueue-helper.c
+++ devel/glib20/files/patch-gio_kqueue_kqueue-helper.c
@@ -1,409 +0,0 @@
---- gio/kqueue/kqueue-helper.c.orig 2018-01-08 21:00:49.000000000 +0100
-+++ gio/kqueue/kqueue-helper.c 2018-04-09 22:46:58.181986000 +0200
-@@ -34,84 +34,7 @@
- #include <errno.h>
- #include <pthread.h>
- #include "kqueue-helper.h"
--#include "kqueue-utils.h"
--#include "kqueue-thread.h"
--#include "kqueue-missing.h"
--#include "kqueue-exclusions.h"
-
--static gboolean kh_debug_enabled = FALSE;
--#define KH_W if (kh_debug_enabled) g_warning
--
--static GHashTable *subs_hash_table = NULL;
--G_LOCK_DEFINE_STATIC (hash_lock);
--
--static int kqueue_descriptor = -1;
--static int kqueue_socket_pair[] = {-1, -1};
--static pthread_t kqueue_thread;
--
--
--void _kh_file_appeared_cb (kqueue_sub *sub);
--
--/**
-- * accessor function for kqueue_descriptor
-- **/
--int
--get_kqueue_descriptor()
--{
-- return kqueue_descriptor;
--}
--
--/**
-- * convert_kqueue_events_to_gio:
-- * @flags: a set of kqueue filter flags
-- * @done: a pointer to #gboolean indicating that the
-- * conversion has been done (out)
-- *
-- * Translates kqueue filter flags into GIO event flags.
-- *
-- * Returns: a #GFileMonitorEvent
-- **/
--static GFileMonitorEvent
--convert_kqueue_events_to_gio (uint32_t flags, gboolean *done)
--{
-- g_assert (done != NULL);
-- *done = FALSE;
--
-- /* TODO: The following notifications should be emulated, if possible:
-- * - G_FILE_MONITOR_EVENT_PRE_UNMOUNT
-- */
-- if (flags & NOTE_DELETE)
-- {
-- *done = TRUE;
-- return G_FILE_MONITOR_EVENT_DELETED;
-- }
-- if (flags & NOTE_ATTRIB)
-- {
-- *done = TRUE;
-- return G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED;
-- }
-- if (flags & (NOTE_WRITE | NOTE_EXTEND))
-- {
-- *done = TRUE;
-- return G_FILE_MONITOR_EVENT_CHANGED;
-- }
-- if (flags & NOTE_RENAME)
-- {
-- /* Since there’s apparently no way to get the new name of the file out of
-- * kqueue(), all we can do is say that this one has been deleted. */
-- *done = TRUE;
-- return G_FILE_MONITOR_EVENT_DELETED;
-- }
-- if (flags & NOTE_REVOKE)
-- {
-- *done = TRUE;
-- return G_FILE_MONITOR_EVENT_UNMOUNTED;
-- }
--
-- /* done is FALSE */
-- return 0;
--}
--
- typedef struct {
- kqueue_sub *sub;
- GFileMonitorSource *source;
-@@ -238,318 +161,21 @@ static const traverse_cbs cbs = {
-
-
- void
--_kh_dir_diff (kqueue_sub *sub, GFileMonitorSource *source)
-+_kh_dir_diff (kqueue_sub *sub)
- {
- dep_list *was;
- handle_ctx ctx;
-
-- g_assert (sub != NULL);
-- g_assert (source != NULL);
--
- memset (&ctx, 0, sizeof (handle_ctx));
- ctx.sub = sub;
-- ctx.source = source;
-+ ctx.source = sub->source;
-
- was = sub->deps;
- sub->deps = dl_listing (sub->filename);
--
-+
- dl_calculate (was, sub->deps, &cbs, &ctx);
-
- dl_free (was);
- }
-
-
--/**
-- * process_kqueue_notifications:
-- * @gioc: unused.
-- * @cond: unused.
-- * @data: unused.
-- *
-- * Processes notifications, coming from the kqueue thread.
-- *
-- * Reads notifications from the command file descriptor, emits the
-- * "changed" event on the appropriate monitor.
-- *
-- * A typical GIO Channel callback function.
-- *
-- * Returns: %TRUE
-- **/
--static gboolean
--process_kqueue_notifications (GIOChannel *gioc,
-- GIOCondition cond,
-- gpointer data)
--{
-- struct kqueue_notification n;
-- kqueue_sub *sub = NULL;
-- GFileMonitorSource *source = NULL;
-- GFileMonitorEvent mask = 0;
--
-- g_assert (kqueue_socket_pair[0] != -1);
-- if (!_ku_read (kqueue_socket_pair[0], &n, sizeof (struct kqueue_notification)))
-- {
-- KH_W ("Failed to read a kqueue notification, error %d", errno);
-- return TRUE;
-- }
--
-- G_LOCK (hash_lock);
-- sub = (kqueue_sub *) g_hash_table_lookup (subs_hash_table, GINT_TO_POINTER (n.fd));
-- G_UNLOCK (hash_lock);
--
-- if (sub == NULL)
-- {
-- KH_W ("Got a notification for a deleted or non-existing subscription %d",
-- n.fd);
-- return TRUE;
-- }
--
-- source = sub->user_data;
-- g_assert (source != NULL);
--
-- if (n.flags & (NOTE_DELETE | NOTE_REVOKE))
-- {
-- if (sub->deps)
-- {
-- dl_free (sub->deps);
-- sub->deps = NULL;
-- }
-- _km_add_missing (sub);
--
-- if (!(n.flags & NOTE_REVOKE))
-- {
-- /* Note that NOTE_REVOKE is issued by the kqueue thread
-- * on EV_ERROR kevent. In this case, a file descriptor is
-- * already closed from the kqueue thread, no need to close
-- * it manually */
-- _kh_cancel_sub (sub);
-- }
-- }
--
-- if (sub->is_dir && n.flags & (NOTE_WRITE | NOTE_EXTEND))
-- {
-- _kh_dir_diff (sub, source);
-- n.flags &= ~(NOTE_WRITE | NOTE_EXTEND);
-- }
--
-- if (n.flags)
-- {
-- gboolean done = FALSE;
-- mask = convert_kqueue_events_to_gio (n.flags, &done);
-- if (done == TRUE)
-- g_file_monitor_source_handle_event (source, mask, NULL, NULL, NULL, g_get_monotonic_time ());
-- }
--
-- return TRUE;
--}
--
--
--/*
-- * _kh_startup_impl:
-- * @unused: unused
-- *
-- * Kqueue backend startup code. Should be called only once.
-- *
-- * Returns: %TRUE on success, %FALSE otherwise.
-- **/
--static gpointer
--_kh_startup_impl (gpointer unused)
--{
-- GIOChannel *channel = NULL;
-- gboolean result = FALSE;
--
-- kqueue_descriptor = kqueue ();
-- result = (kqueue_descriptor != -1);
-- if (!result)
-- {
-- KH_W ("Failed to initialize kqueue\n!");
-- return GINT_TO_POINTER (FALSE);
-- }
--
-- result = socketpair (AF_UNIX, SOCK_STREAM, 0, kqueue_socket_pair);
-- if (result != 0)
-- {
-- KH_W ("Failed to create socket pair\n!");
-- return GINT_TO_POINTER (FALSE) ;
-- }
--
-- result = pthread_create (&kqueue_thread,
-- NULL,
-- _kqueue_thread_func,
-- &kqueue_socket_pair[1]);
-- if (result != 0)
-- {
-- KH_W ("Failed to run kqueue thread\n!");
-- return GINT_TO_POINTER (FALSE);
-- }
--
-- _km_init (_kh_file_appeared_cb);
--
-- channel = g_io_channel_unix_new (kqueue_socket_pair[0]);
-- g_io_add_watch (channel, G_IO_IN, process_kqueue_notifications, NULL);
--
-- subs_hash_table = g_hash_table_new (g_direct_hash, g_direct_equal);
--
-- KH_W ("started gio kqueue backend\n");
-- return GINT_TO_POINTER (TRUE);
--}
--
--
--/*
-- * _kh_startup:
-- * Kqueue backend initialization.
-- *
-- * Returns: %TRUE on success, %FALSE otherwise.
-- **/
--gboolean
--_kh_startup (void)
--{
-- static GOnce init_once = G_ONCE_INIT;
-- g_once (&init_once, _kh_startup_impl, NULL);
-- return GPOINTER_TO_INT (init_once.retval);
--}
--
--
--/**
-- * _kh_start_watching:
-- * @sub: a #kqueue_sub
-- *
-- * Starts watching on a subscription.
-- *
-- * Returns: %TRUE on success, %FALSE otherwise.
-- **/
--gboolean
--_kh_start_watching (kqueue_sub *sub)
--{
-- g_assert (kqueue_socket_pair[0] != -1);
-- g_assert (sub != NULL);
-- g_assert (sub->filename != NULL);
--
-- /* kqueue requires a file descriptor to monitor. Sad but true */
--#if defined (O_EVTONLY)
-- sub->fd = open (sub->filename, O_EVTONLY);
--#else
-- sub->fd = open (sub->filename, O_RDONLY);
--#endif
--
-- if (sub->fd == -1)
-- {
-- KH_W ("failed to open file %s (error %d)", sub->filename, errno);
-- return FALSE;
-- }
--
-- _ku_file_information (sub->fd, &sub->is_dir, NULL);
-- if (sub->is_dir)
-- {
-- /* I know, it is very bad to make such decisions in this way and here.
-- * We already do have an user_data at the #kqueue_sub, and it may point to
-- * GKqueueFileMonitor or GKqueueDirectoryMonitor. For a directory case,
-- * we need to scan in contents for the further diffs. Ideally this process
-- * should be delegated to the GKqueueDirectoryMonitor, but for now I will
-- * do it in a dirty way right here. */
-- if (sub->deps)
-- dl_free (sub->deps);
--
-- sub->deps = dl_listing (sub->filename);
-- }
--
-- G_LOCK (hash_lock);
-- g_hash_table_insert (subs_hash_table, GINT_TO_POINTER (sub->fd), sub);
-- G_UNLOCK (hash_lock);
--
-- _kqueue_thread_push_fd (sub->fd);
--
-- /* Bump the kqueue thread. It will pick up a new sub entry to monitor */
-- if (!_ku_write (kqueue_socket_pair[0], "A", 1))
-- KH_W ("Failed to bump the kqueue thread (add fd, error %d)", errno);
-- return TRUE;
--}
--
--
--/**
-- * _kh_add_sub:
-- * @sub: a #kqueue_sub
-- *
-- * Adds a subscription for monitoring.
-- *
-- * This funciton tries to start watching a subscription with
-- * _kh_start_watching(). On failure, i.e. when a file does not exist yet,
-- * the subscription will be added to a list of missing files to continue
-- * watching when the file will appear.
-- *
-- * Returns: %TRUE
-- **/
--gboolean
--_kh_add_sub (kqueue_sub *sub)
--{
-- g_assert (sub != NULL);
--
-- if (!_kh_start_watching (sub))
-- _km_add_missing (sub);
--
-- return TRUE;
--}
--
--
--/**
-- * _kh_cancel_sub:
-- * @sub a #kqueue_sub
-- *
-- * Stops monitoring on a subscription.
-- *
-- * Returns: %TRUE
-- **/
--gboolean
--_kh_cancel_sub (kqueue_sub *sub)
--{
-- gboolean removed = FALSE;
-- g_assert (kqueue_socket_pair[0] != -1);
-- g_assert (sub != NULL);
--
-- _km_remove (sub);
--
-- G_LOCK (hash_lock);
-- removed = g_hash_table_remove (subs_hash_table, GINT_TO_POINTER (sub->fd));
-- G_UNLOCK (hash_lock);
--
-- if (removed)
-- {
-- /* fd will be closed in the kqueue thread */
-- _kqueue_thread_remove_fd (sub->fd);
--
-- /* Bump the kqueue thread. It will pick up a new sub entry to remove*/
-- if (!_ku_write (kqueue_socket_pair[0], "R", 1))
-- KH_W ("Failed to bump the kqueue thread (remove fd, error %d)", errno);
-- }
--
-- return TRUE;
--}
--
--
--/**
-- * _kh_file_appeared_cb:
-- * @sub: a #kqueue_sub
-- *
-- * A callback function for kqueue-missing subsystem.
-- *
-- * Signals that a missing file has finally appeared in the filesystem.
-- * Emits %G_FILE_MONITOR_EVENT_CREATED.
-- **/
--void
--_kh_file_appeared_cb (kqueue_sub *sub)
--{
-- GFile* child;
--
-- g_assert (sub != NULL);
-- g_assert (sub->filename);
--
-- if (!g_file_test (sub->filename, G_FILE_TEST_EXISTS))
-- return;
--
-- child = g_file_new_for_path (sub->filename);
--
-- g_file_monitor_emit_event (G_FILE_MONITOR (sub->user_data),
-- child,
-- NULL,
-- G_FILE_MONITOR_EVENT_CREATED);
--
-- g_object_unref (child);
--}
Index: devel/glib20/files/patch-glib_gconvert.c
===================================================================
--- devel/glib20/files/patch-glib_gconvert.c
+++ devel/glib20/files/patch-glib_gconvert.c
@@ -1,14 +0,0 @@
-Work around our situation of having both libiconv in libc and libiconv from
-ports installed.
-
---- glib/gconvert.c.orig 2014-02-08 10:15:50.000000000 +0100
-+++ glib/gconvert.c 2014-02-08 10:16:52.000000000 +0100
-@@ -62,7 +62,7 @@
- #error GNU libiconv in use but included iconv.h not from libiconv
- #endif
- #if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H) \
-- && !defined (__APPLE_CC__) && !defined (__LP_64__)
-+ && !defined (LIBICONV_PLUG) && !defined (__APPLE_CC__) && !defined (__LP_64__)
- #error GNU libiconv not in use but included iconv.h is from libiconv
- #endif
-
Index: devel/glib20/files/patch-glib_gfileutils.c
===================================================================
--- devel/glib20/files/patch-glib_gfileutils.c
+++ devel/glib20/files/patch-glib_gfileutils.c
@@ -0,0 +1,14 @@
+https://gitlab.gnome.org/GNOME/glib/merge_requests/832
+
+Index: glib/gfileutils.c
+--- glib/gfileutils.c.orig
++++ glib/gfileutils.c
+@@ -259,7 +259,7 @@ g_mkdir_with_parents (const gchar *pathname,
+
+ if (!g_file_test (fn, G_FILE_TEST_EXISTS))
+ {
+- if (g_mkdir (fn, mode) == -1 && errno != EEXIST)
++ if (g_mkdir (fn, mode) == -1 && errno != EEXIST && (p ? (errno != ENOENT) : (-1)))
+ {
+ int errno_save = errno;
+ if (errno != ENOENT || !p)
Index: devel/glib20/files/patch-glib_gutils.c
===================================================================
--- devel/glib20/files/patch-glib_gutils.c
+++ devel/glib20/files/patch-glib_gutils.c
@@ -1,20 +1,11 @@
---- glib/gutils.c.orig Wed Mar 23 09:55:02 2005
-+++ glib/gutils.c Thu Apr 7 01:06:16 2005
-@@ -1929,7 +1929,7 @@ g_get_system_data_dirs (void)
- data_dirs = (gchar *) g_getenv ("XDG_DATA_DIRS");
+--- glib/gutils.c.orig 2018-12-23 14:10:41.000000000 +0100
++++ glib/gutils.c 2018-12-27 00:18:23.471950000 +0100
+@@ -2219,7 +2219,7 @@
+ }
+ #else
+ if (!conf_dirs || !conf_dirs[0])
+- conf_dirs = "/etc/xdg";
++ conf_dirs = "/usr/local/etc/xdg:/etc/xdg";
- if (!data_dirs || !data_dirs[0])
-- data_dirs = "/usr/local/share/:/usr/share/";
-+ data_dirs = "/usr/local/share/";
-
- data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
+ conf_dir_vector = g_strsplit (conf_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
#endif
-@@ -1983,7 +1983,7 @@ g_get_system_config_dirs (void)
- conf_dirs = (gchar *) g_getenv ("XDG_CONFIG_DIRS");
-
- if (!conf_dirs || !conf_dirs[0])
-- conf_dirs = "/etc/xdg";
-+ conf_dirs = "/usr/local/etc/xdg:/etc/xdg";
-
- conf_dir_vector = g_strsplit (conf_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
- #endif
Index: devel/glib20/files/patch-glib_libcharset_Makefile.in
===================================================================
--- devel/glib20/files/patch-glib_libcharset_Makefile.in
+++ devel/glib20/files/patch-glib_libcharset_Makefile.in
@@ -1,11 +0,0 @@
---- glib/libcharset/Makefile.in.orig 2010-08-08 12:46:01.000000000 +0200
-+++ glib/libcharset/Makefile.in 2010-08-08 12:46:01.000000000 +0200
-@@ -566,7 +566,7 @@ install-dvi: install-dvi-am
-
- install-dvi-am:
-
--install-exec-am: install-exec-local
-+install-exec-am: # install-exec-local
-
- install-html: install-html-am
-
Index: devel/glib20/files/patch-keyfile
===================================================================
--- devel/glib20/files/patch-keyfile
+++ devel/glib20/files/patch-keyfile
@@ -1,668 +0,0 @@
-https://gitlab.gnome.org/GNOME/glib/-/merge_requests/450
-https://gitlab.gnome.org/GNOME/glib/-/merge_requests/603
-https://gitlab.gnome.org/GNOME/glib/-/merge_requests/604
-https://gitlab.gnome.org/GNOME/glib/-/merge_requests/629
-https://gitlab.gnome.org/GNOME/glib/-/merge_requests/974
-https://gitlab.gnome.org/GNOME/glib/-/merge_requests/984
-https://gitlab.gnome.org/GNOME/glib/-/merge_requests/985
-
---- gio/giomodule.c.orig 2018-09-21 09:29:23 UTC
-+++ gio/giomodule.c
-@@ -1136,6 +1136,7 @@ _g_io_modules_ensure_loaded (void)
- /* Initialize types from built-in "modules" */
- g_type_ensure (g_null_settings_backend_get_type ());
- g_type_ensure (g_memory_settings_backend_get_type ());
-+ g_type_ensure (g_keyfile_settings_backend_get_type ());
- #if defined(HAVE_INOTIFY_INIT1)
- g_type_ensure (g_inotify_file_monitor_get_type ());
- #endif
---- gio/gkeyfilesettingsbackend.c.orig 2018-08-15 16:22:08 UTC
-+++ gio/gkeyfilesettingsbackend.c
-@@ -21,14 +21,20 @@
-
- #include "config.h"
-
-+#include <glib.h>
-+#include <glibintl.h>
-+
- #include <stdio.h>
- #include <string.h>
-
- #include "gfile.h"
- #include "gfileinfo.h"
-+#include "gfileenumerator.h"
- #include "gfilemonitor.h"
- #include "gsimplepermission.h"
--#include "gsettingsbackend.h"
-+#include "gsettingsbackendinternal.h"
-+#include "giomodule-priv.h"
-+#include "gportalsupport.h"
-
-
- #define G_TYPE_KEYFILE_SETTINGS_BACKEND (g_keyfile_settings_backend_get_type ())
-@@ -41,6 +47,13 @@
-
- typedef GSettingsBackendClass GKeyfileSettingsBackendClass;
-
-+typedef enum {
-+ PROP_FILENAME = 1,
-+ PROP_ROOT_PATH,
-+ PROP_ROOT_GROUP,
-+ PROP_DEFAULTS_DIR
-+} GKeyfileSettingsBackendProperty;
-+
- typedef struct
- {
- GSettingsBackend parent_instance;
-@@ -48,6 +61,9 @@ typedef struct
- GKeyFile *keyfile;
- GPermission *permission;
- gboolean writable;
-+ char *defaults_dir;
-+ GKeyFile *system_keyfile;
-+ GHashTable *system_locks; /* Used as a set, owning the strings it contains */
-
- gchar *prefix;
- gint prefix_len;
-@@ -61,11 +77,19 @@ typedef struct
- GFileMonitor *dir_monitor;
- } GKeyfileSettingsBackend;
-
--static GType g_keyfile_settings_backend_get_type (void);
--G_DEFINE_TYPE (GKeyfileSettingsBackend,
-- g_keyfile_settings_backend,
-- G_TYPE_SETTINGS_BACKEND)
-+#ifdef G_OS_WIN32
-+#define EXTENSION_PRIORITY 10
-+#else
-+#define EXTENSION_PRIORITY (glib_should_use_portal () && !glib_has_dconf_access_in_sandbox () ? 110 : 10)
-+#endif
-
-+G_DEFINE_TYPE_WITH_CODE (GKeyfileSettingsBackend,
-+ g_keyfile_settings_backend,
-+ G_TYPE_SETTINGS_BACKEND,
-+ _g_io_modules_ensure_extension_points_registered ();
-+ g_io_extension_point_implement (G_SETTINGS_BACKEND_EXTENSION_POINT_NAME,
-+ g_define_type_id, "keyfile", EXTENSION_PRIORITY))
-+
- static void
- compute_checksum (guint8 *digest,
- gconstpointer contents,
-@@ -89,7 +113,8 @@ g_keyfile_settings_backend_keyfile_write (GKeyfileSett
-
- contents = g_key_file_to_data (kfsb->keyfile, &length, NULL);
- g_file_replace_contents (kfsb->file, contents, length, NULL, FALSE,
-- G_FILE_CREATE_REPLACE_DESTINATION,
-+ G_FILE_CREATE_REPLACE_DESTINATION |
-+ G_FILE_CREATE_PRIVATE,
- NULL, NULL, NULL);
-
- compute_checksum (kfsb->digest, contents, length);
-@@ -184,17 +209,51 @@ get_from_keyfile (GKeyfileSettingsBackend *kfsb,
- if (convert_path (kfsb, key, &group, &name))
- {
- gchar *str;
-+ gchar *sysstr;
-
- g_assert (*name);
-
-+ sysstr = g_key_file_get_value (kfsb->system_keyfile, group, name, NULL);
- str = g_key_file_get_value (kfsb->keyfile, group, name, NULL);
-+ if (sysstr &&
-+ (g_hash_table_contains (kfsb->system_locks, key) ||
-+ str == NULL))
-+ {
-+ g_free (str);
-+ str = g_steal_pointer (&sysstr);
-+ }
-
- if (str)
- {
- return_value = g_variant_parse (type, str, NULL, NULL, NULL);
-+
-+ /* As a special case, support values of type %G_VARIANT_TYPE_STRING
-+ * not being quoted, since users keep forgetting to do it and then
-+ * getting confused. */
-+ if (return_value == NULL &&
-+ g_variant_type_equal (type, G_VARIANT_TYPE_STRING) &&
-+ str[0] != '\"')
-+ {
-+ GString *s = g_string_sized_new (strlen (str) + 2);
-+ char *p = str;
-+
-+ g_string_append_c (s, '\"');
-+ while (*p)
-+ {
-+ if (*p == '\"')
-+ g_string_append_c (s, '\\');
-+ g_string_append_c (s, *p);
-+ p++;
-+ }
-+ g_string_append_c (s, '\"');
-+ return_value = g_variant_parse (type, s->str, NULL, NULL, NULL);
-+ g_string_free (s, TRUE);
-+ }
- g_free (str);
- }
-
-+ g_free (sysstr);
-+
- g_free (group);
- g_free (name);
- }
-@@ -209,6 +268,9 @@ set_to_keyfile (GKeyfileSettingsBackend *kfsb,
- {
- gchar *group, *name;
-
-+ if (g_hash_table_contains (kfsb->system_locks, key))
-+ return FALSE;
-+
- if (convert_path (kfsb, key, &group, &name))
- {
- if (value)
-@@ -287,7 +349,8 @@ g_keyfile_settings_backend_check_one (gpointer key,
- {
- WriteManyData *data = user_data;
-
-- return data->failed = !path_is_valid (data->kfsb, key);
-+ return data->failed = g_hash_table_contains (data->kfsb->system_locks, key) ||
-+ !path_is_valid (data->kfsb, key);
- }
-
- static gboolean
-@@ -355,7 +418,9 @@ g_keyfile_settings_backend_get_writable (GSettingsBack
- {
- GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
-
-- return kfsb->writable && path_is_valid (kfsb, name);
-+ return kfsb->writable &&
-+ !g_hash_table_contains (kfsb->system_locks, name) &&
-+ path_is_valid (kfsb, name);
- }
-
- static GPermission *
-@@ -501,6 +566,9 @@ g_keyfile_settings_backend_finalize (GObject *object)
-
- g_key_file_free (kfsb->keyfile);
- g_object_unref (kfsb->permission);
-+ g_key_file_unref (kfsb->system_keyfile);
-+ g_hash_table_unref (kfsb->system_locks);
-+ g_free (kfsb->defaults_dir);
-
- g_file_monitor_cancel (kfsb->file_monitor);
- g_object_unref (kfsb->file_monitor);
-@@ -523,25 +591,6 @@ g_keyfile_settings_backend_init (GKeyfileSettingsBacke
- }
-
- static void
--g_keyfile_settings_backend_class_init (GKeyfileSettingsBackendClass *class)
--{
-- GObjectClass *object_class = G_OBJECT_CLASS (class);
--
-- object_class->finalize = g_keyfile_settings_backend_finalize;
--
-- class->read = g_keyfile_settings_backend_read;
-- class->write = g_keyfile_settings_backend_write;
-- class->write_tree = g_keyfile_settings_backend_write_tree;
-- class->reset = g_keyfile_settings_backend_reset;
-- class->get_writable = g_keyfile_settings_backend_get_writable;
-- class->get_permission = g_keyfile_settings_backend_get_permission;
-- /* No need to implement subscribed/unsubscribe: the only point would be to
-- * stop monitoring the file when there's no GSettings anymore, which is no
-- * big win.
-- */
--}
--
--static void
- file_changed (GFileMonitor *monitor,
- GFile *file,
- GFile *other_file,
-@@ -567,6 +616,283 @@ dir_changed (GFileMonitor *monitor,
- g_keyfile_settings_backend_keyfile_writable (kfsb);
- }
-
-+static void
-+load_system_settings (GKeyfileSettingsBackend *kfsb)
-+{
-+ GError *error = NULL;
-+ const char *dir = "/etc/glib-2.0/settings";
-+ char *path;
-+ char *contents;
-+
-+ kfsb->system_keyfile = g_key_file_new ();
-+ kfsb->system_locks = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-+
-+ if (kfsb->defaults_dir)
-+ dir = kfsb->defaults_dir;
-+
-+ path = g_build_filename (dir, "defaults", NULL);
-+
-+ /* The defaults are in the same keyfile format that we use for the settings.
-+ * It can be produced from a dconf database using: dconf dump
-+ */
-+ if (!g_key_file_load_from_file (kfsb->system_keyfile, path, G_KEY_FILE_NONE, &error))
-+ {
-+ if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
-+ g_warning ("Failed to read %s: %s", path, error->message);
-+ g_clear_error (&error);
-+ }
-+ else
-+ g_debug ("Loading default settings from %s", path);
-+
-+ g_free (path);
-+
-+ path = g_build_filename (dir, "locks", NULL);
-+
-+ /* The locks file is a text file containing a list paths to lock, one per line.
-+ * It can be produced from a dconf database using: dconf list-locks
-+ */
-+ if (!g_file_get_contents (path, &contents, NULL, &error))
-+ {
-+ if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
-+ g_warning ("Failed to read %s: %s", path, error->message);
-+ g_clear_error (&error);
-+ }
-+ else
-+ {
-+ char **lines;
-+ gsize i;
-+
-+ g_debug ("Loading locks from %s", path);
-+
-+ lines = g_strsplit (contents, "\n", 0);
-+ for (i = 0; lines[i]; i++)
-+ {
-+ char *line = lines[i];
-+ if (line[0] == '#' || line[0] == '\0')
-+ {
-+ g_free (line);
-+ continue;
-+ }
-+
-+ g_debug ("Locking key %s", line);
-+ g_hash_table_add (kfsb->system_locks, g_steal_pointer (&line));
-+ }
-+
-+ g_free (lines);
-+ }
-+ g_free (contents);
-+
-+ g_free (path);
-+}
-+
-+static void
-+g_keyfile_settings_backend_constructed (GObject *object)
-+{
-+ GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
-+
-+ if (kfsb->file == NULL)
-+ {
-+ char *filename = g_build_filename (g_get_user_config_dir (),
-+ "glib-2.0", "settings", "keyfile",
-+ NULL);
-+ kfsb->file = g_file_new_for_path (filename);
-+ g_free (filename);
-+ }
-+
-+ if (kfsb->prefix == NULL)
-+ {
-+ kfsb->prefix = g_strdup ("/");
-+ kfsb->prefix_len = 1;
-+ }
-+
-+ kfsb->keyfile = g_key_file_new ();
-+ kfsb->permission = g_simple_permission_new (TRUE);
-+
-+ kfsb->dir = g_file_get_parent (kfsb->file);
-+ g_mkdir_with_parents (g_file_peek_path (kfsb->dir), 0700);
-+
-+ kfsb->file_monitor = g_file_monitor (kfsb->file, G_FILE_MONITOR_NONE, NULL, NULL);
-+ kfsb->dir_monitor = g_file_monitor (kfsb->dir, G_FILE_MONITOR_NONE, NULL, NULL);
-+
-+ compute_checksum (kfsb->digest, NULL, 0);
-+
-+ g_signal_connect (kfsb->file_monitor, "changed",
-+ G_CALLBACK (file_changed), kfsb);
-+ g_signal_connect (kfsb->dir_monitor, "changed",
-+ G_CALLBACK (dir_changed), kfsb);
-+
-+ g_keyfile_settings_backend_keyfile_writable (kfsb);
-+ g_keyfile_settings_backend_keyfile_reload (kfsb);
-+
-+ load_system_settings (kfsb);
-+}
-+
-+static void
-+g_keyfile_settings_backend_set_property (GObject *object,
-+ guint prop_id,
-+ const GValue *value,
-+ GParamSpec *pspec)
-+{
-+ GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
-+
-+ switch ((GKeyfileSettingsBackendProperty)prop_id)
-+ {
-+ case PROP_FILENAME:
-+ /* Construct only. */
-+ g_assert (kfsb->file == NULL);
-+ if (g_value_get_string (value))
-+ kfsb->file = g_file_new_for_path (g_value_get_string (value));
-+ break;
-+
-+ case PROP_ROOT_PATH:
-+ /* Construct only. */
-+ g_assert (kfsb->prefix == NULL);
-+ kfsb->prefix = g_value_dup_string (value);
-+ if (kfsb->prefix)
-+ kfsb->prefix_len = strlen (kfsb->prefix);
-+ break;
-+
-+ case PROP_ROOT_GROUP:
-+ /* Construct only. */
-+ g_assert (kfsb->root_group == NULL);
-+ kfsb->root_group = g_value_dup_string (value);
-+ if (kfsb->root_group)
-+ kfsb->root_group_len = strlen (kfsb->root_group);
-+ break;
-+
-+ case PROP_DEFAULTS_DIR:
-+ /* Construct only. */
-+ g_assert (kfsb->defaults_dir == NULL);
-+ kfsb->defaults_dir = g_value_dup_string (value);
-+ break;
-+
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-+ break;
-+ }
-+}
-+
-+static void
-+g_keyfile_settings_backend_get_property (GObject *object,
-+ guint prop_id,
-+ GValue *value,
-+ GParamSpec *pspec)
-+{
-+ GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
-+
-+ switch ((GKeyfileSettingsBackendProperty)prop_id)
-+ {
-+ case PROP_FILENAME:
-+ g_value_set_string (value, g_file_peek_path (kfsb->file));
-+ break;
-+
-+ case PROP_ROOT_PATH:
-+ g_value_set_string (value, kfsb->prefix);
-+ break;
-+
-+ case PROP_ROOT_GROUP:
-+ g_value_set_string (value, kfsb->root_group);
-+ break;
-+
-+ case PROP_DEFAULTS_DIR:
-+ g_value_set_string (value, kfsb->defaults_dir);
-+ break;
-+
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-+ break;
-+ }
-+}
-+
-+static void
-+g_keyfile_settings_backend_class_init (GKeyfileSettingsBackendClass *class)
-+{
-+ GObjectClass *object_class = G_OBJECT_CLASS (class);
-+
-+ object_class->finalize = g_keyfile_settings_backend_finalize;
-+ object_class->constructed = g_keyfile_settings_backend_constructed;
-+ object_class->get_property = g_keyfile_settings_backend_get_property;
-+ object_class->set_property = g_keyfile_settings_backend_set_property;
-+
-+ class->read = g_keyfile_settings_backend_read;
-+ class->write = g_keyfile_settings_backend_write;
-+ class->write_tree = g_keyfile_settings_backend_write_tree;
-+ class->reset = g_keyfile_settings_backend_reset;
-+ class->get_writable = g_keyfile_settings_backend_get_writable;
-+ class->get_permission = g_keyfile_settings_backend_get_permission;
-+ /* No need to implement subscribed/unsubscribe: the only point would be to
-+ * stop monitoring the file when there's no GSettings anymore, which is no
-+ * big win.
-+ */
-+
-+ /**
-+ * GKeyfileSettingsBackend:filename:
-+ *
-+ * The location where the settings are stored on disk.
-+ *
-+ * Defaults to `$XDG_CONFIG_HOME/glib-2.0/settings/keyfile`.
-+ */
-+ g_object_class_install_property (object_class,
-+ PROP_FILENAME,
-+ g_param_spec_string ("filename",
-+ P_("Filename"),
-+ P_("The filename"),
-+ NULL,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-+ G_PARAM_STATIC_STRINGS));
-+
-+ /**
-+ * GKeyfileSettingsBackend:root-path:
-+ *
-+ * All settings read to or written from the backend must fall under the
-+ * path given in @root_path (which must start and end with a slash and
-+ * not contain two consecutive slashes). @root_path may be "/".
-+ *
-+ * Defaults to "/".
-+ */
-+ g_object_class_install_property (object_class,
-+ PROP_ROOT_PATH,
-+ g_param_spec_string ("root-path",
-+ P_("Root path"),
-+ P_("The root path"),
-+ NULL,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-+ G_PARAM_STATIC_STRINGS));
-+
-+ /**
-+ * GKeyfileSettingsBackend:root-group:
-+ *
-+ * If @root_group is non-%NULL then it specifies the name of the keyfile
-+ * group used for keys that are written directly below the root path.
-+ *
-+ * Defaults to NULL.
-+ */
-+ g_object_class_install_property (object_class,
-+ PROP_ROOT_GROUP,
-+ g_param_spec_string ("root-group",
-+ P_("Root group"),
-+ P_("The root group"),
-+ NULL,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-+ G_PARAM_STATIC_STRINGS));
-+
-+ /**
-+ * GKeyfileSettingsBackend:default-dir:
-+ *
-+ * The directory where the system defaults and locks are located.
-+ *
-+ * Defaults to `/etc/glib-2.0/settings`.
-+ */
-+ g_object_class_install_property (object_class,
-+ PROP_DEFAULTS_DIR,
-+ g_param_spec_string ("defaults-dir",
-+ P_("Default dir"),
-+ P_("Defaults dir"),
-+ NULL,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-+ G_PARAM_STATIC_STRINGS));
-+}
-+
- /**
- * g_keyfile_settings_backend_new:
- * @filename: the filename of the keyfile
-@@ -619,6 +945,11 @@ dir_changed (GFileMonitor *monitor,
- * characters in your path names or '=' in your key names you may be in
- * trouble.
- *
-+ * The backend reads default values from a keyfile called `defaults` in
-+ * the directory specified by the #GKeyfileSettingsBackend:defaults-dir property,
-+ * and a list of locked keys from a text file with the name `locks` in
-+ * the same location.
-+ *
- * Returns: (transfer full): a keyfile-backed #GSettingsBackend
- **/
- GSettingsBackend *
-@@ -626,43 +957,15 @@ g_keyfile_settings_backend_new (const gchar *filename,
- const gchar *root_path,
- const gchar *root_group)
- {
-- GKeyfileSettingsBackend *kfsb;
--
- g_return_val_if_fail (filename != NULL, NULL);
- g_return_val_if_fail (root_path != NULL, NULL);
- g_return_val_if_fail (g_str_has_prefix (root_path, "/"), NULL);
- g_return_val_if_fail (g_str_has_suffix (root_path, "/"), NULL);
- g_return_val_if_fail (strstr (root_path, "//") == NULL, NULL);
-
-- kfsb = g_object_new (G_TYPE_KEYFILE_SETTINGS_BACKEND, NULL);
-- kfsb->keyfile = g_key_file_new ();
-- kfsb->permission = g_simple_permission_new (TRUE);
--
-- kfsb->file = g_file_new_for_path (filename);
-- kfsb->dir = g_file_get_parent (kfsb->file);
-- g_file_make_directory_with_parents (kfsb->dir, NULL, NULL);
--
-- kfsb->file_monitor = g_file_monitor (kfsb->file, 0, NULL, NULL);
-- kfsb->dir_monitor = g_file_monitor (kfsb->dir, 0, NULL, NULL);
--
-- kfsb->prefix_len = strlen (root_path);
-- kfsb->prefix = g_strdup (root_path);
--
-- if (root_group)
-- {
-- kfsb->root_group_len = strlen (root_group);
-- kfsb->root_group = g_strdup (root_group);
-- }
--
-- compute_checksum (kfsb->digest, NULL, 0);
--
-- g_signal_connect (kfsb->file_monitor, "changed",
-- G_CALLBACK (file_changed), kfsb);
-- g_signal_connect (kfsb->dir_monitor, "changed",
-- G_CALLBACK (dir_changed), kfsb);
--
-- g_keyfile_settings_backend_keyfile_writable (kfsb);
-- g_keyfile_settings_backend_keyfile_reload (kfsb);
--
-- return G_SETTINGS_BACKEND (kfsb);
-+ return G_SETTINGS_BACKEND (g_object_new (G_TYPE_KEYFILE_SETTINGS_BACKEND,
-+ "filename", filename,
-+ "root-path", root_path,
-+ "root-group", root_group,
-+ NULL));
- }
---- gio/gportalsupport.c.orig 2018-08-15 16:22:08 UTC
-+++ gio/gportalsupport.c
-@@ -23,6 +23,7 @@
- static gboolean flatpak_info_read;
- static gboolean use_portal;
- static gboolean network_available;
-+static gboolean dconf_access;
-
- static void
- read_flatpak_info (void)
-@@ -40,11 +41,13 @@ read_flatpak_info (void)
-
- use_portal = TRUE;
- network_available = FALSE;
-+ dconf_access = FALSE;
-
- keyfile = g_key_file_new ();
- if (g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, NULL))
- {
- char **shared = NULL;
-+ char *dconf_policy = NULL;
-
- shared = g_key_file_get_string_list (keyfile, "Context", "shared", NULL, NULL);
- if (shared)
-@@ -52,6 +55,14 @@ read_flatpak_info (void)
- network_available = g_strv_contains ((const char * const *)shared, "network");
- g_strfreev (shared);
- }
-+
-+ dconf_policy = g_key_file_get_string (keyfile, "Session Bus Policy", "ca.desrt.dconf", NULL);
-+ if (dconf_policy)
-+ {
-+ if (strcmp (dconf_policy, "talk") == 0)
-+ dconf_access = TRUE;
-+ g_free (dconf_policy);
-+ }
- }
-
- g_key_file_unref (keyfile);
-@@ -64,6 +75,7 @@ read_flatpak_info (void)
- if (var && var[0] == '1')
- use_portal = TRUE;
- network_available = TRUE;
-+ dconf_access = TRUE;
- }
- }
-
-@@ -81,3 +93,9 @@ glib_network_available_in_sandbox (void)
- return network_available;
- }
-
-+gboolean
-+glib_has_dconf_access_in_sandbox (void)
-+{
-+ read_flatpak_info ();
-+ return dconf_access;
-+}
---- gio/gportalsupport.h.orig 2018-08-15 16:22:08 UTC
-+++ gio/gportalsupport.h
-@@ -24,6 +24,7 @@ G_BEGIN_DECLS
-
- gboolean glib_should_use_portal (void);
- gboolean glib_network_available_in_sandbox (void);
-+gboolean glib_has_dconf_access_in_sandbox (void);
-
- G_END_DECLS
-
---- gio/gsettingsbackendinternal.h.orig 2018-08-15 16:22:08 UTC
-+++ gio/gsettingsbackendinternal.h
-@@ -87,6 +87,8 @@ GType g_null_settings_backend_get_ty
-
- GType g_memory_settings_backend_get_type (void);
-
-+GType g_keyfile_settings_backend_get_type (void);
-+
- #ifdef HAVE_COCOA
- GType g_nextstep_settings_backend_get_type (void);
- #endif
---- gio/tests/gsettings.c.orig 2018-09-21 09:29:23 UTC
-+++ gio/tests/gsettings.c
-@@ -1716,6 +1716,23 @@ test_keyfile (void)
- g_assert_cmpstr (str, ==, "howdy");
- g_free (str);
-
-+ /* Now check setting a string without quotes */
-+ called = FALSE;
-+ g_signal_connect (settings, "changed::greeting", G_CALLBACK (key_changed_cb), &called);
-+
-+ g_key_file_set_string (keyfile, "tests", "greeting", "he\"l🤗uń");
-+ g_free (data);
-+ data = g_key_file_to_data (keyfile, &len, NULL);
-+ g_file_set_contents ("keyfile/gsettings.store", data, len, &error);
-+ g_assert_no_error (error);
-+ while (!called)
-+ g_main_context_iteration (NULL, FALSE);
-+ g_signal_handlers_disconnect_by_func (settings, key_changed_cb, &called);
-+
-+ str = g_settings_get_string (settings, "greeting");
-+ g_assert_cmpstr (str, ==, "he\"l🤗uń");
-+ g_free (str);
-+
- g_settings_set (settings, "farewell", "s", "cheerio");
-
- called = FALSE;
Index: pkg-plist
===================================================================
--- pkg-plist
+++ pkg-plist
@@ -104,6 +104,7 @@
include/glib-2.0/gio/gliststore.h
include/glib-2.0/gio/gloadableicon.h
include/glib-2.0/gio/gmemoryinputstream.h
+include/glib-2.0/gio/gmemorymonitor.h
include/glib-2.0/gio/gmemoryoutputstream.h
include/glib-2.0/gio/gmenu.h
include/glib-2.0/gio/gmenuexporter.h
@@ -110,6 +111,7 @@
include/glib-2.0/gio/gmenumodel.h
include/glib-2.0/gio/gmount.h
include/glib-2.0/gio/gmountoperation.h
+include/glib-2.0/gio/gnativesocketaddress.h
include/glib-2.0/gio/gnativevolumemonitor.h
include/glib-2.0/gio/gnetworkaddress.h
include/glib-2.0/gio/gnetworking.h
@@ -226,6 +228,9 @@
include/glib-2.0/glib/gquark.h
include/glib-2.0/glib/gqueue.h
include/glib-2.0/glib/grand.h
+include/glib-2.0/glib/grcbox.h
+include/glib-2.0/glib/grefcount.h
+include/glib-2.0/glib/grefstring.h
include/glib-2.0/glib/gregex.h
include/glib-2.0/glib/gscanner.h
include/glib-2.0/glib/gsequence.h
@@ -246,7 +251,7 @@
include/glib-2.0/glib/gtree.h
include/glib-2.0/glib/gtypes.h
include/glib-2.0/glib/gunicode.h
-include/glib-2.0/glib/gurifuncs.h
+include/glib-2.0/glib/guri.h
include/glib-2.0/glib/gutils.h
include/glib-2.0/glib/guuid.h
include/glib-2.0/glib/gvariant.h
@@ -259,6 +264,7 @@
include/glib-2.0/gobject/gboxed.h
include/glib-2.0/gobject/gclosure.h
include/glib-2.0/gobject/genums.h
+include/glib-2.0/gobject/glib-enumtypes.h
include/glib-2.0/gobject/glib-types.h
include/glib-2.0/gobject/gmarshal.h
include/glib-2.0/gobject/gobject-autocleanups.h
@@ -276,23 +282,18 @@
include/glib-2.0/gobject/gvaluecollector.h
include/glib-2.0/gobject/gvaluetypes.h
lib/glib-2.0/include/glibconfig.h
-lib/libgio-2.0.a
lib/libgio-2.0.so
lib/libgio-2.0.so.0
lib/libgio-2.0.so.%%LIBVERSION%%
-lib/libglib-2.0.a
lib/libglib-2.0.so
lib/libglib-2.0.so.0
lib/libglib-2.0.so.%%LIBVERSION%%
-lib/libgmodule-2.0.a
lib/libgmodule-2.0.so
lib/libgmodule-2.0.so.0
lib/libgmodule-2.0.so.%%LIBVERSION%%
-lib/libgobject-2.0.a
lib/libgobject-2.0.so
lib/libgobject-2.0.so.0
lib/libgobject-2.0.so.%%LIBVERSION%%
-lib/libgthread-2.0.a
lib/libgthread-2.0.so
lib/libgthread-2.0.so.0
lib/libgthread-2.0.so.%%LIBVERSION%%
@@ -324,6 +325,7 @@
share/aclocal/gsettings.m4
share/bash-completion/completions/gapplication
share/bash-completion/completions/gdbus
+share/bash-completion/completions/gio
share/bash-completion/completions/gresource
share/bash-completion/completions/gsettings
share/gdb/auto-load%%RESETPREFIX%%/lib/libglib-2.0.so.%%LIBVERSION%%-gdb.py

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 26, 6:24 PM (3 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26222180
Default Alt Text
D25279.id77007.diff (75 KB)

Event Timeline