2008-03-06 12:02:10 +00:00
|
|
|
{ builderDefs }:
|
|
|
|
|
2008-03-07 05:54:54 +00:00
|
|
|
let makeDictdDB = _src: _name: _subdir: _locale:
|
2008-08-19 06:54:09 +01:00
|
|
|
with builderDefs;
|
2008-11-04 21:24:10 +00:00
|
|
|
let localDefs = builderDefs.passthru.function (rec {
|
2008-03-06 04:39:05 +00:00
|
|
|
src=_src;
|
2009-05-20 00:25:58 +01:00
|
|
|
doInstall = fullDepEntry (''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/share/dictd
|
2008-03-06 12:02:10 +00:00
|
|
|
tar xf ${src}
|
|
|
|
cp $(ls ./${_subdir}/*.{dict*,index} || true) $out/share/dictd
|
2008-03-07 05:54:54 +00:00
|
|
|
echo "${_locale}" >$out/share/dictd/locale
|
2008-03-06 04:39:05 +00:00
|
|
|
'') ["minInit" "addInputs" "defEnsureDir"];
|
|
|
|
|
|
|
|
buildInputs = [];
|
|
|
|
configureFlags = [];
|
2008-08-19 06:54:09 +01:00
|
|
|
});
|
2008-03-06 04:39:05 +00:00
|
|
|
in with localDefs;
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "dictd-db-${_name}";
|
2008-03-07 05:54:54 +00:00
|
|
|
locale = _locale;
|
|
|
|
dbName = _name;
|
2008-03-06 04:39:05 +00:00
|
|
|
builder = writeScript (name + "-builder")
|
|
|
|
(textClosure localDefs
|
|
|
|
[doInstall doForceShare doPropagate]);
|
|
|
|
meta = {
|
2009-03-03 13:27:40 +00:00
|
|
|
description = "${name} dictionary for dictd";
|
2008-03-06 04:39:05 +00:00
|
|
|
};
|
|
|
|
};
|
2008-03-06 12:02:10 +00:00
|
|
|
# Probably a bug in some FreeDict release files, but easier to trivially
|
|
|
|
# work around than report. Not that it can cause any other problems..
|
2008-03-07 05:54:54 +00:00
|
|
|
makeDictdDBFreedict = _src: _name: _locale: makeDictdDB _src _name "{.,bin}" _locale;
|
2008-08-19 06:54:09 +01:00
|
|
|
fetchurl = builderDefs.fetchurl;
|
2008-03-06 12:02:10 +00:00
|
|
|
|
2008-03-06 04:39:05 +00:00
|
|
|
in
|
2008-03-06 12:02:10 +00:00
|
|
|
|
2008-03-07 07:30:56 +00:00
|
|
|
rec {
|
2008-03-06 04:39:05 +00:00
|
|
|
nld2eng = makeDictdDBFreedict (fetchurl {
|
|
|
|
url = http://prdownloads.sourceforge.net/freedict/nld-eng.tar.gz;
|
|
|
|
sha256 = "1vhw81pphb64fzsjvpzsnnyr34ka2fxizfwilnxyjcmpn9360h07";
|
2008-03-07 05:54:54 +00:00
|
|
|
}) "nld-eng" "nl_NL";
|
2008-03-06 04:39:05 +00:00
|
|
|
eng2nld = makeDictdDBFreedict (fetchurl {
|
2016-02-28 12:07:42 +00:00
|
|
|
url = mirror://sourceforge/freedict/eng-nld.tar.gz;
|
2008-03-06 04:39:05 +00:00
|
|
|
sha256 = "0rcg28ldykv0w2mpxc6g4rqmfs33q7pbvf68ssy1q9gpf6mz7vcl";
|
2008-03-07 05:54:54 +00:00
|
|
|
}) "eng-nld" "en_UK";
|
2008-03-06 12:02:10 +00:00
|
|
|
eng2rus = makeDictdDBFreedict (fetchurl {
|
2016-02-28 12:07:42 +00:00
|
|
|
url = mirror://sourceforge/freedict/eng-rus.tar.gz;
|
2008-03-06 04:39:05 +00:00
|
|
|
sha256 = "15409ivhww1wsfjr05083pv6mg10bak8v5pg1wkiqybk7ck61rry";
|
2008-03-07 05:54:54 +00:00
|
|
|
}) "eng-rus" "en_UK";
|
2008-03-06 12:02:10 +00:00
|
|
|
fra2eng = makeDictdDBFreedict (fetchurl {
|
2016-02-28 12:07:42 +00:00
|
|
|
url = mirror://sourceforge/freedict/fra-eng.tar.gz;
|
2008-03-06 04:39:05 +00:00
|
|
|
sha256 = "0sdd88s2zs5whiwdf3hd0s4pzzv75sdsccsrm1wxc87l3hjm85z3";
|
2008-03-07 05:54:54 +00:00
|
|
|
}) "fra-eng" "fr_FR";
|
2008-03-06 12:02:10 +00:00
|
|
|
eng2fra = makeDictdDBFreedict (fetchurl {
|
2016-02-28 12:07:42 +00:00
|
|
|
url = mirror://sourceforge/freedict/eng-fra.tar.gz;
|
2008-03-06 04:39:05 +00:00
|
|
|
sha256 = "0fi6rrnbqnhc6lq8d0nmn30zdqkibrah0mxfg27hsn9z7alwbj3m";
|
2008-03-07 05:54:54 +00:00
|
|
|
}) "eng-fra" "en_UK";
|
2008-03-07 07:30:56 +00:00
|
|
|
mueller_eng2rus_pkg = makeDictdDB (fetchurl {
|
2016-02-28 12:07:42 +00:00
|
|
|
url = mirror://sourceforge/mueller-dict/mueller-dict-3.1.tar.gz;
|
2008-03-06 04:39:05 +00:00
|
|
|
sha256 = "04r5xxznvmcb8hkxqbjgfh2gxvbdd87jnhqn5gmgvxxw53zpwfmq";
|
2008-03-07 05:54:54 +00:00
|
|
|
}) "mueller-eng-rus" "mueller-dict-*/dict" "en_UK";
|
2008-03-07 07:30:56 +00:00
|
|
|
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";
|
|
|
|
};
|
2008-03-06 12:02:10 +00:00
|
|
|
}
|