Automatically move programs in sbin to bin

This should fix the OpenJDK build, which was failing because paxctl is
in sbin and therefore not automatically added to $PATH.

http://hydra.nixos.org/build/15658346
This commit is contained in:
Eelco Dolstra 2014-10-07 14:43:56 +02:00
parent a85dcf4a00
commit ab04b7d0bb
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# This setup hook, for each output, moves everything in $output/sbin
# to $output/bin, and replaces $output/sbin with a symlink to
# $output/bin.
fixupOutputHooks+=(_moveSbin)
_moveSbin() {
if [ "$dontMoveSbin" = 1 ]; then return; fi
if ! [ -e "$prefix/sbin" ]; then return; fi
echo "moving $prefix/sbin/* to $prefix/bin"
mkdir -p $prefix/bin
shopt -s dotglob
for i in $prefix/sbin/*; do
mv "$i" $prefix/bin
done
shopt -u dotglob
rmdir $prefix/sbin
ln -s bin $prefix/sbin
}

View File

@ -44,6 +44,7 @@ let
../../build-support/setup-hooks/compress-man-pages.sh
../../build-support/setup-hooks/strip.sh
../../build-support/setup-hooks/patch-shebangs.sh
../../build-support/setup-hooks/move-sbin.sh
gcc
];