mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 00:10:30 +00:00
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:
parent
e72f99c1c0
commit
c7c77ab029
|
@ -91,5 +91,5 @@ in rec {
|
|||
locale = "en_UK";
|
||||
};
|
||||
wordnet = callPackage ./dictd-wordnet.nix {};
|
||||
wiktionary = callPackage ./dictd-wiktionary.nix {};
|
||||
wiktionary = callPackage ./wiktionary {};
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
8
pkgs/servers/dict/wiktionary/builder.sh
Normal file
8
pkgs/servers/dict/wiktionary/builder.sh
Normal 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
|
23
pkgs/servers/dict/wiktionary/default.nix
Normal file
23
pkgs/servers/dict/wiktionary/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue