3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/dict/wiktionary/default.nix

36 lines
972 B
Nix
Raw Normal View History

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