about summary refs log tree commit diff
path: root/pkgs/applications/office/libreoffice/wrapper.nix
blob: 08b01a4a051bd5b6475c2f514b03a002e849a7d9 (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;
}