Skip to content

Commit

Permalink
devel/cmake*: update to 3.25.1
Browse files Browse the repository at this point in the history
While here, remove a stale patch (upstreamed in CMake 3.10 or so)
and repair the CPack FreeBSD pkg generator.

Prepared by lbartoletti@
Exp-runs by antoine@

PR:		267872, 267894
  • Loading branch information
Adriaan de Groot authored and Adriaan de Groot committed Jan 8, 2023
1 parent 28eaeb1 commit efaecf6
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Mk/Uses/cmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ _INCLUDE_USES_CMAKE_MK= yes

_valid_ARGS= insource run noninja testing _internal

_CMAKE_VERSION= 3.24.3
_CMAKE_VERSION= 3.25.1

# Sanity check
. for arg in ${cmake_ARGS}
Expand Down
4 changes: 1 addition & 3 deletions devel/cmake-core/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
PORTNAME= cmake
# Remember to update devel/cmake-doc and devel/cmake-gui as well.
DISTVERSION= ${_CMAKE_VERSION}
PORTREVISION= 2
CATEGORIES= devel
PKGNAMESUFFIX= -core

Expand Down Expand Up @@ -40,12 +39,11 @@ CONFIGURE_ARGS= --prefix=${PREFIX} \
--init="${WRKSRC}/InitialCache.cmake"

OPTIONS_DEFINE= DOCS CPACK
OPTIONS_DEFAULT= CPACK
OPTIONS_SUB= yes

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

CXXFLAGS+= -D__BSD_VISIBLE

Expand Down
6 changes: 3 additions & 3 deletions devel/cmake-core/distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TIMESTAMP = 1667324304
SHA256 (cmake-3.24.3.tar.gz) = b53aa10fa82bff84ccdb59065927b72d3bee49f4d86261249fc0984b3b367291
SIZE (cmake-3.24.3.tar.gz) = 10399876
TIMESTAMP = 1672089061
SHA256 (cmake-3.25.1.tar.gz) = 1c511d09516af493694ed9baf13c55947a36389674d657a2d5e0ccedc6b291d8
SIZE (cmake-3.25.1.tar.gz) = 10561054
2 changes: 1 addition & 1 deletion devel/cmake-core/files/InitialCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ set(CPACK_ENABLE_FREEBSD_PKG @@CPACK_OPTION_VALUE@@ CACHE BOOL "Enable pkg(8) ge
@@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@@set(LibArchive_LIBRARY "/usr/lib/libarchive.so" CACHE PATH
@@CPACK_OPTION_COMMENT@@ "LibArchive library to link against.")

14 changes: 7 additions & 7 deletions devel/cmake-core/files/patch-Modules_FindOpenMP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Look for omp.h in LOCALBASE and pass suitable -I and -L flags
if those are necessary. Also use OpenMP flags when linking.
PR 223678 and PR 234050.

--- Modules/FindOpenMP.cmake.orig 2021-07-14 14:10:23 UTC
--- Modules/FindOpenMP.cmake.orig 2022-11-17 13:55:41 UTC
+++ Modules/FindOpenMP.cmake
@@ -97,6 +97,33 @@ cmake_policy(SET CMP0012 NEW) # if() recognizes number
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
Expand Down Expand Up @@ -43,7 +43,7 @@ PR 223678 and PR 234050.
function(_OPENMP_FLAG_CANDIDATES LANG)
if(NOT OpenMP_${LANG}_FLAG)
unset(OpenMP_FLAG_CANDIDATES)
@@ -212,6 +239,15 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_
@@ -211,6 +238,15 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_
if(OpenMP_VERBOSE_COMPILE_OPTIONS)
string(APPEND OPENMP_FLAGS_TEST " ${OpenMP_VERBOSE_COMPILE_OPTIONS}")
endif()
Expand All @@ -57,8 +57,8 @@ PR 223678 and PR 234050.
+ set(_need_extra FALSE)
+
string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}")
try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC}
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}"
try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}
SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT
@@ -219,8 +255,23 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_
OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT
)
Expand All @@ -84,7 +84,7 @@ PR 223678 and PR 234050.

if(CMAKE_${LANG}_VERBOSE_FLAG)
unset(OpenMP_${LANG}_IMPLICIT_LIBRARIES)
@@ -567,9 +618,16 @@ foreach(LANG IN LISTS OpenMP_FINDLIST)
@@ -603,9 +654,16 @@ foreach(LANG IN LISTS OpenMP_FINDLIST)
add_library(OpenMP::OpenMP_${LANG} INTERFACE IMPORTED)
endif()
if(OpenMP_${LANG}_FLAGS)
Expand All @@ -100,6 +100,6 @@ PR 223678 and PR 234050.
+ INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_COMPILE_OPTIONS}>")
+ set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY
+ INTERFACE_LINK_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_LINK_OPTIONS}>")
if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Fujitsu")
if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Fujitsu"
OR ${CMAKE_${LANG}_COMPILER_ID} STREQUAL "IntelLLVM")
set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY
INTERFACE_LINK_OPTIONS "${OpenMP_${LANG}_FLAGS}")
11 changes: 0 additions & 11 deletions devel/cmake-core/files/patch-Modules_Platform_FreeBSD-CXX.cmake

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git Source/CPack/cmCPackFreeBSDGenerator.cxx Source/CPack/cmCPackFreeBSDGenerator.cxx
index 162dfc7346..206f2d06a0 100644
--- Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -245,8 +245,15 @@ public:
void write_value(cmGeneratedFileStream& s) const override
{
s << "{\n";
- for (std::string const& elem : value) {
- s << " \"" << elem << R"(": {"origin": ")" << elem << "\"},\n";
+ for (std::string const& origin : value) {
+ // Split the origin into its category and name components.
+ // Treat it like a path (which it sort-of is, in the ports tree).
+ // Because it is a "cat/name" style relative path, it gets split
+ // into "" "cat" and "name" parts.
+ std::vector<std::string> originComponents;
+ cmSystemTools::SplitPath(origin, originComponents);
+ const std::string name = (originComponents.size() == 3) ? originComponents[2] : origin;
+ s << " \"" << name << R"(": {"origin": ")" << origin << "\"},\n";
}
s << '}';
}
Loading

0 comments on commit efaecf6

Please sign in to comment.