···
/* hunspell dictionaries */
3
-
{ stdenv, fetchurl, unzip }:
3
+
{ stdenv, fetchurl, fetchFromGitHub, unzip, coreutils, bash, which, zip }:
10
-
{ name, src, meta, readmeFile, dictFileName, ... }:
12
-
isFrench = hasSuffix "fr_" dictFileName;
13
-
isItaly = hasSuffix "it_" dictFileName;
14
-
isSpanish = hasSuffix "es_" dictFileName;
15
-
isEnglish = hasSuffix "en_" dictFileName;
17
-
stdenv.mkDerivation rec {
18
-
inherit name src meta;
19
-
buildInputs = [ unzip ];
21
-
phases = "unpackPhase installPhase" + (if isItaly then "patchPhase" else "");
22
-
unpackCmd = "unzip $src ${readmeFile} ${dictFileName}.dic ${dictFileName}.aff";
23
-
prePatch = if isItaly then ''
24
-
# Fix dic file empty lines (FS#22275)
25
-
sed '/^\/$/d' -i it_IT.dic
8
+
{ name, readmeFile, dictFileName, ... }@args:
9
+
stdenv.mkDerivation (rec {
install -dm755 "$out/share/hunspell"
···
install -dm755 "$out/share/doc"
install -m644 ${readmeFile} $out/share/doc/${name}.txt
27
+
{ shortName, shortDescription, dictFileName }:
29
+
inherit dictFileName;
31
+
name = "hunspell-dict-${shortName}-rla-${version}";
32
+
readmeFile = "README.txt";
33
+
src = fetchFromGitHub {
36
+
rev = "v${version}";
37
+
sha256 = "0n9ms092k7vg7xpd3ksadxydbrizkb7js7dfxr08nbnnb9fgy0i8";
39
+
meta = with stdenv.lib; {
40
+
description = "Hunspell dictionary for ${shortDescription} from rla";
41
+
homepage = https://github.com/sbosio/rla-es;
42
+
license = with licenses; [ gpl3 lgpl3 mpl11 ];
43
+
maintainers = with maintainers; [ renzo ];
44
+
platforms = platforms.all;
46
+
phases = "unpackPhase patchPhase buildPhase installPhase";
47
+
buildInputs = [ bash coreutils unzip which zip ];
49
+
substituteInPlace ortograf/herramientas/make_dict.sh \
50
+
--replace /bin/bash bash \
51
+
--replace /dev/stderr stderr.log
53
+
substituteInPlace ortograf/herramientas/remover_comentarios.sh \
54
+
--replace /bin/bash bash \
57
+
cd ortograf/herramientas
58
+
bash -x ./make_dict.sh -l ${dictFileName} -2
59
+
unzip ${dictFileName}.zip \
60
+
${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
{ shortName, shortDescription, longDescription, dictFileName }:
···
maintainers = with maintainers; [ renzo ];
platforms = platforms.all;
83
+
buildInputs = [ unzip ];
84
+
phases = "unpackPhase installPhase";
87
+
unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
···
maintainers = with maintainers; [ renzo ];
platforms = platforms.all;
105
+
buildInputs = [ unzip ];
106
+
phases = "unpackPhase installPhase";
109
+
unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
113
+
mkDictFromLinguistico =
{ shortName, shortDescription, dictFileName, src }:
inherit src dictFileName;
···
maintainers = with maintainers; [ renzo ];
platforms = platforms.all;
126
+
buildInputs = [ unzip ];
127
+
phases = "unpackPhase patchPhase installPhase";
130
+
# Fix dic file empty lines (FS#22275)
131
+
sed '/^\/$/d' -i ${dictFileName}.dic
134
+
unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
···
217
+
es-any = mkDictFromRla {
218
+
shortName = "es-any";
219
+
shortDescription = "Spanish (any variant)";
220
+
dictFileName = "es_ANY";
223
+
es-ar = mkDictFromRla {
224
+
shortName = "es-ar";
225
+
shortDescription = "Spanish (Argentina)";
226
+
dictFileName = "es_AR";
229
+
es-bo = mkDictFromRla {
230
+
shortName = "es-bo";
231
+
shortDescription = "Spanish (Bolivia)";
232
+
dictFileName = "es_BO";
235
+
es-cl = mkDictFromRla {
236
+
shortName = "es-cl";
237
+
shortDescription = "Spanish (Chile)";
238
+
dictFileName = "es_CL";
241
+
es-co = mkDictFromRla {
242
+
shortName = "es-co";
243
+
shortDescription = "Spanish (Colombia)";
244
+
dictFileName = "es_CO";
247
+
es-cr = mkDictFromRla {
248
+
shortName = "es-cr";
249
+
shortDescription = "Spanish (Costra Rica)";
250
+
dictFileName = "es_CR";
253
+
es-cu = mkDictFromRla {
254
+
shortName = "es-cu";
255
+
shortDescription = "Spanish (Cuba)";
256
+
dictFileName = "es_CU";
259
+
es-do = mkDictFromRla {
260
+
shortName = "es-do";
261
+
shortDescription = "Spanish (Dominican Republic)";
262
+
dictFileName = "es_DO";
265
+
es-ec = mkDictFromRla {
266
+
shortName = "es-ec";
267
+
shortDescription = "Spanish (Ecuador)";
268
+
dictFileName = "es_EC";
271
+
es-es = mkDictFromRla {
272
+
shortName = "es-es";
273
+
shortDescription = "Spanish (Spain)";
274
+
dictFileName = "es_ES";
277
+
es-gt = mkDictFromRla {
278
+
shortName = "es-gt";
279
+
shortDescription = "Spanish (Guatemala)";
280
+
dictFileName = "es_GT";
283
+
es-hn = mkDictFromRla {
284
+
shortName = "es-hn";
285
+
shortDescription = "Spanish (Honduras)";
286
+
dictFileName = "es_HN";
289
+
es-mx = mkDictFromRla {
290
+
shortName = "es-mx";
291
+
shortDescription = "Spanish (Mexico)";
292
+
dictFileName = "es_MX";
295
+
es-ni = mkDictFromRla {
296
+
shortName = "es-ni";
297
+
shortDescription = "Spanish (Nicaragua)";
298
+
dictFileName = "es_NI";
301
+
es-pa = mkDictFromRla {
302
+
shortName = "es-pa";
303
+
shortDescription = "Spanish (Panama)";
304
+
dictFileName = "es_PA";
307
+
es-pe = mkDictFromRla {
308
+
shortName = "es-pe";
309
+
shortDescription = "Spanish (Peru)";
310
+
dictFileName = "es_PE";
313
+
es-pr = mkDictFromRla {
314
+
shortName = "es-pr";
315
+
shortDescription = "Spanish (Puerto Rico)";
316
+
dictFileName = "es_PR";
319
+
es-py = mkDictFromRla {
320
+
shortName = "es-py";
321
+
shortDescription = "Spanish (Paraguay)";
322
+
dictFileName = "es_PY";
325
+
es-sv = mkDictFromRla {
326
+
shortName = "es-sv";
327
+
shortDescription = "Spanish (El Salvador)";
328
+
dictFileName = "es_SV";
331
+
es-uy = mkDictFromRla {
332
+
shortName = "es-uy";
333
+
shortDescription = "Spanish (Uruguay)";
334
+
dictFileName = "es_UY";
337
+
es-ve = mkDictFromRla {
338
+
shortName = "es-ve";
339
+
shortDescription = "Spanish (Venezuela)";
340
+
dictFileName = "es_VE";
fr-any = mkDictFromDicollecte {
···
218
-
it-it = mkLinguistico rec {
389
+
it-it = mkDictFromLinguistico rec {
shortDescription = "Hunspell dictionary for 'Italian (Italy)' from Linguistico";