2022-12-11 13:13:38 +01:00
|
|
|
# This setup hook moves $out/{man,doc,info} to $out/share.
|
2014-07-08 14:26:35 +02:00
|
|
|
|
2014-08-25 15:30:46 +02:00
|
|
|
preFixupHooks+=(_moveToShare)
|
2014-07-08 14:26:35 +02:00
|
|
|
|
2014-07-08 15:33:15 +02:00
|
|
|
_moveToShare() {
|
2022-05-31 23:34:59 +02:00
|
|
|
if [ -n "$__structuredAttrs" ]; then
|
|
|
|
if [ -z "${forceShare-}" ]; then
|
|
|
|
forceShare=( man doc info )
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
forceShare=( ${forceShare:-man doc info} )
|
|
|
|
fi
|
|
|
|
|
2021-08-19 16:22:40 +02:00
|
|
|
if [[ -z "$out" ]]; then return; fi
|
2014-07-08 14:26:35 +02:00
|
|
|
|
2022-05-31 23:34:59 +02:00
|
|
|
for d in "${forceShare[@]}"; do
|
2014-07-08 15:33:15 +02:00
|
|
|
if [ -d "$out/$d" ]; then
|
|
|
|
if [ -d "$out/share/$d" ]; then
|
2014-07-08 14:26:35 +02:00
|
|
|
echo "both $d/ and share/$d/ exist!"
|
|
|
|
else
|
2014-07-08 15:33:15 +02:00
|
|
|
echo "moving $out/$d to $out/share/$d"
|
|
|
|
mkdir -p $out/share
|
|
|
|
mv $out/$d $out/share/
|
2014-07-08 14:26:35 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|