From 825a34ea3bff75283e152b9846cbc7ee39a007ae Mon Sep 17 00:00:00 2001 From: Moritz 'e1mo' Fromm Date: Tue, 14 Mar 2023 11:53:31 +0100 Subject: [PATCH] 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. --- pkgs/applications/office/libreoffice/wrapper.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/office/libreoffice/wrapper.nix b/pkgs/applications/office/libreoffice/wrapper.nix index c44ca11c4325..13819a0fb5ec 100644 --- a/pkgs/applications/office/libreoffice/wrapper.nix +++ b/pkgs/applications/office/libreoffice/wrapper.nix @@ -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"