git: a722f5607582 - main - graphics/pngquant: enable openmp, unbundle libimagequant

From: Alex Kozlov <ak_at_FreeBSD.org>
Date: Sat, 14 Jan 2023 05:44:28 UTC
The branch main has been updated by ak:

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

commit a722f5607582b5065442d3eefeed9538d359b144
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-01-14 05:42:58 +0000
Commit:     Alex Kozlov <ak@FreeBSD.org>
CommitDate: 2023-01-14 05:42:58 +0000

    graphics/pngquant: enable openmp, unbundle libimagequant
    
    - Use graphics/libimagequant instead of bundled version [1]
    - Re-add OPENMP option, enable it by default [2]
    
    PR:     268931 [1]
    PR:     268932 [2]
---
 graphics/pngquant/Makefile | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/graphics/pngquant/Makefile b/graphics/pngquant/Makefile
index 1a7b280a249f..9158e45509f4 100644
--- a/graphics/pngquant/Makefile
+++ b/graphics/pngquant/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	pngquant
 PORTVERSION=	2.17.0
 DISTVERSIONSUFFIX=	-src
+PORTREVISION=	1
 CATEGORIES=	graphics
 MASTER_SITES=	https://pngquant.org/
 
@@ -11,22 +12,25 @@ WWW=		https://pngquant.org/
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/COPYRIGHT
 
-LIB_DEPENDS=	libpng.so:graphics/png
+LIB_DEPENDS=	libimagequant.so:graphics/libimagequant \
+		libpng.so:graphics/png
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
 
 USES=		cpe gmake pkgconfig
 HAS_CONFIGURE=	yes
+CONFIGURE_ARGS=	--with-libimagequant
 
 PORTDOCS=	CHANGELOG README.md
 PLIST_FILES=	bin/pngquant \
 				man/man1/pngquant.1.gz
 
-OPTIONS_DEFINE=	OPTIMIZED_FLAGS LCMS2 DEBUG DOCS
+OPTIONS_DEFINE=	OPTIMIZED_FLAGS OPENMP LCMS2 DEBUG DOCS
 OPTIONS_DEFINE_i386=	SSE
 OPTIONS_DEFINE_amd64=	SSE
 LCMS2_DESC=	Support for ICC profiles via LCMS library
 OPTIMIZED_FLAGS_DESC=	${OPTIMIZED_CFLAGS_DESC}
+OPTIONS_DEFAULT=	OPENMP
 OPTIONS_DEFAULT_amd64=	SSE
 
 DEBUG_CONFIGURE_ON=	--enable-debug
@@ -34,6 +38,11 @@ DEBUG_CONFIGURE_ON=	--enable-debug
 LCMS2_CONFIGURE_WITH=	lcms2
 LCMS2_LIB_DEPENDS=	liblcms2.so:graphics/lcms2
 
+OPENMP_CONFIGURE_WITH=	openmp
+.if !exists(/usr/include/omp.h)
+OPENMP_USES=		compiler:gcc-c++11-lib
+.endif
+
 OPTIMIZED_FLAGS_CFLAGS=	-O3 -fstrict-aliasing \
 		-ffast-math -funroll-loops -fomit-frame-pointer \
 		-fexpensive-optimizations -ffinite-math-only \