Thursday, December 03, 2026

x11/kde-applications/libkgapi: install libkdexoauth2.la so cyrus-sasl loads XOAUTH2

Hi,

libkgapi installs the KDE XOAUTH2 SASL plugin as
/usr/local/lib/sasl2/libkdexoauth2.so.3.0, but without a libtool .la
file. cyrus-sasl on OpenBSD only picks up plugins through their .la
(every plugin in security/cyrus-sasl2 and security/cyrus-sasl-xoauth2
ships one), so this plugin is never loaded and the XOAUTH2 mechanism
is never offered.

As a result, KMail/Akonadi cannot log in to Gmail or Google Workspace:
the IMAP resource reports "Server is not available", and with
QT_LOGGING_RULES="org.kde.pim.kimap*=true" the log shows

Trying authmod "XOAUTH2"
sasl_client_start failed with: -4 "SASL(-4): no mechanism available:
No worthy mechs found"

Easy to reproduce without KMail (8.0, libkgapi-26.08.1):

$ pluginviewer -c | grep -c XOAUTH2
0

With the .la in place:

$ pluginviewer -c | grep kdexoauth2
Plugin "kdexoauth2" [loaded], API version: 4

and IMAP (XOAUTH2, 993/SSL) and SMTP (XOAUTH2, 465/SSL) to a Google
Workspace account work: mail syncs and sends fine.

The diff below generates the .la in post-install and adds it to the
PLIST. Built and tested on 8.0/amd64 (make package, pkg_add -r of the
new package, pluginviewer and KMail as above).

OK?

--
Leonardo Santagostini

--- x11/kde-applications/libkgapi/Makefile.orig
+++ x11/kde-applications/libkgapi/Makefile
@@ -2,6 +2,8 @@
DISTNAME = libkgapi-${VERSION}
CATEGORIES = www devel

+REVISION = 0
+
SHARED_LIBS += KPim6GAPIBlogger 0.0 # 0.0
SHARED_LIBS += KPim6GAPICalendar 0.0 # 0.0
SHARED_LIBS += KPim6GAPICore 0.1 # 0.0
@@ -26,5 +28,12 @@
LIB_DEPENDS = devel/kf6/kcalendarcore \
devel/kf6/kcontacts \
devel/kf6/kwallet
+
+# cyrus-sasl only loads plugins through their libtool .la file; without it
+# the XOAUTH2 mechanism is never offered and KIMAP/KSMTP logins to Google fail.
+post-install:
+ printf "dlname='libkdexoauth2.so.%s'\nlibrary_names='libkdexoauth2.so.%s'\nold_library=''\ninstalled=yes\nlibdir='%s'\n" \
+ ${LIBkdexoauth2_VERSION} ${LIBkdexoauth2_VERSION} ${TRUEPREFIX}/lib/sasl2 \
+ > ${PREFIX}/lib/sasl2/https://www.google.com/url?q=http://libkdexoauth2.la&source=gmail&ust=1796391235701000&sa=E

.include <https://www.google.com/url?q=http://bsd.port.mk&source=gmail&ust=1796391235701000&sa=E>
--- x11/kde-applications/libkgapi/pkg/PLIST.orig
+++ x11/kde-applications/libkgapi/pkg/PLIST
@@ -391,6 +391,7 @@
@lib lib/libKPim6GAPIMaps.so.${LIBKPim6GAPIMaps_VERSION}
@lib lib/libKPim6GAPIPeople.so.${LIBKPim6GAPIPeople_VERSION}
@lib lib/libKPim6GAPITasks.so.${LIBKPim6GAPITasks_VERSION}
+lib/sasl2/https://www.google.com/url?q=http://libkdexoauth2.la&source=gmail&ust=1796391235701000&sa=E
@lib lib/sasl2/libkdexoauth2.so.${LIBkdexoauth2_VERSION}
share/locale/ar/LC_MESSAGES/libkgapi6_qt.qm
share/locale/ast/LC_MESSAGES/libkgapi6_qt.qm

No comments:

Post a Comment