Skip to content

Commit

Permalink
devel/cmake: prefer python3 over versioned python3.x
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Adriaan de Groot authored and Adriaan de Groot committed Apr 10, 2022
1 parent 4fa997a commit 731a0cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions devel/cmake/Makefile
Expand Up @@ -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}/
Expand Down
12 changes: 12 additions & 0 deletions 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)

0 comments on commit 731a0cb

Please sign in to comment.