summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-04-25 22:45:59 +0300
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-04-25 22:45:59 +0300
commit12b91012e550a0935b0a842802875f3c86fe7fca (patch)
tree7fddab7a21e13ddd5c1ba249045051a96bf13034 /pkgs/os-specific/darwin/apple-source-releases
parenta02917d9da89456905947cf1ed5444bc7a4c3be2 (diff)
downloadnixpkgs-12b91012e550a0935b0a842802875f3c86fe7fca.tar
nixpkgs-12b91012e550a0935b0a842802875f3c86fe7fca.tar.gz
nixpkgs-12b91012e550a0935b0a842802875f3c86fe7fca.tar.bz2
nixpkgs-12b91012e550a0935b0a842802875f3c86fe7fca.tar.lz
nixpkgs-12b91012e550a0935b0a842802875f3c86fe7fca.tar.xz
nixpkgs-12b91012e550a0935b0a842802875f3c86fe7fca.tar.zst
nixpkgs-12b91012e550a0935b0a842802875f3c86fe7fca.zip
darwin.darling: drop
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases')
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix28
1 files changed, 26 insertions, 2 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
index 6f8124dbac4..aa93a32c562 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
@@ -1,12 +1,36 @@
-{ lib, stdenv, buildPackages
+{ lib, stdenv, buildPackages, fetchzip
 , appleDerivation', xnu, Libc, Libm, libdispatch, Libinfo
 , dyld, Csu, architecture, libclosure, CarbonHeaders, ncurses, CommonCrypto
 , copyfile, removefile, libresolvHeaders, libresolv, Libnotify, libplatform, libpthread
-, mDNSResponder, launchd, libutilHeaders, hfsHeaders, darling, darwin-stubs
+, mDNSResponder, launchd, libutilHeaders, hfsHeaders, darwin-stubs
 , headersOnly ? false
 , withLibresolv ? !headersOnly
 }:
 
+let
+  darling.src = fetchzip {
+    url = "https://github.com/darlinghq/darling/archive/d2cc5fa748003aaa70ad4180fff0a9a85dc65e9b.tar.gz";
+    sha256 = "11b51fw47nl505h63bgx5kqiyhf3glhp1q6jkpb6nqfislnzzkrf";
+    postFetch = ''
+      # The archive contains both `src/opendirectory` and `src/OpenDirectory`,
+      # pre-create the directory to choose the canonical case on
+      # case-insensitive filesystems.
+      mkdir -p $out/src/OpenDirectory
+
+      cd $out
+      tar -xzf $downloadedFile --strip-components=1
+      rm -r $out/src/libm
+
+      # If `src/opendirectory` and `src/OpenDirectory` refer to different
+      # things, then combine them into `src/OpenDirectory` to match the result
+      # on case-insensitive filesystems.
+      if [ "$(stat -c %i src/opendirectory)" != "$(stat -c %i src/OpenDirectory)" ]; then
+        mv src/opendirectory/* src/OpenDirectory/
+        rmdir src/opendirectory
+      fi
+    '';
+  };
+in
 appleDerivation' stdenv {
   dontBuild = true;
   dontFixup = true;