darwin stdenv: Ensure libSystem reexports the right libraries

The logic was made pure for the normal libSystem, but this change never
made it to the bootstrap tools. Deduplication the logic as the comment
suggests would have prevented this, but here's a stop-gap until we do
so.

+3 -1
+2
pkgs/stdenv/darwin/default.nix
··· 50 50 args = [ ./unpack-bootstrap-tools.sh ]; 51 51 52 52 inherit (bootstrapFiles) mkdir bzip2 cpio tarball; 53 + reexportedLibrariesFile = 54 + ../../os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries; 53 55 54 56 __sandboxProfile = binShClosure + libSystemProfile; 55 57 };
+1 -1
pkgs/stdenv/darwin/unpack-bootstrap-tools.sh
··· 26 26 $out/lib/system/libsystem_kernel.dylib 27 27 28 28 # TODO: this logic basically duplicates similar logic in the Libsystem expression. Deduplicate them! 29 - libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }') 29 + libs=$(cat $reexportedLibrariesFile | grep -v '^#') 30 30 31 31 for i in $libs; do 32 32 if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then