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