git: 24b34d074090 - main - devel/cctz: Update to 2.4

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Wed, 23 Oct 2024 22:48:46 UTC
The branch main has been updated by diizzy:

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

commit 24b34d074090c834304d83740d22994c83c02ab8
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-10-23 22:44:56 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2024-10-23 22:45:02 +0000

    devel/cctz: Update to 2.4
    
    * Switch to CMake
    * Backport upstream commit 64d12062183e2fa01f8c0127c4b9f91afaeee46c
    * Import patches from Debian
    * Build shared library instead of static
    * Rework Makefile to follow Porters Handbook more closely
    
    References:
    https://github.com/google/cctz/commit/64d12062183e2fa01f8c0127c4b9f91afaeee46c
    
    Sources:
    https://salsa.debian.org/science-team/cctz/-/blob/master/debian/patches/0001-Compile-shared-lib-and-install-it.patch?ref_type=heads
    https://salsa.debian.org/science-team/cctz/-/blob/master/debian/patches/use_system_zoneinfo.patch?ref_type=heads
    
    PR:             261879
    Approved by:    portmgr (maintainer timeout, 2+ years)
---
 devel/cctz/Makefile                   | 32 ++++++++++++++++++--------------
 devel/cctz/distinfo                   |  8 +++++---
 devel/cctz/files/patch-CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++
 devel/cctz/pkg-plist                  | 10 ++++++++++
 4 files changed, 65 insertions(+), 17 deletions(-)

diff --git a/devel/cctz/Makefile b/devel/cctz/Makefile
index f7fcd3ac886d..0f71fb95763d 100644
--- a/devel/cctz/Makefile
+++ b/devel/cctz/Makefile
@@ -1,9 +1,11 @@
 PORTNAME=	cctz
-PORTVERSION=	2.2
-PORTREVISION=	3
 DISTVERSIONPREFIX=	v
+DISTVERSION=	2.4
 CATEGORIES=	devel
 
+PATCH_SITES=	https://github.com/google/cctz/commit/
+PATCHFILES=	64d12062183e2fa01f8c0127c4b9f91afaeee46c.patch:-p1
+
 MAINTAINER=	z7dr6ut7gs@snkmail.com
 COMMENT=	C++ library for handling dates, times, and time zones
 WWW=		https://github.com/google/cctz
@@ -11,24 +13,26 @@ WWW=		https://github.com/google/cctz
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-GH_ACCOUNT=	google
-USES=		compiler:c++11-lib gmake
-USE_GITHUB=	yes
+TEST_DEPENDS=	benchmark>0:devel/benchmark \
+		googletest>0:devel/googletest
 
-MAKE_ARGS+=	CXX=${CXX} \
-		EXTRA_CPPFLAGS="-D_POSIX_C_SOURCE=201112L -D_XOPEN_SOURCE=600"
+USES=		cmake:testing
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	google
 
-PLIST_FILES=	include/cctz/civil_time.h \
-		include/cctz/civil_time_detail.h \
-		include/cctz/time_zone.h \
-		include/cctz/zone_info_source.h \
-		lib/libcctz.a
 PORTDOCS=	README.md
 
+CMAKE_OFF=	BUILD_EXAMPLES \
+		BUILD_TESTING \
+		BUILD_TOOLS
+CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_ARGS=	-DVERSION=${DISTVERSION} -DSOVERSION=${DISTVERSION:R}
+
 OPTIONS_DEFINE=	DOCS
 
-post-install:
+post-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
-	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>
diff --git a/devel/cctz/distinfo b/devel/cctz/distinfo
index 6fd030fa3dc5..201dc1083e52 100644
--- a/devel/cctz/distinfo
+++ b/devel/cctz/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1525700523
-SHA256 (google-cctz-v2.2_GH0.tar.gz) = ab315d5beb18a65ace57f6ea91f9ea298ec163fee89f84a44e81732af4d07348
-SIZE (google-cctz-v2.2_GH0.tar.gz) = 294330
+TIMESTAMP = 1729718272
+SHA256 (google-cctz-v2.4_GH0.tar.gz) = e1a00957d472044808a24a26f1ba020f36dc26949a69c214562d96b74093adb3
+SIZE (google-cctz-v2.4_GH0.tar.gz) = 222831
+SHA256 (64d12062183e2fa01f8c0127c4b9f91afaeee46c.patch) = ce8209dc567a1c2fddb186e2f420435dccb812deef1a18e1e42e2b619fbb0f1f
+SIZE (64d12062183e2fa01f8c0127c4b9f91afaeee46c.patch) = 844
diff --git a/devel/cctz/files/patch-CMakeLists.txt b/devel/cctz/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..0f79593500fb
--- /dev/null
+++ b/devel/cctz/files/patch-CMakeLists.txt
@@ -0,0 +1,32 @@
+--- CMakeLists.txt.orig	2024-10-23 22:32:38 UTC
++++ CMakeLists.txt
+@@ -75,7 +75,7 @@ set(CCTZ_HDRS
+   include/cctz/zone_info_source.h
+   include/cctz/civil_time.h
+   )
+-add_library(cctz
++add_library(cctz SHARED
+   src/civil_time_detail.cc
+   src/time_zone_fixed.cc
+   src/time_zone_fixed.h
+@@ -107,6 +107,11 @@ add_library(cctz::cctz ALIAS cctz)
+   target_link_libraries(cctz PUBLIC ${CoreFoundation})
+ endif()
+ add_library(cctz::cctz ALIAS cctz)
++set_target_properties(cctz PROPERTIES
++    OUTPUT_NAME "cctz"
++    VERSION ${VERSION}
++    SOVERSION ${SOVERSION}
++)
+ 
+ if (BUILD_TOOLS)
+   add_executable(time_tool src/time_tool.cc)
+@@ -155,7 +160,7 @@ if (BUILD_TESTING)
+       time_zone_format_test
+       time_zone_lookup_test
+     PROPERTY
+-      ENVIRONMENT "TZDIR=${CMAKE_CURRENT_SOURCE_DIR}/testdata/zoneinfo"
++      ENVIRONMENT "TZDIR=/usr/share/zoneinfo"
+     )
+ 
+   if (BUILD_BENCHMARK)
diff --git a/devel/cctz/pkg-plist b/devel/cctz/pkg-plist
new file mode 100644
index 000000000000..225b5d03c18f
--- /dev/null
+++ b/devel/cctz/pkg-plist
@@ -0,0 +1,10 @@
+include/cctz/civil_time.h
+include/cctz/civil_time_detail.h
+include/cctz/time_zone.h
+include/cctz/zone_info_source.h
+lib/cmake/cctz/cctz-config.cmake
+lib/cmake/cctz/cctz-targets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/cctz/cctz-targets.cmake
+lib/libcctz.so
+lib/libcctz.so.2
+lib/libcctz.so.2.4