2021-01-15 07:07:56 +00:00
|
|
|
{ lib, stdenv, fetchurl, callPackage }:
|
2008-03-06 12:02:10 +00:00
|
|
|
|
2016-08-31 08:41:12 +00:00
|
|
|
let
|
|
|
|
# Probably a bug in some FreeDict release files, but easier to trivially
|
|
|
|
# work around than report. Not that it can cause any other problems..
|
|
|
|
makeDictdDBFreedict = src: name: locale:
|
|
|
|
makeDictdDB src name "{.,bin}" locale;
|
2008-03-06 04:39:05 +00:00
|
|
|
|
2016-08-31 08:41:12 +00:00
|
|
|
makeDictdDB = src: _name: _subdir: _locale:
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2016-08-31 08:41:12 +00:00
|
|
|
name = "dictd-db-${_name}";
|
|
|
|
inherit src;
|
|
|
|
locale = _locale;
|
|
|
|
dbName = _name;
|
2021-07-18 21:42:48 +00:00
|
|
|
dontBuild = true;
|
2016-08-31 08:41:12 +00:00
|
|
|
unpackPhase = ''
|
|
|
|
tar xf ${src}
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/dictd
|
|
|
|
cp $(ls ./${_subdir}/*.{dict*,index} || true) $out/share/dictd
|
|
|
|
echo "${_locale}" >$out/share/dictd/locale
|
|
|
|
'';
|
2008-03-06 12:02:10 +00:00
|
|
|
|
2016-08-31 08:41:12 +00:00
|
|
|
meta = {
|
|
|
|
description = "dictd-db dictionary for dictd";
|
2021-01-15 07:07:56 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2016-08-31 08:41:12 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in rec {
|
2017-01-05 17:07:22 +00:00
|
|
|
deu2eng = makeDictdDBFreedict (fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "mirror://sourceforge/freedict/deu-eng.tar.gz";
|
2017-01-05 17:07:22 +00:00
|
|
|
sha256 = "0dqrhv04g4f5s84nbgisgcfwk5x0rpincif0yfhfh4sc1bsvzsrb";
|
|
|
|
}) "deu-eng" "de_DE";
|
|
|
|
eng2deu = makeDictdDBFreedict (fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "mirror://sourceforge/freedict/eng-deu.tar.gz";
|
2017-01-05 17:07:22 +00:00
|
|
|
sha256 = "01x12p72sa3071iff3jhzga8588440f07zr56r3x98bspvdlz73r";
|
|
|
|
}) "eng-deu" "en_EN";
|
2016-08-31 08:41:12 +00:00
|
|
|
nld2eng = makeDictdDBFreedict (fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "mirror://sourceforge/freedict/nld-eng.tar.gz";
|
2016-08-31 08:41:12 +00:00
|
|
|
sha256 = "1vhw81pphb64fzsjvpzsnnyr34ka2fxizfwilnxyjcmpn9360h07";
|
|
|
|
}) "nld-eng" "nl_NL";
|
|
|
|
eng2nld = makeDictdDBFreedict (fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "mirror://sourceforge/freedict/eng-nld.tar.gz";
|
2016-08-31 08:41:12 +00:00
|
|
|
sha256 = "0rcg28ldykv0w2mpxc6g4rqmfs33q7pbvf68ssy1q9gpf6mz7vcl";
|
|
|
|
}) "eng-nld" "en_UK";
|
|
|
|
eng2rus = makeDictdDBFreedict (fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "mirror://sourceforge/freedict/eng-rus.tar.gz";
|
2016-08-31 08:41:12 +00:00
|
|
|
sha256 = "15409ivhww1wsfjr05083pv6mg10bak8v5pg1wkiqybk7ck61rry";
|
|
|
|
}) "eng-rus" "en_UK";
|
|
|
|
fra2eng = makeDictdDBFreedict (fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "mirror://sourceforge/freedict/fra-eng.tar.gz";
|
2016-08-31 08:41:12 +00:00
|
|
|
sha256 = "0sdd88s2zs5whiwdf3hd0s4pzzv75sdsccsrm1wxc87l3hjm85z3";
|
|
|
|
}) "fra-eng" "fr_FR";
|
|
|
|
eng2fra = makeDictdDBFreedict (fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "mirror://sourceforge/freedict/eng-fra.tar.gz";
|
2016-08-31 08:41:12 +00:00
|
|
|
sha256 = "0fi6rrnbqnhc6lq8d0nmn30zdqkibrah0mxfg27hsn9z7alwbj3m";
|
|
|
|
}) "eng-fra" "en_UK";
|
|
|
|
mueller_eng2rus_pkg = makeDictdDB (fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "mirror://sourceforge/mueller-dict/mueller-dict-3.1.tar.gz";
|
2016-08-31 08:41:12 +00:00
|
|
|
sha256 = "04r5xxznvmcb8hkxqbjgfh2gxvbdd87jnhqn5gmgvxxw53zpwfmq";
|
|
|
|
}) "mueller-eng-rus" "mueller-dict-*/dict" "en_UK";
|
|
|
|
mueller_enru_abbr = {
|
|
|
|
outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-abbrev";
|
|
|
|
name = "mueller-abbr";
|
|
|
|
dbName = "mueller-abbr";
|
|
|
|
locale = "en_UK";
|
|
|
|
};
|
|
|
|
mueller_enru_base = {
|
|
|
|
outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-base";
|
|
|
|
name = "mueller-base";
|
|
|
|
dbName = "mueller-base";
|
|
|
|
locale = "en_UK";
|
|
|
|
};
|
|
|
|
mueller_enru_dict = {
|
|
|
|
outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-dict";
|
|
|
|
name = "mueller-dict";
|
|
|
|
dbName = "mueller-dict";
|
|
|
|
locale = "en_UK";
|
|
|
|
};
|
|
|
|
mueller_enru_geo = {
|
|
|
|
outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-geo";
|
|
|
|
name = "mueller-geo";
|
|
|
|
dbName = "mueller-geo";
|
|
|
|
locale = "en_UK";
|
|
|
|
};
|
|
|
|
mueller_enru_names = {
|
|
|
|
outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-names";
|
|
|
|
name = "mueller-names";
|
|
|
|
dbName = "mueller-names";
|
|
|
|
locale = "en_UK";
|
|
|
|
};
|
2016-10-19 06:33:10 +00:00
|
|
|
wordnet = callPackage ./dictd-wordnet.nix {};
|
2021-02-11 16:25:11 +00:00
|
|
|
wiktionary = callPackage ./wiktionary {};
|
2008-03-06 12:02:10 +00:00
|
|
|
}
|