icu: use upstream icu (again) on Darwin (#383155)

authored by Randy Eckenrode and committed by GitHub 04af9f03 b8aa4aa6

+7 -142
+5 -2
pkgs/by-name/bu/bun/package.nix
··· 10 10 , curl 11 11 , jq 12 12 , common-updater-scripts 13 + , cctools 13 14 , darwin 15 + , rcodesign 14 16 }: 15 17 16 18 stdenvNoCC.mkDerivation rec { ··· 43 45 postPhases = [ "postPatchelf"]; 44 46 postPatchelf = 45 47 lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' 46 - wrapProgram $out/bin/bun \ 47 - --prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath [ darwin.ICU ]} 48 + '${lib.getExe' cctools "${cctools.targetPrefix}install_name_tool"}' $out/bin/bun \ 49 + -change /usr/lib/libicucore.A.dylib '${lib.getLib darwin.ICU}/lib/libicucore.A.dylib' 50 + '${lib.getExe rcodesign}' sign --code-signature-flags linker-signed $out/bin/bun 48 51 '' 49 52 # We currently cannot generate completions for x86_64-darwin because bun requires avx support to run, which is: 50 53 # 1. Not currently supported by the version of Rosetta on our aarch64 builders
-7
pkgs/development/python-modules/pyicu/default.nix
··· 1 1 { 2 - stdenv, 3 2 lib, 4 3 buildPythonPackage, 5 4 fetchPypi, ··· 18 17 inherit version; 19 18 hash = "sha256-rMfrkr1cVU7VdyScaXhFCk/toKpvAUcBUrOns4KgITI="; 20 19 }; 21 - 22 - patches = lib.optionals stdenv.hostPlatform.isDarwin [ 23 - # fails testExemplarSet2 test due to sjd locale not having an auxiliary 24 - # esType. icuReal doesn't have an sjd locale 25 - ./skip-sjd-local.diff 26 - ]; 27 20 28 21 nativeBuildInputs = [ icu ]; # for icu-config, but should be replaced with pkg-config 29 22 buildInputs = [ icu ];
-13
pkgs/development/python-modules/pyicu/skip-sjd-local.diff
··· 1 - diff --git a/test/test_LocaleData.py b/test/test_LocaleData.py 2 - index 76410e7..7db6f13 100644 3 - --- a/test/test_LocaleData.py 4 - +++ b/test/test_LocaleData.py 5 - @@ -126,6 +126,7 @@ class TestLocaleData(TestCase): 6 - ld = LocaleData(locale) 7 - scriptCodes = Script.getCode(locale) 8 - exemplarSets = [] 9 - + if locale == 'sjd': continue 10 - for k in range(2): # for casing option in (normal, uncased) 11 - # it seems USET_CASE_INSENSITIVE = 2 12 - option = 0 if k == 0 else 2 13 -
-7
pkgs/os-specific/darwin/apple-source-releases/ICU/package.nix
··· 5 5 fixDarwinDylibNames, 6 6 mkAppleDerivation, 7 7 python3, 8 - stdenv, # Necessary for compatibility with python3Packages.tensorflow, which tries to override the stdenv 9 8 testers, 10 9 }: 11 10 ··· 25 24 sourceRoot = "source/icu/icu4c/source"; 26 25 27 26 patches = [ 28 - # Apple defaults to `uint16_t` for compatibility with building one of their private frameworks, 29 - # but nixpkgs needs `char16_t` for compatibility with packages that expect upstream ICU with `char16_t`. 30 - # According to `unicode/umachine.h`, these types are bit-compatible but distinct in C++. 31 - ./patches/define-uchar-as-char16_t.patch 32 - # Enable the C++ API by default to match the upstream ICU packaging in nixpkgs 33 - ./patches/enable-cxx-api-by-default.patch 34 27 # Skip MessageFormatTest test, which is known to crash sometimes and should be suppressed if it does. 35 28 ./patches/suppress-icu-check-crash.patch 36 29 ];
-53
pkgs/os-specific/darwin/apple-source-releases/ICU/patches/define-uchar-as-char16_t.patch
··· 1 - diff --git a/icu/icu4c/source/common/unicode/umachine.h b/icu/icu4c/source/common/unicode/umachine.h 2 - index 9483031569..e451ad7c02 100644 3 - --- a/common/unicode/umachine.h 4 - +++ b/common/unicode/umachine.h 5 - @@ -387,39 +387,6 @@ 6 - * @stable ICU 4.4 7 - */ 8 - 9 - -#if APPLE_ICU_CHANGES 10 - -// rdar://121241618 (StarlightE: VideosUI-883.40.54#24 has failed to build in install; cannot initialize a variable of type 'const UChar *' (aka 'const char16_t) 11 - -#if 0 12 - - // #if 1 is normal (Apple uses 0 to force us to still use uint16_t). UChar defaults to char16_t in C++. 13 - - // For configuration testing of UChar=uint16_t temporarily change this to #if 0. 14 - - // The intltest Makefile #defines UCHAR_TYPE=char16_t, 15 - - // so we only #define it to uint16_t if it is undefined so far. 16 - -#elif !defined(UCHAR_TYPE) 17 - -# define UCHAR_TYPE uint16_t 18 - -#endif 19 - - 20 - -#if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \ 21 - - defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || \ 22 - - defined (U_TOOLUTIL_IMPLEMENTATION) 23 - - // Inside the ICU library code, never configurable. 24 - - typedef char16_t UChar; 25 - -#elif defined(T_CTEST_IMPLEMENTATION) 26 - - // internally to ctestfw, we want to use char16_t in C++ and uint_16 in C 27 - - #if U_CPLUSPLUS_VERSION != 0 28 - - typedef char16_t UChar; // C++ 29 - - #else 30 - - typedef uint16_t UChar; // C 31 - - #endif 32 - -#elif defined(UCHAR_TYPE) 33 - - typedef UCHAR_TYPE UChar; 34 - -#elif U_CPLUSPLUS_VERSION != 0 35 - - typedef char16_t UChar; // C++ 36 - -#else 37 - - typedef uint16_t UChar; // C 38 - -#endif 39 - - 40 - -#else 41 - - 42 - #if 1 43 - // #if 1 is normal. UChar defaults to char16_t in C++. 44 - // For configuration testing of UChar=uint16_t temporarily change this to #if 0. 45 - @@ -441,8 +408,6 @@ 46 - typedef uint16_t UChar; // C 47 - #endif 48 - 49 - -#endif // APPLE_ICU_CHANGES 50 - - 51 - /** 52 - * \var OldUChar 53 - * Default ICU 58 definition of UChar.
-54
pkgs/os-specific/darwin/apple-source-releases/ICU/patches/enable-cxx-api-by-default.patch
··· 1 - diff --git a/icu/icu4c/source/common/unicode/utypes.h b/icu/icu4c/source/common/unicode/utypes.h 2 - index a3e0ec911c..e361c658ef 100644 3 - --- a/common/unicode/utypes.h 4 - +++ b/common/unicode/utypes.h 5 - @@ -66,20 +66,6 @@ 6 - * \def U_SHOW_CPLUSPLUS_API 7 - * @internal 8 - */ 9 - -#if APPLE_ICU_CHANGES 10 - -// rdar://60884991 #58 Replace installsrc patching with changes directly in header files 11 - -// Apple modifies the default to be 0, not 1 12 - -#ifdef __cplusplus 13 - -# ifndef U_SHOW_CPLUSPLUS_API 14 - -# define U_SHOW_CPLUSPLUS_API 0 15 - -# endif 16 - -#else 17 - -# undef U_SHOW_CPLUSPLUS_API 18 - -# define U_SHOW_CPLUSPLUS_API 0 19 - -#endif 20 - - 21 - -#else 22 - - 23 - #ifdef __cplusplus 24 - # ifndef U_SHOW_CPLUSPLUS_API 25 - # define U_SHOW_CPLUSPLUS_API 1 26 - @@ -89,28 +75,6 @@ 27 - # define U_SHOW_CPLUSPLUS_API 0 28 - #endif 29 - 30 - -#endif // APPLE_ICU_CHANGES 31 - - 32 - - 33 - -#if APPLE_ICU_CHANGES 34 - -// rdar://30624081 64b8ed9b89.. Add #if U_SHOW_CPLUSPLUS_API..#endif around C++ interfaces that don’t have it 35 - -// rdar://24075048 0f5f76d43c.. update ICU for AAS to use VS2015, remove old ICU 4.0 shims, fix build issues 36 - -/* 37 - - * Apple-specific warning if U_SHOW_CPLUSPLUS_API set and the compile 38 - - * is not for a build of ICU itself (ICU_DATA_DIR is always defined 39 - - * for ICU builds, and is unlikely to be defined for client builds). 40 - - * Windows VSC compliler does not like #warning, skip for it. 41 - - */ 42 - -#if U_SHOW_CPLUSPLUS_API 43 - -#ifndef ICU_DATA_DIR 44 - -#if U_PLATFORM!=U_PF_WINDOWS 45 - -#warning Do not set U_SHOW_CPLUSPLUS_API for code that ships with the OS, it is only for local tools. 46 - -#warning ICU C++ functionality may not be used by any OS client, it is not binary compatible across updates. 47 - -#endif 48 - -#endif 49 - -#endif 50 - -#endif // APPLE_ICU_CHANGES 51 - - 52 - /** @{ API visibility control */ 53 - 54 - /**
+1
pkgs/top-level/aliases.nix
··· 654 654 i3nator = throw "'i3nator' has been removed due to lack of upstream maintenance"; # Added 2025-01-25 655 655 ib-tws = throw "ib-tws has been removed from nixpkgs as it was broken"; # Added 2024-07-15 656 656 ib-controller = throw "ib-controller has been removed from nixpkgs as it was broken"; # Added 2024-07-15 657 + icuReal = throw "icuReal has been removed from nixpkgs as a mistake"; # Added 2025-02-18 657 658 imagemagick7Big = throw "'imagemagick7Big' has been renamed to/replaced by 'imagemagickBig'"; # Converted to throw 2024-10-17 658 659 imagemagick7 = throw "'imagemagick7' has been renamed to/replaced by 'imagemagick'"; # Converted to throw 2024-10-17 659 660 imagemagick7_light = throw "'imagemagick7_light' has been renamed to/replaced by 'imagemagick_light'"; # Converted to throw 2024-10-17
+1 -6
pkgs/top-level/all-packages.nix
··· 9210 9210 icu76 9211 9211 ; 9212 9212 9213 - # Use Apple’s fork of ICU by default, which provides additional APIs that are not present in upstream ICU. 9214 - # 9215 - # `icuReal` is provided in case the upstream icu package is needed on Darwin instead of the fork. 9216 - # Note that the versioned icu packages always correspond to the upstream versions. 9217 - icuReal = icu76; 9218 - icu = if stdenv.hostPlatform.isDarwin then darwin.ICU else icuReal; 9213 + icu = icu76; 9219 9214 9220 9215 idasen = with python3Packages; toPythonApplication idasen; 9221 9216