Index: head/devel/cmake/Makefile =================================================================== --- head/devel/cmake/Makefile (revision 472856) +++ head/devel/cmake/Makefile (revision 472857) @@ -1,74 +1,99 @@ # Created by: Kyle Martin # $FreeBSD$ PORTNAME= cmake # Remember to update devel/cmake-doc and devel/cmake-gui as well. DISTVERSION= 3.11.4 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= https://www.cmake.org/files/v${PORTVERSION:R}/ 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 libarchive ncurses +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="${PATCHDIR}/InitialCache.cmake" + --init="${WRKSRC}/InitialCache.cmake" -OPTIONS_DEFINE= DOCS MANPAGES +OPTIONS_DEFINE= DOCS MANPAGES CPACK OPTIONS_DEFAULT=MANPAGES OPTIONS_SUB= yes MANPAGES_USES= python:env MANPAGES_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>0:textproc/py-sphinx@${PY_FLAVOR} MANPAGES_CONFIGURE_ON= --sphinx-man +CPACK_DESC= Enable FreeBSD generator in CPack (experimental) +CPACK_LIB_DEPENDS= libpkg.so:ports-mgmt/pkg +CPACK_USES_OFF= libarchive +# When CPACK is on, uses base libarchive and won't pass stage-qa + CONFLICTS_INSTALL= cmake-modules-* .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 @${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/InitialCache.cmake =================================================================== --- head/devel/cmake/files/InitialCache.cmake (revision 472856) +++ head/devel/cmake/files/InitialCache.cmake (revision 472857) @@ -1,19 +1,29 @@ # 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.") -# Don't even try -set(CPACK_ENABLE_FREEBSD_PKG OFF CACHE BOOL "Enable pkg(8) generator in CPack") +# 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/libthr.so;/usr/lib/libarchive.so" CACHE PATH +@@CPACK_OPTION_COMMENT@@ "LibArchive library to link against.") + Index: head/devel/cmake/files/patch-Source_CPack_cmCPackFreeBSDGenerator.cxx =================================================================== --- head/devel/cmake/files/patch-Source_CPack_cmCPackFreeBSDGenerator.cxx (nonexistent) +++ head/devel/cmake/files/patch-Source_CPack_cmCPackFreeBSDGenerator.cxx (revision 472857) @@ -0,0 +1,18 @@ +diff --git Source/CPack/cmCPackFreeBSDGenerator.cxx Source/CPack/cmCPackFreeBSDGenerator.cxx +index 91ae1a23f..a676302e7 100644 +--- Source/CPack/cmCPackFreeBSDGenerator.cxx ++++ Source/CPack/cmCPackFreeBSDGenerator.cxx +@@ -339,6 +339,13 @@ int cmCPackFreeBSDGenerator::PackageFiles() + + std::string output_dir = + cmSystemTools::CollapseCombinedPath(toplevel, "../"); ++ if (!pkg_initialized() && pkg_init(NULL, NULL) != EPKG_OK) ++ { ++ cmCPackLogger(cmCPackLog::LOG_ERROR, ++ "Can not initialize libpkg." << std::endl); ++ return 0; ++ } ++ + pkg_create_from_manifest(output_dir.c_str(), ::TXZ, toplevel.c_str(), + manifestname.c_str(), NULL); + Property changes on: head/devel/cmake/files/patch-Source_CPack_cmCPackFreeBSDGenerator.cxx ___________________________________________________________________ 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