summary refs log tree commit diff
path: root/pkgs/applications/office/libreoffice/wrapper.nix
blob: ce8910d76d45ab8f4b89fc2d22f33be69644881d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ 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;
  meta = libreoffice.meta;
}