package.nix (951B)
1 { 2 lib, 3 stdenvNoCC, 4 fetchwebarchive, 5 dict, 6 jq, 7 stardict-tools, 8 }: 9 10 stdenvNoCC.mkDerivation { 11 pname = "komputeko"; 12 version = "2021-05-28"; 13 14 __structuredAttrs = true; 15 16 src = fetchwebarchive { 17 url = "https://komputeko.net/data.json"; 18 timestamp = "20210630073336"; 19 hash = "sha256-dIvzbfqMjfogkj3Zld6lQ9PmNth712fw2lNr/OCvUEQ="; 20 }; 21 22 dontUnpack = true; 23 24 nativeBuildInputs = [ 25 dict 26 jq 27 stardict-tools 28 ]; 29 30 buildPhase = '' 31 cat $src | \ 32 jq -r '.words[]|select(has("en") and has("eo"))|[.en[0].word,([.eo[].word]|join(", "))]|@tsv' > komputeko.tsv 33 stardict-tabfile komputeko.tsv 34 ''; 35 36 installPhase = "install -Dm644 *.{dict*,idx,ifo} -t $out"; 37 38 meta = { 39 homepage = "https://komputeko.net/"; 40 description = "Prikomputila terminokolekto"; 41 maintainers = [ lib.maintainers.sikmir ]; 42 license = lib.licenses.cc-by-sa-40; 43 platforms = lib.platforms.all; 44 skip.ci = true; 45 }; 46 }
