libreoffice: improve out/share looping in wrapper

The copying/linking implemented in #220694 resulted in a higher
maintenance burden (need to manually add all new folders in $out/share).
The introduced loop will continue linking everything but the .desktop
files.
This commit is contained in:
Moritz 'e1mo' Fromm
2023-03-14 11:53:31 +01:00
parent 3c66f2de15
commit 825a34ea3b
@@ -89,12 +89,16 @@ in runCommand "${unwrapped.name}-wrapped" {
} (''
mkdir -p "$out/bin"
mkdir -p "$out/share"
for dir in ${unwrapped}/share/*; do
dirname="''${dir##*/}"
if [[ $dirname == "applications" ]]; then
cp -r $dir/ $out/share/
else
ln -s $dir $out/share/
fi
done
ln -s ${unwrapped}/share/icons $out/share/icons
ln -s ${unwrapped}/share/templates $out/share/templates
ln -s ${unwrapped}/lib $out/lib
cp -r ${unwrapped}/share/applications/ $out/share/
for f in $out/share/applications/*.desktop; do
substituteInPlace "$f" \
--replace "Exec=libreoffice${major}.${minor}" "Exec=soffice"