@@ -0,0 +1,36 @@
1+{ lib
2+, stdenv
3+, fetchzip
4+, openjdk8
5+, makeWrapper
6+}:
7+
8+
9+stdenv.mkDerivation rec {
10+ pname = "kaitai-struct-compiler";
11+ version = "0.9";
12+
13+ src = fetchzip {
14+ url = "https://github.com/kaitai-io/kaitai_struct_compiler/releases/download/${version}/kaitai-struct-compiler-${version}.zip";
15+ sha256 = "sha256-2HSasigpJDuWNejNVklnpQwaA4MC030S9taF/7YvzgY=";
16+ };
17+
18+ nativeBuildInputs = [ makeWrapper ];
19+
20+ installPhase = ''
21+ install -D $src/bin/kaitai-struct-compiler $out/bin/kaitai-struct-compiler
22+ ln -s $out/bin/kaitai-struct-compiler $out/bin/ksc
23+ cp -R $src/lib $out/lib
24+ wrapProgram $out/bin/kaitai-struct-compiler --prefix PATH : ${lib.makeBinPath [ openjdk8 ] }
25+ '';
26+
27+ meta = with lib; {
28+ homepage = "https://github.com/kaitai-io/kaitai_struct_compiler";
29+ description =
30+ "Compiler to generate binary data parsers in C++ / C# / Go / Java / JavaScript / Lua / Perl / PHP / Python / Ruby ";
31+ license = licenses.gpl3Only;
32+ maintainers = with maintainers; [ luis ];
33+ platforms = platforms.unix;
34+ };
35+}
36+