git: 87ef1c7edb4a - main - sysutils/udiskie: New port: Removable disk automounter using the UDisks2 D-Bus API

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Tue, 20 Oct 2026 08:31:29 UTC
The branch main has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=87ef1c7edb4af9095e9ba3a53f9a2d8668338f23

commit 87ef1c7edb4af9095e9ba3a53f9a2d8668338f23
Author:     Jordan Hubbard <jkh@FreeBSD.org>
AuthorDate: 2026-10-01 18:38:05 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2026-10-20 08:31:03 +0000

    sysutils/udiskie: New port: Removable disk automounter using the UDisks2 D-Bus API
    
    udiskie is a UDisks2 front-end that automatically mounts removable media
    when it is inserted. It provides a tray icon, desktop notifications,
    password prompts for encrypted devices, and the udiskie-mount,
    udiskie-umount and udiskie-info command line tools.
    
    WWW: https://github.com/coldfix/udiskie
    
    Reported by:    jkh (new maintainer)
    Pull Request:   https://github.com/freebsd/freebsd-ports/pull/630
    Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
---
 sysutils/Makefile                                |  1 +
 sysutils/udiskie/Makefile                        | 38 ++++++++++++++++++++++++
 sysutils/udiskie/distinfo                        |  3 ++
 sysutils/udiskie/files/patch-pyproject.toml      | 12 ++++++++
 sysutils/udiskie/files/patch-udiskie_keyutils.py | 24 +++++++++++++++
 sysutils/udiskie/files/patch-udiskie_udisks2.py  | 19 ++++++++++++
 sysutils/udiskie/pkg-descr                       |  6 ++++
 7 files changed, 103 insertions(+)

diff --git a/sysutils/Makefile b/sysutils/Makefile
index 442d74c6b9cb..66a296f36c4c 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1591,6 +1591,7 @@
     SUBDIR += ucspi-tcp
     SUBDIR += ucspi-unix
     SUBDIR += udfclient
+    SUBDIR += udiskie
     SUBDIR += ufetch
     SUBDIR += ufs-utils
     SUBDIR += uhidd
diff --git a/sysutils/udiskie/Makefile b/sysutils/udiskie/Makefile
new file mode 100644
index 000000000000..3a49c6c8426a
--- /dev/null
+++ b/sysutils/udiskie/Makefile
@@ -0,0 +1,38 @@
+PORTNAME=	udiskie
+DISTVERSION=	2.7.0
+CATEGORIES=	sysutils python
+MASTER_SITES=	PYPI
+
+MAINTAINER=	jkh@FreeBSD.org
+COMMENT=	Removable disk automounter using the UDisks2 D-Bus API
+WWW=		https://github.com/coldfix/udiskie
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+BUILD_DEPENDS=	${PY_SETUPTOOLS} \
+		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}docopt>0:devel/py-docopt@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pygobject>0:devel/py-pygobject@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pyyaml>0:devel/py-pyyaml@${PY_FLAVOR} \
+		bsdisks:sysutils/bsdisks
+
+USES=		gnome python
+USE_GNOME=	gtk30:run introspection:run
+USE_PYTHON=	autoplist noflavors pep517
+
+NO_ARCH=	yes
+
+OPTIONS_DEFINE=	NLS NOTIFY
+OPTIONS_DEFAULT=	NOTIFY
+
+NOTIFY_DESC=	Desktop notifications via libnotify
+
+NLS_USES=	gettext-tools
+NOTIFY_RUN_DEPENDS=	${LOCALBASE}/lib/girepository-1.0/Notify-0.7.typelib:devel/libnotify
+
+# setup.py builds a catalog for every lang/*.po it finds.
+post-patch-NLS-off:
+	${RM} ${WRKSRC}/lang/*.po
+
+.include <bsd.port.mk>
diff --git a/sysutils/udiskie/distinfo b/sysutils/udiskie/distinfo
new file mode 100644
index 000000000000..af2df3e5d04c
--- /dev/null
+++ b/sysutils/udiskie/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1790689939
+SHA256 (udiskie-2.7.0.tar.gz) = 316b2feba0e415429e5632b5367c9b6366cb8a90cf919cd8a1053bbb26492bb3
+SIZE (udiskie-2.7.0.tar.gz) = 112543
diff --git a/sysutils/udiskie/files/patch-pyproject.toml b/sysutils/udiskie/files/patch-pyproject.toml
new file mode 100644
index 000000000000..f6256305390d
--- /dev/null
+++ b/sysutils/udiskie/files/patch-pyproject.toml
@@ -0,0 +1,12 @@
+--- pyproject.toml.orig	2026-09-29 14:54:07 UTC
++++ pyproject.toml
+@@ -7,8 +7,7 @@ requires-python = ">=3.5"
+ description = "Removable disk automounter based on udisks"
+ dynamic = ["version", "readme"]
+ requires-python = ">=3.5"
+-license = "MIT"
+-license-files = ["COPYING"]
++license = {text = "MIT"}
+ authors = [
+     {name = "Byron Clark", email = "byron@theclarkfamily.name"},
+     {name = "Thomas Gläßle", email = "t_glaessle@gmx.de"},
diff --git a/sysutils/udiskie/files/patch-udiskie_keyutils.py b/sysutils/udiskie/files/patch-udiskie_keyutils.py
new file mode 100644
index 000000000000..7011245abcd7
--- /dev/null
+++ b/sysutils/udiskie/files/patch-udiskie_keyutils.py
@@ -0,0 +1,24 @@
+--- udiskie/keyutils.py.orig	2026-09-29 16:06:47 UTC
++++ udiskie/keyutils.py
+@@ -52,11 +52,17 @@ class KeyRejected(KeyutilsError):
+     pass
+ 
+ 
++# The key error codes are Linux-specific; skip the ones the platform lacks
++# so that a missing keyutils library surfaces as ImportError below.
+ _errno_map = {
+-    errno.ENOKEY: KeyNotAvailable,
+-    errno.EKEYEXPIRED: KeyExpired,
+-    errno.EKEYREVOKED: KeyRevoked,
+-    errno.EKEYREJECTED: KeyRejected,
++    getattr(errno, name): exc_type
++    for name, exc_type in (
++        ('ENOKEY', KeyNotAvailable),
++        ('EKEYEXPIRED', KeyExpired),
++        ('EKEYREVOKED', KeyRevoked),
++        ('EKEYREJECTED', KeyRejected),
++    )
++    if hasattr(errno, name)
+ }
+ 
+ 
diff --git a/sysutils/udiskie/files/patch-udiskie_udisks2.py b/sysutils/udiskie/files/patch-udiskie_udisks2.py
new file mode 100644
index 000000000000..3584f4767005
--- /dev/null
+++ b/sysutils/udiskie/files/patch-udiskie_udisks2.py
@@ -0,0 +1,19 @@
+--- udiskie/udisks2.py.orig	2026-09-29 14:53:20 UTC
++++ udiskie/udisks2.py
+@@ -734,8 +734,14 @@ class Daemon(Emitter):
+                    '/org/freedesktop/UDisks2/Manager',
+                    Interface['Properties'])
+         manager = await dbus.connect_service(*service)
+-        version = await dbus.call(manager._proxy, 'Get', '(ss)', (
+-            Interface['Manager'], 'Version'))
++        try:
++            version = await dbus.call(manager._proxy, 'Get', '(ss)', (
++                Interface['Manager'], 'Version'))
++        except GLib.Error:
++            # Some UDisks2 implementations, such as bsdisks on FreeBSD, do
++            # not export the Manager object. Treat the version as unknown,
++            # which also disables the keyfile support check.
++            return '0'
+         return version
+ 
+     async def loop_setup(self, fd, options):
diff --git a/sysutils/udiskie/pkg-descr b/sysutils/udiskie/pkg-descr
new file mode 100644
index 000000000000..cf7308949ae5
--- /dev/null
+++ b/sysutils/udiskie/pkg-descr
@@ -0,0 +1,6 @@
+udiskie is a UDisks2 front-end that automatically mounts removable media
+when it is inserted. It provides a tray icon, desktop notifications,
+password prompts for encrypted devices, and the udiskie-mount,
+udiskie-umount and udiskie-info command line tools.
+
+On FreeBSD the UDisks2 D-Bus service is provided by sysutils/bsdisks.