depot/third_party/nixpkgs/pkgs/development/libraries/qt-6/patches/0004-qtbase-qt-cmake-always-use-cmake-from-path.patch

48 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Wed, 12 Apr 2023 10:13:50 +0800
Subject: [PATCH] qtbase: qt-cmake: always use cmake from path
The generated qt-cmake scripts embeds the absolute path of cmake used
during the build of qtbase, bloating the runtime closure of qtbase.
---
bin/qt-cmake-create.in | 7 +------
bin/qt-cmake.in | 7 +------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/bin/qt-cmake-create.in b/bin/qt-cmake-create.in
index 7865d0fe91b..884dc4aba93 100755
--- a/bin/qt-cmake-create.in
+++ b/bin/qt-cmake-create.in
@@ -7,12 +7,7 @@ HELP_MESSAGE="Usage
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
-original_cmake_path="@CMAKE_COMMAND@"
-cmake_path=$original_cmake_path
-if ! test -f "$cmake_path"; then
- cmake_path="cmake"
-fi
+cmake_path="cmake"
if [ "$#" -gt 1 ]; then
echo "Invalid number of arguments"
diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in
index f719257f602..571ffe788fa 100755
--- a/bin/qt-cmake.in
+++ b/bin/qt-cmake.in
@@ -4,12 +4,7 @@
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
-original_cmake_path="@CMAKE_COMMAND@"
-cmake_path=$original_cmake_path
-if ! test -f "$cmake_path"; then
- cmake_path="cmake"
-fi
+cmake_path="cmake"
toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"