2021-03-25 12:14:44 +01:00
|
|
|
{ lib, stdenv, fetchurl, python2, dict, glibcLocales }:
|
2021-02-11 17:25:11 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dict-db-wiktionary";
|
2021-09-11 17:52:17 +02:00
|
|
|
version = "20210901";
|
2021-02-11 17:25:11 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
|
2021-09-11 17:52:17 +02:00
|
|
|
sha256 = "S87E0aAFITOTugvsXOmbq8+P/LS2J+GmFvJYeYj79PM=";
|
2021-02-11 17:25:11 +01:00
|
|
|
};
|
|
|
|
|
2021-07-27 10:51:14 +02: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-11 17:25:11 +01:00
|
|
|
|
2021-02-11 17:43:36 +01:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-02-11 17:25:11 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "DICT version of English Wiktionary";
|
2021-07-27 10:51:14 +02:00
|
|
|
homepage = "https://en.wiktionary.org/";
|
2021-02-11 17:25:11 +01:00
|
|
|
maintainers = with maintainers; [ qyliss ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = with licenses; [ cc-by-sa-30 fdl11Plus ];
|
|
|
|
};
|
|
|
|
}
|