git: cbdb82ae536d - main - devel/cmake-core: drop dependency on some external libs to avoid a loop cycle (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Tue, 08 Nov 2022 19:58:46 UTC
The branch main has been updated by fluffy:

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

commit cbdb82ae536d83e4c7ffa8ef4b6fb150afe3f1c7
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2022-11-08 19:55:10 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2022-11-08 19:55:10 +0000

    devel/cmake-core: drop dependency on some external libs to avoid a loop cycle (+)
    
    Switch to bundled libcurl+libnghttp2 to utilize fetch ability for cmake
    Always use system libarchive/zlib
    
    Discussed with: tcberner
---
 devel/cmake-core/Makefile                            | 20 ++++++++++++++------
 .../files/patch-Utilities_cmcurl_lib_url.c           | 13 +++++++++++++
 devel/cmake-core/pkg-plist                           |  2 ++
 3 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/devel/cmake-core/Makefile b/devel/cmake-core/Makefile
index 4561410066f5..89e4989ea782 100644
--- a/devel/cmake-core/Makefile
+++ b/devel/cmake-core/Makefile
@@ -1,9 +1,8 @@
 PORTNAME=	cmake
 # Remember to update devel/cmake-doc and devel/cmake-gui as well.
 DISTVERSION=	${_CMAKE_VERSION}
+PORTREVISION=	1
 CATEGORIES=	devel
-MASTER_SITES=	https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \
-		https://www.cmake.org/files/v${PORTVERSION}/
 PKGNAMESUFFIX=	-core
 
 MAINTAINER=	kde@FreeBSD.org
@@ -13,8 +12,7 @@ WWW=		https://www.cmake.org/
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/Copyright.txt
 
-LIB_DEPENDS=	libcurl.so:ftp/curl \
-		libexpat.so:textproc/expat2 \
+LIB_DEPENDS=	libexpat.so:textproc/expat2 \
 		libjsoncpp.so:devel/jsoncpp \
 		libuv.so:devel/libuv \
 		librhash.so:security/rhash
@@ -27,7 +25,17 @@ CONFIGURE_ENV=	MAKE=make
 CONFIGURE_ARGS=	--prefix=${PREFIX} \
 		--datadir="/${DATADIR_REL}" \
 		--docdir="/${DOCSDIR_REL}" \
-		--system-libs \
+		--system-expat \
+		--system-jsoncpp \
+		--system-zlib \
+		--system-zstd \
+		--system-bzip2 \
+		--system-liblzma \
+		--system-libarchive \
+		--system-librhash \
+		--system-libuv \
+		--no-system-curl \
+		--no-system-nghttp2 \
 		--parallel=${MAKE_JOBS_NUMBER} \
 		--init="${WRKSRC}/InitialCache.cmake"
 
@@ -36,7 +44,7 @@ OPTIONS_SUB=	yes
 
 CPACK_DESC=		Enable FreeBSD generator in CPack (experimental)
 CPACK_LIB_DEPENDS=	libpkg.so:${PKG_ORIGIN}
-CPACK_USES_OFF=		libarchive
+# CPACK_USES_OFF=		libarchive
 # When CPACK is on, uses base libarchive and won't pass stage-qa
 
 CXXFLAGS+=	-D__BSD_VISIBLE
diff --git a/devel/cmake-core/files/patch-Utilities_cmcurl_lib_url.c b/devel/cmake-core/files/patch-Utilities_cmcurl_lib_url.c
new file mode 100644
index 000000000000..bfb9c287ed71
--- /dev/null
+++ b/devel/cmake-core/files/patch-Utilities_cmcurl_lib_url.c
@@ -0,0 +1,13 @@
+--- Utilities/cmcurl/lib/url.c.orig	2022-08-04 13:53:57 UTC
++++ Utilities/cmcurl/lib/url.c
+@@ -626,6 +626,10 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
+     CURL_HTTP_VERSION_1_1
+ #endif
+     ;
++#if defined(__FreeBSD_version)
++  /* different handling of signals and threads */
++  set->no_signal = TRUE;
++#endif
+   Curl_http2_init_userset(set);
+   return result;
+ }
diff --git a/devel/cmake-core/pkg-plist b/devel/cmake-core/pkg-plist
index 1b0f4255343f..44e0fc3b467b 100644
--- a/devel/cmake-core/pkg-plist
+++ b/devel/cmake-core/pkg-plist
@@ -3091,6 +3091,8 @@ share/bash-completion/completions/ctest
 %%DATADIR%%/Templates/Windows/Windows_TemporaryKey.pfx
 %%DATADIR%%/include/cmCPluginAPI.h
 %%PORTDOCS%%%%DOCSDIR%%/Copyright.txt
+%%PORTDOCS%%%%DOCSDIR%%/cmcurl/COPYING
+%%PORTDOCS%%%%DOCSDIR%%/cmnghttp2/COPYING
 %%PORTDOCS%%%%DOCSDIR%%/cmsys/Copyright.txt
 share/emacs/site-lisp/cmake-mode.el
 share/vim/vimfiles/indent/cmake.vim