git: 81d2af56be29 - main - graphics/webp: Add IMGCONV option

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 21 Jun 2022 21:00:38 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=81d2af56be29daa64a3d29c79b76136a25f33394

commit 81d2af56be29daa64a3d29c79b76136a25f33394
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-06-21 20:58:56 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-06-21 20:58:56 +0000

    graphics/webp: Add IMGCONV option
    
    PR:             264798
    Submitted by:   adamw
---
 graphics/webp/Makefile  | 13 ++++++++-----
 graphics/webp/pkg-plist | 16 ++++++++--------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/graphics/webp/Makefile b/graphics/webp/Makefile
index a887c0052c48..9353471148c9 100644
--- a/graphics/webp/Makefile
+++ b/graphics/webp/Makefile
@@ -13,10 +13,6 @@ COMMENT=	Google WebP image format conversion tool
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-LIB_DEPENDS=	libgif.so:graphics/giflib \
-		libpng.so:graphics/png \
-		libtiff.so:graphics/tiff
-
 USES=		compiler:c11 jpeg libtool localbase
 
 CONFIGURE_ARGS=	--enable-libwebpdecoder \
@@ -29,9 +25,16 @@ USE_LDCONFIG=	yes
 
 PORTSCOUT=	limit:^[0-9\.]*$$
 
-OPTIONS_DEFINE=	X11
+OPTIONS_DEFINE=	IMGCONV X11
+OPTIONS_DEFAULT=IMGCONV
 OPTIONS_SUB=	yes
+IMGCONV_DESC=		Install converters to/from WebP
 
+IMGCONV_CONFIGURE_OFF=	build_cwebp=no build_dwebp=no build_gif2webp=no build_img2webp=no
+IMGCONV_CONFIGURE_ON=	build_cwebp=yes build_dwebp=yes build_gif2webp=yes build_img2webp=yes
+IMGCONV_LIB_DEPENDS=	libgif.so:graphics/giflib \
+			libpng.so:graphics/png \
+			libtiff.so:graphics/tiff
 X11_CONFIGURE_OFF=	build_vwebp=no
 X11_CONFIGURE_ON=	build_vwebp=yes
 X11_USE=		GL=glut
diff --git a/graphics/webp/pkg-plist b/graphics/webp/pkg-plist
index 170c94eec91c..bec926770a21 100644
--- a/graphics/webp/pkg-plist
+++ b/graphics/webp/pkg-plist
@@ -1,7 +1,7 @@
-bin/cwebp
-bin/dwebp
-bin/gif2webp
-bin/img2webp
+%%IMGCONV%%bin/cwebp
+%%IMGCONV%%bin/dwebp
+%%IMGCONV%%bin/gif2webp
+%%IMGCONV%%bin/img2webp
 %%X11%%bin/vwebp
 bin/webpinfo
 bin/webpmux
@@ -31,10 +31,10 @@ libdata/pkgconfig/libwebp.pc
 libdata/pkgconfig/libwebpdecoder.pc
 libdata/pkgconfig/libwebpdemux.pc
 libdata/pkgconfig/libwebpmux.pc
-man/man1/cwebp.1.gz
-man/man1/dwebp.1.gz
-man/man1/gif2webp.1.gz
-man/man1/img2webp.1.gz
+%%IMGCONV%%man/man1/cwebp.1.gz
+%%IMGCONV%%man/man1/dwebp.1.gz
+%%IMGCONV%%man/man1/gif2webp.1.gz
+%%IMGCONV%%man/man1/img2webp.1.gz
 %%X11%%man/man1/vwebp.1.gz
 man/man1/webpinfo.1.gz
 man/man1/webpmux.1.gz