From 559627cd0165f3ea17df756a8285226ddd5b99c3 Mon Sep 17 00:00:00 2001 From: nilason Date: Tue, 25 Jul 2023 12:00:19 +0200 Subject: [PATCH] cmake-devel-gui: fix CMAKE_ROOT for cmake-gui 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 --- devel/cmake-devel/Portfile | 8 +++++--- .../cmake-devel/files/patch-cmakeroot-with-app.diff | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 devel/cmake-devel/files/patch-cmakeroot-with-app.diff diff --git a/devel/cmake-devel/Portfile b/devel/cmake-devel/Portfile index d86e42add1c73..093cf59c1164b 100644 --- a/devel/cmake-devel/Portfile +++ b/devel/cmake-devel/Portfile @@ -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 @@ -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 \ @@ -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" \ diff --git a/devel/cmake-devel/files/patch-cmakeroot-with-app.diff b/devel/cmake-devel/files/patch-cmakeroot-with-app.diff new file mode 100644 index 0000000000000..3a839adbbb635 --- /dev/null +++ b/devel/cmake-devel/files/patch-cmakeroot-with-app.diff @@ -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);