kaitai-struct-compiler 0.7 (new formula) (#20491)
Kaitai is a compiler for generating binary data parsers in a target language
This commit is contained in:
parent
19f6cb330c
commit
2de56dcb01
1 changed files with 33 additions and 0 deletions
33
Formula/kaitai-struct-compiler.rb
Normal file
33
Formula/kaitai-struct-compiler.rb
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
class KaitaiStructCompiler < Formula
|
||||||
|
desc "Compiler for generating binary data parsers"
|
||||||
|
homepage "http://kaitai.io/"
|
||||||
|
url "https://bintray.com/artifact/download/kaitai-io/universal/0.7/kaitai-struct-compiler-0.7.zip"
|
||||||
|
sha256 "2fdd2646ea019bbf55be5bc27f24b037a7152514dbafbb7cfcdaf27a1d190045"
|
||||||
|
|
||||||
|
bottle :unneeded
|
||||||
|
|
||||||
|
depends_on :java => "1.8+"
|
||||||
|
|
||||||
|
def install
|
||||||
|
libexec.install Dir["lib/*"]
|
||||||
|
|
||||||
|
(bin/"kaitai-struct-compiler").write <<~EOS
|
||||||
|
#!/bin/bash
|
||||||
|
java -cp "#{libexec}/*" io.kaitai.struct.JavaMain "$@"
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
|
test do
|
||||||
|
(testpath/"Test.ksy").write <<~EOS
|
||||||
|
meta:
|
||||||
|
id: test
|
||||||
|
endian: le
|
||||||
|
file-extension: test
|
||||||
|
seq:
|
||||||
|
- id: header
|
||||||
|
type: u4
|
||||||
|
EOS
|
||||||
|
system bin/"kaitai-struct-compiler", "Test.ksy", "-t", "java", "-d", testpath
|
||||||
|
assert_predicate testpath/"src/Test.java", :exist?
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue