2012-10-27 23:02:44 +02:00
|
|
|
{stdenv, fetchurl, python, dict, glibcLocales, writeScript}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2014-01-29 22:11:35 +01:00
|
|
|
version = "20140118";
|
2012-10-27 23:02:44 +02:00
|
|
|
name = "dict-db-wiktionary-${version}";
|
|
|
|
data = fetchurl {
|
|
|
|
url = "http://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
|
2014-01-29 22:11:35 +01:00
|
|
|
sha256 = "892c9fc16b248a31e2d3e42590267161c1b899b31fe923eb1ede1deb6d24cfa8";
|
2012-10-27 23:02:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
convert = ./wiktionary2dict.py;
|
|
|
|
buildInputs = [python dict glibcLocales];
|
|
|
|
|
|
|
|
builder = writeScript "wiktionary-builder.sh" ''
|
|
|
|
source $stdenv/setup
|
|
|
|
|
2014-06-30 14:56:10 +02:00
|
|
|
mkdir -p $out/share/dictd/
|
2012-10-27 23:02:44 +02:00
|
|
|
cd $out/share/dictd
|
|
|
|
|
|
|
|
python -O ${convert} ${data}
|
|
|
|
dictzip wiktionary-en.dict
|
|
|
|
echo en_US.UTF-8 > locale
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "DICT version of English Wiktionary";
|
|
|
|
homepage = http://en.wiktionary.org/;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.mornfall ];
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|