aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan de Groot <adridg@FreeBSD.org>2022-04-10 15:34:55 +0000
committerAdriaan de Groot <adridg@FreeBSD.org>2022-04-10 15:34:55 +0000
commit731a0cba8469ce33d4406f735afac00f6914e158 (patch)
treee1ff8161fef4414eb6dc8984160f6b23fd6a4614
parent4fa997a61fe059f99c05548a9e885f96d118bf34 (diff)
downloadports-731a0cba8469ce33d4406f735afac00f6914e158.tar.gz
ports-731a0cba8469ce33d4406f735afac00f6914e158.zip
devel/cmake: prefer python3 over versioned python3.x
Depending on which mechanism is used to find Python (Python3 in particular, since there's only one Python2 version left), either python3 is found -- installed by the python3 metaport, and presumed to be the "preferred / default Python3 version" -- of a versioned python3. Asking for, say, Python 3.6 will get you whatever python3 points at -- assuming it is newer than 3.6 -- or, with the other mechanism, the newest python (e.g. highest installed version). Those are not necessarily the same. Switch the new mechanism to preferring python3; there's a knob in CMake itself for that, we just need to set it in the FreeBSD config-file. PR: 252277
-rw-r--r--devel/cmake/Makefile1
-rw-r--r--devel/cmake/files/patch-Modules_Platform_FreeBSD.cmake12
2 files changed, 13 insertions, 0 deletions
diff --git a/devel/cmake/Makefile b/devel/cmake/Makefile
index 69095886dc8d..476f5a689af4 100644
--- a/devel/cmake/Makefile
+++ b/devel/cmake/Makefile
@@ -3,6 +3,7 @@
PORTNAME= cmake
# Remember to update devel/cmake-doc and devel/cmake-gui as well.
DISTVERSION= 3.22.2
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \
https://www.cmake.org/files/v${PORTVERSION}/
diff --git a/devel/cmake/files/patch-Modules_Platform_FreeBSD.cmake b/devel/cmake/files/patch-Modules_Platform_FreeBSD.cmake
new file mode 100644
index 000000000000..a34d8d0de404
--- /dev/null
+++ b/devel/cmake/files/patch-Modules_Platform_FreeBSD.cmake
@@ -0,0 +1,12 @@
+--- Modules/Platform/FreeBSD.cmake.orig 2022-04-10 15:22:59 UTC
++++ Modules/Platform/FreeBSD.cmake
+@@ -26,4 +26,9 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+ endforeach()
+
++# Prefer python3 (installed by the python3 metaport) over the
++# highest-versioned Python3 interpreter, when asked for a non-exact
++# Python3 version.
++set(Python3_FIND_UNVERSIONED_NAMES FIRST)
++
+ include(Platform/UnixPaths)