summary refs log tree commit diff
path: root/pkgs/applications/office/libreoffice/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/office/libreoffice/wrapper.nix')
-rw-r--r--pkgs/applications/office/libreoffice/wrapper.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/applications/office/libreoffice/wrapper.nix b/pkgs/applications/office/libreoffice/wrapper.nix
new file mode 100644
index 00000000000..8566bd76e1e
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/wrapper.nix
@@ -0,0 +1,16 @@
+{ libreoffice, runCommand, dbus, bash }:
+let
+  jdk = libreoffice.jdk;
+in
+(runCommand "${libreoffice.name}" {
+  inherit dbus libreoffice jdk bash;
+} ''
+  mkdir -p "$out/bin"
+  ln -s "${libreoffice}/share" "$out/share"
+  substituteAll "${./wrapper.sh}" "$out/bin/soffice"
+  chmod a+x "$out/bin/soffice"
+
+  for i in $(ls "${libreoffice}/bin/"); do
+    test "$i" = "soffice" || ln -s soffice "$out/bin/$(basename "$i")"
+  done
+'') // { inherit libreoffice dbus; }