nixpkgs/pkgs/build-support/setup-hooks/move-docs.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
701 B
Bash
Raw Normal View History

# This setup hook moves $out/{man,doc,info} to $out/share.
2014-08-25 15:30:46 +02:00
preFixupHooks+=(_moveToShare)
_moveToShare() {
if [ -n "$__structuredAttrs" ]; then
if [ -z "${forceShare-}" ]; then
forceShare=( man doc info )
fi
else
forceShare=( ${forceShare:-man doc info} )
fi
if [[ -z "$out" ]]; then return; fi
for d in "${forceShare[@]}"; do
if [ -d "$out/$d" ]; then
if [ -d "$out/share/$d" ]; then
echo "both $d/ and share/$d/ exist!"
else
echo "moving $out/$d to $out/share/$d"
mkdir -p $out/share
mv $out/$d $out/share/
fi
fi
done
}