summary refs log tree commit diff
path: root/pkgs/development/libraries/hunspell
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-07-24 15:39:46 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-07-24 17:39:24 -0400
commit69423bd5aac831e40ca7d925021653d89c5caea3 (patch)
tree9e802a20a95075d12a59cbac83c5d6c9a2802c25 /pkgs/development/libraries/hunspell
parent2db3a7d1e61dcba4926f8df976f6f8b68d5c7c66 (diff)
downloadnixpkgs-69423bd5aac831e40ca7d925021653d89c5caea3.tar
nixpkgs-69423bd5aac831e40ca7d925021653d89c5caea3.tar.gz
nixpkgs-69423bd5aac831e40ca7d925021653d89c5caea3.tar.bz2
nixpkgs-69423bd5aac831e40ca7d925021653d89c5caea3.tar.lz
nixpkgs-69423bd5aac831e40ca7d925021653d89c5caea3.tar.xz
nixpkgs-69423bd5aac831e40ca7d925021653d89c5caea3.tar.zst
nixpkgs-69423bd5aac831e40ca7d925021653d89c5caea3.zip
hunspell: add patch to look in XDG_DATA_DIRS
Diffstat (limited to 'pkgs/development/libraries/hunspell')
-rw-r--r--pkgs/development/libraries/hunspell/0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch37
-rw-r--r--pkgs/development/libraries/hunspell/default.nix2
2 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/development/libraries/hunspell/0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch b/pkgs/development/libraries/hunspell/0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch
new file mode 100644
index 00000000000..4607f8b8ee0
--- /dev/null
+++ b/pkgs/development/libraries/hunspell/0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch
@@ -0,0 +1,37 @@
+From 8c67f314de2684d77315eecd99ef091d441f17dd Mon Sep 17 00:00:00 2001
+From: Matthew Bauer <mjbauer95@gmail.com>
+Date: Wed, 24 Jul 2019 15:35:18 -0400
+Subject: [PATCH] Make hunspell look in XDG_DATA_DIRS for dictionaries
+
+Some dictionaries may exist but only show up under XDG_DATA_DIRS. For
+instance, $HOME/.local/share/hunspell could contain some dictionaries.
+
+This patch adds each directory in the hunspell subdir of each
+XDG_DATA_DIRS to the lookup path.
+
+Upstream pr is available at: https://github.com/hunspell/hunspell/pull/637
+---
+ src/tools/hunspell.cxx | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/tools/hunspell.cxx b/src/tools/hunspell.cxx
+index 690e34a..6cd127e 100644
+--- a/src/tools/hunspell.cxx
++++ b/src/tools/hunspell.cxx
+@@ -2044,6 +2044,13 @@ int main(int argc, char** argv) {
+     if (getenv("DICPATH")) {
+       path_std_str.append(getenv("DICPATH")).append(PATHSEP);
+     }
++    if (getenv("XDG_DATA_DIRS")) {
++      char* dir = strtok(getenv("XDG_DATA_DIRS"), ":");
++      while (dir != NULL) {
++        path_std_str.append(dir).append("/hunspell:");
++        dir = strtok(NULL, ":");
++      }
++    }
+     path_std_str.append(LIBDIR).append(PATHSEP);
+     if (HOME) {
+       const char * userooodir[] = USEROOODIR;
+-- 
+2.22.0
+
diff --git a/pkgs/development/libraries/hunspell/default.nix b/pkgs/development/libraries/hunspell/default.nix
index 3728c05e516..18e32585ce2 100644
--- a/pkgs/development/libraries/hunspell/default.nix
+++ b/pkgs/development/libraries/hunspell/default.nix
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
   buildInputs = [ ncurses readline ];
   nativeBuildInputs = [ autoreconfHook ];
 
+  patches = [ ./0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch ];
+
   postPatch = ''
     patchShebangs tests
   '';