Unverified Commit 466006b9 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #329289 from reckenrode/darwin-icu-fixes

darwin.ICU: clean up and fix staging-next
parents 68c32553 9721bc83
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -11,31 +11,34 @@ let
in

appleDerivation {
  patches = [ ./suppress-icu-check-crash.patch ];

  nativeBuildInputs = [ python3 ];

  depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ];

  postPatch = ''
    substituteInPlace makefile \
      --replace "/usr/bin/" "" \
      --replace "xcrun --sdk macosx --find" "echo -n" \
      --replace "xcrun --sdk macosx.internal --show-sdk-path" "echo -n /dev/null" \
      --replace "-install_name " "-install_name $out"
      --replace-fail "/usr/bin/" "" \
      --replace-fail "xcrun --sdk macosx --find" "echo -n" \
      --replace-fail "xcrun --sdk macosx.internal --show-sdk-path" "echo -n /dev/null" \
      --replace-fail "-install_name " "-install_name $out" \
      --replace-fail '-x -u -r -S' '-x --keep-undefined -S'

    substituteInPlace icuSources/config/mh-darwin \
      --replace "-install_name " "-install_name $out/"
      --replace-fail "-install_name " "-install_name $out/"

    # drop using impure /var/db/timezone/icutz
    substituteInPlace makefile \
      --replace '-DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\"' ""
      --replace-fail '-DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\"' ""

    # FIXME: This will cause `ld: warning: OS version (12.0) too small, changing to 13.0.0`, APPLE should fix it.
    substituteInPlace makefile \
      --replace "ZIPPERING_LDFLAGS=-Wl,-iosmac_version_min,12.0" "ZIPPERING_LDFLAGS="
      --replace-fail "ZIPPERING_LDFLAGS=-Wl,-iosmac_version_min,12.0" "ZIPPERING_LDFLAGS="

    # skip test for missing encodingSamples data
    substituteInPlace icuSources/test/cintltst/ucsdetst.c \
      --replace "&TestMailFilterCSS" "NULL"
      --replace-fail "&TestMailFilterCSS" "NULL"

    patchShebangs icuSources
  '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
@@ -44,7 +47,7 @@ appleDerivation {
    # propagate the correct value of CC, CXX, etc, but has the following double
    # expansion that results in the empty string.
    substituteInPlace makefile \
      --replace '$($(ENV_BUILDHOST))' '$(ENV_BUILDHOST)'
      --replace-fail '$($(ENV_BUILDHOST))' '$(ENV_BUILDHOST)'
  '';

  # APPLE is using makefile to save its default configuration and call ./configure, so we hack makeFlags
+13 −0
Original line number Diff line number Diff line
diff --git a/icuSources/test/cintltst/cmsgtst.c b/icuSources/test/cintltst/cmsgtst.c
index cb328707..1073e6c1 100644
--- a/icuSources/test/cintltst/cmsgtst.c
+++ b/icuSources/test/cintltst/cmsgtst.c
@@ -231,7 +231,7 @@ static void MessageFormatTest( void )
                         austrdup(result), austrdup(testResultStrings[i]) );
                 }
 
-#if (U_PLATFORM == U_PF_LINUX) /* add platforms here .. */
+#if (U_PLATFORM == U_PF_LINUX || U_PLATFORM == U_PF_DARWIN) /* add platforms here .. */
                 log_verbose("Skipping potentially crashing test for mismatched varargs.\n");
 #else
                 log_verbose("Note: the next is a platform dependent test. If it crashes, add an exclusion for your platform near %s:%d\n", __FILE__, __LINE__); 
+1 −1
Original line number Diff line number Diff line
@@ -1323,7 +1323,7 @@ in

        darwin = super.darwin.overrideScope (_: superDarwin: {
          inherit (prevStage.darwin)
            CF ICU Libsystem darwin-stubs dyld locale libobjc rewrite-tbd xnu;
            CF Libsystem darwin-stubs dyld locale libobjc rewrite-tbd xnu;

          apple_sdk = superDarwin.apple_sdk // {
            inherit (prevStage.darwin.apple_sdk) sdkRoot;