Skip to content

Commit

Permalink
Merge pull request #91 from nix-community/fix-sysroot
Browse files Browse the repository at this point in the history
fix sysroot resolution
  • Loading branch information
figsoda authored Nov 7, 2022
2 parents 469ee5d + 671bf18 commit 0eadf2f
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions lib/combine.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
{ lib, symlinkJoin }:
{ lib, symlinkJoin, 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 -maxdepth 1); do
install -m755 $(realpath "$file") $out/bin
${lib.optionalString stdenv.isLinux ''
if isELF "$file"; then
patchelf --set-rpath $out/lib "$file" || true
fi
''}
${lib.optionalString stdenv.isDarwin ''
install_name_tool -add_rpath $out/lib "$file" || true
''}
done
for file in $(find $out/lib -name "librustc_driver-*" -maxdepth 1); do
install $(realpath "$file") $out/lib
done
'';
meta.platforms = lib.platforms.all;
}

0 comments on commit 0eadf2f

Please sign in to comment.