Files
haikuports/dev-build/cmake/patches/cmake-3.31.5.patchset

482 lines
17 KiB
Plaintext

From 896984ac0e48b1ef6aaa99ebe709159de0461cd2 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 24 Mar 2018 14:19:43 +0100
Subject: Fix search path for Lua headers.
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index 2249ab1..b010f9a 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -32,7 +32,7 @@ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
- PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include
+ PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include lua5.1
PATHS
~/Library/Frameworks
/Library/Frameworks
--
2.45.2
From 53df0ab3ae6e0452ccffe903229227d00a8880c9 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 7 Sep 2019 17:29:56 +0200
Subject: links against libnetwork
diff --git a/bootstrap b/bootstrap
index 53358d5..95e1631 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1799,6 +1799,9 @@ else
uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE=700"
libs="${libs} -lsocket"
;;
+ *Haiku*)
+ libs="${libs} -lnetwork"
+ ;;
esac
fi
if test "x${bootstrap_system_libuv}" = "x"; then
--
2.45.2
From edbe9c67c3c9a9df96fe9aefbd8cbf8033889d0c Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 7 Sep 2019 23:46:47 +0200
Subject: bootstrap uses cmlibuv
diff --git a/Utilities/cmlibuv/src/unix/core.c b/Utilities/cmlibuv/src/unix/core.c
index 83e8b61..314f239 100644
--- a/Utilities/cmlibuv/src/unix/core.c
+++ b/Utilities/cmlibuv/src/unix/core.c
@@ -1440,7 +1440,9 @@ int uv_os_getpriority(uv_pid_t pid, int* priority) {
return UV_EINVAL;
errno = 0;
+#ifndef __HAIKU__
r = getpriority(PRIO_PROCESS, (int) pid);
+#endif
if (r == -1 && errno != 0)
return UV__ERR(errno);
@@ -1454,8 +1456,10 @@ int uv_os_setpriority(uv_pid_t pid, int priority) {
if (priority < UV_PRIORITY_HIGHEST || priority > UV_PRIORITY_LOW)
return UV_EINVAL;
+#ifndef __HAIKU__
if (setpriority(PRIO_PROCESS, (int) pid, priority) != 0)
return UV__ERR(errno);
+#endif
return 0;
}
--
2.45.2
From f56b12d30b173e0b5e6cbc2d082681ede488a572 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 21 Sep 2019 15:30:44 +0200
Subject: Haiku: Improve secondary arch detection
Find the directory when it's not the last in the list.
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index 7d9a737..74b17f5 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -33,8 +33,8 @@ execute_process(
RESULT_VARIABLE _HAIKU_SEARCH_DIRS_FOUND
OUTPUT_STRIP_TRAILING_WHITESPACE)
-string(REGEX MATCH "libraries: =?([^\n]*:)?/boot/system/develop/lib/([^/]*)/?(:?\n+)" _dummy "${_HAIKU_SEARCH_DIRS}\n")
-set(CMAKE_HAIKU_SECONDARY_ARCH "${CMAKE_MATCH_2}")
+string(REGEX MATCH "libraries: =?([^\n]*:)?(/boot)?/system(/develop)?/lib/([^/]*)/?(:|\n)" _dummy "${_HAIKU_SEARCH_DIRS}\n")
+set(CMAKE_HAIKU_SECONDARY_ARCH "${CMAKE_MATCH_4}")
if(NOT CMAKE_HAIKU_SECONDARY_ARCH)
set(CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR "")
--
2.45.2
From 41d9dc27850b199d4ba9e004e46c0bfd4c009118 Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Fri, 21 Feb 2020 15:38:39 -0500
Subject: Modules/Haiku: Set CMAKE_SYSTEM_FRAMEWORK_PATH.
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index 74b17f5..41d77bb 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -117,6 +117,9 @@ LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_HAIKU_DEVELOP_LIB_DIRECTORIES})
+# This is needed for find_package to search develop/lib/cmake/.
+list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH /boot/system/develop /boot/system/non-packaged/develop)
+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/boot/system" CACHE PATH
"Install path prefix, prepended onto install directories." FORCE)
--
2.45.2
From 6e2b9d9887dfff82726ddd87a87623e128db78c2 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 Apr 2021 21:09:12 +0200
Subject: disable dependency tracking for older GNU compilers
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 83c818d..668ed54 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -49,7 +49,9 @@ macro(__compiler_gnu lang)
# distcc does not transform -o to -MT when invoking the preprocessor
# internally, as it ought to. Work around this bug by setting -MT here
# even though it isn't strictly necessary.
- set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
+ if(NOT CMAKE_${lang}_COMPILER_ID STREQUAL "GNU" OR NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.0)
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
+ endif()
endif()
# Initial configuration flags.
--
2.45.2
From 9910fc23d478fdb9aa5371302557adfad6deee44 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 20 Oct 2021 14:28:22 +0200
Subject: Haiku: fix install dirs, let FindPackage search in data/
diff --git a/Source/CMakeInstallDestinations.cmake b/Source/CMakeInstallDestinations.cmake
index e82bec3..0f8a620 100644
--- a/Source/CMakeInstallDestinations.cmake
+++ b/Source/CMakeInstallDestinations.cmake
@@ -1,11 +1,11 @@
# Keep formatting here consistent with bootstrap script expectations.
if(BEOS)
set(CMAKE_BIN_DIR_DEFAULT "bin") # HAIKU
- set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
+ set(CMAKE_DATA_DIR_DEFAULT "data/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
set(CMAKE_INFO_DIR_DEFAULT "documentation/info") # HAIKU
set(CMAKE_MAN_DIR_DEFAULT "documentation/man") # HAIKU
- set(CMAKE_XDGDATA_DIR_DEFAULT "share") # HAIKU
+ set(CMAKE_XDGDATA_DIR_DEFAULT "data") # HAIKU
elseif(CYGWIN)
set(CMAKE_BIN_DIR_DEFAULT "bin") # CYGWIN
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION}") # CYGWIN
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index cc150fd..07a7c24 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -2712,7 +2712,11 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
common.emplace_back("libx32"_s);
}
common.emplace_back("lib"_s);
+#ifdef __HAIKU__
+ common.emplace_back("data"_s);
+#else
common.emplace_back("share"_s);
+#endif
auto cmnGen = cmEnumPathSegmentsGenerator{ common };
auto cmakeGen = cmAppendPathSegmentGenerator{ "cmake"_s };
--
2.45.2
From ccdcc868d50cafcd296dc590b4820b3f8eb57e2b Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 23 Feb 2022 13:44:06 +0100
Subject: Disable weak symbols; they do not seem to behave correctly.
diff --git a/Utilities/cmzstd/lib/common/zstd_trace.h b/Utilities/cmzstd/lib/common/zstd_trace.h
index da20534..97bcdc2 100644
--- a/Utilities/cmzstd/lib/common/zstd_trace.h
+++ b/Utilities/cmzstd/lib/common/zstd_trace.h
@@ -29,7 +29,7 @@ extern "C" {
defined(__GNUC__) && defined(__ELF__) && \
(defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86) || defined(__aarch64__)) && \
!defined(__APPLE__) && !defined(_WIN32) && !defined(__MINGW32__) && \
- !defined(__CYGWIN__) && !defined(_AIX)
+ !defined(__CYGWIN__) && !defined(_AIX) && !defined(__HAIKU__)
# define ZSTD_HAVE_WEAK_SYMBOLS 1
#else
# define ZSTD_HAVE_WEAK_SYMBOLS 0
--
2.45.2
From f3ba72d01431c5a6e5474c3373782a3194501e30 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 9 Feb 2024 13:48:22 +0100
Subject: Haiku: enable debugger
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79a562c..c896be0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -137,7 +137,7 @@ option(CMake_BUILD_PCH "Compile CMake with precompiled headers" OFF)
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(NOT DEFINED CMake_ENABLE_DEBUGGER)
# The debugger uses cppdap, which does not compile everywhere.
- if(CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin|Linux|BSD|DragonFly|CYGWIN|MSYS"
+ if(CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin|Linux|BSD|DragonFly|CYGWIN|MSYS|Haiku"
AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.16)
AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "XLClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.1)
AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "LCC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1.23)
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index c4cd101..00f3209 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -865,6 +865,9 @@ if(CMake_ENABLE_DEBUGGER)
)
endif()
target_link_libraries(CMakeLib PUBLIC cppdap::cppdap)
+ if(HAIKU)
+ target_link_libraries(CMakeLib PUBLIC network)
+ endif()
endif()
# Check if we can build the Mach-O parser.
--
2.45.2
From 2d34136f2a19c93be7b05ff50b54792948fbb48a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A1ximo=20Casta=C3=B1eda?= <antiswen@yahoo.es>
Date: Sat, 31 Aug 2024 21:52:20 +0200
Subject: Fix build for non-x86 arches
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 933d649..666f543 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -4957,6 +4957,7 @@ bool SystemInformationImplementation::QueryHaikuInfo()
this->TotalVirtualMemory = 0;
this->AvailableVirtualMemory = 0;
+#if defined(__i386__) || defined(__x86_64__)
// Retrieve cpuid_info union for cpu 0
cpuid_info cpu_info;
get_cpuid(&cpu_info, 0, 0);
@@ -4992,6 +4993,7 @@ bool SystemInformationImplementation::QueryHaikuInfo()
// Chip Extended Model
this->ChipID.ExtendedModel = cpu_info.eax_1.extended_model;
+#endif
// Get ChipID.ProcessorName from other information already gathered
this->RetrieveClassicalCPUIdentity();
--
2.45.2
From 79a7bb3ec990cfcc5cb76fdc18db63c179787bf1 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 25 Sep 2024 09:11:06 +0200
Subject: FindPython: when component Development is searched, also search
Interpreter
FindPython only uses the python config when an interpreter is found.
The python config contains the right include paths on x86 for instance.
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index c741ec1..30b638f 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -1434,6 +1434,9 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
list (APPEND ${_PYTHON_PREFIX}_FIND_COMPONENTS "Development.Module" "Development.Embed")
+ if (HAIKU)
+ list (APPEND ${_PYTHON_PREFIX}_FIND_COMPONENTS "Interpreter")
+ endif()
endif()
list (REMOVE_DUPLICATES ${_PYTHON_PREFIX}_FIND_COMPONENTS)
foreach (_${_PYTHON_PREFIX}_COMPONENT IN ITEMS Interpreter Compiler Development Development.Module Development.SABIModule Development.Embed NumPy)
--
2.45.2
From e6d256b3b28ab8b31904c9d688ce6595b07997b5 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Mon, 23 Sep 2024 05:40:41 -0300
Subject: Use 'headers' instead of 'include' as fallback.
Just a quick swap, to help CMake find Python's headers on 32 bits Haiku.
(64 bits was working OK. See HaikuPorts issue #11155)
Not strictly needed after korli's previous fix, but... doesn't hurts.
Kudos to madmax for this early workaround!
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 30b638f..61780d7 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -334,11 +334,11 @@ function (_PYTHON_GET_PATH_SUFFIXES _PYTHON_PGPS_PATH_SUFFIXES)
elseif (_PGPS_INCLUDE)
set (suffixes "${abi}")
if (suffixes)
- list (TRANSFORM suffixes PREPEND "include/python${version}")
+ list (TRANSFORM suffixes PREPEND "headers/python${version}")
else()
- set (suffixes "include/python${version}")
+ set (suffixes "headers/python${version}")
endif()
- list (APPEND path_suffixes ${suffixes} include)
+ list (APPEND path_suffixes ${suffixes} headers)
endif()
endforeach()
endif()
--
2.45.2
From d9263b179508e3dec5e056b8f618157b842c629f Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Thu, 26 Sep 2024 15:16:36 -0300
Subject: Avoid installing icons, .desktop, and mime files.
Those are intended for use on Linux and friends.
Fix by Begasus. Thanks!
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index e4b53fd..3938f3e 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -330,7 +330,7 @@ install(TARGETS cmake-gui
RUNTIME DESTINATION bin ${COMPONENT}
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" ${COMPONENT})
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT HAIKU)
foreach(size IN ITEMS 32 128)
install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetup${size}.png"
--
2.45.2
From b3979d2fa09129e1e4bdc18d7d108df075b980c5 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Mon, 10 Feb 2025 14:59:31 +0100
Subject: Build fixes (Linker configuration)
Related:https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9992
diff --git a/Modules/Platform/Linker/Haiku-ASM.cmake b/Modules/Platform/Linker/Haiku-ASM.cmake
new file mode 100644
index 0000000..9e8a2b3
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-ASM.cmake
@@ -0,0 +1,5 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# GNU is the default linker
+include(Platform/Linker/Haiku-GNU-ASM)
diff --git a/Modules/Platform/Linker/Haiku-C.cmake b/Modules/Platform/Linker/Haiku-C.cmake
new file mode 100644
index 0000000..4abf4a7
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-C.cmake
@@ -0,0 +1,5 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# GNU is the default linker
+include(Platform/Linker/Haiku-GNU-C)
diff --git a/Modules/Platform/Linker/Haiku-CXX.cmake b/Modules/Platform/Linker/Haiku-CXX.cmake
new file mode 100644
index 0000000..96fd0f8
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-CXX.cmake
@@ -0,0 +1,5 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# GNU is the default linker
+include(Platform/Linker/Haiku-GNU-CXX)
diff --git a/Modules/Platform/Linker/Haiku-GNU-ASM.cmake b/Modules/Platform/Linker/Haiku-GNU-ASM.cmake
new file mode 100644
index 0000000..bfef8b9
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-GNU-ASM.cmake
@@ -0,0 +1,4 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include(Platform/Linker/Linux-GNU-ASM)
diff --git a/Modules/Platform/Linker/Haiku-GNU-C.cmake b/Modules/Platform/Linker/Haiku-GNU-C.cmake
new file mode 100644
index 0000000..2d0efda
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-GNU-C.cmake
@@ -0,0 +1,4 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include(Platform/Linker/Linux-GNU-C)
diff --git a/Modules/Platform/Linker/Haiku-GNU-CXX.cmake b/Modules/Platform/Linker/Haiku-GNU-CXX.cmake
new file mode 100644
index 0000000..33c46d5
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-GNU-CXX.cmake
@@ -0,0 +1,4 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include(Platform/Linker/Linux-GNU-CXX)
diff --git a/Modules/Platform/Linker/Haiku-LLD-ASM.cmake b/Modules/Platform/Linker/Haiku-LLD-ASM.cmake
new file mode 100644
index 0000000..870e59e
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-LLD-ASM.cmake
@@ -0,0 +1,4 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include(Platform/Linker/Linux-LLD-ASM)
diff --git a/Modules/Platform/Linker/Haiku-LLD-C.cmake b/Modules/Platform/Linker/Haiku-LLD-C.cmake
new file mode 100644
index 0000000..efeeb16
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-LLD-C.cmake
@@ -0,0 +1,4 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include(Platform/Linker/Linux-LLD-C)
diff --git a/Modules/Platform/Linker/Haiku-LLD-CXX.cmake b/Modules/Platform/Linker/Haiku-LLD-CXX.cmake
new file mode 100644
index 0000000..46a516c
--- /dev/null
+++ b/Modules/Platform/Linker/Haiku-LLD-CXX.cmake
@@ -0,0 +1,4 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include(Platform/Linker/Linux-LLD-CXX)
--
2.45.2