darwin.ICU: avoid conflicts with the system libicucore (#506470)

This commit is contained in:
Randy Eckenrode
2026-04-14 13:57:39 +00:00
committed by GitHub
@@ -133,6 +133,16 @@ let
--replace-fail '$(top_srcdir)/../LICENSE' "$NIX_BUILD_TOP/source/icu/LICENSE"
substituteInPlace config/dist-data.sh \
--replace-fail "\''${top_srcdir}/../LICENSE" "$NIX_BUILD_TOP/source/icu/LICENSE"
# Make sure this ICU build puts C++ symbols in a distinct namespace to avoid symbol clashes with other ICU
# implementations (including both the system ICU and builds of the upstream ICU).
# This breaks binary compatibility for the C++ API, but its not ABI stable anyway. Without doing this,
# `dotnet` crashes on macOS 26.4 when linked against `libicucore.A.dylib` from Nixpkgs.
substituteInPlace common/unicode/uvernum.h \
--replace-fail 'U_ICU_VERSION_SUFFIX ' 'U_ICU_VERSION_SUFFIX _nix'
# Only enable symbol renaming for C++ symbols. C symbols need to remain unversioned for compatibility.
substituteInPlace common/unicode/uversion.h \
--replace-fail U_DISABLE_RENAMING 0
'';
# remove dependency on bootstrap-tools in early stdenv build