cmake: clean up obsolete Darwin patches (#373535)

This commit is contained in:
Emily
2025-01-26 23:24:35 +00:00
committed by GitHub
3 changed files with 0 additions and 102 deletions
@@ -1,39 +0,0 @@
diff -Naur cmake-3.25.1-old/Source/CMakeLists.txt cmake-3.25.1-new/Source/CMakeLists.txt
--- cmake-3.25.1-old/Source/CMakeLists.txt 2022-11-30 10:57:03.000000000 -0300
+++ cmake-3.25.1-new/Source/CMakeLists.txt 2022-12-19 01:00:08.412064304 -0300
@@ -916,7 +916,6 @@
# On Apple we need CoreFoundation and CoreServices
if(APPLE)
target_link_libraries(CMakeLib PUBLIC "-framework CoreFoundation")
- target_link_libraries(CMakeLib PUBLIC "-framework CoreServices")
endif()
if(WIN32 AND NOT UNIX)
diff -Naur cmake-3.25.1-old/Source/cmGlobalXCodeGenerator.cxx cmake-3.25.1-new/Source/cmGlobalXCodeGenerator.cxx
--- cmake-3.25.1-old/Source/cmGlobalXCodeGenerator.cxx 2022-11-30 10:57:03.000000000 -0300
+++ cmake-3.25.1-new/Source/cmGlobalXCodeGenerator.cxx 2022-12-19 01:00:56.065135169 -0300
@@ -56,10 +56,6 @@
#if !defined(CMAKE_BOOTSTRAP) && defined(__APPLE__)
# include <CoreFoundation/CoreFoundation.h>
-# if !TARGET_OS_IPHONE
-# define HAVE_APPLICATION_SERVICES
-# include <ApplicationServices/ApplicationServices.h>
-# endif
#endif
#if !defined(CMAKE_BOOTSTRAP)
diff -Naur cmake-3.25.1-old/Utilities/cmlibarchive/CMakeLists.txt cmake-3.25.1-new/Utilities/cmlibarchive/CMakeLists.txt
--- cmake-3.25.1-old/Utilities/cmlibarchive/CMakeLists.txt 2022-11-30 10:57:03.000000000 -0300
+++ cmake-3.25.1-new/Utilities/cmlibarchive/CMakeLists.txt 2022-12-19 01:01:43.392205981 -0300
@@ -2041,10 +2041,6 @@
ADD_CUSTOM_TARGET(run_all_tests)
ENDIF(ENABLE_TEST)
-# We need CoreServices on Mac OS.
-IF(APPLE)
- LIST(APPEND ADDITIONAL_LIBS "-framework CoreServices")
-ENDIF(APPLE)
add_subdirectory(libarchive)
IF(0) # CMake does not build libarchive's command-line tools.
@@ -1,55 +0,0 @@
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index 7625cf65d9..167903e309 100644
--- a/Utilities/cmlibuv/CMakeLists.txt
+++ b/Utilities/cmlibuv/CMakeLists.txt
@@ -193,6 +193,22 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
src/unix/kqueue.c
src/unix/proctitle.c
)
+
+ include(CheckIncludeFile)
+
+ check_include_file("ApplicationServices/ApplicationServices.h" HAVE_ApplicationServices)
+ if (HAVE_ApplicationServices)
+ list(APPEND uv_defines
+ HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H=1
+ )
+ endif()
+
+ check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
+ if (HAVE_CoreServices)
+ list(APPEND uv_defines
+ HAVE_CORESERVICES_CORESERVICES_H=1
+ )
+ endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff --git a/Utilities/cmlibuv/src/unix/fsevents.c b/Utilities/cmlibuv/src/unix/fsevents.c
index a51f29b3f6..3f6bf01968 100644
--- a/Utilities/cmlibuv/src/unix/fsevents.c
+++ b/Utilities/cmlibuv/src/unix/fsevents.c
@@ -21,7 +21,7 @@
#include "uv.h"
#include "internal.h"
-#if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MAX_ALLOWED < 1070
+#if !HAVE_CORESERVICES_CORESERVICES_H || MAC_OS_X_VERSION_MAX_ALLOWED < 1070
/* iOS (currently) doesn't provide the FSEvents-API (nor CoreServices) */
/* macOS prior to 10.7 doesn't provide the full FSEvents API so use kqueue */
@@ -39,7 +39,7 @@ int uv__fsevents_close(uv_fs_event_t* handle) {
void uv__fsevents_loop_delete(uv_loop_t* loop) {
}
-#else /* TARGET_OS_IPHONE */
+#else /* !HAVE_CORESERVICES_CORESERVICES_H */
#include "darwin-stub.h"
@@ -920,4 +920,4 @@ int uv__fsevents_close(uv_fs_event_t* handle) {
return 0;
}
-#endif /* TARGET_OS_IPHONE */
+#endif /* !HAVE_CORESERVICES_CORESERVICES_H */
-8
View File
@@ -61,16 +61,8 @@ stdenv.mkDerivation (finalAttrs: {
./000-nixpkgs-cmake-prefix-path.diff
# Don't search in non-Nix locations such as /usr, but do search in our libc.
./001-search-path.diff
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
# TODO: Remove these in `staging`.
# Don't depend on frameworks.
./002-application-services.diff
# Derived from https://github.com/libuv/libuv/commit/1a5d4f08238dd532c3718e210078de1186a5920d
./003-libuv-application-services.diff
]
++ lib.optional stdenv.hostPlatform.isCygwin ./004-cygwin.diff
# Derived from https://github.com/curl/curl/commit/31f631a142d855f069242f3e0c643beec25d1b51
# On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG.
++ lib.optional stdenv.hostPlatform.isDarwin ./006-darwin-always-set-runtime-c-flag.diff
# On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path.