stdenv-bootstrap-tools: update unpack to use $reexportedLibrariesFile

This commit is contained in:
Daiderd Jordan 2018-07-05 19:24:07 +02:00
parent 52b8b68e82
commit 5024e4aa39
No known key found for this signature in database
GPG Key ID: D02435D05B810C96

View File

@ -178,6 +178,9 @@ in rec {
unpack = stdenv.mkDerivation (bootstrapFiles // {
name = "unpack";
reexportedLibrariesFile =
../../os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries;
# This is by necessity a near-duplicate of unpack-bootstrap-tools.sh. If we refer to it directly,
# we can't make any changes to it due to our testing stdenv depending on it. Think of this as the
# unpack-bootstrap-tools.sh for the next round of bootstrap tools.
@ -209,7 +212,7 @@ in rec {
$out/lib/system/libsystem_kernel.dylib
# TODO: this logic basically duplicates similar logic in the Libsystem expression. Deduplicate them!
libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }')
libs=$(cat $reexportedLibrariesFile | grep -v '^#')
for i in $libs; do
if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then