From 731a0cba8469ce33d4406f735afac00f6914e158 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 10 Apr 2022 17:34:55 +0200 Subject: [PATCH] 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 --- devel/cmake/Makefile | 1 + .../cmake/files/patch-Modules_Platform_FreeBSD.cmake | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 devel/cmake/files/patch-Modules_Platform_FreeBSD.cmake diff --git a/devel/cmake/Makefile b/devel/cmake/Makefile index 69095886dc8d2..476f5a689af44 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 0000000000000..a34d8d0de404c --- /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)