Skip to content

Commit

Permalink
fix sysroot resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
figsoda committed Nov 7, 2022
1 parent 469ee5d commit 0a855f1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/combine.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
{ lib, symlinkJoin }:
{ lib, symlinkJoin, zlib, stdenv }:

name: paths:

symlinkJoin {
inherit name paths;
postBuild = ''
if [ -d $out/bin ]; then
cp --remove-destination $(realpath $out/bin/*) $out/bin
fi
for file in $(find $out/bin -xtype f); do
install -m755 $(realpath "$file") $out/bin
${lib.optionalString stdenv.isLinux ''
patchelf --set-rpath $out/lib "$file" || true
''}
${lib.optionalString stdenv.isDarwin ''
install_name_tool -add_rpath $out/lib "$file" || true
''}
done
for file in $(find $out/lib -name "librustc_driver-*"); do
install $(realpath "$file") $out/lib
done
'';
meta.platforms = lib.platforms.all;
}

0 comments on commit 0a855f1

Please sign in to comment.