pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

glib2: Update wip/glib2 to 2.68.0



Module Name:	pkgsrc-wip
Committed By:	Dan CÃirnat <cirnatdan%NetBSD.org@localhost>
Pushed By:	cirnatdan
Date:		Fri Mar 26 11:16:17 2021 +0100
Changeset:	7dad3db8bccbf2b250e756ccf777dc80732329ca

Modified Files:
	glib2/Makefile
	glib2/Makefile.common
	glib2/PLIST
	glib2/buildlink3.mk
	glib2/distinfo
	glib2/modules.mk
	glib2/patches/patch-gio_gcredentialsprivate.h
	glib2/patches/patch-gio_giomodule.c
	glib2/patches/patch-gio_gresource-tool.c
	glib2/patches/patch-gio_inotify_inotify-kernel.c
	glib2/patches/patch-gobject_glib-mkenums.in
	glib2/schemas.mk
Added Files:
	glib2/options.mk
	glib2/patches/patch-gio_gdbus-2.0_codegen_meson.build
	glib2/patches/patch-gio_glib-compile-schemas.c
	glib2/patches/patch-gio_gunixmounts.c
	glib2/patches/patch-gio_meson.build
	glib2/patches/patch-gio_tests_gdbus-export.c
	glib2/patches/patch-gio_tests_meson.build
	glib2/patches/patch-glib_gatomic.c
	glib2/patches/patch-glib_gatomic.h
	glib2/patches/patch-glib_genviron.c
	glib2/patches/patch-glib_gspawn.c
	glib2/patches/patch-glib_meson.build
	glib2/patches/patch-glib_tests_hash.c
	glib2/patches/patch-glib_tests_include.c
	glib2/patches/patch-glib_tests_meson.build
	glib2/patches/patch-gobject_meson.build
	glib2/patches/patch-meson.build
	glib2/patches/patch-meson_options.txt
Removed Files:
	glib2/patches/patch-ah
	glib2/patches/patch-aha
	glib2/patches/patch-cb
	glib2/patches/patch-glib_gmain.c
	glib2/patches/patch-gmodule_gmodule-ar.c
	glib2/patches/patch-gmodule_gmodule-dl.c
	glib2/patches/patch-gmodule_gmodule-dyld.c
	glib2/patches/patch-gmodule_gmodule-win32.c
	glib2/patches/patch-gmodule_gmodule.c

Log Message:
glib2: Update wip/glib2 to 2.68.0

Needed for GNOME 40 until devel/glib2 is updated

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7dad3db8bccbf2b250e756ccf777dc80732329ca

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 glib2/Makefile                                     | 108 ++++++++++++---------
 glib2/Makefile.common                              |  77 ++-------------
 glib2/PLIST                                        |  35 +++----
 glib2/buildlink3.mk                                |  10 +-
 glib2/distinfo                                     |  45 +++++----
 glib2/modules.mk                                   |   2 +-
 glib2/options.mk                                   |  28 ++++++
 glib2/patches/patch-ah                             |  24 -----
 glib2/patches/patch-aha                            |  13 ---
 glib2/patches/patch-cb                             |  13 ---
 glib2/patches/patch-gio_gcredentialsprivate.h      |   8 +-
 .../patch-gio_gdbus-2.0_codegen_meson.build        |  29 ++++++
 glib2/patches/patch-gio_giomodule.c                |  46 +++------
 glib2/patches/patch-gio_glib-compile-schemas.c     |  24 +++++
 glib2/patches/patch-gio_gresource-tool.c           |   6 +-
 glib2/patches/patch-gio_gunixmounts.c              |  17 ++++
 glib2/patches/patch-gio_inotify_inotify-kernel.c   |  17 +++-
 glib2/patches/patch-gio_meson.build                |  15 +++
 glib2/patches/patch-gio_tests_gdbus-export.c       |  70 +++++++++++++
 glib2/patches/patch-gio_tests_meson.build          |  83 ++++++++++++++++
 glib2/patches/patch-glib_gatomic.c                 |  31 ++++++
 glib2/patches/patch-glib_gatomic.h                 |  25 +++++
 glib2/patches/patch-glib_genviron.c                |  20 ++++
 glib2/patches/patch-glib_gmain.c                   |  81 ----------------
 glib2/patches/patch-glib_gspawn.c                  |  20 ++++
 glib2/patches/patch-glib_meson.build               |  33 +++++++
 glib2/patches/patch-glib_tests_hash.c              |  60 ++++++++++++
 glib2/patches/patch-glib_tests_include.c           |  17 ++++
 glib2/patches/patch-glib_tests_meson.build         |  28 ++++++
 glib2/patches/patch-gmodule_gmodule-ar.c           |  29 ------
 glib2/patches/patch-gmodule_gmodule-dl.c           |  57 -----------
 glib2/patches/patch-gmodule_gmodule-dyld.c         |  32 ------
 glib2/patches/patch-gmodule_gmodule-win32.c        |  16 ---
 glib2/patches/patch-gmodule_gmodule.c              |  57 -----------
 glib2/patches/patch-gobject_glib-mkenums.in        |  10 +-
 glib2/patches/patch-gobject_meson.build            |  14 +++
 glib2/patches/patch-meson.build                    |  19 ++++
 glib2/patches/patch-meson_options.txt              |  18 ++++
 glib2/schemas.mk                                   |   2 +-
 39 files changed, 699 insertions(+), 540 deletions(-)

diffs:
diff --git a/glib2/Makefile b/glib2/Makefile
index 634e63726b..cb62322194 100644
--- a/glib2/Makefile
+++ b/glib2/Makefile
@@ -1,70 +1,82 @@
-# $NetBSD: Makefile,v 1.244 2018/10/19 16:44:15 leot Exp $
+# $NetBSD: Makefile,v 1.277 2021/03/22 06:54:19 adam Exp $
 
 .include "Makefile.common"
 
-CATEGORIES=		devel gnome
+CATEGORIES=	devel gnome
+COMMENT=	Some useful routines for C programming (glib2)
 
-COMMENT=		Some useful routines for C programming (glib2)
+.include "options.mk"
 
-USE_TOOLS+=		msgfmt perl:run readlink
+MESON_ARGS+=	-Dinstalled_tests=false
+# Avoid linux dependency on libmount-dev
+MESON_ARGS+=	-Dlibmount=disabled
+.if ${OPSYS} == "FreeBSD"
+MESON_ARGS+=	-Db_lundef=false
+.endif
+
+MAKE_ENV+=	LD_LIBRARY_PATH=${WRKSRC}/output/gio:${WRKSRC}/output/glib:${WRKSRC}/output/gobject:${WRKSRC}/output/gmodule
+
+CPPFLAGS.SunOS+=	-D_XOPEN_SOURCE=600 -D__EXTENSIONS__
+LDFLAGS.SunOS+=		-liconv -lintl -lnsl -lsocket
+LDFLAGS.FreeBSD+=	-liconv
 
-PKGCONFIG_OVERRIDE+=	glib-2.0.pc.in
-PKGCONFIG_OVERRIDE+=	gmodule-2.0.pc.in
-PKGCONFIG_OVERRIDE+=	gmodule-export-2.0.pc.in
-PKGCONFIG_OVERRIDE+=	gmodule-no-export-2.0.pc.in
-PKGCONFIG_OVERRIDE+=	gobject-2.0.pc.in
-PKGCONFIG_OVERRIDE+=	gthread-2.0.pc.in
-PKGCONFIG_OVERRIDE+=	gio-2.0.pc.in
-PKGCONFIG_OVERRIDE+=	gio-unix-2.0.pc.in
-PKGCONFIG_OVERRIDE+=	gio-windows-2.0.pc.in
+REPLACE_PYTHON+=	gio/gio-querymodules-wrapper.py
+REPLACE_PYTHON+=	gio/tests/gengiotypefuncs.py
+REPLACE_PYTHON+=	gio/tests/memory-monitor-dbus.py.in
+REPLACE_PYTHON+=	gio/tests/memory-monitor-portal.py.in
+REPLACE_PYTHON+=	gio/tests/static-link.py
+REPLACE_PYTHON+=	glib/update-gtranslit.py
+REPLACE_PYTHON+=	gobject/tests/mkenums.py
+REPLACE_PYTHON+=	tests/gen-casefold-txt.py
+REPLACE_PYTHON+=	tests/gen-casemap-txt.py
 
-FILES_SUBST+=		GIO_MODULES_DIR=${PREFIX}/lib/gio/modules
+GIO_MODULES_DIR=	${PREFIX}/lib/gio/modules
+OWN_DIRS=		${GIO_MODULES_DIR}
+
+FILES_SUBST+=		GIO_MODULES_DIR=${GIO_MODULES_DIR}
 FILES_SUBST+=		GIO_QUERYMODULES=${PREFIX}/bin/gio-querymodules
 FILES_SUBST+=		GLIB_COMPILE_SCHEMAS=${PREFIX}/bin/glib-compile-schemas
 FILES_SUBST+=		GLIB_SCHEMAS_DIR=${PREFIX}/share/glib-2.0/schemas
 
-# gtester is the glib unit testing and reporting framework
-# agc doesn't want glib2 to depend on python so we install it
-# in a broken and useless state.
-CHECK_INTERPRETER_SKIP+=	bin/gtester-report
-CHECK_WRKREF_SKIP+=		bin/gtester-report
-
-# need pcre utf8 + unicode-properties
-BUILDLINK_API_DEPENDS.pcre+=	pcre>=8.31
-# to avoid pkg-config dependency, explicitly specify pcre location
-CONFIGURE_ARGS+=		PCRE_CFLAGS=-I${BUILDLINK_PREFIX.pcre}/include
-CONFIGURE_ARGS+=		PCRE_LIBS="${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.pcre}/lib -L${BUILDLINK_PREFIX.pcre}/lib -lpcre"
-
-# needs gz_header structure
-BUILDLINK_API_DEPENDS.zlib+=	zlib>=1.2.2.1
-
-LIBS.SunOS+=		-lnsl -lsocket
-CPPFLAGS.SunOS+=	-DBSD_COMP
-
-.if ${OBJECT_FMT} == "ELF"
-.  if ${OPSYS} == "SunOS"
-.    if empty(ABI:U:M64)
-# Solaris libelf in 32-bit mode does not support largefile.  We patch files
-# individually to force _FILE_OFFSET_BITS=32 but need to turn back on -lelf
-# after configure disabled it.
-CONFIGURE_ENV+=		LIBELF_LIBS='-lelf'
-.    endif
-.  else
-.    include "../../devel/libelf/buildlink3.mk"
-.  endif
-.endif
+BUILD_DEFS+=		VARBASE
+SUBST_CLASSES+=		dbusdb
+SUBST_MESSAGE.dbusdb=	Adjust dbus machine uuid path to dbus package
+SUBST_STAGE.dbusdb=	pre-configure
+SUBST_FILES.dbusdb=	gio/gdbusconnection.c
+SUBST_FILES.dbusdb+=	po/*.po
+SUBST_SED.dbusdb=	-e 's,/var/lib/dbus,${VARBASE}/db/dbus,g'
+
+SUBST_CLASSES+=		xdg
+SUBST_MESSAGE.xdg=	Adjust XDG_DATA_DIRS so schemas and pixbuf loaders are found
+SUBST_STAGE.xdg=	pre-configure
+SUBST_FILES.xdg=	glib/gcharset.c glib/gutils.c gio/xdgmime/xdgmime.c
+SUBST_SED.xdg=		-e 's,/usr/local/share/:/usr/share/,${PREFIX}/share,'
+SUBST_SED.xdg+=		-e 's,/etc/xdg,${PKG_SYSCONFDIR}/xdg,'
+SUBST_SED.xdg+=		-e 's,/usr/share/locale,${PREFIX}/${PKGLOCALEDIR}/locale,'
 
+PKGCONFIG_OVERRIDE+=	output/meson-private/gio-2.0.pc
+PKGCONFIG_OVERRIDE+=	output/meson-private/gio-unix-2.0.pc
+PKGCONFIG_OVERRIDE+=	output/meson-private/glib-2.0.pc
+PKGCONFIG_OVERRIDE+=	output/meson-private/gmodule-2.0.pc
+PKGCONFIG_OVERRIDE+=	output/meson-private/gmodule-export-2.0.pc
+PKGCONFIG_OVERRIDE+=	output/meson-private/gmodule-no-export-2.0.pc
+PKGCONFIG_OVERRIDE+=	output/meson-private/gobject-2.0.pc
+PKGCONFIG_OVERRIDE+=	output/meson-private/gthread-2.0.pc
+
+PKGCONFIG_OVERRIDE_STAGE=	post-configure
 
 # to run gdbus-codegen to generate gdbus-daemon-generated.{h,c}
 TOOL_DEPENDS+=		${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat
-PYTHON_FOR_BUILD_ONLY?=	yes
-.include "../../lang/python/pyversion.mk"
+PYTHON_FOR_BUILD_ONLY=	yes
 
-.include "../../devel/meson/build.mk"
+post-extract:
+	${CHMOD} +x ${WRKSRC}/gio/tests/gengiotypefuncs.py
 
 .include "../../converters/libiconv/buildlink3.mk"
 .include "../../devel/gettext-lib/buildlink3.mk"
 .include "../../devel/pcre/buildlink3.mk"
-.include "../../devel/zlib/buildlink3.mk"
+.include "../../devel/meson/build.mk"
 .include "../../devel/libffi/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../lang/python/application.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/glib2/Makefile.common b/glib2/Makefile.common
index 1b9980dbfd..0d95d5e388 100644
--- a/glib2/Makefile.common
+++ b/glib2/Makefile.common
@@ -1,82 +1,21 @@
-# $NetBSD: Makefile.common,v 1.66 2018/08/19 18:32:27 wiz Exp $
-#
-# used by devel/glib2/Makefile
+# $NetBSD: Makefile.common,v 1.89 2021/03/23 13:48:27 adam Exp $
 # used by devel/gdbus-codegen/Makefile
+# used by devel/glib2/Makefile
 # used by devel/glib2-tools/Makefile
-# used by sysutils/gio-fam/Makefile
 
-# When updating this package, please apply patch-ak to configure.in and
-# then run a matching version of autoconf to regen patch-aa.
-DISTNAME=	glib-2.58.2
+DISTNAME=	glib-2.68.0
 PKGNAME=	${DISTNAME:S/glib/glib2/}
-CATEGORIES=	# empty; redefined in Makefile
 MASTER_SITES=	${MASTER_SITE_GNOME:=sources/glib/${PKGVERSION_NOREV:R}/}
 EXTRACT_SUFX=	.tar.xz
 
 MAINTAINER=	prlw1%cam.ac.uk@localhost
 HOMEPAGE=	https://developer.gnome.org/glib/
-COMMENT=	# empty; redefined in Makefile
 LICENSE=	gnu-lgpl-v2.1
 
-USE_PKGLOCALEDIR=	yes
-USE_TOOLS+=		gmake pkg-config
-USE_LANGUAGES=		c c++ c99
-USE_LIBTOOL=		yes
-TEST_TARGET=		check
-
-#DISTINFO_FILE=		${.CURDIR}/../../devel/glib2/distinfo
-#PATCHDIR=		${.CURDIR}/../../devel/glib2/patches
-
-# When ICONV_TYPE=gnu ensure we explicitly use the GNU version, to avoid
-# conflicts between iconv.h from converters/libiconv and builtin libiconv
-# which may be non-GNU.
-CONFIGURE_ARGS.gnu-iconv=	--with-libiconv=gnu
-
-CONFIGURE_ENV+=		PERL_PATH=${PERL5:Q}
-
-.include "../../mk/bsd.prefs.mk"
-
-CPPFLAGS+=		-DPREFIX="\"${PREFIX}\""
-CPPFLAGS+=		-DPKGLOCALEDIR="\"${PKGLOCALEDIR}\""
-CPPFLAGS+=		-DPKG_SYSCONFDIR="\"${PKG_SYSCONFDIR}\""
-
-.if ${OPSYS} == "FreeBSD"
-SUBST_CLASSES+=		thr
-SUBST_STAGE.thr=	pre-configure
-SUBST_FILES.thr=	gthread/Makefile.in
-.  if ${OS_VERSION:R} >= 5
-SUBST_SED.thr+=		-e "s|@G_THREAD_LIBS_FOR_GTHREAD@|-lpthread|g"
-.  else
-SUBST_SED.thr+=		-e "s|@G_THREAD_LIBS_FOR_GTHREAD@|-Wc,-lc_r|g"
-.  endif
-SUBST_MESSAGE.thr=	Fixing libgthread.
-.endif
-
-.if !empty(MACHINE_PLATFORM:MDarwin-[56].*-*)
-CONFIGURE_ENV+=		gt_cv_c_wchar_t=no
-.endif
-
-BUILDLINK_TRANSFORM.Darwin+=	rm:-Werror=missing-prototypes
-BUILDLINK_TRANSFORM.SunOS+=	rm:-Werror=format=2
-
-CONFIGURE_ENV.HPUX+=		ac_cv_func_mmap_fixed_mapped=yes
-
-.include "../../mk/dlopen.buildlink3.mk"
-
-.if !empty(MACHINE_PLATFORM:MIRIX-5*)
-CONFIGURE_ARGS+=	--disable-threads
-.else
-.include "../../mk/pthread.buildlink3.mk"
-.endif
+USE_LANGUAGES=	c c++ c99
+USE_TOOLS+=	msgfmt pkg-config
 
-pre-configure:
-	${LN} -s ${PYTHONBIN} ${BUILDLINK_DIR}/bin/python3
+# does snprintf %d with pid_t...
+BUILDLINK_TRANSFORM+=	rm:-Werror=format=2
 
-BUILD_DEFS+=		VARBASE
-SUBST_CLASSES+=		dbusdb
-SUBST_MESSAGE.dbusdb=	Adjust dbus machine uuid path to dbus package
-SUBST_STAGE.dbusdb=	pre-configure
-SUBST_FILES.dbusdb=	gio/gdbusconnection.c
-SUBST_FILES.dbusdb+=	gio/gdbusprivate.c
-SUBST_FILES.dbusdb+=	po/*.po
-SUBST_SED.dbusdb=	-e 's,/var/lib/dbus,${VARBASE}/db/dbus,g'
+PYTHON_VERSIONS_INCOMPATIBLE=	27
diff --git a/glib2/PLIST b/glib2/PLIST
index d5e33fdad6..316853b1ad 100644
--- a/glib2/PLIST
+++ b/glib2/PLIST
@@ -1,20 +1,14 @@
 @comment $NetBSD$
 bin/gapplication
 bin/gdbus
-bin/gdbus-codegen
 bin/gio
-bin/gio-launch-desktop
 bin/gio-querymodules
 bin/glib-compile-resources
 bin/glib-compile-schemas
-bin/glib-genmarshal
 bin/glib-gettextize
-bin/glib-mkenums
 bin/gobject-query
 bin/gresource
 bin/gsettings
-bin/gtester
-bin/gtester-report
 include/gio-unix-2.0/gio/gdesktopappinfo.h
 include/gio-unix-2.0/gio/gfiledescriptorbased.h
 include/gio-unix-2.0/gio/gunixconnection.h
@@ -106,12 +100,14 @@ include/glib-2.0/gio/glistmodel.h
 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
 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
@@ -242,6 +238,7 @@ include/glib-2.0/glib/gstdio.h
 include/glib-2.0/glib/gstrfuncs.h
 include/glib-2.0/glib/gstring.h
 include/glib-2.0/glib/gstringchunk.h
+include/glib-2.0/glib/gstrvbuilder.h
 include/glib-2.0/glib/gtestutils.h
 include/glib-2.0/glib/gthread.h
 include/glib-2.0/glib/gthreadpool.h
@@ -251,7 +248,7 @@ include/glib-2.0/glib/gtrashstack.h
 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
@@ -264,6 +261,7 @@ include/glib-2.0/gobject/gbinding.h
 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
@@ -283,19 +281,19 @@ include/glib-2.0/gobject/gvaluetypes.h
 lib/glib-2.0/include/glibconfig.h
 lib/libgio-2.0.so
 lib/libgio-2.0.so.0
-lib/libgio-2.0.so.0.5800.2
+lib/libgio-2.0.so.0.6800.0
 lib/libglib-2.0.so
 lib/libglib-2.0.so.0
-lib/libglib-2.0.so.0.5800.2
+lib/libglib-2.0.so.0.6800.0
 lib/libgmodule-2.0.so
 lib/libgmodule-2.0.so.0
-lib/libgmodule-2.0.so.0.5800.2
+lib/libgmodule-2.0.so.0.6800.0
 lib/libgobject-2.0.so
 lib/libgobject-2.0.so.0
-lib/libgobject-2.0.so.0.5800.2
+lib/libgobject-2.0.so.0.6800.0
 lib/libgthread-2.0.so
 lib/libgthread-2.0.so.0
-lib/libgthread-2.0.so.0.5800.2
+lib/libgthread-2.0.so.0.6800.0
 lib/pkgconfig/gio-2.0.pc
 lib/pkgconfig/gio-unix-2.0.pc
 lib/pkgconfig/glib-2.0.pc
@@ -312,18 +310,10 @@ share/bash-completion/completions/gdbus
 share/bash-completion/completions/gio
 share/bash-completion/completions/gresource
 share/bash-completion/completions/gsettings
-share/gdb/auto-load${LOCALBASE}/lib/libglib-2.0.so.0.5800.2-gdb.py
-share/gdb/auto-load${LOCALBASE}/lib/libgobject-2.0.so.0.5800.2-gdb.py
+share/gdb/auto-load/usr/pkg/lib/libglib-2.0.so.0.6800.0-gdb.py
+share/gdb/auto-load/usr/pkg/lib/libgobject-2.0.so.0.6800.0-gdb.py
 share/gettext/its/gschema.its
 share/gettext/its/gschema.loc
-share/glib-2.0/codegen/__init__.py
-share/glib-2.0/codegen/codegen.py
-share/glib-2.0/codegen/codegen_docbook.py
-share/glib-2.0/codegen/codegen_main.py
-share/glib-2.0/codegen/config.py
-share/glib-2.0/codegen/dbustypes.py
-share/glib-2.0/codegen/parser.py
-share/glib-2.0/codegen/utils.py
 share/glib-2.0/gdb/glib_gdb.py
 share/glib-2.0/gdb/gobject_gdb.py
 share/glib-2.0/gettext/po/Makefile.in.in
@@ -427,4 +417,3 @@ share/locale/yi/LC_MESSAGES/glib20.mo
 share/locale/zh_CN/LC_MESSAGES/glib20.mo
 share/locale/zh_HK/LC_MESSAGES/glib20.mo
 share/locale/zh_TW/LC_MESSAGES/glib20.mo
-@pkgdir lib/gio/modules
diff --git a/glib2/buildlink3.mk b/glib2/buildlink3.mk
index 844c61924e..16cf3df4d4 100644
--- a/glib2/buildlink3.mk
+++ b/glib2/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.29 2018/04/23 08:26:50 adam Exp $
+# $NetBSD: buildlink3.mk,v 1.31 2020/03/08 16:42:24 bsiegert Exp $
 
 BUILDLINK_TREE+=	glib2
 
@@ -6,10 +6,10 @@ BUILDLINK_TREE+=	glib2
 GLIB2_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.glib2+=	glib2>=2.4.0
-BUILDLINK_ABI_DEPENDS.glib2+=	glib2>=2.34.0
+BUILDLINK_ABI_DEPENDS.glib2+=	glib2>=2.64.0nb1
 BUILDLINK_PKGSRCDIR.glib2?=	../../devel/glib2
-BUILDLINK_INCDIRS.glib2+=	include/glib/glib-2.0
-BUILDLINK_INCDIRS.glib2+=	include/glib/gio-unix-2.0
+BUILDLINK_INCDIRS.glib2+=	include/glib-2.0
+BUILDLINK_INCDIRS.glib2+=	include/gio-unix-2.0
 BUILDLINK_INCDIRS.glib2+=	lib/glib-2.0/include
 
 TOOL_DEPENDS+=	glib2-tools-[0-9]*:../../devel/glib2-tools
@@ -19,9 +19,7 @@ TOOL_DEPENDS+=	glib2-tools-[0-9]*:../../devel/glib2-tools
 .include "../../devel/pcre/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../devel/libffi/buildlink3.mk"
-.if empty(MACHINE_PLATFORM:MIRIX-5*)
 .include "../../mk/pthread.buildlink3.mk"
-.endif
 .endif # GLIB2_BUILDLINK3_MK
 
 BUILDLINK_TREE+=	-glib2
diff --git a/glib2/distinfo b/glib2/distinfo
index 6f27f9d4b9..ffbea91633 100644
--- a/glib2/distinfo
+++ b/glib2/distinfo
@@ -1,27 +1,36 @@
-$NetBSD: distinfo,v 1.237 2018/10/19 16:44:15 leot Exp $
+$NetBSD: distinfo,v 1.281 2021/03/23 13:48:27 adam Exp $
 
-SHA1 (glib-2.58.2.tar.xz) = 9831bbdca749a42526d0afc4b31799e8be22037c
-RMD160 (glib-2.58.2.tar.xz) = 29102e684ab62a69cf4aad980f687c47f6356b42
-SHA512 (glib-2.58.2.tar.xz) = 4017ae308f2ef6313abbff2eb9b21ec6f8fa38935007491ca0cb4d1ffac6fedab6f50e911ac088995d6212323ba1767399f18529a2620d60378ecade193b4b1a
-Size (glib-2.58.2.tar.xz) = 4862612 bytes
-SHA1 (patch-ah) = d523967c88fc06f46de1d7f2eb04be65db04ada2
+SHA1 (glib-2.68.0.tar.xz) = cd51b3d7c99ffbc9bb6b39fa6450fc147385c3cb
+RMD160 (glib-2.68.0.tar.xz) = 8843183c417ffe664a935d5ba229af4b5d8328bd
+SHA512 (glib-2.68.0.tar.xz) = dce0660476d67d7736c00861f4c3c267723f39032f582d1b2c17660a4939eeccd97e975da61b5be49e6f54612c6d5ce592aa7bdeacf4ecc75f3b38358da94a1d
+Size (glib-2.68.0.tar.xz) = 4938804 bytes
 SHA1 (patch-aha) = ade66edd87a5e76a1256bd8bcdc9bc3dd614885c
 SHA1 (patch-al) = af8428eeb6ce5e4dd70ddf972693df18d6c26d50
 SHA1 (patch-am) = 99f54927d76580dfeda2a6b1909e1bea5dbdc293
-SHA1 (patch-cb) = 56e2a9b2de04c8e528faf7ce778503fa55dcc3ac
-SHA1 (patch-gio_gcredentialsprivate.h) = dab92e07f8357a7dc1a569e37f65f9b199aee281
+SHA1 (patch-gio_gcredentialsprivate.h) = 6547edb518a98c3aca53acc1f98bde83e71b14cb
 SHA1 (patch-gio_gdbus-2.0_codegen_gdbus-codegen.in) = ccbb10335fb477e347993444d68d5e88d9e93050
-SHA1 (patch-gio_giomodule.c) = 08181ad8d46dde1a028faa246a4852e474610eaa
+SHA1 (patch-gio_gdbus-2.0_codegen_meson.build) = ec8ce89da08059ebf953d84a1dca5a2b380349f4
+SHA1 (patch-gio_giomodule.c) = d704699b2f457a08fff9219fe697e5fd2cc582ed
+SHA1 (patch-gio_glib-compile-schemas.c) = 4fc8e8ba62bef01762007ebf21569053374808d0
 SHA1 (patch-gio_glocalfileinfo.c) = 8e0b7e9543ce3c702c468f56e7ecf418d70b049f
-SHA1 (patch-gio_gresource-tool.c) = 43f1133bcf0ce4f3e12f018643b795ed972d5857
+SHA1 (patch-gio_gresource-tool.c) = ad0e59f48f5f98ea66be568dbe2e5a5d1ac602fc
 SHA1 (patch-gio_gunixcredentialsmessage.c) = c13119ddd6262db7c03e53857e987f0c495d3312
-SHA1 (patch-gio_inotify_inotify-kernel.c) = 18fc55be06dfa4ebf7128b8d1888aaff3b2b95c0
-SHA1 (patch-glib_gmain.c) = d09ff66e475ee52d37ac0dcb463110f690ce6511
+SHA1 (patch-gio_gunixmounts.c) = 13af07fffe898457edd0d8db4296a60fccba913d
+SHA1 (patch-gio_inotify_inotify-kernel.c) = 78544b4c32ef3b44e8721b1c07407f46a9e8c8a4
+SHA1 (patch-gio_meson.build) = c2bda4943f8580706ec45760604ed1bdf63d1c6f
+SHA1 (patch-gio_tests_gdbus-export.c) = 59d85ca079d02b52e33153c7d2ac1cc48c26707a
+SHA1 (patch-gio_tests_meson.build) = 38fbe56f310545163623c5dbd9ba1f8a25e4d928
+SHA1 (patch-glib_gatomic.c) = deb2e74010523ad41ce141aa2f49b807ba2672e6
+SHA1 (patch-glib_gatomic.h) = d1c39c3594a5c89d196349e5eafb5512795f55f8
+SHA1 (patch-glib_genviron.c) = dd25be36536d56dfe933225d785eb65f753c4a97
+SHA1 (patch-glib_gspawn.c) = 8f833edd594168fe62c5d0e161ebaafdebda2294
 SHA1 (patch-glib_gthread-posix.c) = ca93c8dc358453eb79b518c884464c90d7628888
-SHA1 (patch-gmodule_gmodule-ar.c) = e382a0ada232e083d51cbede7f689a50ebeff4d8
-SHA1 (patch-gmodule_gmodule-dl.c) = b678a04debbc79ebb67d91db7716990658e76da4
-SHA1 (patch-gmodule_gmodule-dyld.c) = 5adf62970d9cff22d451307aaa0b00d975dab138
-SHA1 (patch-gmodule_gmodule-win32.c) = 477a861f8590a62c3dbc0aa4ad728cc86ebb34dd
-SHA1 (patch-gmodule_gmodule.c) = 55c5f9d16e3517f3fdc04d40922f50d9c66b0b9a
+SHA1 (patch-glib_meson.build) = 65cbe6e3bd650f8f2c37f003a48ef183700a6ef9
+SHA1 (patch-glib_tests_hash.c) = a7e19ca55fcbbc0b188c34755cae5b6b65b67f1a
+SHA1 (patch-glib_tests_include.c) = 12d98caebfb87c1146821d518c37c45f97fc7be0
+SHA1 (patch-glib_tests_meson.build) = d358bd579eb09655c608106092bdeed8f16ff4d0
 SHA1 (patch-gobject_glib-genmarshal.in) = f21ca416d4eb4ad5a8ce3ffa053f8bcd2be8953a
-SHA1 (patch-gobject_glib-mkenums.in) = 651713a9c1fd83aea5060f996b58b35fbe3a43c7
+SHA1 (patch-gobject_glib-mkenums.in) = c177cf9b1ea81542665240678f47f68351a3760d
+SHA1 (patch-gobject_meson.build) = 412b65558aa4cf9648ee84a57ad6dfcc988b1a1d
+SHA1 (patch-meson.build) = cef4289d9c63c2a14cad08c3b2c944371e6f6573
+SHA1 (patch-meson_options.txt) = 7f633fbbfa9d9b2d958365891ffb9e4094d7dd54
diff --git a/glib2/modules.mk b/glib2/modules.mk
index a6cd710137..517bd78fa4 100644
--- a/glib2/modules.mk
+++ b/glib2/modules.mk
@@ -1,4 +1,4 @@
-# $NetBSD: modules.mk,v 1.1 2010/11/17 14:09:55 drochner Exp $
+# $NetBSD: modules.mk,v 1.2 2019/11/03 10:39:12 rillig Exp $
 #
 # This Makefile fragment is intended to be included by packages that install
 # GIO modules.  It takes care of rebuilding the corresponding databases at
diff --git a/glib2/options.mk b/glib2/options.mk
new file mode 100644
index 0000000000..fd13a9e729
--- /dev/null
+++ b/glib2/options.mk
@@ -0,0 +1,28 @@
+# $NetBSD: options.mk,v 1.22 2019/10/29 09:22:24 adam Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.glib2
+PKG_SUPPORTED_OPTIONS=	fam
+
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "Darwin"
+PKG_SUPPORTED_OPTIONS+=	cocoa
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+PLIST_VARS+=	cocoa nococoa
+
+# if this options is enabled, use quartz for gtk{2,3}
+.if !empty(PKG_OPTIONS:Mcocoa)
+MESON_ARGS+=	-Duse_cocoa=true
+PLIST.cocoa=	yes
+.else
+PLIST.nococoa=	yes
+.endif
+
+PLIST_VARS+=	fam
+.if !empty(PKG_OPTIONS:Mfam)
+MESON_ARGS+=	-Dfam=true
+PLIST.fam=	yes
+.include "../../mk/fam.buildlink3.mk"
+.endif
diff --git a/glib2/patches/patch-ah b/glib2/patches/patch-ah
deleted file mode 100644
index 9e0248a6f3..0000000000
--- a/glib2/patches/patch-ah
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-ah,v 1.13 2017/10/13 15:35:10 prlw1 Exp $
-
-Set default search paths for pkgsrc.
-
---- glib/gutils.c.orig	2017-08-15 20:27:00.000000000 +0000
-+++ glib/gutils.c
-@@ -2017,7 +2017,7 @@ g_get_system_data_dirs (void)
- 
- #ifndef G_OS_WIN32
-       if (!data_dirs || !data_dirs[0])
--          data_dirs = "/usr/local/share/:/usr/share/";
-+          data_dirs = PREFIX "/share/";
- 
-       data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
- #else
-@@ -2093,7 +2093,7 @@ g_get_system_config_dirs (void)
- 	}
- #else
-       if (!conf_dirs || !conf_dirs[0])
--          conf_dirs = "/etc/xdg";
-+          conf_dirs = PKG_SYSCONFDIR "/xdg";
- 
-       conf_dir_vector = g_strsplit (conf_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
- #endif
diff --git a/glib2/patches/patch-aha b/glib2/patches/patch-aha
deleted file mode 100644
index beb500f9b8..0000000000
--- a/glib2/patches/patch-aha
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-aha,v 1.2 2016/05/27 08:19:27 prlw1 Exp $
-
---- glib/gcharset.c.orig	2016-05-10 08:54:30.000000000 +0000
-+++ glib/gcharset.c
-@@ -293,7 +293,7 @@ unalias_lang (char *lang)
-   if (g_once_init_enter (&alias_table))
-     {
-       GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal);
--      read_aliases ("/usr/share/locale/locale.alias", table);
-+      read_aliases (PREFIX "/" PKGLOCALEDIR "/locale/locale.alias", table);
-       g_once_init_leave (&alias_table, table);
-     }
- 
diff --git a/glib2/patches/patch-cb b/glib2/patches/patch-cb
deleted file mode 100644
index 3b554df0aa..0000000000
--- a/glib2/patches/patch-cb
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-cb,v 1.3 2012/05/01 18:45:52 adam Exp $
-
---- gio/xdgmime/xdgmime.c.orig	2008-09-02 15:09:17.000000000 +0000
-+++ gio/xdgmime/xdgmime.c
-@@ -257,7 +257,7 @@ xdg_run_command_on_dirs (XdgDirectoryFun
- 
-   xdg_data_dirs = getenv ("XDG_DATA_DIRS");
-   if (xdg_data_dirs == NULL)
--    xdg_data_dirs = "/usr/local/share/:/usr/share/";
-+    xdg_data_dirs = PREFIX "/share/";
- 
-   ptr = xdg_data_dirs;
- 
diff --git a/glib2/patches/patch-gio_gcredentialsprivate.h b/glib2/patches/patch-gio_gcredentialsprivate.h
index 1ef198765f..a56a0adf77 100644
--- a/glib2/patches/patch-gio_gcredentialsprivate.h
+++ b/glib2/patches/patch-gio_gcredentialsprivate.h
@@ -1,15 +1,15 @@
-$NetBSD: patch-gio_gcredentialsprivate.h,v 1.3 2018/10/19 16:44:15 leot Exp $
+$NetBSD: patch-gio_gcredentialsprivate.h,v 1.4 2020/09/29 10:43:33 prlw1 Exp $
 
 NetBSD has G_CREDENTIALS_SOCKET_GET_CREDENTIALS_SUPPORTED.
 
---- gio/gcredentialsprivate.h.orig	2017-07-13 23:03:38.000000000 +0000
+--- gio/gcredentialsprivate.h.orig	2020-08-18 10:52:24.847177300 +0000
 +++ gio/gcredentialsprivate.h
-@@ -47,7 +47,7 @@
+@@ -134,7 +134,7 @@
  #define G_CREDENTIALS_USE_NETBSD_UNPCBID 1
  #define G_CREDENTIALS_NATIVE_TYPE G_CREDENTIALS_TYPE_NETBSD_UNPCBID
  #define G_CREDENTIALS_NATIVE_SIZE (sizeof (struct unpcbid))
 -/* #undef G_CREDENTIALS_UNIX_CREDENTIALS_MESSAGE_SUPPORTED */
 +#define G_CREDENTIALS_SOCKET_GET_CREDENTIALS_SUPPORTED 1
  #define G_CREDENTIALS_SPOOFING_SUPPORTED 1
+ #define G_CREDENTIALS_HAS_PID 1
  
- #elif defined(__OpenBSD__)
diff --git a/glib2/patches/patch-gio_gdbus-2.0_codegen_meson.build b/glib2/patches/patch-gio_gdbus-2.0_codegen_meson.build
new file mode 100644
index 0000000000..01e64fccef
--- /dev/null
+++ b/glib2/patches/patch-gio_gdbus-2.0_codegen_meson.build
@@ -0,0 +1,29 @@
+$NetBSD: patch-gio_gdbus-2.0_codegen_meson.build,v 1.2 2019/11/14 11:40:30 wiz Exp $
+
+Leave gdbus-2.0/codegen sudirectory to devel/gdbus-codegen package.
+
+--- gio/gdbus-2.0/codegen/meson.build.orig	2019-10-04 11:44:23.000000000 +0000
++++ gio/gdbus-2.0/codegen/meson.build
+@@ -17,6 +17,7 @@ gdbus_codegen_conf.set('DATADIR', glib_d
+ gdbus_codegen = configure_file(input : 'gdbus-codegen.in',
+   output : 'gdbus-codegen',
+   install_dir : get_option('bindir'),
++  install : false,
+   configuration : gdbus_codegen_conf
+ )
+   # Provide tools for others when we're a subproject and they use the Meson GNOME module
+@@ -28,6 +29,7 @@ gdbus_codegen_built_files = []
+ gdbus_codegen_built_files += configure_file(input : 'config.py.in',
+                                             output : 'config.py',
+                                             install_dir : codegen_dir,
++                                            install : false,
+                                             configuration : gdbus_codegen_conf)
+ 
+ foreach f : gdbus_codegen_files
+@@ -35,5 +37,6 @@ foreach f : gdbus_codegen_files
+   # and then install it too so that it can be used after installation
+   gdbus_codegen_built_files += configure_file(input : f, output : f,
+                                               install_dir : codegen_dir,
++                                              install : false,
+                                               copy : true)
+ endforeach
diff --git a/glib2/patches/patch-gio_giomodule.c b/glib2/patches/patch-gio_giomodule.c
index 6b3c3794a7..c14444a84c 100644
--- a/glib2/patches/patch-gio_giomodule.c
+++ b/glib2/patches/patch-gio_giomodule.c
@@ -1,37 +1,15 @@
-$NetBSD: patch-gio_giomodule.c,v 1.3 2018/05/21 08:39:38 jperkin Exp $
+$NetBSD: patch-gio_giomodule.c,v 1.6 2019/08/20 14:06:46 wiz Exp $
 
-Re-enable gdesktopappinfo on Darwin.
+Disable inotify on SunOS.
 
---- gio/giomodule.c.orig	2017-06-22 12:52:49.000000000 +0000
+--- gio/giomodule.c.orig	2019-07-24 10:52:04.000000000 +0000
 +++ gio/giomodule.c
-@@ -43,12 +43,9 @@
- #endif
- #include <glib/gstdio.h>
- 
--#if defined(G_OS_UNIX) && !defined(HAVE_COCOA)
-+#if defined(G_OS_UNIX)
- #include "gdesktopappinfo.h"
- #endif
--#ifdef HAVE_COCOA
--#include "gosxappinfo.h"
--#endif
- 
- #ifdef HAVE_COCOA
- #include <AvailabilityMacros.h>
-@@ -978,7 +975,7 @@ _g_io_modules_ensure_extension_points_re
-     {
-       registered_extensions = TRUE;
-       
--#if defined(G_OS_UNIX) && !defined(HAVE_COCOA)
-+#if defined(G_OS_UNIX)
- #if !GLIB_CHECK_VERSION (3, 0, 0)
-       ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME);
-       G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-@@ -1119,7 +1116,6 @@ _g_io_modules_ensure_loaded (void)
- #endif
- #ifdef HAVE_COCOA
-       g_type_ensure (g_nextstep_settings_backend_get_type ());
--      g_type_ensure (g_osx_app_info_get_type ());
- #endif
- #ifdef G_OS_UNIX
-       g_type_ensure (_g_unix_volume_monitor_get_type ());
+@@ -1210,7 +1210,7 @@ _g_io_modules_ensure_loaded (void)
+       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)
++#if defined(HAVE_INOTIFY_INIT1) && !defined(__sun)
+       g_type_ensure (g_inotify_file_monitor_get_type ());
+ #endif
+ #if defined(HAVE_KQUEUE)
diff --git a/glib2/patches/patch-gio_glib-compile-schemas.c b/glib2/patches/patch-gio_glib-compile-schemas.c
new file mode 100644
index 0000000000..4d1409986d
--- /dev/null
+++ b/glib2/patches/patch-gio_glib-compile-schemas.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-gio_glib-compile-schemas.c,v 1.1 2020/09/18 11:18:29 wiz Exp $
+
+gsettings-desktop-schemas uses deprecated paths and is not going to stop
+anytime soon, see
+https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/issues/27
+
+--- gio/glib-compile-schemas.c.orig	2020-08-18 11:06:36.941520700 +0000
++++ gio/glib-compile-schemas.c
+@@ -1232,6 +1232,7 @@ parse_state_start_schema (ParseState  *s
+       return;
+     }
+ 
++#if 0
+   if (path && (g_str_has_prefix (path, "/apps/") ||
+                g_str_has_prefix (path, "/desktop/") ||
+                g_str_has_prefix (path, "/system/")))
+@@ -1244,6 +1245,7 @@ parse_state_start_schema (ParseState  *s
+       g_printerr ("%s\n", message);
+       g_free (message);
+     }
++#endif
+ 
+   state->schema_state = schema_state_new (path, gettext_domain,
+                                           extends, extends_name, list_of);
diff --git a/glib2/patches/patch-gio_gresource-tool.c b/glib2/patches/patch-gio_gresource-tool.c
index f934a337af..7f7d34e218 100644
--- a/glib2/patches/patch-gio_gresource-tool.c
+++ b/glib2/patches/patch-gio_gresource-tool.c
@@ -1,6 +1,8 @@
-$NetBSD: patch-gio_gresource-tool.c,v 1.1 2012/07/12 14:43:26 jperkin Exp $
+$NetBSD: patch-gio_gresource-tool.c,v 1.2 2019/06/03 09:53:50 prlw1 Exp $
 
---- gio/gresource-tool.c.orig	2018-12-18 14:51:13.000000000 +0000
+Solaris fix
+
+--- gio/gresource-tool.c.orig	2019-05-03 13:43:28.000000000 +0000
 +++ gio/gresource-tool.c
 @@ -29,6 +29,11 @@
  #include <locale.h>
diff --git a/glib2/patches/patch-gio_gunixmounts.c b/glib2/patches/patch-gio_gunixmounts.c
new file mode 100644
index 0000000000..f43037d68c
--- /dev/null
+++ b/glib2/patches/patch-gio_gunixmounts.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-gio_gunixmounts.c,v 1.5 2019/06/06 11:05:12 adam Exp $
+
+SunOS has sys/mntent.h but no mnt_opts.
+XXX who else uses the sys/mntent.h case?
+https://gitlab.gnome.org/GNOME/glib/merge_requests/890
+
+--- gio/gunixmounts.c.orig	2019-05-03 13:43:28.000000000 +0000
++++ gio/gunixmounts.c
+@@ -736,7 +736,7 @@ _g_get_unix_mounts (void)
+                                              mntent.mnt_mountp,
+                                              NULL,
+                                              mntent.mnt_fstype,
+-                                             mntent.mnt_opts,
++                                             mntent.mnt_mntopts,
+                                              is_read_only);
+ 
+       return_list = g_list_prepend (return_list, mount_entry);
diff --git a/glib2/patches/patch-gio_inotify_inotify-kernel.c b/glib2/patches/patch-gio_inotify_inotify-kernel.c
index e2ad322877..b5857131b9 100644
--- a/glib2/patches/patch-gio_inotify_inotify-kernel.c
+++ b/glib2/patches/patch-gio_inotify_inotify-kernel.c
@@ -1,10 +1,21 @@
-$NetBSD: patch-gio_inotify_inotify-kernel.c,v 1.1 2016/04/13 10:13:43 jperkin Exp $
+$NetBSD: patch-gio_inotify_inotify-kernel.c,v 1.5 2019/11/14 11:40:30 wiz Exp $
 
 Use _XOPEN_NAME_MAX in lieu of NAME_MAX for SunOS.
 
---- gio/inotify/inotify-kernel.c.orig	2016-02-23 22:25:36.000000000 +0000
+Include <sys/filio.h> for FIONREAD on SunOS.
+https://gitlab.gnome.org/GNOME/glib/merge_requests/889
+
+--- gio/inotify/inotify-kernel.c.orig	2019-10-04 11:44:23.000000000 +0000
 +++ gio/inotify/inotify-kernel.c
-@@ -36,6 +36,9 @@
+@@ -33,11 +33,17 @@
+ #ifdef HAVE_SYS_FILIO_H
+ #include <sys/filio.h>
+ #endif
++#ifdef HAVE_SYS_FILIO_H
++#include <sys/filio.h>
++#endif
+ #include <glib/glib-unix.h>
+ 
  #include "glib-private.h"
  
  /* From inotify(7) */
diff --git a/glib2/patches/patch-gio_meson.build b/glib2/patches/patch-gio_meson.build
new file mode 100644
index 0000000000..e3887055f7
--- /dev/null
+++ b/glib2/patches/patch-gio_meson.build
@@ -0,0 +1,15 @@
+$NetBSD: patch-gio_meson.build,v 1.7 2019/11/14 11:40:30 wiz Exp $
+
+Disable inotify on SunOS.
+
+--- gio/meson.build.orig	2019-10-04 11:44:23.000000000 +0000
++++ gio/meson.build
+@@ -760,7 +760,7 @@ gioenumtypes_c = custom_target('gioenumt
+ gioenumtypes_dep = declare_dependency(sources : [gioenumtypes_h, glib_enumtypes_h])
+ 
+ # inotify
+-if glib_conf.has('HAVE_SYS_INOTIFY_H') and have_func_inotify_init1
++if glib_conf.has('HAVE_SYS_INOTIFY_H') and have_func_inotify_init1 and host_system != 'sunos'
+   subdir('inotify')
+   internal_deps += [ inotify_lib ]
+   internal_objects += [inotify_lib.extract_all_objects()]
diff --git a/glib2/patches/patch-gio_tests_gdbus-export.c b/glib2/patches/patch-gio_tests_gdbus-export.c
new file mode 100644
index 0000000000..7d5d1099fd
--- /dev/null
+++ b/glib2/patches/patch-gio_tests_gdbus-export.c
@@ -0,0 +1,70 @@
+$NetBSD: patch-gio_tests_gdbus-export.c,v 1.1 2019/06/21 20:21:00 prlw1 Exp $
+
+Revert GHashTable improvements
+https://gitlab.gnome.org/GNOME/glib/merge_requests/208
+
+to fix PR pkg/54310
+
+--- gio/tests/gdbus-export.c.orig	2019-06-10 17:47:20.000000000 +0000
++++ gio/tests/gdbus-export.c
+@@ -337,22 +337,6 @@ introspect_callback (GDBusProxy   *proxy
+   g_main_loop_quit (loop);
+ }
+ 
+-static gint
+-compare_strings (gconstpointer a,
+-                 gconstpointer b)
+-{
+-  const gchar *sa = *(const gchar **) a;
+-  const gchar *sb = *(const gchar **) b;
+-
+-  /* Array terminator must sort last */
+-  if (sa == NULL)
+-    return 1;
+-  if (sb == NULL)
+-    return -1;
+-
+-  return strcmp (sa, sb);
+-}
+-
+ static gchar **
+ get_nodes_at (GDBusConnection  *c,
+               const gchar      *object_path)
+@@ -406,9 +390,6 @@ get_nodes_at (GDBusConnection  *c,
+   g_free (xml_data);
+   g_dbus_node_info_unref (node_info);
+ 
+-  /* Nodes are semantically unordered; sort array so tests can rely on order */
+-  g_ptr_array_sort (p, compare_strings);
+-
+   return (gchar **) g_ptr_array_free (p, FALSE);
+ }
+ 
+@@ -1259,9 +1240,9 @@ test_object_registration (void)
+   nodes = get_nodes_at (c, "/foo/dyna");
+   g_assert (nodes != NULL);
+   g_assert_cmpint (g_strv_length (nodes), ==, 3);
+-  g_assert_cmpstr (nodes[0], ==, "cat");
+-  g_assert_cmpstr (nodes[1], ==, "cheezburger");
+-  g_assert_cmpstr (nodes[2], ==, "lol");
++  g_assert_cmpstr (nodes[0], ==, "lol");
++  g_assert_cmpstr (nodes[1], ==, "cat");
++  g_assert_cmpstr (nodes[2], ==, "cheezburger");
+   g_strfreev (nodes);
+   g_assert_cmpint (count_interfaces (c, "/foo/dyna/lol"), ==, 4);
+   g_assert_cmpint (count_interfaces (c, "/foo/dyna/cat"), ==, 4);
+@@ -1272,10 +1253,10 @@ test_object_registration (void)
+   nodes = get_nodes_at (c, "/foo/dyna");
+   g_assert (nodes != NULL);
+   g_assert_cmpint (g_strv_length (nodes), ==, 4);
+-  g_assert_cmpstr (nodes[0], ==, "cat");
+-  g_assert_cmpstr (nodes[1], ==, "cheezburger");
+-  g_assert_cmpstr (nodes[2], ==, "dynamicallycreated");
+-  g_assert_cmpstr (nodes[3], ==, "lol");
++  g_assert_cmpstr (nodes[0], ==, "lol");
++  g_assert_cmpstr (nodes[1], ==, "cat");
++  g_assert_cmpstr (nodes[2], ==, "cheezburger");
++  g_assert_cmpstr (nodes[3], ==, "dynamicallycreated");
+   g_strfreev (nodes);
+   g_assert_cmpint (count_interfaces (c, "/foo/dyna/dynamicallycreated"), ==, 4);
+ 
diff --git a/glib2/patches/patch-gio_tests_meson.build b/glib2/patches/patch-gio_tests_meson.build
new file mode 100644
index 0000000000..d01a2d80c2
--- /dev/null
+++ b/glib2/patches/patch-gio_tests_meson.build
@@ -0,0 +1,83 @@
+$NetBSD: patch-gio_tests_meson.build,v 1.4 2020/03/10 17:30:00 minskim Exp $
+
+Darwin: Set LD_LIBRARY_PATH to run uninstalled executable with @rpath.
+
+--- gio/tests/meson.build.orig	2019-12-19 16:33:15.000000000 +0000
++++ gio/tests/meson.build
+@@ -470,7 +470,9 @@ if not meson.is_cross_build() or meson.h
+   plugin_resources_c = custom_target('plugin-resources.c',
+     input : 'test4.gresource.xml',
+     output : 'plugin-resources.c',
+-    command : [glib_compile_resources,
++    command : [env_program.path(),
++               'LD_LIBRARY_PATH=gio:glib:gmodule:gobject',
++    	       glib_compile_resources,
+                '--target=@OUTPUT@',
+                '--sourcedir=' + meson.current_source_dir(),
+                '--generate-source',
+@@ -494,7 +496,9 @@ if not meson.is_cross_build() or meson.h
+   test_gresource = custom_target('test.gresource',
+     input : 'test.gresource.xml',
+     output : 'test.gresource',
+-    command : [glib_compile_resources,
++    command : [env_program.path(),
++               'LD_LIBRARY_PATH=gio:glib:gmodule:gobject',
++    	       glib_compile_resources,
+                '--target=@OUTPUT@',
+                '--sourcedir=' + meson.current_source_dir(),
+                '--sourcedir=' + meson.current_build_dir(),
+@@ -505,7 +509,9 @@ if not meson.is_cross_build() or meson.h
+   test_resources2_c = custom_target('test_resources2.c',
+     input : 'test3.gresource.xml',
+     output : 'test_resources2.c',
+-    command : [glib_compile_resources,
++    command : [env_program.path(),
++               'LD_LIBRARY_PATH=gio:glib:gmodule:gobject',
++    	       glib_compile_resources,
+                '--target=@OUTPUT@',
+                '--sourcedir=' + meson.current_source_dir(),
+                '--generate',
+@@ -516,7 +522,9 @@ if not meson.is_cross_build() or meson.h
+   test_resources2_h = custom_target('test_resources2.h',
+     input : 'test3.gresource.xml',
+     output : 'test_resources2.h',
+-    command : [glib_compile_resources,
++    command : [env_program.path(),
++               'LD_LIBRARY_PATH=gio:glib:gmodule:gobject',
++    	       glib_compile_resources,
+                '--target=@OUTPUT@',
+                '--sourcedir=' + meson.current_source_dir(),
+                '--generate',
+@@ -528,7 +536,9 @@ if not meson.is_cross_build() or meson.h
+     input : 'test2.gresource.xml',
+     depends : big_test_resource,
+     output : 'test_resources.c',
+-    command : [glib_compile_resources,
++    command : [env_program.path(),
++               'LD_LIBRARY_PATH=gio:glib:gmodule:gobject',
++    	       glib_compile_resources,
+                '--target=@OUTPUT@',
+                '--sourcedir=' + meson.current_source_dir(),
+                '--sourcedir=' + meson.current_build_dir(),
+@@ -539,7 +549,9 @@ if not meson.is_cross_build() or meson.h
+   digit_test_resources_c = custom_target('digit_test_resources.c',
+     input : '111_digit_test.gresource.xml',
+     output : 'digit_test_resources.c',
+-    command : [glib_compile_resources,
++    command : [env_program.path(),
++               'LD_LIBRARY_PATH=gio:glib:gmodule:gobject',
++    	       glib_compile_resources,
+                '--target=@OUTPUT@',
+                '--sourcedir=' + meson.current_source_dir(),
+                '--sourcedir=' + meson.current_build_dir(),
+@@ -550,7 +562,9 @@ if not meson.is_cross_build() or meson.h
+   digit_test_resources_h = custom_target('digit_test_resources.h',
+     input : '111_digit_test.gresource.xml',
+     output : 'digit_test_resources.h',
+-    command : [glib_compile_resources,
++    command : [env_program.path(),
++               'LD_LIBRARY_PATH=gio:glib:gmodule:gobject',
++    	       glib_compile_resources,
+                '--target=@OUTPUT@',
+                '--sourcedir=' + meson.current_source_dir(),
+                '--generate',
diff --git a/glib2/patches/patch-glib_gatomic.c b/glib2/patches/patch-glib_gatomic.c
new file mode 100644
index 0000000000..c2585a84f0
--- /dev/null
+++ b/glib2/patches/patch-glib_gatomic.c
@@ -0,0 +1,31 @@
+$NetBSD: patch-glib_gatomic.c,v 1.2 2020/03/04 15:11:48 wiz Exp $
+
+Ignore __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 as is already done
+for android and linux. PR pkg/54298
+
+--- glib/gatomic.c.orig	2020-02-27 16:12:52.000000000 +0000
++++ glib/gatomic.c
+@@ -94,8 +94,6 @@
+  * implement the atomic operations in a lock-free manner.
+  */
+ 
+-#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+-
+ /**
+  * g_atomic_int_get:
+  * @atomic: a pointer to a #gint or #guint
+@@ -658,14 +656,6 @@ gsize
+   return InterlockedXor (atomic, val);
+ #endif
+ }
+-#else
+-
+-/* This error occurs when `meson configure` decided that we should be capable
+- * of lock-free atomics but we find at compile-time that we are not.
+- */
+-#error G_ATOMIC_LOCK_FREE defined, but incapable of lock-free atomics.
+-
+-#endif /* defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) */
+ 
+ #else /* G_ATOMIC_LOCK_FREE */
+ 
diff --git a/glib2/patches/patch-glib_gatomic.h b/glib2/patches/patch-glib_gatomic.h
new file mode 100644
index 0000000000..f7f7b3507d
--- /dev/null
+++ b/glib2/patches/patch-glib_gatomic.h
@@ -0,0 +1,25 @@
+$NetBSD: patch-glib_gatomic.h,v 1.2 2020/03/04 15:11:48 wiz Exp $
+
+Ignore __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 as is already done
+for android and linux. PR pkg/54298
+
+--- glib/gatomic.h.orig	2020-02-27 16:12:52.000000000 +0000
++++ glib/gatomic.h
+@@ -82,7 +82,7 @@ gint                    g_atomic_int_exc
+ 
+ G_END_DECLS
+ 
+-#if defined(G_ATOMIC_LOCK_FREE) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
++#if defined(G_ATOMIC_LOCK_FREE)
+ 
+ /* We prefer the new C11-style atomic extension of GCC if available */
+ #if defined(__ATOMIC_SEQ_CST)
+@@ -372,7 +372,7 @@ G_END_DECLS
+ 
+ #endif /* !defined(__ATOMIC_SEQ_CST) */
+ 
+-#else /* defined(G_ATOMIC_LOCK_FREE) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) */
++#else /* defined(G_ATOMIC_LOCK_FREE) */
+ 
+ #define g_atomic_int_get(atomic) \
+   (g_atomic_int_get ((gint *) (atomic)))
diff --git a/glib2/patches/patch-glib_genviron.c b/glib2/patches/patch-glib_genviron.c
new file mode 100644
index 0000000000..ff26525214
--- /dev/null
+++ b/glib2/patches/patch-glib_genviron.c
@@ -0,0 +1,20 @@
+$NetBSD: patch-glib_genviron.c,v 1.2 2020/03/04 15:11:48 wiz Exp $
+
+Avoid the build failure with Clang on FreeBSD (see PR 54752).
+Set environ as a weak symbol (thanks to Joerg).
+
+--- glib/genviron.c.orig	2020-02-27 16:12:52.000000000 +0000
++++ glib/genviron.c
+@@ -329,8 +329,12 @@ g_setenv (const gchar *variable,
+ /* According to the Single Unix Specification, environ is not
+  * in any system header, although unistd.h often declares it.
+  */
++#if defined(__FreeBSD__)
++extern __attribute__((__weak__)) char **environ;
++#else
+ extern char **environ;
+ #endif
++#endif
+ 
+ /**
+  * g_unsetenv:
diff --git a/glib2/patches/patch-glib_gmain.c b/glib2/patches/patch-glib_gmain.c
deleted file mode 100644
index e87a1ab7ca..0000000000
--- a/glib2/patches/patch-glib_gmain.c
+++ /dev/null
@@ -1,81 +0,0 @@
-$NetBSD: patch-glib_gmain.c,v 1.1 2015/01/25 06:54:28 pho Exp $
-
-Imported patch from the upstream Bugzilla:
-
-  Bug 728123 - glib2 @2.40.0 issues a "Got weird mach timebase info" error (Macports, PPC)
-  https://bugzilla.gnome.org/show_bug.cgi?id=728123
-
-Tested on powerpc-apple-darwin9.
-
---- glib/gmain.c.orig	2014-11-09 21:54:26.000000000 +0000
-+++ glib/gmain.c
-@@ -2694,47 +2694,31 @@ g_get_monotonic_time (void)
- gint64
- g_get_monotonic_time (void)
- {
--  static mach_timebase_info_data_t timebase_info;
-+  mach_timebase_info_data_t timebase_info;
-+  guint64 val;
- 
--  if (timebase_info.denom == 0)
--    {
--      /* This is a fraction that we must use to scale
--       * mach_absolute_time() by in order to reach nanoseconds.
--       *
--       * We've only ever observed this to be 1/1, but maybe it could be
--       * 1000/1 if mach time is microseconds already, or 1/1000 if
--       * picoseconds.  Try to deal nicely with that.
--       */
--      mach_timebase_info (&timebase_info);
--
--      /* We actually want microseconds... */
--      if (timebase_info.numer % 1000 == 0)
--        timebase_info.numer /= 1000;
--      else
--        timebase_info.denom *= 1000;
--
--      /* We want to make the numer 1 to avoid having to multiply... */
--      if (timebase_info.denom % timebase_info.numer == 0)
--        {
--          timebase_info.denom /= timebase_info.numer;
--          timebase_info.numer = 1;
--        }
--      else
--        {
--          /* We could just multiply by timebase_info.numer below, but why
--           * bother for a case that may never actually exist...
--           *
--           * Plus -- performing the multiplication would risk integer
--           * overflow.  If we ever actually end up in this situation, we
--           * should more carefully evaluate the correct course of action.
--           */
--          mach_timebase_info (&timebase_info); /* Get a fresh copy for a better message */
--          g_error ("Got weird mach timebase info of %d/%d.  Please file a bug against GLib.",
--                   timebase_info.numer, timebase_info.denom);
--        }
-+  /* we get nanoseconds from mach_absolute_time() using timebase_info */
-+  mach_timebase_info (&timebase_info);
-+  val = mach_absolute_time();
-+
-+  if (timebase_info.numer != timebase_info.denom)
-+    {
-+      guint64 t_high, t_low;
-+      guint64 result_high, result_low;
-+
-+      /* 64 bit x 32 bit / 32 bit with 96-bit intermediate 
-+       * algorithm lifted from qemu */
-+      t_low = (val & 0xffffffffLL) * (guint64)timebase_info.numer;
-+      t_high = (val >> 32) * (guint64)timebase_info.numer;
-+      t_high += (t_low >> 32);
-+      result_high = t_high / (guint64)timebase_info.denom;
-+      result_low = (((t_high % (guint64)timebase_info.denom) << 32) +
-+                   (t_low & 0xffffffff)) / (guint64)timebase_info.denom;
-+      val = ((result_high << 32) | result_low);
-     }
- 
--  return mach_absolute_time () / timebase_info.denom;
-+  /* nanoseconds to microseconds */
-+  return val / 1000;
- }
- #else
- gint64
diff --git a/glib2/patches/patch-glib_gspawn.c b/glib2/patches/patch-glib_gspawn.c
new file mode 100644
index 0000000000..69636285fd
--- /dev/null
+++ b/glib2/patches/patch-glib_gspawn.c
@@ -0,0 +1,20 @@
+$NetBSD: patch-glib_gspawn.c,v 1.2 2020/03/04 15:11:48 wiz Exp $
+
+Avoid the build failure with Clang on FreeBSD (see PR 54752).
+Set environ as a weak symbol (thanks to Joerg).
+
+--- glib/gspawn.c.orig	2020-02-27 16:12:52.000000000 +0000
++++ glib/gspawn.c
+@@ -85,8 +85,12 @@
+ #ifdef HAVE__NSGETENVIRON
+ #define environ (*_NSGetEnviron())
+ #else
++#if defined(__FreeBSD__)
++extern __attribute__((__weak__)) char **environ;
++#else
+ extern char **environ;
+ #endif
++#endif
+ 
+ #ifndef O_CLOEXEC
+ #define O_CLOEXEC 0
diff --git a/glib2/patches/patch-glib_meson.build b/glib2/patches/patch-glib_meson.build
new file mode 100644
index 0000000000..41f3f809bb
--- /dev/null
+++ b/glib2/patches/patch-glib_meson.build
@@ -0,0 +1,33 @@
+$NetBSD: patch-glib_meson.build,v 1.9 2020/09/29 10:43:33 prlw1 Exp $
+
+- Don't bother with gtester as it's slated for deprecation anyway:
+  https://gitlab.gnome.org/GNOME/glib/issues/1441
+
+--- glib/meson.build.orig	2020-02-27 16:12:52.000000000 +0000
++++ glib/meson.build
+@@ -410,25 +410,8 @@ if host_system == 'windows'
+       include_directories : configinc,
+       dependencies : [libglib_dep])
+   endif
+-else
+-  gtester = executable('gtester', 'gtester.c',
+-    install : true,
+-    c_args : ['-UG_DISABLE_ASSERT'],
+-    include_directories : configinc,
+-    dependencies : [libglib_dep])
+ endif
+ 
+-report_conf = configuration_data()
+-report_conf.set('GLIB_VERSION', glib_version)
+-report_conf.set('PYTHON', python_name)
+-configure_file(
+-  input: 'gtester-report.in',
+-  output: 'gtester-report',
+-  install_dir: get_option('bindir'),
+-  configuration: report_conf,
+-  install_mode: 'rwxr-xr-x'
+-)
+-
+ install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
+ 
+ gdb_conf = configuration_data()
diff --git a/glib2/patches/patch-glib_tests_hash.c b/glib2/patches/patch-glib_tests_hash.c
new file mode 100644
index 0000000000..800d81eea3
--- /dev/null
+++ b/glib2/patches/patch-glib_tests_hash.c
@@ -0,0 +1,60 @@
+$NetBSD: patch-glib_tests_hash.c,v 1.3 2020/03/04 15:11:48 wiz Exp $
+
+Revert GHashTable improvements
+https://gitlab.gnome.org/GNOME/glib/merge_requests/208
+
+to fix PR pkg/54310
+
+--- glib/tests/hash.c.orig	2020-02-27 16:12:52.000000000 +0000
++++ glib/tests/hash.c
+@@ -1353,9 +1353,6 @@ struct _GHashTable
+   gint             nnodes;
+   gint             noccupied;  /* nnodes + tombstones */
+ 
+-  guint            have_big_keys : 1;
+-  guint            have_big_values : 1;
+-
+   gpointer        *keys;
+   guint           *hashes;
+   gpointer        *values;
+@@ -1390,23 +1387,6 @@ count_keys (GHashTable *h, gint *unused,
+     }
+ }
+ 
+-#define BIG_ENTRY_SIZE (SIZEOF_VOID_P)
+-#define SMALL_ENTRY_SIZE (SIZEOF_INT)
+-
+-#if SMALL_ENTRY_SIZE < BIG_ENTRY_SIZE
+-# define USE_SMALL_ARRAYS
+-#endif
+-
+-static gpointer
+-fetch_key_or_value (gpointer a, guint index, gboolean is_big)
+-{
+-#ifdef USE_SMALL_ARRAYS
+-  return is_big ? *(((gpointer *) a) + index) : GUINT_TO_POINTER (*(((guint *) a) + index));
+-#else
+-  return *(((gpointer *) a) + index);
+-#endif
+-}
+-
+ static void
+ check_data (GHashTable *h)
+ {
+@@ -1414,9 +1394,14 @@ check_data (GHashTable *h)
+ 
+   for (i = 0; i < h->size; i++)
+     {
+-      if (h->hashes[i] >= 2)
++      if (h->hashes[i] < 2)
++        {
++          g_assert (h->keys[i] == NULL);
++          g_assert (h->values[i] == NULL);
++        }
++      else
+         {
+-          g_assert_cmpint (h->hashes[i], ==, h->hash_func (fetch_key_or_value (h->keys, i, h->have_big_keys)));
++          g_assert_cmpint (h->hashes[i], ==, h->hash_func (h->keys[i]));
+         }
+     }
+ }
diff --git a/glib2/patches/patch-glib_tests_include.c b/glib2/patches/patch-glib_tests_include.c
new file mode 100644
index 0000000000..9861ed9c08
--- /dev/null
+++ b/glib2/patches/patch-glib_tests_include.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-glib_tests_include.c,v 1.3 2019/11/26 10:27:09 jperkin Exp $
+
+Fix SunOS build.
+
+--- glib/tests/include.c.orig	2019-10-21 17:18:40.000000000 +0000
++++ glib/tests/include.c
+@@ -1,8 +1,10 @@
+ /* Test case for bug 659866 */
+ 
++#ifndef __sun
+ #define _POSIX_C_SOURCE 199309L
+ #undef _GNU_SOURCE
+ #undef _XOPEN_SOURCE
++#endif
+ #include <pthread.h>
+ #include <glib.h>
+ 
diff --git a/glib2/patches/patch-glib_tests_meson.build b/glib2/patches/patch-glib_tests_meson.build
new file mode 100644
index 0000000000..252ffc8709
--- /dev/null
+++ b/glib2/patches/patch-glib_tests_meson.build
@@ -0,0 +1,28 @@
+$NetBSD: patch-glib_tests_meson.build,v 1.1 2019/11/14 12:26:26 ryoon Exp $
+
+* Fix gtester is not defined error during configure.
+
+--- glib/tests/meson.build.orig	2021-03-18 13:28:31.953625200 +0000
++++ glib/tests/meson.build
+@@ -269,21 +269,4 @@ executable('testing-helper', 'testing-he
+   install: installed_tests_enabled,
+ )
+ 
+-# some testing of gtester functionality
+-if not meson.is_cross_build() and host_system != 'windows'
+-  xmllint = find_program('xmllint', required: false)
+-  if xmllint.found()
+-    tmpsample_xml = custom_target('tmpsample.xml',
+-      output : 'tmpsample.xml',
+-      command : [ gtester, '-k', '--quiet', '--i-know-this-is-deprecated', '-o', '@OUTPUT@',
+-                  '--test-arg=--gtester-selftest', gtester])
+-
+-    test('gtester-xmllint-check', xmllint,
+-      args : ['--noout', tmpsample_xml],
+-      env : test_env,
+-      suite : ['glib'],
+-    )
+-  endif
+-endif
+-
+ subdir('path-test-subdir')
diff --git a/glib2/patches/patch-gmodule_gmodule-ar.c b/glib2/patches/patch-gmodule_gmodule-ar.c
deleted file mode 100644
index 820e53fc4b..0000000000
--- a/glib2/patches/patch-gmodule_gmodule-ar.c
+++ /dev/null
@@ -1,29 +0,0 @@
-$NetBSD: patch-gmodule_gmodule-ar.c,v 1.1 2018/10/08 10:12:06 prlw1 Exp $
-
-https://gitlab.gnome.org/GNOME/glib/issues/19
-
---- gmodule/gmodule-ar.c.orig	2017-07-13 23:03:39.000000000 +0000
-+++ gmodule/gmodule-ar.c
-@@ -141,19 +141,10 @@ _g_module_self (void)
- }
- 
- static void
--_g_module_close (gpointer handle,
--		 gboolean is_unref)
-+_g_module_close (gpointer handle)
- {
--  /* are there any systems out there that have dlopen()/dlclose()
--   * without a reference count implementation?
--   */
--  is_unref |= 1;
--  
--  if (is_unref)
--    {
--      if (dlclose (handle) != 0)
--	g_module_set_error (fetch_dlerror (TRUE));
--    }
-+  if (dlclose (handle) != 0)
-+    g_module_set_error (fetch_dlerror (TRUE));
- }
- 
- static gpointer
diff --git a/glib2/patches/patch-gmodule_gmodule-dl.c b/glib2/patches/patch-gmodule_gmodule-dl.c
deleted file mode 100644
index 192f373917..0000000000
--- a/glib2/patches/patch-gmodule_gmodule-dl.c
+++ /dev/null
@@ -1,57 +0,0 @@
-$NetBSD: patch-gmodule_gmodule-dl.c,v 1.1 2018/10/08 10:12:06 prlw1 Exp $
-
-RTLD_GLOBAL is a bug.
-https://gitlab.gnome.org/GNOME/glib/issues/19
-
---- gmodule/gmodule-dl.c.orig	2018-01-08 21:34:19.000000000 +0000
-+++ gmodule/gmodule-dl.c
-@@ -106,46 +106,13 @@ _g_module_open (const gchar *file_name,
- static gpointer
- _g_module_self (void)
- {
--  gpointer handle;
--  
--  /* to query symbols from the program itself, special link options
--   * are required on some systems.
--   */
--
--  /* On Android 32 bit (i.e. not __LP64__), dlopen(NULL)
--   * does not work reliable and generally no symbols are found
--   * at all. RTLD_DEFAULT works though.
--   * On Android 64 bit, dlopen(NULL) seems to work but dlsym(handle)
--   * always returns 'undefined symbol'. Only if RTLD_DEFAULT or 
--   * NULL is given, dlsym returns an appropriate pointer.
--   */
--#if defined(__BIONIC__)
--  handle = RTLD_DEFAULT;
--#else
--  handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY);
--#endif
--  if (!handle)
--    g_module_set_error (fetch_dlerror (TRUE));
--  
--  return handle;
-+  return RTLD_DEFAULT;
- }
- 
- static void
--_g_module_close (gpointer handle,
--		 gboolean is_unref)
-+_g_module_close (gpointer handle)
- {
--  /* are there any systems out there that have dlopen()/dlclose()
--   * without a reference count implementation?
--   *
--   * See above for the Android special case
--   */
--#if defined(__BIONIC__)
--  is_unref = (handle != RTLD_DEFAULT);
--#else
--  is_unref |= 1;
--#endif
--
--  if (is_unref)
-+  if (handle != RTLD_DEFAULT)
-     {
-       if (dlclose (handle) != 0)
- 	g_module_set_error (fetch_dlerror (TRUE));
diff --git a/glib2/patches/patch-gmodule_gmodule-dyld.c b/glib2/patches/patch-gmodule_gmodule-dyld.c
deleted file mode 100644
index d2bc967419..0000000000
--- a/glib2/patches/patch-gmodule_gmodule-dyld.c
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-gmodule_gmodule-dyld.c,v 1.1 2018/10/08 10:12:06 prlw1 Exp $
-
-http://bugzilla.gnome.org/show_bug.cgi?id=107626
-https://gitlab.gnome.org/GNOME/glib/issues/19
-
---- gmodule/gmodule-dyld.c.orig	2018-09-14 11:18:09.527026838 +0000
-+++ gmodule/gmodule-dyld.c
-@@ -96,8 +96,7 @@ _g_module_self (void)
- }
- 
- static void
--_g_module_close (gpointer handle,
--		 gboolean is_unref)
-+_g_module_close (gpointer handle)
- {
-   if (handle == &self_module)
-     return;
-@@ -118,7 +117,13 @@ _g_module_symbol (gpointer     handle,
-       if (NSIsSymbolNameDefined (symbol_name))
- 	sym = NSLookupAndBindSymbol (symbol_name);
-       else
--	sym = NULL;
-+	{
-+	  GModule *mod;
-+	  for (mod = modules, sym = NULL; mod && !sym; mod = mod->next)
-+	    {
-+	      sym = NSLookupSymbolInModule (mod->handle, symbol_name);
-+	    }
-+	}
-     }
-   else
-     sym = NSLookupSymbolInModule (handle, symbol_name);
diff --git a/glib2/patches/patch-gmodule_gmodule-win32.c b/glib2/patches/patch-gmodule_gmodule-win32.c
deleted file mode 100644
index bd3a6c852b..0000000000
--- a/glib2/patches/patch-gmodule_gmodule-win32.c
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-gmodule_gmodule-win32.c,v 1.1 2018/10/08 10:12:06 prlw1 Exp $
-
-https://gitlab.gnome.org/GNOME/glib/issues/19
-
---- gmodule/gmodule-win32.c.orig	2018-01-08 21:34:19.000000000 +0000
-+++ gmodule/gmodule-win32.c
-@@ -105,8 +105,7 @@ _g_module_self (void)
- }
- 
- static void
--_g_module_close (gpointer handle,
--		 gboolean is_unref)
-+_g_module_close (gpointer handle)
- {
-   if (handle != null_module_handle)
-     if (!FreeLibrary (handle))
diff --git a/glib2/patches/patch-gmodule_gmodule.c b/glib2/patches/patch-gmodule_gmodule.c
deleted file mode 100644
index 67e4a3d85b..0000000000
--- a/glib2/patches/patch-gmodule_gmodule.c
+++ /dev/null
@@ -1,57 +0,0 @@
-$NetBSD: patch-gmodule_gmodule.c,v 1.1 2018/10/08 10:12:06 prlw1 Exp $
-
-RTLD_GLOBAL is a bug.
-https://gitlab.gnome.org/GNOME/glib/issues/19
-
---- gmodule/gmodule.c.orig	2018-01-08 21:34:19.000000000 +0000
-+++ gmodule/gmodule.c
-@@ -207,8 +207,7 @@ struct _GModule
- static gpointer		_g_module_open		(const gchar	*file_name,
- 						 gboolean	 bind_lazy,
- 						 gboolean	 bind_local);
--static void		_g_module_close		(gpointer	 handle,
--						 gboolean	 is_unref);
-+static void		_g_module_close		(gpointer	 handle);
- static gpointer		_g_module_self		(void);
- static gpointer		_g_module_symbol	(gpointer	 handle,
- 						 const gchar	*symbol_name);
-@@ -299,8 +298,7 @@ _g_module_open (const gchar	*file_name,
-   return NULL;
- }
- static void
--_g_module_close	(gpointer	 handle,
--		 gboolean	 is_unref)
-+_g_module_close	(gpointer	 handle)
- {
- }
- static gpointer
-@@ -510,9 +508,8 @@ g_module_open (const gchar    *file_name
-       if (!main_module)
- 	{
- 	  handle = _g_module_self ();
--/* On Android 64 bit, RTLD_DEFAULT is (void *)0x0
-- * so it always fails to create main_module if file_name is NULL */
--#if !defined(__BIONIC__) || !defined(__LP64__)
-+/* On Linux, handle == RTLD_DEFAULT is (void *)0x0 */
-+#if G_MODULE_IMPL != G_MODULE_IMPL_DL
- 	  if (handle)
- #endif
- 	    {
-@@ -617,7 +614,7 @@ g_module_open (const gchar    *file_name
-       module = g_module_find_by_handle (handle);
-       if (module)
- 	{
--	  _g_module_close (module->handle, TRUE);
-+	  _g_module_close (module->handle);
- 	  module->ref_count++;
- 	  g_module_set_error (NULL);
- 	  
-@@ -723,7 +720,7 @@ g_module_close (GModule *module)
- 	}
-       module->next = NULL;
-       
--      _g_module_close (module->handle, FALSE);
-+      _g_module_close (module->handle);
-       g_free (module->file_name);
-       g_free (module);
-     }
diff --git a/glib2/patches/patch-gobject_glib-mkenums.in b/glib2/patches/patch-gobject_glib-mkenums.in
index f9ed3e4f26..376056c7bb 100644
--- a/glib2/patches/patch-gobject_glib-mkenums.in
+++ b/glib2/patches/patch-gobject_glib-mkenums.in
@@ -1,17 +1,9 @@
-$NetBSD: patch-gobject_glib-mkenums.in,v 1.4 2018/04/01 20:26:25 joerg Exp $
+$NetBSD: patch-gobject_glib-mkenums.in,v 1.5 2019/06/03 09:53:50 prlw1 Exp $
 
-- Revert 4395a897 Use env to run the Python-based tools
-  https://bugzilla.gnome.org/show_bug.cgi?id=788527
 - Do not print failing characters that might not be ASCII
 
 --- gobject/glib-mkenums.in.orig	2018-01-08 20:00:49.000000000 +0000
 +++ gobject/glib-mkenums.in
-@@ -1,4 +1,4 @@
--#!/usr/bin/env @PYTHON@
-+#!@PYTHON@
- 
- # If the code below looks horrible and unpythonic, do not panic.
- #
 @@ -88,9 +88,8 @@ else:
  # https://bugzilla.gnome.org/show_bug.cgi?id=785113#c20
  def replace_and_warn(err):
diff --git a/glib2/patches/patch-gobject_meson.build b/glib2/patches/patch-gobject_meson.build
new file mode 100644
index 0000000000..17acef177b
--- /dev/null
+++ b/glib2/patches/patch-gobject_meson.build
@@ -0,0 +1,14 @@
+$NetBSD: patch-gobject_meson.build,v 1.5 2019/11/14 11:40:30 wiz Exp $
+
+Leave glib-genmarshal and glib-mkenums to devel/glib2-tools.
+
+--- gobject/meson.build.orig	2019-10-04 11:44:24.000000000 +0000
++++ gobject/meson.build
+@@ -75,6 +75,7 @@ foreach tool: python_tools
+     input : tool + '.in',
+     output : tool,
+     configuration : python_tools_conf,
++    install : false,
+     install_dir : glib_bindir,
+   )
+ 
diff --git a/glib2/patches/patch-meson.build b/glib2/patches/patch-meson.build
new file mode 100644
index 0000000000..6353e8f93e
--- /dev/null
+++ b/glib2/patches/patch-meson.build
@@ -0,0 +1,19 @@
+$NetBSD$
+
+--- meson.build.orig	2021-03-18 13:28:31.970625400 +0000
++++ meson.build
+@@ -2220,9 +2220,11 @@ endif
+ 
+ glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline)
+ 
+-python = import('python').find_installation('python3')
+-# used for '#!/usr/bin/env <name>'
+-python_name = 'python3'
++python = import('python').find_installation('python3', required: false)
++if not python.found()
++  python = import('python').find_installation()
++endif
++python_name = python.path()
+ 
+ python_version = python.language_version()
+ python_version_req = '>=3.5'
diff --git a/glib2/patches/patch-meson_options.txt b/glib2/patches/patch-meson_options.txt
new file mode 100644
index 0000000000..536a54799a
--- /dev/null
+++ b/glib2/patches/patch-meson_options.txt
@@ -0,0 +1,18 @@
+$NetBSD: patch-meson_options.txt,v 1.2 2019/11/14 11:40:30 wiz Exp $
+
+Add use_cocoa option.
+
+--- meson_options.txt.orig	2019-10-04 11:44:24.000000000 +0000
++++ meson_options.txt
+@@ -90,6 +90,11 @@ option('nls',
+        yield: true,
+        description : 'Enable native language support (translations)')
+ 
++option('use_cocoa',
++       type : 'boolean',
++       value : false,
++       description : 'Use Cocoa on macOS')
++
+ option('oss_fuzz',
+        type : 'feature',
+        value : 'disabled',
diff --git a/glib2/schemas.mk b/glib2/schemas.mk
index 604e8ba7d3..086eede74c 100644
--- a/glib2/schemas.mk
+++ b/glib2/schemas.mk
@@ -1,4 +1,4 @@
-# $NetBSD: schemas.mk,v 1.2 2011/02/20 15:07:40 jmmv Exp $
+# $NetBSD: schemas.mk,v 1.3 2019/11/03 10:39:12 rillig Exp $
 #
 # This Makefile fragment is intended to be included by packages that install
 # GSettings schemas.  It takes care of rebuilding the corresponding databases


Home | Main Index | Thread Index | Old Index