Merge pull request #299969 from runeksvendsen/fix-libsystem-bug

Libsystem: remove broken `postFetch` step in `darling.src`
This commit is contained in:
Weijia Wang 2024-04-02 05:49:09 +02:00 committed by GitHub
commit 3f88034387
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 17 deletions

View File

@ -10,24 +10,13 @@
let
darling.src = fetchzip {
url = "https://github.com/darlinghq/darling/archive/d2cc5fa748003aaa70ad4180fff0a9a85dc65e9b.tar.gz";
sha256 = "11b51fw47nl505h63bgx5kqiyhf3glhp1q6jkpb6nqfislnzzkrf";
hash = "sha256-/YynrKJdi26Xj4lvp5wsN+TAhZjonOrNNHuk4L5tC7s=";
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
# The archive contains both `src/opendirectory` and `src/OpenDirectory`.
# Since neither directory is used for anything, we just remove them to avoid
# the potential issue where file systems with different case sensitivity produce
# different hashes.
rm -rf $out/src/{OpenDirectory,opendirectory}
'';
};