2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-02-26 14:04:52 +00:00

unixtools: link instead of copying

This is better for disk space.
This commit is contained in:
Matthew Bauer 2018-07-08 19:23:10 -04:00
parent 7e4ce2cfcb
commit f1a14f9844

View File

@ -22,16 +22,19 @@ let
in runCommand "${cmd}-${version}" { in runCommand "${cmd}-${version}" {
meta.platforms = map (n: { kernel.name = n; }) (attrNames providers); meta.platforms = map (n: { kernel.name = n; }) (attrNames providers);
passthru = { inherit provider; }; passthru = { inherit provider; };
preferLocalBuild = true;
} '' } ''
if ! [ -x "${bin}" ]; then if ! [ -x ${bin} ]; then
echo "Cannot find command ${cmd}" echo Cannot find command ${cmd}
exit 1 exit 1
fi fi
install -D "${bin}" "$out/bin/${cmd}" mkdir -p $out/bin
ln -s ${bin} $out/bin/${cmd}
if [ -f "${manpage}" ]; then if [ -f ${manpage} ]; then
install -D "${manpage}" $out/share/man/man1/${cmd}.1.gz mkdir -p $out/share/man/man1
ln -s ${manpage} $out/share/man/man1/${cmd}.1.gz
fi fi
''; '';