2023-01-20 10:41:00 +00:00
|
|
|
# This setup hook moves $out/{man,doc,info} to $out/share.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preFixupHooks+=(_moveToShare)
|
|
|
|
|
|
|
|
_moveToShare() {
|
2023-01-20 10:41:00 +00:00
|
|
|
if [ -n "$__structuredAttrs" ]; then
|
|
|
|
if [ -z "${forceShare-}" ]; then
|
|
|
|
forceShare=( man doc info )
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
forceShare=( ${forceShare:-man doc info} )
|
|
|
|
fi
|
|
|
|
|
2021-09-26 12:46:18 +00:00
|
|
|
if [[ -z "$out" ]]; then return; fi
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
for d in "${forceShare[@]}"; do
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
|
}
|