···55 fixDarwinDylibNames,
66 mkAppleDerivation,
77 python3,
88+ stdenv, # Necessary for compatibility with python3Packages.tensorflow, which tries to override the stdenv
89 testers,
910}:
1011···2425 sourceRoot = "source/icu/icu4c/source";
25262627 patches = [
2828+ # Apple defaults to `uint16_t` for compatibility with building one of their private frameworks,
2929+ # but nixpkgs needs `char16_t` for compatibility with packages that expect upstream ICU with `char16_t`.
3030+ # According to `unicode/umachine.h`, these types are bit-compatible but distinct in C++.
3131+ ./patches/define-uchar-as-char16_t.patch
3232+ # Enable the C++ API by default to match the upstream ICU packaging in nixpkgs
3333+ ./patches/enable-cxx-api-by-default.patch
2734 # Skip MessageFormatTest test, which is known to crash sometimes and should be suppressed if it does.
2835 ./patches/suppress-icu-check-crash.patch
2936 ];
···11+diff --git a/icu/icu4c/source/common/unicode/umachine.h b/icu/icu4c/source/common/unicode/umachine.h
22+index 9483031569..e451ad7c02 100644
33+--- a/common/unicode/umachine.h
44++++ b/common/unicode/umachine.h
55+@@ -387,39 +387,6 @@
66+ * @stable ICU 4.4
77+ */
88+99+-#if APPLE_ICU_CHANGES
1010+-// 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)
1111+-#if 0
1212+- // #if 1 is normal (Apple uses 0 to force us to still use uint16_t). UChar defaults to char16_t in C++.
1313+- // For configuration testing of UChar=uint16_t temporarily change this to #if 0.
1414+- // The intltest Makefile #defines UCHAR_TYPE=char16_t,
1515+- // so we only #define it to uint16_t if it is undefined so far.
1616+-#elif !defined(UCHAR_TYPE)
1717+-# define UCHAR_TYPE uint16_t
1818+-#endif
1919+-
2020+-#if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \
2121+- defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || \
2222+- defined (U_TOOLUTIL_IMPLEMENTATION)
2323+- // Inside the ICU library code, never configurable.
2424+- typedef char16_t UChar;
2525+-#elif defined(T_CTEST_IMPLEMENTATION)
2626+- // internally to ctestfw, we want to use char16_t in C++ and uint_16 in C
2727+- #if U_CPLUSPLUS_VERSION != 0
2828+- typedef char16_t UChar; // C++
2929+- #else
3030+- typedef uint16_t UChar; // C
3131+- #endif
3232+-#elif defined(UCHAR_TYPE)
3333+- typedef UCHAR_TYPE UChar;
3434+-#elif U_CPLUSPLUS_VERSION != 0
3535+- typedef char16_t UChar; // C++
3636+-#else
3737+- typedef uint16_t UChar; // C
3838+-#endif
3939+-
4040+-#else
4141+-
4242+ #if 1
4343+ // #if 1 is normal. UChar defaults to char16_t in C++.
4444+ // For configuration testing of UChar=uint16_t temporarily change this to #if 0.
4545+@@ -441,8 +408,6 @@
4646+ typedef uint16_t UChar; // C
4747+ #endif
4848+4949+-#endif // APPLE_ICU_CHANGES
5050+-
5151+ /**
5252+ * \var OldUChar
5353+ * Default ICU 58 definition of UChar.
···11+diff --git a/icu/icu4c/source/common/unicode/utypes.h b/icu/icu4c/source/common/unicode/utypes.h
22+index a3e0ec911c..e361c658ef 100644
33+--- a/common/unicode/utypes.h
44++++ b/common/unicode/utypes.h
55+@@ -66,20 +66,6 @@
66+ * \def U_SHOW_CPLUSPLUS_API
77+ * @internal
88+ */
99+-#if APPLE_ICU_CHANGES
1010+-// rdar://60884991 #58 Replace installsrc patching with changes directly in header files
1111+-// Apple modifies the default to be 0, not 1
1212+-#ifdef __cplusplus
1313+-# ifndef U_SHOW_CPLUSPLUS_API
1414+-# define U_SHOW_CPLUSPLUS_API 0
1515+-# endif
1616+-#else
1717+-# undef U_SHOW_CPLUSPLUS_API
1818+-# define U_SHOW_CPLUSPLUS_API 0
1919+-#endif
2020+-
2121+-#else
2222+-
2323+ #ifdef __cplusplus
2424+ # ifndef U_SHOW_CPLUSPLUS_API
2525+ # define U_SHOW_CPLUSPLUS_API 1
2626+@@ -89,28 +75,6 @@
2727+ # define U_SHOW_CPLUSPLUS_API 0
2828+ #endif
2929+3030+-#endif // APPLE_ICU_CHANGES
3131+-
3232+-
3333+-#if APPLE_ICU_CHANGES
3434+-// rdar://30624081 64b8ed9b89.. Add #if U_SHOW_CPLUSPLUS_API..#endif around C++ interfaces that don’t have it
3535+-// rdar://24075048 0f5f76d43c.. update ICU for AAS to use VS2015, remove old ICU 4.0 shims, fix build issues
3636+-/*
3737+- * Apple-specific warning if U_SHOW_CPLUSPLUS_API set and the compile
3838+- * is not for a build of ICU itself (ICU_DATA_DIR is always defined
3939+- * for ICU builds, and is unlikely to be defined for client builds).
4040+- * Windows VSC compliler does not like #warning, skip for it.
4141+- */
4242+-#if U_SHOW_CPLUSPLUS_API
4343+-#ifndef ICU_DATA_DIR
4444+-#if U_PLATFORM!=U_PF_WINDOWS
4545+-#warning Do not set U_SHOW_CPLUSPLUS_API for code that ships with the OS, it is only for local tools.
4646+-#warning ICU C++ functionality may not be used by any OS client, it is not binary compatible across updates.
4747+-#endif
4848+-#endif
4949+-#endif
5050+-#endif // APPLE_ICU_CHANGES
5151+-
5252+ /** @{ API visibility control */
5353+5454+ /**
+6-1
pkgs/top-level/all-packages.nix
···93769376 icu76
93779377 ;
9378937893799379- icu = icu74;
93799379+ # Use Apple’s fork of ICU by default, which provides additional APIs that are not present in upstream ICU.
93809380+ #
93819381+ # `icuReal` is provided in case the upstream icu package is needed on Darwin instead of the fork.
93829382+ # Note that the versioned icu packages always correspond to the upstream versions.
93839383+ icuReal = icu74;
93849384+ icu = if stdenv.hostPlatform.isDarwin then darwin.ICU else icuReal;
9380938593819386 idasen = with python3Packages; toPythonApplication idasen;
93829387