diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-10-07 14:43:56 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-10-07 14:43:56 +0200 |
commit | ab04b7d0bba24d068ee57c25050ecf73a428c552 (patch) | |
tree | 87c24d1cad2999c84c156aab25ca9fb9d227b779 /pkgs | |
parent | a85dcf4a00c1ac354eda3b84209b8fa6b2133259 (diff) |
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
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/setup-hooks/move-sbin.sh | 19 | ||||
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/build-support/setup-hooks/move-sbin.sh b/pkgs/build-support/setup-hooks/move-sbin.sh new file mode 100644 index 0000000000000..5db97afbbb635 --- /dev/null +++ b/pkgs/build-support/setup-hooks/move-sbin.sh @@ -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 +} diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index c37bea7e31c39..66afda486041a 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -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 ]; |