2021-03-20 04:20:00 +00:00
|
|
|
{ lib, stdenv, fetchurl, python2, dict, glibcLocales }:
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dict-db-wiktionary";
|
2021-10-06 13:57:05 +00:00
|
|
|
version = "20210920";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
|
2021-10-06 13:57:05 +00:00
|
|
|
sha256 = "UeufbpSpRL+JrU3SkhxzWJncEsrM1es88grRmFwGABk=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
# script in nixpkgs does not support python2
|
|
|
|
nativeBuildInputs = [ python2 dict glibcLocales ];
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/dictd/
|
|
|
|
cd $out/share/dictd
|
|
|
|
|
|
|
|
${python2.interpreter} -O ${./wiktionary2dict.py} "${src}"
|
|
|
|
dictzip wiktionary-en.dict
|
|
|
|
echo en_US.UTF-8 > locale
|
|
|
|
'';
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "DICT version of English Wiktionary";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://en.wiktionary.org/";
|
2021-02-13 14:23:35 +00:00
|
|
|
maintainers = with maintainers; [ qyliss ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = with licenses; [ cc-by-sa-30 fdl11Plus ];
|
|
|
|
};
|
|
|
|
}
|