summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/darling/default.nix
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2021-04-18 09:55:45 -0400
committerGitHub <noreply@github.com>2021-04-18 09:55:45 -0400
commit6eeab63be433fc0a024d281a239028febc8f1e34 (patch)
treece1d30e7004072eb0f83d61951c0c6c7bba65cd1 /pkgs/os-specific/darwin/darling/default.nix
parent56a4d9857a269a3df89cb9b5ea99917e83850620 (diff)
parent1a25e9b05cca2e2b0bfa3292798ffe37b5d2dcf8 (diff)
downloadnixpkgs-6eeab63be433fc0a024d281a239028febc8f1e34.tar
nixpkgs-6eeab63be433fc0a024d281a239028febc8f1e34.tar.gz
nixpkgs-6eeab63be433fc0a024d281a239028febc8f1e34.tar.bz2
nixpkgs-6eeab63be433fc0a024d281a239028febc8f1e34.tar.lz
nixpkgs-6eeab63be433fc0a024d281a239028febc8f1e34.tar.xz
nixpkgs-6eeab63be433fc0a024d281a239028febc8f1e34.tar.zst
nixpkgs-6eeab63be433fc0a024d281a239028febc8f1e34.zip
Merge pull request #107431 from veprbl/pr/darling_src_fix
darwin.darling.src: fix build on case-sensitive filesystems
Diffstat (limited to 'pkgs/os-specific/darwin/darling/default.nix')
-rw-r--r--pkgs/os-specific/darwin/darling/default.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/os-specific/darwin/darling/default.nix b/pkgs/os-specific/darwin/darling/default.nix
index ef9afafbcd3..22fb6d3b07c 100644
--- a/pkgs/os-specific/darwin/darling/default.nix
+++ b/pkgs/os-specific/darwin/darling/default.nix
@@ -8,11 +8,22 @@ stdenv.mkDerivation rec {
     url = "https://github.com/darlinghq/darling/archive/d2cc5fa748003aaa70ad4180fff0a9a85dc65e9b.tar.gz";
     sha256 = "11b51fw47nl505h63bgx5kqiyhf3glhp1q6jkpb6nqfislnzzkrf";
     postFetch = ''
-      # Get rid of case conflict
-      mkdir $out
+      # 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
     '';
   };