about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2020-02-25 21:39:11 +0000
committerGitHub <noreply@github.com>2020-02-25 21:39:11 +0000
commitfcf9e23e7320fcbc74a030125713c6e5a4cbbe47 (patch)
treed3cc22f8b5dcddde8c14f1a26a39fe86f31be77d /pkgs
parent09a8f9297c965dd2acd297f010211792cb603347 (diff)
parentc95bfd235b6a94a9bf748abff408f9a598974183 (diff)
Merge pull request #80353 from mmilata/libreoffice-spellcheck-dicpath
libreoffice: wrapper: add hunspell dirs to DICPATH
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/office/libreoffice/src-fresh/primary.nix3
-rw-r--r--pkgs/applications/office/libreoffice/src-still/primary.nix3
-rw-r--r--pkgs/applications/office/libreoffice/wrapper.sh7
3 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/applications/office/libreoffice/src-fresh/primary.nix b/pkgs/applications/office/libreoffice/src-fresh/primary.nix
index ec7f9e52bbba7..fb21d1292d6d5 100644
--- a/pkgs/applications/office/libreoffice/src-fresh/primary.nix
+++ b/pkgs/applications/office/libreoffice/src-fresh/primary.nix
@@ -26,7 +26,8 @@ rec {
     sha256 = "0a7arjlxxy7hjm1brxwd124bf1gkbl92bgygi3sbbhbsv07pjdcr";
   };
 
-  # TODO: dictionaries
+  # the "dictionaries" archive is not used for LO build because we already build hunspellDicts packages from
+  # it and LibreOffice can use these by pointing DICPATH environment variable at the hunspell directory
 
   help = fetchSrc {
     name = "help";
diff --git a/pkgs/applications/office/libreoffice/src-still/primary.nix b/pkgs/applications/office/libreoffice/src-still/primary.nix
index d3da7d09b704f..36deae53670a7 100644
--- a/pkgs/applications/office/libreoffice/src-still/primary.nix
+++ b/pkgs/applications/office/libreoffice/src-still/primary.nix
@@ -26,7 +26,8 @@ rec {
     sha256 = "01g09bbn1ixrsfj4l0x6x8p06dz9hnlrhnr3f3xb42drmi9ipvjv";
   };
 
-  # TODO: dictionaries
+  # the "dictionaries" archive is not used for LO build because we already build hunspellDicts packages from
+  # it and LibreOffice can use these by pointing DICPATH environment variable at the hunspell directory
 
   help = fetchSrc {
     name = "help";
diff --git a/pkgs/applications/office/libreoffice/wrapper.sh b/pkgs/applications/office/libreoffice/wrapper.sh
index 62569734745c0..806dd0806ad59 100644
--- a/pkgs/applications/office/libreoffice/wrapper.sh
+++ b/pkgs/applications/office/libreoffice/wrapper.sh
@@ -17,6 +17,13 @@ if uname | grep Linux > /dev/null &&
     export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
 fi
 
+for PROFILE in $NIX_PROFILES; do
+    HDIR="$PROFILE/share/hunspell"
+    if [ -d "$HDIR" ]; then
+        export DICPATH=$DICPATH''${DICPATH:+:}$HDIR
+    fi
+done
+
 "@libreoffice@/bin/$(basename "$0")" "$@"
 code="$?"