singular: Wrap executables instead of symlinking

This way config scripts can fidn out their own location
This commit is contained in:
Michael Raskin 2016-10-15 15:28:12 +02:00
parent 2bed05d8e1
commit 36804c75e4

View File

@ -33,7 +33,11 @@ stdenv.mkDerivation rec {
binaries="$(find "$out"/* \( -type f -o -type l \) -perm -111 \! -name '*.so' -maxdepth 1)"
ln -s "$out"/*/{include,lib} "$out"
mkdir -p "$out/bin"
ln -s $binaries "$out/bin"
for b in $binaries; do
bbn="$(basename "$b")"
echo -e '#! ${stdenv.shell}\n"'"$b"'" "$@"' > "$out/bin/$bbn"
chmod a+x "$out/bin/$bbn"
done
'';
enableParallelBuild = true;