default.nix (997B)
1 { 2 lib, 3 stdenvNoCC, 4 fetchFromGitHub, 5 dict, 6 pandoc, 7 stardict-tools, 8 }: 9 10 stdenvNoCC.mkDerivation { 11 pname = "it-sanasto"; 12 version = "2020-02-27"; 13 14 src = fetchFromGitHub { 15 owner = "TimoSalomaki"; 16 repo = "IT-sanasto"; 17 rev = "e31974edd50a50db6ef1b95aab81a18f33800e67"; 18 hash = "sha256-+YLKG4kqflWkRdrER0A7GRYXluZpuf1TO0zyk3gVzU4="; 19 }; 20 21 nativeBuildInputs = [ 22 dict 23 pandoc 24 stardict-tools 25 ]; 26 27 buildPhase = '' 28 for i in *.md; do 29 pandoc -f markdown -t html -s $i | awk -F "</*td>" '/<\/*td>.*/ {print $2}' 30 done | paste -d"#" - - - | sed 's/#/\t/;s/#/\\n/' > it-sanasto.tab 31 32 stardict-tabfile it-sanasto.tab 33 ''; 34 35 installPhase = "install -Dm644 *.{dict*,idx,ifo} -t $out"; 36 37 meta = { 38 description = "IT-alan englanti-suomi -sanasto"; 39 homepage = "https://github.com/TimoSalomaki/IT-sanasto"; 40 license = lib.licenses.mit; 41 maintainers = [ lib.maintainers.sikmir ]; 42 platforms = lib.platforms.all; 43 skip.ci = true; 44 }; 45 }