From 6dbdf283cfe0620578ab198af3569195e0900a11 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 29 Jun 2023 20:35:48 -0400 Subject: swift-corelibs: switch to nixpkgs icu Upstream swift-corelibs links against icu on Linux, so it is not necessarily tied to the version of ICU provided by Apple for Darwin. swift-corelibs and qtwebkit are the only two packages that link against darwin.ICU. Switching to the nixpkgs icu will allow the Darwin-specific package to be deprecated and removed eventually. --- .../swift-corelibs/0007-Use-nixpkgs-icu.patch | 31 ++++++++++++++++++++++ .../darwin/swift-corelibs/corefoundation.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/os-specific/darwin/swift-corelibs/0007-Use-nixpkgs-icu.patch diff --git a/pkgs/os-specific/darwin/swift-corelibs/0007-Use-nixpkgs-icu.patch b/pkgs/os-specific/darwin/swift-corelibs/0007-Use-nixpkgs-icu.patch new file mode 100644 index 00000000000..78fa517ce76 --- /dev/null +++ b/pkgs/os-specific/darwin/swift-corelibs/0007-Use-nixpkgs-icu.patch @@ -0,0 +1,31 @@ +diff -ur d/CoreFoundation/CMakeLists.txt e/CoreFoundation/CMakeLists.txt +--- d/CoreFoundation/CMakeLists.txt 1969-12-31 19:00:01.000000000 -0500 ++++ e/CoreFoundation/CMakeLists.txt 2023-06-29 19:13:15.561253229 -0400 +@@ -343,6 +343,7 @@ + elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) + find_package(CURL REQUIRED) + target_include_directories(CoreFoundation PRIVATE ${CURL_INCLUDE_DIRS}) ++ find_package(ICU COMPONENTS uc i18n data REQUIRED) + find_package(LibXml2 REQUIRED) + target_include_directories(CoreFoundation PRIVATE ${LIBXML2_INCLUDE_DIR}) + else() +@@ -377,6 +378,9 @@ + elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) + target_link_libraries(CoreFoundation PRIVATE + ${CURL_LIBRARIES} ++ ICU::uc ++ ICU::i18n ++ ICU::data + ${LIBXML2_LIBRARIES}) + else() + target_link_libraries(CoreFoundation +@@ -408,9 +412,6 @@ + PROPERTIES LINK_FLAGS + -Xlinker;@${CMAKE_SOURCE_DIR}/linux.ld;-Bsymbolic) + elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) +- target_link_libraries(CoreFoundation +- PRIVATE +- icucore) + target_link_options(CoreFoundation + PUBLIC + "LINKER:-alias_list,../Base.subproj/DarwinSymbolAliases" diff --git a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix index 4b99e75aad7..90282b391d9 100644 --- a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix +++ b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation { # versioning and drops the prefix and suffix, so the dynamic library is named `CoreFoundation` # instead of `libCoreFoundation.dylib`. ./0006-System-CF-framework-compatibility.patch + # Link against the nixpkgs ICU instead of using Appleā€™s vendored version. + ./0007-Use-nixpkgs-icu.patch ]; postPatch = '' -- cgit 1.4.1