dictdDBs.wiktionary: improve expression

* Fix style
* Move builder.sh into its own file
* Use standard "src" name for source
* Add myself as maintainer
* Add license
This commit is contained in:
Alyssa Ross 2021-02-11 16:25:11 +00:00
parent e72f99c1c0
commit c7c77ab029
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0
5 changed files with 32 additions and 32 deletions

View file

@ -91,5 +91,5 @@ in rec {
locale = "en_UK";
};
wordnet = callPackage ./dictd-wordnet.nix {};
wiktionary = callPackage ./dictd-wiktionary.nix {};
wiktionary = callPackage ./wiktionary {};
}

View file

@ -1,31 +0,0 @@
{lib, stdenv, fetchurl, python, dict, glibcLocales, writeScript}:
stdenv.mkDerivation rec {
version = "20210201";
pname = "dict-db-wiktionary";
data = fetchurl {
url = "http://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
sha256 = "0dc34cbadsg0f6lhfcyx0np7zjnlg6837piqhlvnn0b45xnzn0cs";
};
convert = ./wiktionary2dict.py;
buildInputs = [python dict glibcLocales];
builder = writeScript "wiktionary-builder.sh" ''
source $stdenv/setup
mkdir -p $out/share/dictd/
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";
homepage = "http://en.wiktionary.org/";
maintainers = [ ];
platforms = lib.platforms.all;
};
}

View file

@ -0,0 +1,8 @@
source $stdenv/setup
mkdir -p $out/share/dictd/
cd $out/share/dictd
python -O "$convert" "$src"
dictzip wiktionary-en.dict
echo en_US.UTF-8 > locale

View file

@ -0,0 +1,23 @@
{ lib, stdenv, fetchurl, python, dict, glibcLocales }:
stdenv.mkDerivation rec {
version = "20210201";
pname = "dict-db-wiktionary";
src = fetchurl {
url = "https://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
sha256 = "0dc34cbadsg0f6lhfcyx0np7zjnlg6837piqhlvnn0b45xnzn0cs";
};
convert = ./wiktionary2dict.py;
buildInputs = [ python dict glibcLocales ];
builder = ./builder.sh;
meta = with lib; {
description = "DICT version of English Wiktionary";
homepage = "http://en.wiktionary.org/";
maintainers = with maintainers; [ qyliss ];
platforms = platforms.all;
license = with licenses; [ cc-by-sa-30 fdl11Plus ];
};
}