Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix sysroot resolution #91

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}