nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit d099ef13790c1c714112dabb10b20577e70731ef
parent 3c7b697f5f676a3bf4fa9c292b90363b760218e6
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Wed,  2 Sep 2020 22:03:07 +0300

Add it-sanasto

Diffstat:
Mnix/sources.json | 14++++++++++++++
Apkgs/data/dicts/it-sanasto/default.nix | 31+++++++++++++++++++++++++++++++
Mpkgs/default.nix | 1+
3 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/nix/sources.json b/nix/sources.json @@ -400,6 +400,20 @@ "url": "https://github.com/viva64/how-to-use-pvs-studio-free/archive/182a5e730128755b12f44f39d8254e88397c9cce.tar.gz", "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" }, + "it-sanasto": { + "branch": "master", + "builtin": false, + "date": "2020-02-27T16:11:28Z", + "description": "IT-alan englanti-suomi -sanasto", + "homepage": "https://github.com/HankiDesign/IT-sanasto", + "owner": "HankiDesign", + "repo": "IT-sanasto", + "rev": "e31974edd50a50db6ef1b95aab81a18f33800e67", + "sha256": "0knd2mw97wjc7d9zvfb9wsb1f5hr7d04gi6s8nj5aziai4dwm0pr", + "type": "tarball", + "url": "https://github.com/HankiDesign/IT-sanasto/archive/e31974edd50a50db6ef1b95aab81a18f33800e67.tar.gz", + "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" + }, "jsonseq": { "branch": "master", "builtin": false, diff --git a/pkgs/data/dicts/it-sanasto/default.nix b/pkgs/data/dicts/it-sanasto/default.nix @@ -0,0 +1,31 @@ +{ stdenvNoCC, lib, pandoc, stardict-tools, sources }: +let + pname = "it-sanasto"; + date = lib.substring 0 10 sources.it-sanasto.date; + version = "unstable-" + date; +in +stdenvNoCC.mkDerivation { + inherit pname version; + src = sources.it-sanasto; + + nativeBuildInputs = [ pandoc stardict-tools ]; + + buildPhase = '' + for i in *.md; do + pandoc -f markdown -t html -s $i | awk -F "</*td>" '/<\/*td>.*/ {print $2}' + done | paste -d"#" - - - | sed 's/#/\t/;s/#/\\n/' > ${pname}.tab + + stardict-tabfile ${pname}.tab + ''; + + installPhase = '' + install -Dm644 ${pname}.{dict,idx,ifo} -t $out + ''; + + meta = with lib; { + inherit (sources.it-sanasto) description homepage; + license = licenses.mit; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -48,6 +48,7 @@ lib.makeScope newScope ( ### DATA huzheng = callPackage ./data/dicts/huzheng { }; + it-sanasto = callPackage ./data/dicts/it-sanasto { }; wiktionary = callPackage ./data/dicts/wiktionary { }; gpsmap64 = callPackage ./data/firmwares/gpsmap64 { };