1 { lib, stdenv, fetchFromGitHub, unzip, zip, libiconv, perl, aspell, dos2unix
2 , singleWordlist ? null
5 stdenv.mkDerivation rec {
7 version = "2020.12.07";
9 src = fetchFromGitHub {
12 rev = "rel-${version}";
13 sha256 = "sha256-J61jhpnZcXMnoGlSuSCrKDZnnyp3Snjr+fUpTVKX64g=";
17 substituteInPlace scowl/src/Makefile \
21 nativeBuildInputs = [ unzip zip perl aspell dos2unix ];
22 buildInputs = lib.optional (!stdenv.hostPlatform.isLinux) libiconv;
24 env.NIX_CFLAGS_COMPILE = "-Wno-narrowing";
28 export PERL5LIB="$PERL5LIB''${PERL5LIB:+:}$PWD/varcon"
31 postBuild = lib.optionalString (singleWordlist == null) ''
39 enableParallelBuilding = false;
41 installPhase = if singleWordlist == null then ''
44 mkdir -p "$out/share/scowl"
45 mkdir -p "$out/lib" "$out/share/hunspell" "$out/share/myspell"
46 mkdir -p "$out/share/dict"
48 cp -r scowl/speller/aspell "$out/lib/aspell"
49 cp scowl/speller/*.{aff,dic} "$out/share/hunspell"
50 ln -s "$out/share/hunspell" "$out/share/myspell/dicts"
52 cp scowl/final/* "$out/share/scowl"
56 for region in american british british_s british_z canadian australian; do
77 regcode_var="$regcode"
78 if test "$region" = british; then
82 echo $region $regcode $regcode_sz
83 for s in 10 20 30 35 40 50 55 60 70 80 90 95; do
84 ./mk-list $regcode $s > "$out/share/dict/w$region.$s"
85 ./mk-list --variants=1 $regcode_var $s > "$out/share/dict/w$region.variants.$s"
86 ./mk-list --variants=2 $regcode_var $s > "$out/share/dict/w$region.acceptable.$s"
88 ./mk-list $regcode 60 > "$out/share/dict/w$region.txt"
89 ./mk-list --variants=1 $regcode_var 60 > "$out/share/dict/w$region.variants.txt"
90 ./mk-list --variants=2 $regcode_var 80 > "$out/share/dict/w$region.scrabble.txt"
92 ./mk-list --variants=1 en-gb 60 > "$out/share/dict/words.variants.txt"
93 ./mk-list --variants=1 en-gb 80 > "$out/share/dict/words.scrabble.txt"
94 ./mk-list en-gb-ise 60 > "$out/share/dict/words.txt"
99 mkdir -p "$out/share/dict"
101 ./mk-list ${singleWordlist} > "$out/share/dict/words.txt"
105 description = "Spell checker oriented word lists";
106 license = lib.licenses.mit;
107 maintainers = [lib.maintainers.raskin];
108 platforms = lib.platforms.unix;
109 homepage = "http://wordlist.aspell.net/";