nixpkgs-suyu/pkgs/servers/dict/wiktionary/default.nix
Barry Fishman 9287d37501 dictdDbs.wiktionary: use python3
In pkgs/servers/dict:
  * wiktionary/default.nix: change python2 -> python3
  * wiktionary/latest_version.py: decodes('utf-8') no longer needed
  * wiktionary/wiktionary2dict.py: 'import codesc' no longer needed
2023-01-09 15:35:23 -05:00

34 lines
925 B
Nix

{ lib, stdenv, fetchurl, python3, dict, glibcLocales }:
stdenv.mkDerivation rec {
pname = "dict-db-wiktionary";
version = "20220420";
src = fetchurl {
url = "https://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
sha256 = "qsha26LL2513SDtriE/0zdPX1zlnpzk1KKk+R9dSdew=";
};
nativeBuildInputs = [ python3 dict glibcLocales ];
dontUnpack = true;
installPhase = ''
mkdir -p $out/share/dictd/
cd $out/share/dictd
${python3.interpreter} -O ${./wiktionary2dict.py} "${src}"
dictzip wiktionary-en.dict
echo en_US.UTF-8 > locale
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "DICT version of English Wiktionary";
homepage = "https://en.wiktionary.org/";
maintainers = with maintainers; [ qyliss ];
platforms = platforms.all;
license = with licenses; [ cc-by-sa-30 fdl11Plus ];
};
}