Index: head/devel/cmake/Makefile =================================================================== --- head/devel/cmake/Makefile (revision 566433) +++ head/devel/cmake/Makefile (revision 566434) @@ -1,103 +1,104 @@ # Created by: Kyle Martin # $FreeBSD$ PORTNAME= cmake # Remember to update devel/cmake-doc and devel/cmake-gui as well. DISTVERSION= 3.19.5 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \ https://www.cmake.org/files/v${PORTVERSION}/ MAINTAINER= kde@FreeBSD.org COMMENT= Cross-platform Makefile generator LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/Copyright.txt LIB_DEPENDS= libcurl.so:ftp/curl \ libexpat.so:textproc/expat2 \ libjsoncpp.so:devel/jsoncpp \ libuv.so:devel/libuv \ librhash.so:security/rhash USES= compiler:c++11-lang ncurses HAS_CONFIGURE= yes CONFIGURE_ENV= MAKE=make CONFIGURE_ARGS= --prefix=${PREFIX} \ --datadir="/${DATADIR_REL}" \ --docdir="/${DOCSDIR_REL}" \ --system-libs \ --parallel=${MAKE_JOBS_NUMBER} \ --init="${WRKSRC}/InitialCache.cmake" OPTIONS_DEFINE= DOCS MANPAGES CPACK OPTIONS_DEFAULT=MANPAGES OPTIONS_SUB= yes MANPAGES_USES= python:env MANPAGES_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx MANPAGES_CONFIGURE_ON= --sphinx-man CPACK_DESC= Enable FreeBSD generator in CPack (experimental) CPACK_LIB_DEPENDS= libpkg.so:${PKG_ORIGIN} CPACK_USES_OFF= libarchive # When CPACK is on, uses base libarchive and won't pass stage-qa CONFLICTS_INSTALL= cmake-modules-* CXXFLAGS+= -D__BSD_VISIBLE .include .if defined(STRIP) && ${STRIP} != "" && !defined(WITH_DEBUG) INSTALL_TARGET= install/strip .endif # 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" 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" 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' \ ${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,' \ ${WRKSRC}/Modules/FindDCMTK.cmake @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/Modules/FindFLEX.cmake @${FIND} ${WRKSRC} -name "*.bak" -delete -o -name "*.orig" -delete # 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 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 Index: head/devel/cmake/files/patch-cmake-issue-18031 =================================================================== --- head/devel/cmake/files/patch-cmake-issue-18031 (nonexistent) +++ head/devel/cmake/files/patch-cmake-issue-18031 (revision 566434) @@ -0,0 +1,100 @@ +Use newer pkg_create() API + +diff --git Source/CPack/cmCPackFreeBSDGenerator.cxx Source/CPack/cmCPackFreeBSDGenerator.cxx +index b673006f25..63c7810b15 100644 +--- Source/CPack/cmCPackFreeBSDGenerator.cxx ++++ Source/CPack/cmCPackFreeBSDGenerator.cxx +@@ -35,6 +35,56 @@ int cmCPackFreeBSDGenerator::InitializeInternal() + + cmCPackFreeBSDGenerator::~cmCPackFreeBSDGenerator() = default; + ++// This is a wrapper for struct pkg_create and pkg_create() ++// ++// Instantiate this class with suitable parameters, then ++// check isValid() to check if it's ok. Afterwards, call ++// Create() to do the actual work. This will leave a package ++// in the given `output_dir`. ++// ++// This wrapper cleans up the struct pkg_create. ++class PkgCreate ++{ ++public: ++ PkgCreate() ++ : d(nullptr) ++ { ++ } ++ PkgCreate(const std::string& output_dir, const std::string& toplevel_dir, ++ const std::string& manifest_name) ++ : d(pkg_create_new()) ++ , manifest(manifest_name) ++ ++ { ++ if (d) { ++ pkg_create_set_format(d, "txz"); ++ pkg_create_set_compression_level(d, 0); // Explicitly set default ++ pkg_create_set_overwrite(d, false); ++ pkg_create_set_rootdir(d, toplevel_dir.c_str()); ++ pkg_create_set_output_dir(d, output_dir.c_str()); ++ } ++ } ++ ~PkgCreate() ++ { ++ if (d) ++ pkg_create_free(d); ++ } ++ ++ bool isValid() const { return d; } ++ ++ bool Create() ++ { ++ if (!isValid()) ++ return false; ++ int r = pkg_create(d, manifest.c_str(), nullptr, false); ++ return r == 0; ++ } ++ ++private: ++ struct pkg_create* d; ++ std::string manifest; ++}; ++ + // This is a wrapper, for use only in stream-based output, + // that will output a string in UCL escaped fashion (in particular, + // quotes and backslashes are escaped). The list of characters +@@ -281,7 +331,7 @@ int cmCPackFreeBSDGenerator::PackageFiles() + { + if (!this->ReadListFile("Internal/CPack/CPackFreeBSD.cmake")) { + cmCPackLogger(cmCPackLog::LOG_ERROR, +- "Error while execution CPackFreeBSD.cmake" << std::endl); ++ "Error while executing CPackFreeBSD.cmake" << std::endl); + return 0; + } + +@@ -317,9 +367,25 @@ int cmCPackFreeBSDGenerator::PackageFiles() + ONE_PACKAGE_PER_COMPONENT); + } + ++ if (!pkg_initialized() && pkg_init(NULL, NULL) != EPKG_OK) { ++ cmCPackLogger(cmCPackLog::LOG_ERROR, ++ "Can not initialize FreeBSD libpkg." << std::endl); ++ return 0; ++ } ++ + std::string output_dir = cmSystemTools::CollapseFullPath("../", toplevel); +- pkg_create_from_manifest(output_dir.c_str(), ::TXZ, toplevel.c_str(), +- manifestname.c_str(), nullptr); ++ PkgCreate package(output_dir, toplevel, manifestname); ++ if (package.isValid()) { ++ if (!package.Create()) { ++ cmCPackLogger(cmCPackLog::LOG_ERROR, ++ "Error during pkg_create()" << std::endl); ++ return 0; ++ } ++ } else { ++ cmCPackLogger(cmCPackLog::LOG_ERROR, ++ "Error before pkg_create()" << std::endl); ++ return 0; ++ } + + std::string broken_suffix = + cmStrCat('-', var_lookup("CPACK_TOPLEVEL_TAG"), ".txz"); Property changes on: head/devel/cmake/files/patch-cmake-issue-18031 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property