From nobody Tue Aug 20 05:55:01 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnzFf2N2fz5VLDd; Tue, 20 Aug 2024 05:55:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnzFf0VgGz4XWx; Tue, 20 Aug 2024 05:55:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724133302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yPctkjSU+FzYphi/j9JMvFQd+T9DTqnUs3xGbLPxitY=; b=Yyr+ND8IYT0S2UQKuS95zQsgkiGRp2kAdZRvZGYvn1p2u9Q+TnbLaCutxf0XlvcECn/8dM Nd0n3rt8bFFiiW310fiDqnDy08u3tXtOhH+guNj/nc0oQa/g3m7iTHWqrpatcMeS7Q82Oj BgkPIHM4TSZuPhn3xvTwHNBG603JD3xW2wHLRCYN4uW/ttr3N0/PoS6boUESNKWCwCwILu S3uKqNfean2O50ta7eOlIvuVxq2xggDv1ADn3+OiSduR3StIcMdZPBiL8/jON8Bkb8WlvI tUqNGdAvn/e/jLTJ1Odm9ks2PVn+tQ/bTq5mMYtebD2gQeoorJ1+uuhbza8TVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724133302; a=rsa-sha256; cv=none; b=nNwl9OvVHQaYknRPHrpJx7VBSKzi16+n1KKvoJhvu78y/1k0/SYIY+TimpxlSz3kNP3qyT lEF8xwLRikvdKQYFdpPBa9N9IVVizpkaB1Qcq/KsOHpFY3zRKK+Jz7hinx+VPIDsfmUjNG M/PjlZoyEopXtM7BzshRz8yn6Q+b0iqSj6B5XrEX04t41seOYslyhpUVncc4oCAcRR9/Zu 3vNdYQ2lmaENdGPKhqvJRRknlQBoYI97g9Nr93werv0AGj1GPL6/pC8BYGFmTJGmwBLWPK h/n3UUlVSasYKFLW60S8rdIf+TrRLc5OGlB1fcYTCom5043mF+pbfcm4Jew5Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724133302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yPctkjSU+FzYphi/j9JMvFQd+T9DTqnUs3xGbLPxitY=; b=VvoABtmqGjitnFUBB/rLNTOiuxGlcF78beYtHEyQdjAxyBKwoOcVLsnfYC41EF1QCTy9Fj 9k6aAGl8TV7Gn7M+5FF0mdvLwuY1ZkZHLEIZ2pggRdEhzqJP0msXPqrK8WhytFf8UEMi86 0p/+KwljPFy01QHp1OeNJ6eAmhZCnN+Czff5zPUqdCQGQfm9T5NeWJRwu9fuwNuvo9MJZd quJObD5OOIA6F1zRKv6vFuTl2wiCK+JHzfXgCPXSEkqYt+o+3BAhmTiGKvhcGCDQ1dI8OG zG0M4z8peirzp0AXXFXMKABvxH2b7+GQAFj3pnBNuRc/wpJrKGk/OgJs/hDkxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnzFf00BNzp3H; Tue, 20 Aug 2024 05:55:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K5t1QK056500; Tue, 20 Aug 2024 05:55:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K5t1cX056497; Tue, 20 Aug 2024 05:55:01 GMT (envelope-from git) Date: Tue, 20 Aug 2024 05:55:01 GMT Message-Id: <202408200555.47K5t1cX056497@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Jason E. Hale" Subject: git: 76b8901dae25 - main - devel/cmake-core: Refactor List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhale X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76b8901dae25efc80678bb950bdb34a780a39479 Auto-Submitted: auto-generated The branch main has been updated by jhale: URL: https://cgit.FreeBSD.org/ports/commit/?id=76b8901dae25efc80678bb950bdb34a780a39479 commit 76b8901dae25efc80678bb950bdb34a780a39479 Author: Jason E. Hale AuthorDate: 2024-08-13 08:47:30 +0000 Commit: Jason E. Hale CommitDate: 2024-08-20 05:54:56 +0000 devel/cmake-core: Refactor Move the update reminder to Uses/Mk/cmake.mk where the version has been changed since after 7bdeb4414c22 and will be more likely noticed. Switch to an out-of-source build. This eliminates the need to remove certain unwanted files prior to install. Define a sensible CONFIGURE_LOG for users to report as the default doesn't exist. Sort CONFIGURE_ARGS, not necessarily alphabetically, but to improve readability. Pet portclippy(1): hoist the post-patch target. Settle on one sed(1) delimiter instead of three. Pipes (|) seems to be the most readable here. Remove cruft from ${FILESDIR}/InitialCache.cmake and convert to SUB_FILES to take advantage of framework substitutions. archivers/lzmalib is gone, so there is no need to patch for that. Remove the CPACK_OPTION_COMMENT variable in favor of CMake logic. --- Mk/Uses/cmake.mk | 2 + devel/cmake-core/Makefile | 78 +++++++++++++--------------- devel/cmake-core/files/InitialCache.cmake | 29 ----------- devel/cmake-core/files/InitialCache.cmake.in | 17 ++++++ 4 files changed, 55 insertions(+), 71 deletions(-) diff --git a/Mk/Uses/cmake.mk b/Mk/Uses/cmake.mk index 26504eda516f..f467bc7f9dd5 100644 --- a/Mk/Uses/cmake.mk +++ b/Mk/Uses/cmake.mk @@ -62,6 +62,8 @@ _INCLUDE_USES_CMAKE_MK= yes _valid_ARGS= indirect insource noninja run testing _internal +# Reminder: devel/cmake-core, devel/cmake-doc, devel/cmake-gui, and devel/cmake-man +# are all affected by changing _CMAKE_VERSION. Please check each of these ports. _CMAKE_VERSION= 3.30.2 CMAKE_BIN= ${LOCALBASE}/bin/cmake diff --git a/devel/cmake-core/Makefile b/devel/cmake-core/Makefile index 9c2d40f285a0..2048f1a6092d 100644 --- a/devel/cmake-core/Makefile +++ b/devel/cmake-core/Makefile @@ -1,5 +1,4 @@ PORTNAME= cmake -# Remember to update devel/cmake-doc and devel/cmake-gui as well. DISTVERSION= ${_CMAKE_VERSION} CATEGORIES= devel PKGNAMESUFFIX= -core @@ -13,31 +12,33 @@ LICENSE_FILE= ${WRKSRC}/Copyright.txt LIB_DEPENDS= libexpat.so:textproc/expat2 \ libjsoncpp.so:devel/jsoncpp \ - libuv.so:devel/libuv \ - librhash.so:security/rhash + librhash.so:security/rhash \ + libuv.so:devel/libuv -USES= cmake:_internal compiler:c++11-lang cpe localbase ncurses ssl +USES= cmake:_internal compiler:c++17-lang cpe localbase ncurses ssl CPE_VENDOR= cmake_project HAS_CONFIGURE= yes +CONFIGURE_CMD= ${WRKSRC}/bootstrap +CONFIGURE_LOG= Bootstrap.cmk/cmake_bootstrap.log CONFIGURE_ARGS= --prefix=${PREFIX} \ --datadir="/${DATADIR_REL}" \ --docdir="/${DOCSDIR_REL}" \ + --init="${BUILD_WRKSRC}/InitialCache.cmake" \ + --parallel=${MAKE_JOBS_NUMBER} \ + --system-bzip2 \ --system-expat \ --system-jsoncpp \ - --system-zlib \ - --system-zstd \ - --system-bzip2 \ --system-liblzma \ --system-libarchive \ --system-librhash \ --system-libuv \ + --system-zlib \ + --system-zstd \ --no-system-cppdap \ --no-system-curl \ --no-system-nghttp2 \ - --parallel=${MAKE_JOBS_NUMBER} \ - --verbose \ - --init="${WRKSRC}/InitialCache.cmake" + --verbose .if defined(WITH_CCACHE_BUILD) CONFIGURE_ARGS+= --enable-ccache .endif @@ -48,59 +49,52 @@ CFLAGS+= -I${OPENSSLINC} CXXFLAGS+= -D__BSD_VISIBLE LDFLAGS+= -L${OPENSSLLIB} +SUB_FILES= InitialCache.cmake + +BUILD_WRKSRC= ${WRKDIR}/.build +CONFIGURE_WRKSRC= ${BUILD_WRKSRC} +INSTALL_WRKSRC= ${BUILD_WRKSRC} + OPTIONS_DEFINE= DOCS CPACK OPTIONS_DEFAULT= CPACK OPTIONS_SUB= yes CPACK_DESC= Enable FreeBSD generator in CPack CPACK_LIB_DEPENDS= libpkg.so:${PKG_ORIGIN} - -# Before running configure, substitute in the values of options -# for the build. CMake's configure doesn't accept --with-foo -# or similar options: it expects them to be set in CMake-style -# syntax in the initial cache. -pre-configure: - @${CP} "${FILESDIR}/InitialCache.cmake" "${WRKSRC}/InitialCache.cmake" - @${FIND} ${WRKSRC} -name "*.bak" -delete -o -name "*.orig" -delete - -pre-configure-CPACK-on: - @${REINPLACE_CMD} \ - -e 's/@@CPACK_OPTION_VALUE@@/ON/' \ - -e 's/@@CPACK_OPTION_COMMENT@@//' \ - "${WRKSRC}/InitialCache.cmake" - -pre-configure-CPACK-off: - @${REINPLACE_CMD} \ - -e 's/@@CPACK_OPTION_VALUE@@/OFF/' \ - -e 's/@@CPACK_OPTION_COMMENT@@/# /' \ - "${WRKSRC}/InitialCache.cmake" +CPACK_SUB_LIST= CPACK_OPTION_VALUE="ON" +CPACK_SUB_LIST_OFF= CPACK_OPTION_VALUE="OFF" post-patch: @(${FIND} ${WRKSRC}/Modules -name "*.cmake" -print0; \ ${FIND} ${WRKSRC}/Tests -name "CMakeLists.txt" -print0 ) | \ - ${XARGS} -0 -n 100 ${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},g; \ - s,/usr/X11R6,${LOCALBASE},g' - @${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},g' \ + ${XARGS} -0 -n 100 ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g; \ + s|/usr/X11R6|${LOCALBASE}|g' + @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Source/cmLocalGenerator.cxx \ ${WRKSRC}/Source/CPack/cmCPackGenerator.cxx \ ${WRKSRC}/bootstrap - @${REINPLACE_CMD} -e 's,/opt/kde4,${PREFIX},g' \ - ${WRKSRC}/Modules/FindKDE4.cmake - @${REINPLACE_CMD} -e 's,/usr/include,${LOCALBASE}/include,' \ + @${REINPLACE_CMD} -e 's|_compiler=\"ccache|_compiler="${CCACHE_BIN}|g' \ + ${WRKSRC}/bootstrap + @${REINPLACE_CMD} -e 's|/usr/include|${LOCALBASE}/include|' \ ${WRKSRC}/Modules/FindDCMTK.cmake @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/Modules/FindFLEX.cmake - @${REINPLACE_CMD} -e 's|_compiler=\"ccache|_compiler="${CCACHE_BIN}|g' \ - ${WRKSRC}/bootstrap + @${REINPLACE_CMD} -e 's|/opt/kde4|${PREFIX}|g' \ + ${WRKSRC}/Modules/FindKDE4.cmake # cmake-gui(1) is installed by devel/cmake-gui. Remove the man page's source to # prevent it from being built/installed by devel/cmake. - ${RM} ${WRKSRC}/Help/manual/cmake-gui.1.rst + @${RM} ${WRKSRC}/Help/manual/cmake-gui.1.rst + +pre-configure: + @${MKDIR} ${BUILD_WRKSRC} +# Before running configure, substitute in the values of options +# for the build. CMake's configure doesn't accept --with-foo +# or similar options: it expects them to be set in CMake-style +# syntax in the initial cache. + @${CP} ${WRKDIR}/InitialCache.cmake ${BUILD_WRKSRC} post-install: ${INSTALL_DATA} ${WRKSRC}/Auxiliary/cmake-mode.el ${STAGEDIR}${PREFIX}/share/emacs/site-lisp - # The .NoDartCoverage is supposed to suppress testing in the - # source directories, but gets accidentally installed. - @${FIND} ${STAGEDIR}${PREFIX} -name ".NoDartCoverage" -delete .include diff --git a/devel/cmake-core/files/InitialCache.cmake b/devel/cmake-core/files/InitialCache.cmake deleted file mode 100644 index 38e354586af1..000000000000 --- a/devel/cmake-core/files/InitialCache.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# Disable CMake's tests while building. We are not interested in them when -# building packages/ports, and it may create problems if part of some -# dependencies are installed (for example, devel/qmake4 is installed, but -# devel/qt4-corelib is not). -# See https://mail.kde.org/pipermail/kde-freebsd/2013-July/015703.html -set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.") - -# Force CMake to look for base's liblzma, otherwise the configuration process -# will fail if archivers/lzmalib is installed, as CMake will try to use its -# liblzma.so. -# Note that this is necessary only for `make configure' to work, as liblzma is -# only ever used if CMake's bundled libarchive is being used. -set(LIBLZMA_INCLUDE_DIR "/usr/include" CACHE PATH - "Directory where LibLZMA headers are located.") -set(LIBLZMA_LIBRARY "/usr/lib/liblzma.so" CACHE PATH - "LibLZMA library to link against.") - -# Set (or not) by the CPACK option by replacing @@CPACK_OPTION_VALUE@@ -# with the value of the option itself. -# -set(CPACK_ENABLE_FREEBSD_PKG @@CPACK_OPTION_VALUE@@ CACHE BOOL "Enable pkg(8) generator in CPack") -# Use base libarchive instead of ports, because libpkg uses base -@@CPACK_OPTION_COMMENT@@set(LibArchive_INCLUDE_DIR "/usr/include" CACHE PATH -@@CPACK_OPTION_COMMENT@@ "Directory where LibArchive headers are located.") -# Hack to (a) prevent using either ports libarchive or the bundled version -# and (b) libpkg links to base libarchive. -@@CPACK_OPTION_COMMENT@@set(LibArchive_LIBRARY "/usr/lib/libarchive.so" CACHE PATH -@@CPACK_OPTION_COMMENT@@ "LibArchive library to link against.") - diff --git a/devel/cmake-core/files/InitialCache.cmake.in b/devel/cmake-core/files/InitialCache.cmake.in new file mode 100644 index 000000000000..7532a7832dc9 --- /dev/null +++ b/devel/cmake-core/files/InitialCache.cmake.in @@ -0,0 +1,17 @@ +# TODO: Add TEST option to enable regression tests. The tests require +# additional packages to be installed and a small amount of patching +# to account for our local changes. +set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.") + +# Toggled by the CPACK option. Set to ON by default. +set(CPACK_ENABLE_FREEBSD_PKG %%CPACK_OPTION_VALUE%% CACHE BOOL + "Enable pkg(8) generator in CPack") + +if(CPACK_ENABLE_FREEBSD_PKG) +# Use base libarchive instead of the ports or bundled version, because +# libpkg links against base. + set(LibArchive_INCLUDE_DIR "/usr/include" CACHE PATH + "Directory where LibArchive headers are located.") + set(LibArchive_LIBRARY "/usr/lib/libarchive.so" CACHE PATH + "LibArchive library to link against.") +endif(CPACK_ENABLE_FREEBSD_PKG)