git: 03396f7bbf82 - main - deskutils/libportal: split into slave ports corresponding to GUI backend

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Sun, 19 Feb 2023 11:11:56 UTC
The branch main has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=03396f7bbf82a31317c72b5051d5db6422b04567

commit 03396f7bbf82a31317c72b5051d5db6422b04567
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2023-02-19 11:03:56 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2023-02-19 11:11:44 +0000

    deskutils/libportal: split into slave ports corresponding to GUI backend
    
    The port has been splitted into 1 master and 3 slave ports for those
    who want only a subset of the supported backends and don't want
    excessive dependency, namely:
    - deskutils/libportal:      common non-GUI part (master port)
    - deskutils/libportal-gtk3: gtk3 backend
    - deskutils/libportal-gtk4: gtk4 backend
    - deskutils/libportal-qt5:  qt5 backend
    
    While here, correct license and make dependency adjustments of
    consumer ports.
    
    PR:             269546
    Reviewed by:    arrowd
    Approved by:    arrowd (maintainer)
---
 deskutils/Makefile                 |  3 +++
 deskutils/libportal-gtk3/Makefile  | 10 ++++++++++
 deskutils/libportal-gtk4/Makefile  | 10 ++++++++++
 deskutils/libportal-qt5/Makefile   | 11 +++++++++++
 deskutils/libportal/Makefile       | 25 +++++++++++++++++--------
 deskutils/libportal/pkg-plist      | 14 --------------
 deskutils/libportal/pkg-plist.gtk3 |  9 +++++++++
 deskutils/libportal/pkg-plist.gtk4 |  9 +++++++++
 deskutils/libportal/pkg-plist.qt5  |  5 +++++
 devel/gnome-builder/Makefile       |  3 ++-
 graphics/gcolor3/Makefile          |  4 +++-
 x11-fm/nautilus/Makefile           |  2 ++
 12 files changed, 81 insertions(+), 24 deletions(-)

diff --git a/deskutils/Makefile b/deskutils/Makefile
index 613137f614a5..2dc79156f89e 100644
--- a/deskutils/Makefile
+++ b/deskutils/Makefile
@@ -158,6 +158,9 @@
     SUBDIR += libcprime
     SUBDIR += libkdepim
     SUBDIR += libportal
+    SUBDIR += libportal-gtk3
+    SUBDIR += libportal-gtk4
+    SUBDIR += libportal-qt5
     SUBDIR += ljclive
     SUBDIR += lumina-archiver
     SUBDIR += lumina-calculator
diff --git a/deskutils/libportal-gtk3/Makefile b/deskutils/libportal-gtk3/Makefile
new file mode 100644
index 000000000000..2030f829505b
--- /dev/null
+++ b/deskutils/libportal-gtk3/Makefile
@@ -0,0 +1,10 @@
+PKGNAMESUFFIX=	-${BACKEND}
+COMMENT=	GIO-styled async APIs for Flatpak (${BACKEND} backend)
+
+BACKEND=	gtk3
+
+USE_GNOME=	gtk30
+
+MASTERDIR=	${.CURDIR}/../libportal
+
+.include "${MASTERDIR}/Makefile"
diff --git a/deskutils/libportal-gtk4/Makefile b/deskutils/libportal-gtk4/Makefile
new file mode 100644
index 000000000000..0658235fba86
--- /dev/null
+++ b/deskutils/libportal-gtk4/Makefile
@@ -0,0 +1,10 @@
+PKGNAMESUFFIX=	-${BACKEND}
+COMMENT=	GIO-styled async APIs for Flatpak (${BACKEND} backend)
+
+BACKEND=	gtk4
+
+USE_GNOME=	gtk40
+
+MASTERDIR=	${.CURDIR}/../libportal
+
+.include "${MASTERDIR}/Makefile"
diff --git a/deskutils/libportal-qt5/Makefile b/deskutils/libportal-qt5/Makefile
new file mode 100644
index 000000000000..7997fc0a1aea
--- /dev/null
+++ b/deskutils/libportal-qt5/Makefile
@@ -0,0 +1,11 @@
+PKGNAMESUFFIX=	-${BACKEND}
+COMMENT=	GIO-styled async APIs for Flatpak (${BACKEND} backend)
+
+BACKEND=	qt5
+
+USES=		qt:5
+USE_QT=		buildtools core gui qmake:build testlib widgets x11extras
+
+MASTERDIR=	${.CURDIR}/../libportal
+
+.include "${MASTERDIR}/Makefile"
diff --git a/deskutils/libportal/Makefile b/deskutils/libportal/Makefile
index 0fc7e6e9304c..9f712d12df62 100644
--- a/deskutils/libportal/Makefile
+++ b/deskutils/libportal/Makefile
@@ -1,20 +1,20 @@
 PORTNAME=	libportal
 PORTVERSION=	0.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	deskutils
 
 MAINTAINER=	arrowd@FreeBSD.org
-COMMENT=	GIO-styled async APIs for Flatpak
+COMMENT?=	GIO-styled async APIs for Flatpak
 WWW=		https://github.com/flatpak/libportal
 
-LICENSE=	GPLv2+
+LICENSE=	LGPL3
+LICENSE_FILE=	${WRKSRC}/COPYING
 
 BUILD_DEPENDS=	gtkdoc-scan:textproc/gtk-doc
 
-USES=		gnome meson pkgconfig qt:5
+USES+=		gnome meson pkgconfig
 
-USE_GNOME=	glib20 gtk30 introspection:build
-USE_QT=		buildtools core gui qmake:build testlib widgets x11extras
+USE_GNOME+=	glib20 introspection:build
 USE_LDCONFIG=	yes
 
 USE_GITHUB=	yes
@@ -26,8 +26,17 @@ OPTIONS_DEFAULT=	VAPI
 VAPI_MESON_TRUE=	vapi
 VAPI_USES=		vala:build
 
-# docs require a port for gi-docgen
-MESON_ARGS=	-Ddocs=false '-Dbackends=["qt5", "gtk3"]'
+MESON_ARGS=	-Ddocs=false -Dbackends=${BACKEND}
 OPTIONS_SUB=	yes
 
+.if defined(BACKEND)
+LIB_DEPENDS=	libportal.so:deskutils/libportal
+PLIST=		${PKGDIR}/pkg-plist.${BACKEND}
+
+post-install:
+	@cd ${STAGEDIR}${PREFIX} && \
+		${CAT} ${PKGDIR}/pkg-plist | ${SED} -e 's/^%%VAPI%%//' | ${XARGS} ${RM}
+	@${FIND} ${STAGEDIR}${PREFIX} -type d -empty -delete
+.endif
+
 .include <bsd.port.mk>
diff --git a/deskutils/libportal/pkg-plist b/deskutils/libportal/pkg-plist
index d357d19b0ea4..6f3a54e53624 100644
--- a/deskutils/libportal/pkg-plist
+++ b/deskutils/libportal/pkg-plist
@@ -1,5 +1,3 @@
-include/libportal-gtk3/portal-gtk3.h
-include/libportal-qt5/portal-qt5.h
 include/libportal/account.h
 include/libportal/background.h
 include/libportal/camera.h
@@ -23,22 +21,10 @@ include/libportal/types.h
 include/libportal/updates.h
 include/libportal/wallpaper.h
 lib/girepository-1.0/Xdp-1.0.typelib
-lib/girepository-1.0/XdpGtk3-1.0.typelib
-lib/libportal-gtk3.so
-lib/libportal-gtk3.so.1
-lib/libportal-gtk3.so.1.0.0
-lib/libportal-qt5.so
-lib/libportal-qt5.so.1
-lib/libportal-qt5.so.1.0.0
 lib/libportal.so
 lib/libportal.so.1
 lib/libportal.so.1.0.0
-libdata/pkgconfig/libportal-gtk3.pc
-libdata/pkgconfig/libportal-qt5.pc
 libdata/pkgconfig/libportal.pc
 share/gir-1.0/Xdp-1.0.gir
-share/gir-1.0/XdpGtk3-1.0.gir
-%%VAPI%%share/vala/vapi/libportal-gtk3.deps
-%%VAPI%%share/vala/vapi/libportal-gtk3.vapi
 %%VAPI%%share/vala/vapi/libportal.deps
 %%VAPI%%share/vala/vapi/libportal.vapi
diff --git a/deskutils/libportal/pkg-plist.gtk3 b/deskutils/libportal/pkg-plist.gtk3
new file mode 100644
index 000000000000..1d0f1900be1a
--- /dev/null
+++ b/deskutils/libportal/pkg-plist.gtk3
@@ -0,0 +1,9 @@
+include/libportal-gtk3/portal-gtk3.h
+lib/girepository-1.0/XdpGtk3-1.0.typelib
+lib/libportal-gtk3.so
+lib/libportal-gtk3.so.1
+lib/libportal-gtk3.so.1.0.0
+libdata/pkgconfig/libportal-gtk3.pc
+share/gir-1.0/XdpGtk3-1.0.gir
+%%VAPI%%share/vala/vapi/libportal-gtk3.deps
+%%VAPI%%share/vala/vapi/libportal-gtk3.vapi
diff --git a/deskutils/libportal/pkg-plist.gtk4 b/deskutils/libportal/pkg-plist.gtk4
new file mode 100644
index 000000000000..18865313953d
--- /dev/null
+++ b/deskutils/libportal/pkg-plist.gtk4
@@ -0,0 +1,9 @@
+include/libportal-gtk4/portal-gtk4.h
+lib/girepository-1.0/XdpGtk4-1.0.typelib
+lib/libportal-gtk4.so
+lib/libportal-gtk4.so.1
+lib/libportal-gtk4.so.1.0.0
+libdata/pkgconfig/libportal-gtk4.pc
+share/gir-1.0/XdpGtk4-1.0.gir
+%%VAPI%%share/vala/vapi/libportal-gtk4.deps
+%%VAPI%%share/vala/vapi/libportal-gtk4.vapi
diff --git a/deskutils/libportal/pkg-plist.qt5 b/deskutils/libportal/pkg-plist.qt5
new file mode 100644
index 000000000000..642ce22e9f43
--- /dev/null
+++ b/deskutils/libportal/pkg-plist.qt5
@@ -0,0 +1,5 @@
+include/libportal-qt5/portal-qt5.h
+lib/libportal-qt5.so
+lib/libportal-qt5.so.1
+lib/libportal-qt5.so.1.0.0
+libdata/pkgconfig/libportal-qt5.pc
diff --git a/devel/gnome-builder/Makefile b/devel/gnome-builder/Makefile
index 8b0691b77109..ff3ae22d0df8 100644
--- a/devel/gnome-builder/Makefile
+++ b/devel/gnome-builder/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	gnome-builder
 PORTVERSION=	42.1
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	devel gnome
 MASTER_SITES=	GNOME/sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+)\..*/\1/}
 DIST_SUBDIR=	gnome
@@ -27,6 +27,7 @@ LIB_DEPENDS=	libcmark.so:textproc/cmark \
 		libpcre.so:devel/pcre \
 		libpeas-1.0.so:devel/libpeas \
 		libportal.so:deskutils/libportal \
+		libportal-gtk3.so:deskutils/libportal-gtk3 \
 		libsoup-2.4.so:devel/libsoup \
 		libtemplate_glib-1.0.so:devel/template-glib \
 		libwebkit2gtk-4.0.so:www/webkit2-gtk3
diff --git a/graphics/gcolor3/Makefile b/graphics/gcolor3/Makefile
index 3a02e9c265e8..cc034711c7ba 100644
--- a/graphics/gcolor3/Makefile
+++ b/graphics/gcolor3/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	gcolor3
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2.4.0
+PORTREVISION=	1
 CATEGORIES=	graphics
 
 PATCH_SITES=	${GL_SITE}/${GL_ACCOUNT}/${GL_PROJECT}/-/commit/
@@ -13,7 +14,8 @@ WWW=		https://www.hjdskes.nl/projects/gcolor3/
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-LIB_DEPENDS=	libportal-gtk3.so:deskutils/libportal
+LIB_DEPENDS=	libportal.so:deskutils/libportal \
+		libportal-gtk3.so:deskutils/libportal-gtk3
 
 USES=		gnome gettext meson libtool pkgconfig
 USE_GITLAB=	yes
diff --git a/x11-fm/nautilus/Makefile b/x11-fm/nautilus/Makefile
index 22059250b2c0..0c45cc7c65a6 100644
--- a/x11-fm/nautilus/Makefile
+++ b/x11-fm/nautilus/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	nautilus
 PORTVERSION=	42.2
+PORTREVISION=	1
 CATEGORIES=	x11-fm gnome
 MASTER_SITES=	GNOME/sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+)\..*/\1/}
 DIST_SUBDIR=	gnome
@@ -15,6 +16,7 @@ LIB_DEPENDS=	libgexiv2.so:graphics/gexiv2 \
 		libgnome-autoar-0.so:archivers/gnome-autoar \
 		libhandy-1.so:x11-toolkits/libhandy \
 		libportal.so:deskutils/libportal \
+		libportal-gtk3.so:deskutils/libportal-gtk3 \
 		libtotem.so:multimedia/totem \
 		libtracker-sparql-3.0.so:sysutils/tracker3