pkgsrc-WIP-changes archive

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

xdg-desktop-portal: update to 1.20.3



Module Name:	pkgsrc-wip
Committed By:	kikadf <kikadf.01%gmail.com@localhost>
Pushed By:	kikadf
Date:		Mon Jan 12 17:09:33 2026 +0100
Changeset:	5924ea88ad7c81be1278a261f15dedd463194f74

Modified Files:
	xdg-desktop-portal/Makefile
	xdg-desktop-portal/PLIST
	xdg-desktop-portal/TODO
	xdg-desktop-portal/distinfo
Added Files:
	xdg-desktop-portal/patches/patch-document-portal_meson.build
	xdg-desktop-portal/patches/patch-document-portal_permission-db.c
	xdg-desktop-portal/patches/patch-src_pipewire.c
	xdg-desktop-portal/patches/patch-src_xdp-app-info-flatpak.c
	xdg-desktop-portal/patches/patch-src_xdp-app-info.c
	xdg-desktop-portal/patches/patch-src_xdp-documents.c
	xdg-desktop-portal/patches/patch-src_xdp-sealed-fd.c

Log Message:
xdg-desktop-portal: update to 1.20.3

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

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

diffstat:
 xdg-desktop-portal/Makefile                        |  32 ++++++-
 xdg-desktop-portal/PLIST                           | 103 ++++++++++++++++++++-
 xdg-desktop-portal/TODO                            |  11 ++-
 xdg-desktop-portal/distinfo                        |  13 ++-
 .../patches/patch-document-portal_meson.build      |  40 ++++++++
 .../patches/patch-document-portal_permission-db.c  |  30 ++++++
 xdg-desktop-portal/patches/patch-src_pipewire.c    |  16 ++++
 .../patches/patch-src_xdp-app-info-flatpak.c       |  25 +++++
 .../patches/patch-src_xdp-app-info.c               |  22 +++++
 .../patches/patch-src_xdp-documents.c              |  24 +++++
 .../patches/patch-src_xdp-sealed-fd.c              |  50 ++++++++++
 11 files changed, 356 insertions(+), 10 deletions(-)

diffs:
diff --git a/xdg-desktop-portal/Makefile b/xdg-desktop-portal/Makefile
index 4ddb371e05..1c9180d5ca 100644
--- a/xdg-desktop-portal/Makefile
+++ b/xdg-desktop-portal/Makefile
@@ -1,20 +1,46 @@
 # $NetBSD$
 
-DISTNAME=	xdg-desktop-portal-1.18.4
+DISTNAME=	xdg-desktop-portal-1.20.3
 CATEGORIES=	sysutils
 MASTER_SITES=	${MASTER_SITE_GITHUB:=flatpak/}
-EXTRACT_SUFX=	.tar.xz
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE=	https://github.com/flatpak/xdg-desktop-portal/releases/download/1.18.4/ # TODO: check
+HOMEPAGE=	https://github.com/flatpak/xdg-desktop-portal/
 COMMENT=	Desktop integration portal (from Flatpak)
 LICENSE=	gnu-lgpl-v2.1
 
 USE_TOOLS+=	pkg-config
 
+# tests require umockdev
+MESON_ARGS+=	-Dtests=disabled
+# require bubblewrap
+MESON_ARGS+=	-Dsandboxed-image-validation=disabled
+MESON_ARGS+=	-Dsandboxed-sound-validation=disabled
+
+.include "../../mk/bsd.fast.prefs.mk"
+.if ${OPSYS} == "NetBSD"
+# shm_open
+LDFLAGS+=	-lrt
+.  if ${OPSYS_VERSION} >= 110000
+# memfd_create(), seals
+CFLAGS+=	-D_NETBSD_SOURCE
+.  endif
+.endif
+
+post-install:
+	${RM} -r ${DESTDIR}${PREFIX}/lib/systemd
+	# fuse3 issue: see patch-document-portal_meson.build
+	${RM} ${DESTDIR}${PREFIX}/share/dbus-1/interfaces/org.freedesktop.portal.Documents.xml
+	${RM} ${DESTDIR}${PREFIX}/share/dbus-1/services/org.freedesktop.portal.Documents.service
+
 .include "../../devel/meson/build.mk"
+.include "../../lang/python/tool.mk"
 .include "../../devel/glib2/buildlink3.mk"
+.include "../../devel/libportal/buildlink3.mk"
+.include "../../geography/geoclue/buildlink3.mk"
 .include "../../graphics/gdk-pixbuf2/buildlink3.mk"
+.include "../../multimedia/gst-plugins1-base/buildlink3.mk"
+.include "../../wip/pipewire/buildlink3.mk"
 .include "../../textproc/json-glib/buildlink3.mk"
 .include "../../mk/fuse.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/xdg-desktop-portal/PLIST b/xdg-desktop-portal/PLIST
index 92ba51a2d7..ea6067f8a7 100644
--- a/xdg-desktop-portal/PLIST
+++ b/xdg-desktop-portal/PLIST
@@ -1,4 +1,101 @@
 @comment $NetBSD$
-@comment TODO: to fill this file with the file listing:
-@comment TODO: 1. run "/usr/bin/make package"
-@comment TODO: 2. run "/usr/bin/make print-PLIST"
+libexec/xdg-desktop-portal
+libexec/xdg-desktop-portal-rewrite-launchers
+libexec/xdg-desktop-portal-validate-icon
+libexec/xdg-desktop-portal-validate-sound
+libexec/xdg-permission-store
+share/dbus-1/interfaces/org.freedesktop.host.portal.Registry.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Access.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Account.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.AppChooser.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Background.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Clipboard.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.DynamicLauncher.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Email.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.FileChooser.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.GlobalShortcuts.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Inhibit.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.InputCapture.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Lockdown.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Notification.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.PermissionStore.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Print.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.RemoteDesktop.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Request.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.ScreenCast.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Screenshot.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Secret.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Session.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Settings.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Usb.xml
+share/dbus-1/interfaces/org.freedesktop.impl.portal.Wallpaper.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Account.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Background.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Camera.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Clipboard.xml
+share/dbus-1/interfaces/org.freedesktop.portal.DynamicLauncher.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Email.xml
+share/dbus-1/interfaces/org.freedesktop.portal.FileChooser.xml
+share/dbus-1/interfaces/org.freedesktop.portal.FileTransfer.xml
+share/dbus-1/interfaces/org.freedesktop.portal.GameMode.xml
+share/dbus-1/interfaces/org.freedesktop.portal.GlobalShortcuts.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Inhibit.xml
+share/dbus-1/interfaces/org.freedesktop.portal.InputCapture.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Location.xml
+share/dbus-1/interfaces/org.freedesktop.portal.MemoryMonitor.xml
+share/dbus-1/interfaces/org.freedesktop.portal.NetworkMonitor.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Notification.xml
+share/dbus-1/interfaces/org.freedesktop.portal.OpenURI.xml
+share/dbus-1/interfaces/org.freedesktop.portal.PowerProfileMonitor.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Print.xml
+share/dbus-1/interfaces/org.freedesktop.portal.ProxyResolver.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Realtime.xml
+share/dbus-1/interfaces/org.freedesktop.portal.RemoteDesktop.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Request.xml
+share/dbus-1/interfaces/org.freedesktop.portal.ScreenCast.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Screenshot.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Secret.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Session.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Settings.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Trash.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Usb.xml
+share/dbus-1/interfaces/org.freedesktop.portal.Wallpaper.xml
+share/dbus-1/services/org.freedesktop.impl.portal.PermissionStore.service
+share/dbus-1/services/org.freedesktop.portal.Desktop.service
+share/locale/be/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/bg/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/ca/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/cs/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/da/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/de/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/en_GB/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/es/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/fr/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/gl/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/he/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/hi/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/hr/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/hu/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/id/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/ie/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/it/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/ja/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/ka/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/lt/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/nl/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/oc/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/pl/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/pt/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/pt_BR/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/ro/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/ru/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/sk/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/sl/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/sr/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/sv/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/tr/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/uk/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/zh_CN/LC_MESSAGES/xdg-desktop-portal.mo
+share/locale/zh_TW/LC_MESSAGES/xdg-desktop-portal.mo
+share/pkgconfig/xdg-desktop-portal.pc
+@pkgdir lib
diff --git a/xdg-desktop-portal/TODO b/xdg-desktop-portal/TODO
index 001f5eebbb..ef66e5b182 100644
--- a/xdg-desktop-portal/TODO
+++ b/xdg-desktop-portal/TODO
@@ -1 +1,10 @@
-Needs pipewire package.
+Build warnings:
+/usr/pkgsrc/wip/xdg-desktop-portal/work/.buildlink/include/spa-0.2/spa/utils/string.h:274:9: warning: implicit declaration of function 'uselocale'; did you mean 'setlocale'? [-Wimplicit-function-declaration]
+  274 |  prev = uselocale(locale);
+      |         ^~~~~~~~~
+      |         setlocale
+/usr/pkgsrc/wip/xdg-desktop-portal/work/.buildlink/include/spa-0.2/spa/utils/string.h:274:7: warning: assignment to 'locale_t' {aka 'struct _locale *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
+  274 |  prev = uselocale(locale);
+      |       ^
+
+NOTE: from pipewire ^
diff --git a/xdg-desktop-portal/distinfo b/xdg-desktop-portal/distinfo
index e005010c2f..f314eac4de 100644
--- a/xdg-desktop-portal/distinfo
+++ b/xdg-desktop-portal/distinfo
@@ -1,5 +1,12 @@
 $NetBSD$
 
-BLAKE2s (xdg-desktop-portal-1.18.4.tar.xz) = f39c5f5a8e4fb167e40fde66991155d035787ff945cd4993c2b3c797806b0038
-SHA512 (xdg-desktop-portal-1.18.4.tar.xz) = 482676777e8180752e13ff485acab91de117f4ecf2aefd313a6f596df800f37d7004ee4ba1040009eb69a6efc780efc7dcd7e46b3f59c47bd9f21aef48d346de
-Size (xdg-desktop-portal-1.18.4.tar.xz) = 699380 bytes
+BLAKE2s (xdg-desktop-portal-1.20.3.tar.gz) = e5ff13b3cc60e884018ea5599643d0e414fa6467d7b693f3f0e414fbc0edbc51
+SHA512 (xdg-desktop-portal-1.20.3.tar.gz) = a172deebdcf7924aa62d98bb77bab250796f8b2f2f3097933a57cca419edbdf5642f1042180849d8c9905debc519b5edf25dd61b755bd9fb99a8c690dd5620a0
+Size (xdg-desktop-portal-1.20.3.tar.gz) = 1337615 bytes
+SHA1 (patch-document-portal_meson.build) = de1def6921d0eb12224c9148d8e3518eddd483b1
+SHA1 (patch-document-portal_permission-db.c) = 883189abb9a0fe6816e23226644e12011aa316f0
+SHA1 (patch-src_pipewire.c) = bd381b746833f33f65cd546afaaa1075915f9a4d
+SHA1 (patch-src_xdp-app-info-flatpak.c) = bc07d637f355950321a6f281dfca3d90dd0bee2a
+SHA1 (patch-src_xdp-app-info.c) = cbfdc7ded0d68b90dc0d4036953673df90bd14c7
+SHA1 (patch-src_xdp-documents.c) = 3a53b1a30635a258f5b0445345a4272305df8665
+SHA1 (patch-src_xdp-sealed-fd.c) = 0703072a44a29eaa83fd47ed9fd3d8d060d26348
diff --git a/xdg-desktop-portal/patches/patch-document-portal_meson.build b/xdg-desktop-portal/patches/patch-document-portal_meson.build
new file mode 100644
index 0000000000..38dc4be335
--- /dev/null
+++ b/xdg-desktop-portal/patches/patch-document-portal_meson.build
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Build error:
+../document-portal/document-portal-fuse.c:281:37: error: 'FUSE_ROOT_ID' undeclared here
+../document-portal/document-portal-fuse.c:395:15: error: 'FUSE_SET_ATTR_MODE' undeclared
+../document-portal/document-portal-fuse.c:398:15: error: 'FUSE_SET_ATTR_UID' undeclared
+...
+
+--- document-portal/meson.build.orig	2026-01-12 14:49:05.731913861 +0000
++++ document-portal/meson.build
+@@ -59,14 +59,14 @@ xdg_document_portal_sources = [
+   permission_store_built_sources,
+ ]
+ 
+-xdg_document_portal = executable(
+-  'xdg-document-portal',
+-  xdg_document_portal_sources,
+-  dependencies: [xdg_desktop_portal_deps, fuse3_dep],
+-  include_directories: incs_xdg_desktop_portal,
+-  install: true,
+-  install_dir: libexecdir,
+-)
++#xdg_document_portal = executable(
++#  'xdg-document-portal',
++#  xdg_document_portal_sources,
++#  dependencies: [xdg_desktop_portal_deps, fuse3_dep],
++#  include_directories: incs_xdg_desktop_portal,
++#  install: true,
++#  install_dir: libexecdir,
++#)
+ 
+ configure_file(
+   input: 'xdg-document-portal.service.in',
+@@ -93,4 +93,4 @@ permission_portal_service_file = configu
+   configuration: base_config,
+   install: true,
+   install_dir: dbus_service_dir,
+-)
+\ No newline at end of file
++)
diff --git a/xdg-desktop-portal/patches/patch-document-portal_permission-db.c b/xdg-desktop-portal/patches/patch-document-portal_permission-db.c
new file mode 100644
index 0000000000..647da75e84
--- /dev/null
+++ b/xdg-desktop-portal/patches/patch-document-portal_permission-db.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Fix statfs on NetBSD
+
+--- document-portal/permission-db.c.orig	2025-05-20 17:07:14.000000000 +0000
++++ document-portal/permission-db.c
+@@ -33,6 +33,11 @@
+ #ifdef HAVE_SYS_MOUNT_H
+ #include <sys/mount.h>
+ #endif
++#if defined(__NetBSD__)
++#include <sys/statvfs.h>
++#define statfs statvfs
++#define MFSNAMELEN _VFS_NAMELEN
++#endif
+ 
+ #include "permission-db.h"
+ #include "gvdb/gvdb-reader.h"
+@@ -257,7 +262,11 @@ is_on_nfs (const char *path)
+   if (statfs_result != 0)
+     return FALSE;
+ 
++#if defined(__OpenBSD__) || defined(__NetBSD__)
++  return (strncmp(statfs_buffer.f_fstypename, "nfs", MFSNAMELEN) == 0);
++#else
+   return statfs_buffer.f_type == 0x6969;
++#endif
+ }
+ 
+ static gboolean
diff --git a/xdg-desktop-portal/patches/patch-src_pipewire.c b/xdg-desktop-portal/patches/patch-src_pipewire.c
new file mode 100644
index 0000000000..ed934c8edc
--- /dev/null
+++ b/xdg-desktop-portal/patches/patch-src_pipewire.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Use pipewire_init:
+  https://gitlab.freedesktop.org/wtaymans/pipewire/-/commit/75081f8b4d852146d4880c29da45d1f21941b8a3
+
+--- src/pipewire.c.orig	2026-01-12 10:57:53.266590608 +0000
++++ src/pipewire.c
+@@ -242,7 +242,7 @@ ensure_pipewire_is_initialized (void)
+   if (is_pipewire_initialized)
+     return;
+ 
+-  pw_init (NULL, NULL);
++  pipewire_init (NULL, NULL);
+ 
+   is_pipewire_initialized = TRUE;
+ }
diff --git a/xdg-desktop-portal/patches/patch-src_xdp-app-info-flatpak.c b/xdg-desktop-portal/patches/patch-src_xdp-app-info-flatpak.c
new file mode 100644
index 0000000000..74e02349a3
--- /dev/null
+++ b/xdg-desktop-portal/patches/patch-src_xdp-app-info-flatpak.c
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* No Flatpak support
+
+--- src/xdp-app-info-flatpak.c.orig	2026-01-12 10:33:38.074348687 +0000
++++ src/xdp-app-info-flatpak.c
+@@ -643,6 +643,10 @@ static int
+ open_flatpak_info (int      pid,
+                    GError **error)
+ {
++  g_set_error (error, XDP_APP_INFO_ERROR, XDP_APP_INFO_ERROR_WRONG_APP_KIND,
++                           "Certainly not a flatpak");
++  return -1;
++#if 0
+   g_autofree char *root_path = NULL;
+   g_autofd int root_fd = -1;
+   g_autofd int info_fd = -1;
+@@ -695,6 +699,7 @@ open_flatpak_info (int      pid,
+     }
+ 
+   return g_steal_fd (&info_fd);
++#endif
+ }
+ 
+ gboolean
diff --git a/xdg-desktop-portal/patches/patch-src_xdp-app-info.c b/xdg-desktop-portal/patches/patch-src_xdp-app-info.c
new file mode 100644
index 0000000000..f0df759a62
--- /dev/null
+++ b/xdg-desktop-portal/patches/patch-src_xdp-app-info.c
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Fix build without O_PATH
+
+--- src/xdp-app-info.c.orig	2026-01-12 10:29:35.457923446 +0000
++++ src/xdp-app-info.c
+@@ -585,6 +585,7 @@ xdp_app_info_get_path_for_fd (XdpAppInfo
+   if (path == NULL)
+     return NULL;
+ 
++#ifdef O_PATH
+   if ((fd_flags & O_PATH) == O_PATH)
+     {
+       int read_access_mode;
+@@ -634,6 +635,7 @@ xdp_app_info_get_path_for_fd (XdpAppInfo
+         writable = TRUE;
+     }
+   else /* Regular file with no O_PATH */
++#endif
+     {
+       int accmode = fd_flags & O_ACCMODE;
+ 
diff --git a/xdg-desktop-portal/patches/patch-src_xdp-documents.c b/xdg-desktop-portal/patches/patch-src_xdp-documents.c
new file mode 100644
index 0000000000..7da055059b
--- /dev/null
+++ b/xdg-desktop-portal/patches/patch-src_xdp-documents.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Fix build without O_PATH
+
+--- src/xdp-documents.c.orig	2026-01-12 10:26:48.724615416 +0000
++++ src/xdp-documents.c
+@@ -96,10 +96,17 @@ xdp_register_document (const char       
+   basename = g_path_get_basename (path);
+   dirname = g_path_get_dirname (path);
+ 
++#ifdef O_PATH
+   if (flags & XDP_DOCUMENT_FLAG_FOR_SAVE)
+     fd = open (dirname, O_PATH | O_CLOEXEC);
+   else
+     fd = open (path, O_PATH | O_CLOEXEC);
++#else
++  if (flags & XDP_DOCUMENT_FLAG_FOR_SAVE)
++    fd = open (dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
++  else
++    fd = open (path, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
++#endif
+ 
+   if (fd == -1)
+     {
diff --git a/xdg-desktop-portal/patches/patch-src_xdp-sealed-fd.c b/xdg-desktop-portal/patches/patch-src_xdp-sealed-fd.c
new file mode 100644
index 0000000000..33b42afbda
--- /dev/null
+++ b/xdg-desktop-portal/patches/patch-src_xdp-sealed-fd.c
@@ -0,0 +1,50 @@
+$NetBSD$
+
+* memfd_create and seals available on NetBSD>=11
+
+--- src/xdp-sealed-fd.c.orig	2026-01-12 13:31:04.004734564 +0000
++++ src/xdp-sealed-fd.c
+@@ -80,6 +80,7 @@ xdp_sealed_fd_new_take_memfd (int      m
+ 
+   g_return_val_if_fail (fd != -1, NULL);
+ 
++#if !defined(__NetBSD__) || __NetBSD_Version__ >= 1100000000
+   seals = fcntl (fd, F_GET_SEALS);
+   if (seals == -1)
+    {
+@@ -106,6 +107,7 @@ xdp_sealed_fd_new_take_memfd (int      m
+                    "fcntl F_ADD_SEALS: %s", g_strerror (saved_errno));
+       return NULL;
+     }
++#endif
+ 
+   sealed_fd = g_object_new (XDP_TYPE_SEALED_FD, NULL);
+   sealed_fd->fd = g_steal_fd (&fd);
+@@ -127,7 +129,11 @@ xdp_sealed_fd_new_from_bytes (GBytes  *b
+ 
+   g_return_val_if_fail (bytes != NULL, NULL);
+ 
++#if !defined(__NetBSD__) || __NetBSD_Version__ >= 1100000000
+   fd = memfd_create ("xdp-sealed-fd", MFD_ALLOW_SEALING);
++#else
++  fd = shm_open ("xdp-sealed-fd", O_RDWR, 0600);
++#endif
+   if (fd == -1)
+     {
+       int saved_errno;
+@@ -181,6 +187,7 @@ xdp_sealed_fd_new_from_bytes (GBytes  *b
+       return NULL;
+     }
+ 
++#if !defined(__NetBSD__) || __NetBSD_Version__ >= 1100000000
+   if (fcntl (fd, F_ADD_SEALS, REQUIRED_SEALS) == -1)
+     {
+       saved_errno = errno;
+@@ -190,6 +197,7 @@ xdp_sealed_fd_new_from_bytes (GBytes  *b
+                    "fcntl F_ADD_SEALS: %s", g_strerror (saved_errno));
+       return NULL;
+     }
++#endif
+ 
+   sealed_fd = g_object_new (XDP_TYPE_SEALED_FD, NULL);
+   sealed_fd->fd = g_steal_fd (&fd);


Home | Main Index | Thread Index | Old Index