Skip to content

Commit

Permalink
cmake-devel-gui: fix CMAKE_ROOT for cmake-gui
Browse files Browse the repository at this point in the history
CMake code for cmake-gui looks inside app bundle for CMAKE_ROOT,
this patches it to look in MacPorts $prefix.

See: https://trac.macports.org/ticket/62855
  • Loading branch information
nilason authored and mascguy committed Aug 28, 2023
1 parent 811830d commit 559627c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 5 additions & 3 deletions devel/cmake-devel/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ version 20230810-3.27.2-[string range ${gitlab.version} 0 7]
checksums rmd160 7a30991369c51f9d0e6875d6ba40d10c31730fb6 \
sha256 4ecc149a24251b3d6ba12e00893b5265fff580755c8630e8512cc56692cfff98 \
size 8423256
revision 0
revision 1

epoch 1

Expand Down Expand Up @@ -76,7 +76,8 @@ patchfiles-append \
patch-fix-clock_gettime-test.diff \
patch-qt5gui.diff \
patch-cmake-cmInstallRuntime-initializer-fix.diff \
patch-uv_spawn.diff
patch-uv_spawn.diff \
patch-cmakeroot-with-app.diff

depends_lib-append \
port:curl \
Expand Down Expand Up @@ -188,7 +189,8 @@ post-patch {
# patch PREFIX
reinplace "s|__PREFIX__|${prefix}|g" \
${worksrcpath}/macports.cmake \
${worksrcpath}/Modules/Platform/Darwin.cmake
${worksrcpath}/Modules/Platform/Darwin.cmake \
${worksrcpath}/Source/cmSystemTools.cxx

# patch FRAMEWORKS
reinplace "s|__FRAMEWORKS_DIR__|${frameworks_dir}|g" \
Expand Down
13 changes: 13 additions & 0 deletions devel/cmake-devel/files/patch-cmakeroot-with-app.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Addresses https://trac.macports.org/ticket/62855

--- Source/cmSystemTools.cxx.orig 2023-03-08 20:04:09.000000000 +0100
+++ Source/cmSystemTools.cxx 2023-07-25 11:24:23.000000000 +0200
@@ -2570,6 +2570,8 @@
exe_dir = cmSystemTools::GetFilenamePath(exe_dir);
if (cmSystemTools::FileExists(exe_dir + CMAKE_BIN_DIR "/cmake")) {
exe_dir += CMAKE_BIN_DIR;
+ } else if (cmSystemTools::FileExists("__PREFIX__" CMAKE_BIN_DIR "/cmake")) {
+ exe_dir = cmSystemTools::GetFilenamePath("__PREFIX__" CMAKE_BIN_DIR "/cmake");
} else {
exe_dir = cmSystemTools::GetFilenamePath(exe_dir);
exe_dir = cmSystemTools::GetFilenamePath(exe_dir);

0 comments on commit 559627c

Please sign in to comment.