git: 22a9ae807211 - main - sysutils/tracker3: add SOUP2 and SOUP3 multi options

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 17 Jun 2023 10:29:29 UTC
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=22a9ae807211b4e93266a3857293c98b3790c9b4

commit 22a9ae807211b4e93266a3857293c98b3790c9b4
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-06-17 10:28:17 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-06-17 10:28:34 +0000

    sysutils/tracker3: add SOUP2 and SOUP3 multi options
    
    Because Tracker can support libsoup2 and libsoup3 backend, and also at
    the same time, it makes sense to add a multi option to give the user the
    possibility of selecting them.
    
    The default is still libsoup2, so the default dependencies of this port
    will not change at this time.
    
    PR:             272017
    MFH:            2023Q2
---
 sysutils/tracker3/Makefile  | 27 +++++++++++++++++++++++++--
 sysutils/tracker3/pkg-plist |  3 ++-
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/sysutils/tracker3/Makefile b/sysutils/tracker3/Makefile
index bedd2f4b0346..676172a46220 100644
--- a/sysutils/tracker3/Makefile
+++ b/sysutils/tracker3/Makefile
@@ -15,7 +15,6 @@ BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}gobject3>=0:devel/py-gobject3@${PY_FLAVOR}
 LIB_DEPENDS=	libdbus-1.so:devel/dbus \
 		libicutu.so:devel/icu \
 		libjson-glib-1.0.so:devel/json-glib \
-		libsoup-2.4.so:devel/libsoup \
 		libuuid.so:misc/e2fsprogs-libuuid
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}gobject3>=0:devel/py-gobject3@${PY_FLAVOR}
 
@@ -36,14 +35,38 @@ PORTSCOUT=	limitw:1,even
 
 OPTIONS_DEFINE=		DOCS MAN
 OPTIONS_SUB=		yes
+
+OPTIONS_MULTI=		SOUP
+OPTIONS_MULTI_SOUP=	SOUP2 SOUP3
+
+OPTIONS_DEFAULT=	SOUP2
+
+SOUP2_DESC=		libsoup 2 backend (from devel/libsoup)
+SOUP3_DESC=		libsoup 3 backend (from devel/libsoup3)
+
 DOCS_BUILD_DEPENDS=	gtk-doc>0:textproc/gtk-doc
 DOCS_MESON_TRUE=	docs
 MAN_BUILD_DEPENDS=	asciidoc:textproc/asciidoc
 MAN_MESON_TRUE=		man
 MAN_DESC=		Install manual pages
 
+SOUP2_LIB_DEPENDS=	libsoup-2.4.so:devel/libsoup
+SOUP3_LIB_DEPENDS=	libsoup-3.0.so:devel/libsoup3
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MSOUP2} && ${PORT_OPTIONS:MSOUP3}
+MESON_ARGS+=		-Dsoup=soup2,soup3
+.elif ${PORT_OPTIONS:MSOUP2}
+MESON_ARGS+=		-Dsoup=soup2
+.else # SOUP3
+MESON_ARGS+=		-Dsoup=soup3
+.endif
+
+.include <bsd.port.pre.mk>
+
 post-patch:
 	${REINPLACE_CMD} -e 's|/etc/asciidoc|${PYTHONPREFIX_SITELIBDIR}/asciidoc/resources|' \
 		${WRKSRC}/docs/manpages/meson.build
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/sysutils/tracker3/pkg-plist b/sysutils/tracker3/pkg-plist
index cad2fbd88e5c..45f781c5d96c 100644
--- a/sysutils/tracker3/pkg-plist
+++ b/sysutils/tracker3/pkg-plist
@@ -22,7 +22,8 @@ lib/girepository-1.0/Tracker-3.0.typelib
 lib/libtracker-sparql-3.0.so
 lib/libtracker-sparql-3.0.so.0
 lib/libtracker-sparql-3.0.so.0.503.0
-lib/tracker-3.0/libtracker-http-soup2.so
+%%SOUP2%%lib/tracker-3.0/libtracker-http-soup2.so
+%%SOUP3%%lib/tracker-3.0/libtracker-http-soup3.so
 lib/tracker-3.0/libtracker-parser-libicu.so
 lib/tracker-3.0/trackertestutils/__init__.py
 lib/tracker-3.0/trackertestutils/__main__.py