summary refs log tree commit diff
path: root/pkgs/os-specific/darwin
diff options
context:
space:
mode:
authorMonson Shao <holymonson@gmail.com>2021-01-28 23:53:29 +0800
committerMonson Shao <holymonson@gmail.com>2021-01-29 15:42:27 +0800
commit145ed3fcbc06a92fba6efd142a957cc6321ecb21 (patch)
treeca206979bd2d8e059baf068af1fc5461000fdd05 /pkgs/os-specific/darwin
parentb2e84fa59c1680185d0eeb79609e92b2f37aff1b (diff)
downloadnixpkgs-145ed3fcbc06a92fba6efd142a957cc6321ecb21.tar
nixpkgs-145ed3fcbc06a92fba6efd142a957cc6321ecb21.tar.gz
nixpkgs-145ed3fcbc06a92fba6efd142a957cc6321ecb21.tar.bz2
nixpkgs-145ed3fcbc06a92fba6efd142a957cc6321ecb21.tar.lz
nixpkgs-145ed3fcbc06a92fba6efd142a957cc6321ecb21.tar.xz
nixpkgs-145ed3fcbc06a92fba6efd142a957cc6321ecb21.tar.zst
nixpkgs-145ed3fcbc06a92fba6efd142a957cc6321ecb21.zip
darwin.ICU: update to 66108 and restruct
Diffstat (limited to 'pkgs/os-specific/darwin')
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch22
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix55
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/default.nix1
3 files changed, 44 insertions, 34 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch b/pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch
deleted file mode 100644
index fd9df812940..00000000000
--- a/pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/icuSources/i18n/ucoleitr.cpp b/icuSources/i18n/ucoleitr.cpp
-index ecc94c9..936452f 100644
---- a/icuSources/i18n/ucoleitr.cpp
-+++ b/icuSources/i18n/ucoleitr.cpp
-@@ -320,7 +320,7 @@ ucol_nextProcessed(UCollationElements *elems,
-                    int32_t            *ixHigh,
-                    UErrorCode         *status)
- {
--    return (UCollationPCE::UCollationPCE(elems)).nextProcessed(ixLow, ixHigh, status);
-+    return (UCollationPCE(elems)).nextProcessed(ixLow, ixHigh, status);
- }
- 
- 
-@@ -384,7 +384,7 @@ ucol_previousProcessed(UCollationElements *elems,
-                    int32_t            *ixHigh,
-                    UErrorCode         *status)
- {
--    return (UCollationPCE::UCollationPCE(elems)).previousProcessed(ixLow, ixHigh, status);
-+    return (UCollationPCE(elems)).previousProcessed(ixLow, ixHigh, status);
- }
- 
- U_NAMESPACE_BEGIN
diff --git a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix
index 761ff3ea925..032b1447463 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix
@@ -1,23 +1,56 @@
-{ appleDerivation }:
+{ appleDerivation, python3 }:
 
 appleDerivation {
-  patches = [ ./clang-5.patch ];
+  nativeBuildInputs = [ python3 ];
 
   postPatch = ''
     substituteInPlace makefile \
-      --replace /usr/bin/ "" \
-      --replace '$(ISYSROOT)' "" \
-      --replace 'shell xcodebuild -version -sdk' 'shell true' \
-      --replace 'shell xcrun -sdk $(SDKPATH) -find' 'shell echo' \
-      --replace '-install_name $(libdir)' "-install_name $out/lib/" \
-      --replace /usr/local/bin/ /bin/ \
-      --replace /usr/lib/ /lib/ \
+      --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"
+
+    substituteInPlace icuSources/config/mh-darwin \
+      --replace "-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)\\\"\"' ""
+
+    # 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="
+
+    # skip test for missing encodingSamples data
+    substituteInPlace icuSources/test/cintltst/ucsdetst.c \
+      --replace "&TestMailFilterCSS" "NULL"
+
+    patchShebangs icuSources
   '';
 
-  makeFlags = [ "DSTROOT=$(out)" ];
+  # APPLE is using makefile to save its default configuration and call ./configure, so we hack makeFlags
+  # instead of configuring ourself, trying to stay abreast of APPLE.
+  dontConfigure = true;
+  makeFlags = [
+    "DSTROOT=$(out)"
+
+    # remove /usr prefix on include and lib
+    "PRIVATE_HDR_PREFIX="
+    "libdir=/lib/"
+
+    "DATA_INSTALL_DIR=/share/icu/"
+    "DATA_LOOKUP_DIR=$(DSTROOT)$(DATA_INSTALL_DIR)"
+
+    # hack to use our lower macos version
+    "MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_MIN_REQUIRED"
+    "OSX_HOST_VERSION_MIN_STRING=$(MACOSX_DEPLOYMENT_TARGET)"
+  ];
+
+  doCheck = true;
+  checkTarget = "check";
 
   postInstall = ''
-    mv $out/usr/local/include $out/include
+    # we don't need all those in usr/local
     rm -rf $out/usr
   '';
 }
diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix
index 014904ca24d..61d9d452263 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix
@@ -226,7 +226,6 @@ let
     dtrace          = applePackage "dtrace"            "osx-10.12.6"     "0hpd6348av463yqf70n3xkygwmf1i5zza8kps4zys52sviqz3a0l" {};
     dyld            = applePackage "dyld"              "osx-10.12.6"     "0q4jmk78b5ajn33blh4agyq6v2a63lpb3fln78az0dy12bnp1qqk" {};
     eap8021x        = applePackage "eap8021x"          "osx-10.11.6"     "0iw0qdib59hihyx2275rwq507bq2a06gaj8db4a8z1rkaj1frskh" {};
-    ICU             = applePackage "ICU"               "osx-10.10.5"     "1qihlp42n5g4dl0sn0f9pc0bkxy1452dxzf0vr6y5gqpshlzy03p" {};
     IOKit           = applePackage "IOKit"             "osx-10.11.6"     "0kcbrlyxcyirvg5p95hjd9k8a01k161zg0bsfgfhkb90kh2s8x00" { inherit IOKitSrcs; };
     launchd         = applePackage "launchd"           "osx-10.9.5"      "0w30hvwqq8j5n90s3qyp0fccxflvrmmjnicjri4i1vd2g196jdgj" {};
     libauto         = applePackage "libauto"           "osx-10.9.5"      "17z27yq5d7zfkwr49r7f0vn9pxvj95884sd2k6lq6rfaz9gxqhy3" {};