git: 154ff6338871 - main - graphics/librsvg2: add options, remove libgsf dependency

From: Adriaan de Groot <adridg_at_FreeBSD.org>
Date: Mon, 06 Dec 2021 19:57:27 UTC
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=154ff63388716dfe5643f099914e8078106d4a97

commit 154ff63388716dfe5643f099914e8078106d4a97
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2021-12-06 19:31:56 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2021-12-06 19:55:57 +0000

    graphics/librsvg2: add options, remove libgsf dependency
    
    This is a combination of patches from two PRs, from Andriy Voskoboinyk
    and Andrew Romanenko, which have been languishing. Both added a DOCS
    option, and Andrew makes Vala optional while Andriy removes an unneeded
    dependency on libgsf and gettext.
    
    Note that graphics/librsvg2 is the outdated version, used only on
    platforms where the newer librsvg2-rust is not available.
    
    PR:             243071 239346
    Reported by:    Andrew Romanenkom, Andriy Voskoboinyk
---
 Mk/Uses/gnome.mk            |  2 +-
 graphics/librsvg2/Makefile  | 31 ++++++++++++++++++++++---------
 graphics/librsvg2/pkg-plist | 42 +++++++++++++++++++++---------------------
 3 files changed, 44 insertions(+), 31 deletions(-)

diff --git a/Mk/Uses/gnome.mk b/Mk/Uses/gnome.mk
index 42eaaa78a8c6..6527f9c3e518 100644
--- a/Mk/Uses/gnome.mk
+++ b/Mk/Uses/gnome.mk
@@ -246,7 +246,7 @@ librsvg2_BUILD_DEPENDS=	librsvg2>=0:graphics/librsvg2
 librsvg2_LIB_DEPENDS=	librsvg-2.so:graphics/librsvg2
 librsvg2_RUN_DEPENDS=	librsvg2>=0:graphics/librsvg2
 .endif
-librsvg2_USE_GNOME_IMPL=libgsf gdkpixbuf2 pango
+librsvg2_USE_GNOME_IMPL=gdkpixbuf2 pango
 
 nautilus3_LIB_DEPENDS=	libnautilus-extension.so:x11-fm/nautilus
 nautilus3_USE_GNOME_IMPL=gnomedesktop3 libxml2
diff --git a/graphics/librsvg2/Makefile b/graphics/librsvg2/Makefile
index 6ebcf5119dfb..dc6920027650 100644
--- a/graphics/librsvg2/Makefile
+++ b/graphics/librsvg2/Makefile
@@ -2,6 +2,7 @@
 
 PORTNAME=	librsvg
 PORTVERSION=	2.40.21
+PORTREVISION=	1
 CATEGORIES=	graphics gnome
 MASTER_SITES=	GNOME
 PKGNAMESUFFIX=	2
@@ -13,26 +14,38 @@ COMMENT=	Library for parsing and rendering SVG vector-graphic files
 LICENSE=	GPLv2 LGPL20
 LICENSE_COMB=	multi
 
+LIB_DEPENDS=	libfreetype.so:print/freetype2 \
+		libfontconfig.so:x11-fonts/fontconfig \
+		libpng.so:graphics/png \
+		libcroco-0.6.so:textproc/libcroco
+
+USES=		cpe gmake gnome libtool localbase pathfix pkgconfig tar:xz
+
 CONFLICTS_INSTALL=	librsvg2-rust
 # librsvg2 2.42+ needs rust to build, which is not available on all
 # FreeBSD archs. So limit pure C version 2.40.x.
 PORTSCOUT=	limit:^2\.40\.
 
-BUILD_DEPENDS=	valac:lang/vala
-LIB_DEPENDS=	libfreetype.so:print/freetype2 \
-		libfontconfig.so:x11-fonts/fontconfig \
-		libpng.so:graphics/png \
-		libcroco-0.6.so:textproc/libcroco
+OPTIONS_DEFINE=		DOCS VAPI
+OPTIONS_DEFAULT=	DOCS VAPI
+OPTIONS_SUB=		yes
 
-USES=		cpe gettext gmake gnome libtool localbase pathfix pkgconfig tar:xz
-USE_GNOME=	cairo gnomeprefix libgsf gdkpixbuf2 introspection:build \
+DOCS_CONFIGURE_ENABLE=	grk-doc-html
+
+VAPI_BUILD_DEPENDS=	valac:lang/vala
+VAPI_CONFIGURE_ON=	--enable-vala=yes
+VAPI_CONFIGURE_OFF=	--enable-vala=no
+
+USE_GNOME=	cairo gnomeprefix gdkpixbuf2 introspection:build \
 		libxml2 pango
 CPE_VENDOR=	gnome
 USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
 INSTALL_TARGET=	install-strip
-CONFIGURE_ARGS=	--enable-vala \
-		--disable-Bsymbolic
+CONFIGURE_ARGS=	--disable-Bsymbolic
+
+DOCSDIR?=	${PREFIX}/share/doc
+GNOME_HTML_DIR=	${DOCSDIR}
 
 PLIST_SUB+=	PORTVERSION=${PORTVERSION}
 
diff --git a/graphics/librsvg2/pkg-plist b/graphics/librsvg2/pkg-plist
index e7191ce7ef13..07d52269c0e0 100644
--- a/graphics/librsvg2/pkg-plist
+++ b/graphics/librsvg2/pkg-plist
@@ -12,28 +12,28 @@ lib/librsvg-2.so.2
 lib/librsvg-2.so.%%PORTVERSION%%
 libdata/pkgconfig/librsvg-2.0.pc
 man/man1/rsvg-convert.1.gz
-share/doc/rsvg-2.0/RsvgHandle.html
-share/doc/rsvg-2.0/annotation-glossary.html
-share/doc/rsvg-2.0/api-index-full.html
-share/doc/rsvg-2.0/home.png
-share/doc/rsvg-2.0/index.html
-share/doc/rsvg-2.0/left-insensitive.png
-share/doc/rsvg-2.0/left.png
-share/doc/rsvg-2.0/licence.html
-share/doc/rsvg-2.0/object-tree.html
-share/doc/rsvg-2.0/right-insensitive.png
-share/doc/rsvg-2.0/right.png
-share/doc/rsvg-2.0/rsvg-2.0.devhelp2
-share/doc/rsvg-2.0/rsvg-Using-RSVG-with-GIO.html
-share/doc/rsvg-2.0/rsvg-Using-RSVG-with-GdkPixbuf.html
-share/doc/rsvg-2.0/rsvg-Using-RSVG-with-cairo.html
-share/doc/rsvg-2.0/rsvg-Version-check-and-feature-tests.html
-share/doc/rsvg-2.0/rsvg.html
-share/doc/rsvg-2.0/style.css
-share/doc/rsvg-2.0/up-insensitive.png
-share/doc/rsvg-2.0/up.png
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/RsvgHandle.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/annotation-glossary.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/api-index-full.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/home.png
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/index.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/left-insensitive.png
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/left.png
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/licence.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/object-tree.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/right-insensitive.png
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/right.png
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/rsvg-2.0.devhelp2
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/rsvg-Using-RSVG-with-GIO.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/rsvg-Using-RSVG-with-GdkPixbuf.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/rsvg-Using-RSVG-with-cairo.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/rsvg-Version-check-and-feature-tests.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/rsvg.html
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/style.css
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/up-insensitive.png
+%%PORTDOCS%%%%DOCSDIR%%/rsvg-2.0/up.png
 share/gir-1.0/Rsvg-2.0.gir
 share/thumbnailers/librsvg.thumbnailer
-share/vala/vapi/librsvg-2.0.vapi
+%%VAPI%%share/vala/vapi/librsvg-2.0.vapi
 @postexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
 @postunexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true