git: cd3b7e7e2c94 - main - graphics/poppler: fix build in unclean environment

From: Tobias C. Berner <tcberner_at_FreeBSD.org>
Date: Wed, 06 Jul 2022 18:24:11 UTC
The branch main has been updated by tcberner:

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

commit cd3b7e7e2c9442aeeec9c489aa83efa626410d63
Author:     Tobias C. Berner <tcberner@FreeBSD.org>
AuthorDate: 2022-07-06 17:53:29 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2022-07-06 18:23:47 +0000

    graphics/poppler: fix build in unclean environment
    
    poppler will run gperf, when it is present which may be the
    case in an unclean environment.
    
    To make this consistent, always pull in gperf, and use gsed to
    work around sed/gsed differences.
    
    Reported by:            VVD <vvd@unislabs.com>
---
 graphics/poppler/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/graphics/poppler/Makefile b/graphics/poppler/Makefile
index 7aa604f204eb..7ddf93fda852 100644
--- a/graphics/poppler/Makefile
+++ b/graphics/poppler/Makefile
@@ -18,10 +18,11 @@ LIB_DEPENDS=	libnspr4.so:devel/nspr \
 		libfreetype.so:print/freetype2 \
 		libnss3.so:security/nss \
 		libfontconfig.so:x11-fonts/fontconfig
-BUILD_DEPENDS=	${LOCALBASE}/include/boost/container/small_vector.hpp:devel/boost-libs
+BUILD_DEPENDS=	${LOCALBASE}/include/boost/container/small_vector.hpp:devel/boost-libs \
+		gsed:textproc/gsed
 RUN_DEPENDS=	poppler-data>0:graphics/poppler-data
 
-USES=		cmake:insource compiler:c++17-lang cpe gnome jpeg libtool \
+USES=		cmake:insource compiler:c++17-lang cpe gnome gperf jpeg libtool \
 		localbase pathfix pkgconfig tar:xz
 CPE_VENDOR=	freedesktop
 USE_GNOME=	cairo libxml2
@@ -44,6 +45,9 @@ CMAKE_ARGS+=	-DCMAKE_IGNORE_PATH:PATH=${PREFIX}/lib/openjpeg-1.5
 _POPPLER_SLAVES=	library glib qt5 utils
 _SLAVE_PORT?=		library
 
+BINARY_ALIAS=		gperf=${GPERF} \
+			sed=${LOCALBASE}/bin/gsed
+
 # Activate the wanted module, and deactivate the others.
 CMAKE_ON+=	ENABLE_${_SLAVE_PORT:tu}
 CMAKE_OFF+=	${_POPPLER_SLAVES:N${_SLAVE_PORT}:tu:S/^/ENABLE_/}