1 { lib, stdenv, fetchurl, fetchpatch, fetchzip, perl, ncurses
4 , aspell, glibc, runCommand
6 , searchNixProfiles ? true
11 # Source for u-deva.cmap and u-deva.cset: use the Marathi
12 # dictionary like Debian does.
13 devaMapsSource = fetchzip {
14 name = "aspell-u-deva";
15 url = "https://ftp.gnu.org/gnu/aspell/dict/mr/aspell6-mr-0.10-0.tar.bz2";
16 sha256 = "1v8cdl8x2j1d4vbvsq1xrqys69bbccd6mi03fywrhkrrljviyri1";
21 stdenv.mkDerivation rec {
26 url = "mirror://gnu/aspell/aspell-${version}.tar.gz";
27 sha256 = "1wi60ankalmh8ds7nplz434jd7j94gdvbahdwsr539rlad8pxdzr";
32 # objstack: assert that the alloc size will fit within a chunk
33 name = "CVE-2019-25051.patch";
34 url = "https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a.patch";
35 sha256 = "03z259xrk41x3j190gaprf3mqysyfgh3a04rjmch3h625vj95x39";
37 ] ++ lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
40 patch interfaces/cc/aspell.h < ${./clang.patch}
43 nativeBuildInputs = [ perl ];
44 buildInputs = [ ncurses perl ];
50 --enable-pkglibdir=$out/lib/aspell
51 --enable-pkgdatadir=$out/lib/aspell
55 # Include u-deva.cmap and u-deva.cset in the aspell package
56 # to avoid conflict between 'mr' and 'hi' dictionaries as they
57 # both include those files.
59 cp ${devaMapsSource}/u-deva.{cmap,cset} $out/lib/aspell/
63 uses-curses = runCommand "${pname}-curses" {
64 buildInputs = [ glibc ];
66 if ! ldd ${aspell}/bin/aspell | grep -q ${ncurses}
68 echo "Test failure: It does not look like aspell picked up the curses dependency."
76 description = "Spell checker for many languages";
77 homepage = "http://aspell.net/";
78 license = lib.licenses.lgpl2Plus;
80 platforms = with lib.platforms; all;