1 { lib, stdenv, fetchurl, callPackage }:
4 # Probably a bug in some FreeDict release files, but easier to trivially
5 # work around than report. Not that it can cause any other problems..
6 makeDictdDBFreedict = src: name: locale:
7 makeDictdDB src name "{.,bin}" locale;
9 makeDictdDB = src: _name: _subdir: _locale:
11 name = "dictd-db-${_name}";
20 mkdir -p $out/share/dictd
21 cp $(ls ./${_subdir}/*.{dict*,index} || true) $out/share/dictd
22 echo "${_locale}" >$out/share/dictd/locale
26 description = "dictd-db dictionary for dictd";
27 platforms = lib.platforms.linux;
31 deu2eng = makeDictdDBFreedict (fetchurl {
32 url = "mirror://sourceforge/freedict/deu-eng.tar.gz";
33 sha256 = "0dqrhv04g4f5s84nbgisgcfwk5x0rpincif0yfhfh4sc1bsvzsrb";
35 eng2deu = makeDictdDBFreedict (fetchurl {
36 url = "mirror://sourceforge/freedict/eng-deu.tar.gz";
37 sha256 = "01x12p72sa3071iff3jhzga8588440f07zr56r3x98bspvdlz73r";
39 nld2eng = makeDictdDBFreedict (fetchurl {
40 url = "mirror://sourceforge/freedict/nld-eng.tar.gz";
41 sha256 = "1vhw81pphb64fzsjvpzsnnyr34ka2fxizfwilnxyjcmpn9360h07";
43 eng2nld = makeDictdDBFreedict (fetchurl {
44 url = "mirror://sourceforge/freedict/eng-nld.tar.gz";
45 sha256 = "0rcg28ldykv0w2mpxc6g4rqmfs33q7pbvf68ssy1q9gpf6mz7vcl";
47 eng2rus = makeDictdDBFreedict (fetchurl {
48 url = "mirror://sourceforge/freedict/eng-rus.tar.gz";
49 sha256 = "15409ivhww1wsfjr05083pv6mg10bak8v5pg1wkiqybk7ck61rry";
51 fra2eng = makeDictdDBFreedict (fetchurl {
52 url = "mirror://sourceforge/freedict/fra-eng.tar.gz";
53 sha256 = "0sdd88s2zs5whiwdf3hd0s4pzzv75sdsccsrm1wxc87l3hjm85z3";
55 eng2fra = makeDictdDBFreedict (fetchurl {
56 url = "mirror://sourceforge/freedict/eng-fra.tar.gz";
57 sha256 = "0fi6rrnbqnhc6lq8d0nmn30zdqkibrah0mxfg27hsn9z7alwbj3m";
59 epo2eng = makeDictdDB (fetchurl {
60 url = "https://download.freedict.org/dictionaries/epo-eng/1.0.1/freedict-epo-eng-1.0.1.dictd.tar.xz";
61 sha256 = "095xwqfc43dnm0g74i83lg03542f064jy2xbn3qnjxiwysz9ksnz";
62 }) "epo-eng" "epo-eng" "eo";
63 jpn2eng = makeDictdDB (fetchurl {
64 url = let version = "0.1";
65 in "mirror://sourceforge/freedict/jpn-eng/${version}/freedict-jpn-eng-${version}.dictd.tar.xz";
66 sha256 = "sha256-juJBoEq7EztLZzOomc7uoZhXVaQPKoUvIxxPLB0xByc=";
67 }) "jpn-eng" "jpn-eng" "ja_JP";
68 eng2jpn = makeDictdDB (fetchurl {
69 url = let version = "2022.04.06";
70 in "https://download.freedict.org/dictionaries/eng-jpn/${version}/freedict-eng-jpn-${version}.dictd.tar.xz";
71 sha256 = "sha256-kfRT2kgbV3XKarCr4mqDRT5A1jR8M8APky5M5MFYatE=";
72 }) "eng-jpn" "eng-jpn" "en_UK";
73 mueller_eng2rus_pkg = makeDictdDB (fetchurl {
74 url = "mirror://sourceforge/mueller-dict/mueller-dict-3.1.tar.gz";
75 sha256 = "04r5xxznvmcb8hkxqbjgfh2gxvbdd87jnhqn5gmgvxxw53zpwfmq";
76 }) "mueller-eng-rus" "mueller-dict-*/dict" "en_UK";
78 outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-abbrev";
79 name = "mueller-abbr";
80 dbName = "mueller-abbr";
84 outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-base";
85 name = "mueller-base";
86 dbName = "mueller-base";
90 outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-dict";
91 name = "mueller-dict";
92 dbName = "mueller-dict";
96 outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-geo";
98 dbName = "mueller-geo";
101 mueller_enru_names = {
102 outPath = "${mueller_eng2rus_pkg}/share/dictd/mueller-names";
103 name = "mueller-names";
104 dbName = "mueller-names";
107 wordnet = callPackage ./dictd-wordnet.nix {};
108 wiktionary = callPackage ./wiktionary {};