Aspell: Use the `ASPELL_CONF' environment variable instead of patching Aspell.

A related change in `/etc/profile' will be checked in in the NixOS repository.

svn path=/nixpkgs/trunk/; revision=10672
This commit is contained in:
Ludovic Courtès 2008-02-14 09:40:28 +00:00
parent d884e1d0a6
commit 3925367ca2
2 changed files with 7 additions and 37 deletions

View File

@ -10,15 +10,15 @@ stdenv.mkDerivation {
buildInputs = [perl];
patches = [
# A patch that allows additional dictionary directories to be set
# specified through the environment variable
# ASPELL_EXTRA_DICT_DIRS (comma-separated).
./dict-path.patch
];
# Note: Users should define the `ASPELL_CONF' environment variable to
# `dict-dir $HOME/.nix-profile/lib/aspell/' so that they can access
# dictionaries installed in their profile.
#
# We can't use `$out/etc/aspell.conf' for that purpose since Aspell
# doesn't expand environment variables such as `$HOME'.
meta = {
description = "A spell checker for many languages";
description = "GNU Aspell, A spell checker for many languages";
homepage = http://aspell.net/;
license = "LGPL";
};

View File

@ -1,30 +0,0 @@
diff -rc aspell-0.60.5-orig/common/info.cpp aspell-0.60.5/common/info.cpp
*** aspell-0.60.5-orig/common/info.cpp 2004-11-10 07:18:45.000000000 +0100
--- aspell-0.60.5/common/info.cpp 2007-10-23 17:30:47.000000000 +0200
***************
*** 209,214 ****
--- 209,215 ----
unsigned int name_size,
IStream & in)
{
+ char * extra_dict_dirs = getenv("ASPELL_EXTRA_DICT_DIRS");
ModuleInfoNode * * prev = &head_;
ModuleInfoNode * to_add = new ModuleInfoNode();
to_add->c_struct.name = 0;
***************
*** 246,251 ****
--- 247,260 ----
goto RETURN_ERROR;
}
}
+
+ // Add dictionaries from directories in
+ // $ASPELL_EXTRA_DICT_DIRS. Maybe this isn't the right place to do
+ // this, but it works.
+ if (extra_dict_dirs) {
+ to_add->c_struct.dict_dirs = &(to_add->dict_dirs);
+ itemize(extra_dict_dirs, to_add->dict_dirs);
+ }
while (*prev != 0 &&
(*prev)->c_struct.order_num < to_add->c_struct.order_num)