git: eda03052ddb2 - main - graphics/podofo: Add UNISTRING option to avoid potential dependency

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Fri, 30 Dec 2022 09:08:35 UTC
The branch main has been updated by sunpoet:

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

commit eda03052ddb2064e89964eef6e79ee7d22c73fc5
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-12-30 08:40:05 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-12-30 09:04:10 +0000

    graphics/podofo: Add UNISTRING option to avoid potential dependency
    
    - Bump PORTREVISION for dependency and package change
---
 graphics/podofo/Makefile                   |  8 ++++++--
 graphics/podofo/files/patch-CMakeLists.txt | 19 +++++++++++++------
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/graphics/podofo/Makefile b/graphics/podofo/Makefile
index cebf523124d5..a3ad7002f64e 100644
--- a/graphics/podofo/Makefile
+++ b/graphics/podofo/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	podofo
 PORTVERSION=	0.9.8
+PORTREVISION=	1
 CATEGORIES=	graphics print
 MASTER_SITES=	SF
 
@@ -26,9 +27,10 @@ CPE_VENDOR=	podofo_project
 
 DOS2UNIX_FILES=	cmake/modules/FindFREETYPE.cmake
 
-OPTIONS_DEFINE=	IMPOSE JPEG PNG TIFF
-OPTIONS_DEFAULT=JPEG PNG TIFF
+OPTIONS_DEFINE=	IMPOSE JPEG PNG TIFF UNISTRING
+OPTIONS_DEFAULT=JPEG PNG TIFF UNISTRING
 IMPOSE_DESC=	Build impose tool (Lua required)
+UNISTRING_DESC=	Use libunistring for conversion
 
 IMPOSE_CMAKE_BOOL=	WANT_LUA
 IMPOSE_CXXFLAGS=	-I${LUA_INCDIR}
@@ -40,5 +42,7 @@ PNG_CMAKE_BOOL=		WANT_PNG
 PNG_LIB_DEPENDS=	libpng.so:graphics/png
 TIFF_CMAKE_BOOL=	WANT_TIFF
 TIFF_LIB_DEPENDS=	libtiff.so:graphics/tiff
+UNISTRING_CMAKE_BOOL=	WANT_UNISTRING
+UNISTRING_LIB_DEPENDS=	libunistring.so:devel/libunistring
 
 .include <bsd.port.mk>
diff --git a/graphics/podofo/files/patch-CMakeLists.txt b/graphics/podofo/files/patch-CMakeLists.txt
index f809260c5145..4e57653dc3ff 100644
--- a/graphics/podofo/files/patch-CMakeLists.txt
+++ b/graphics/podofo/files/patch-CMakeLists.txt
@@ -1,4 +1,4 @@
---- CMakeLists.txt.orig	2021-01-05 16:56:54 UTC
+--- CMakeLists.txt.orig	2022-05-03 12:18:23 UTC
 +++ CMakeLists.txt
 @@ -348,6 +348,7 @@ ELSE(LIBIDN_FOUND)
  	MESSAGE("Libidn not found. AES-256 Encryption support will be disabled")
@@ -28,15 +28,22 @@
  FIND_PACKAGE(PNG)
  
  IF(PNG_FOUND)
-@@ -378,6 +383,7 @@ ELSE(PNG_FOUND)
+@@ -378,7 +383,9 @@ ELSE(PNG_FOUND)
    MESSAGE("LibPng not found. PNG support will be disabled")
    SET(PNG_LIBRARIES "")
  ENDIF(PNG_FOUND)
 +ENDIF(WANT_PNG)
  
++IF(WANT_UNISTRING)
  FIND_PACKAGE(UNISTRING)
  
-@@ -393,6 +399,7 @@ ENDIF(UNISTRING_FOUND)
+ IF(UNISTRING_FOUND)
+@@ -389,10 +396,12 @@ ELSE(UNISTRING_FOUND)
+   MESSAGE("LibUnistring not found. Unistring support will be disabled")
+   SET(UNISTRING_LIBRARY "")
+ ENDIF(UNISTRING_FOUND)
++ENDIF(WANT_UNISTRING)
+ 
  
  IF(NOT PODOFO_BUILD_LIB_ONLY)
  
@@ -44,7 +51,7 @@
  FIND_PACKAGE(CppUnit)
  
  IF(CppUnit_FOUND)
-@@ -402,6 +409,7 @@ IF(CppUnit_FOUND)
+@@ -402,6 +411,7 @@ IF(CppUnit_FOUND)
  ELSE(CppUnit_FOUND)
    MESSAGE("Cppunit not found. No unit tests will be built.")
  ENDIF(CppUnit_FOUND)
@@ -52,7 +59,7 @@
  
  ENDIF(NOT PODOFO_BUILD_LIB_ONLY)
  
-@@ -442,6 +450,7 @@ ELSE(WANT_FONTCONFIG)
+@@ -442,6 +452,7 @@ ELSE(WANT_FONTCONFIG)
  ENDIF(WANT_FONTCONFIG)
  
  IF(NOT PODOFO_BUILD_LIB_ONLY)
@@ -60,7 +67,7 @@
  FIND_PACKAGE(LUA)
  IF(LUA_FOUND)
  	# If we have lua, we can build podofoimpose.
-@@ -453,6 +462,7 @@ IF(LUA_FOUND)
+@@ -453,6 +464,7 @@ IF(LUA_FOUND)
  ELSE(LUA_FOUND)
  	MESSAGE("Lua not found - PoDoFoImpose and PoDoFoColor will be built without Lua support")
  ENDIF(LUA_FOUND)