2021-01-15 07:07:56 +00:00
|
|
|
{lib, stdenv, fetchurl, python, dict, glibcLocales, writeScript}:
|
2012-10-27 22:02:44 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-10-19 07:31:49 +01:00
|
|
|
version = "20161001";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "dict-db-wiktionary";
|
2012-10-27 22:02:44 +01:00
|
|
|
data = fetchurl {
|
|
|
|
url = "http://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
|
2016-10-19 07:31:49 +01:00
|
|
|
sha256 = "0g3k7kxp2nzg0v56i4cz253af3aqvhn1lwkys2fnam51cn3yqm7m";
|
2012-10-27 22:02:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
convert = ./wiktionary2dict.py;
|
|
|
|
buildInputs = [python dict glibcLocales];
|
|
|
|
|
|
|
|
builder = writeScript "wiktionary-builder.sh" ''
|
|
|
|
source $stdenv/setup
|
|
|
|
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/share/dictd/
|
2012-10-27 22:02:44 +01: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";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://en.wiktionary.org/";
|
2018-01-17 05:13:23 +00:00
|
|
|
maintainers = [ ];
|
2021-01-15 07:07:56 +00:00
|
|
|
platforms = lib.platforms.all;
|
2012-10-27 22:02:44 +01:00
|
|
|
};
|
|
|
|
}
|