mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
stdenv: Put moving docs to $out/share in a separate setup hook
This commit is contained in:
parent
e3f7dbbac8
commit
9e31c66d1b
24
pkgs/build-support/setup-hooks/move-docs.sh
Normal file
24
pkgs/build-support/setup-hooks/move-docs.sh
Normal file
@ -0,0 +1,24 @@
|
||||
# This setup hook automatically moves $out/{man,doc,info} to
|
||||
# $out/share.
|
||||
|
||||
preFixupHooks+=(_moveDocs)
|
||||
|
||||
_moveDocs() {
|
||||
forceShare=${forceShare:=man doc info}
|
||||
if [ -z "$forceShare" ]; then return; fi
|
||||
|
||||
for d in $forceShare; do
|
||||
if [ -d "$prefix/$d" ]; then
|
||||
if [ -d "$prefix/share/$d" ]; then
|
||||
echo "both $d/ and share/$d/ exist!"
|
||||
else
|
||||
echo "moving $prefix/$d to $prefix/share/$d"
|
||||
mkdir -p $prefix/share
|
||||
if [ -w $prefix/share ]; then
|
||||
mv $prefix/$d $prefix/share
|
||||
ln -s share/$d $prefix
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
@ -30,7 +30,8 @@ let
|
||||
unsafeGetAttrPos = builtins.unsafeGetAttrPos or (n: as: null);
|
||||
|
||||
extraBuildInputs' = extraBuildInputs ++
|
||||
[ ../../build-support/setup-hooks/compress-man-pages.sh
|
||||
[ ../../build-support/setup-hooks/move-docs.sh
|
||||
../../build-support/setup-hooks/compress-man-pages.sh
|
||||
../../build-support/setup-hooks/strip.sh
|
||||
../../build-support/setup-hooks/patch-shebangs.sh
|
||||
gcc
|
||||
|
@ -701,25 +701,6 @@ fixupPhase() {
|
||||
|
||||
runHook preFixup
|
||||
|
||||
# Put man/doc/info under $out/share.
|
||||
forceShare=${forceShare:=man doc info}
|
||||
if [ -n "$forceShare" ]; then
|
||||
for d in $forceShare; do
|
||||
if [ -d "$prefix/$d" ]; then
|
||||
if [ -d "$prefix/share/$d" ]; then
|
||||
echo "both $d/ and share/$d/ exists!"
|
||||
else
|
||||
echo "fixing location of $d/ subdirectory"
|
||||
mkdir -p $prefix/share
|
||||
if [ -w $prefix/share ]; then
|
||||
mv -v $prefix/$d $prefix/share
|
||||
ln -sv share/$d $prefix
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done;
|
||||
fi
|
||||
|
||||
# Apply fixup to each output.
|
||||
local output
|
||||
for output in $outputs; do
|
||||
|
Loading…
Reference in New Issue
Block a user