summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron McDaniel2018-05-29 15:34:28 -0500
committerAaron McDaniel2018-05-29 15:34:28 -0500
commit1b994d34314a7dd240d009d2825ec98eb913b602 (patch)
treed970e4d72fa93e36a246b21d93b72d769a641c06
downloadaur-1b994d34314a7dd240d009d2825ec98eb913b602.tar.gz
Initial commit
-rw-r--r--.SRCINFO20
-rw-r--r--.gitignore3
-rw-r--r--PKGBUILD69
3 files changed, 92 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..d51418d2aba
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = kaitai-struct-compiler-git
+ pkgdesc = Kaitai Struct Compiler: Compiler for the Kaitai declarative binary format parsing language
+ pkgver = 0.8.r56.g078d45b
+ pkgrel = 1
+ url = http://kaitai.io
+ arch = x86_64
+ license = GPL
+ makedepends = git
+ makedepends = sbt
+ makedepends = unzip
+ makedepends = ruby-rdoc
+ depends = scala
+ depends = java-runtime
+ provides = kaitai-struct-compiler
+ conflicts = kaitai-struct-compiler
+ source = kaitai-struct-compiler-git::git+https://github.com/kaitai-io/kaitai_struct.git
+ md5sums = SKIP
+
+pkgname = kaitai-struct-compiler-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..c173ed6165e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+kaitai-struct-compiler**
+pkg
+src
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..a337be17a69
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,69 @@
+# Maintainer: Aaron McDaniel (mcd1992) <'aur' at the domain 'fgthou.se'>
+
+pkgname=kaitai-struct-compiler-git
+pkgver=0.8.r56.g078d45b
+pkgrel=1
+pkgdesc='Kaitai Struct Compiler: Compiler for the Kaitai declarative binary format parsing language'
+url='http://kaitai.io'
+arch=('x86_64')
+license=('GPL')
+depends=('scala' 'java-runtime')
+makedepends=('git' 'sbt' 'unzip' 'ruby-rdoc')
+optdepends=()
+backup=()
+source=("${pkgname}::git+https://github.com/kaitai-io/kaitai_struct.git")
+md5sums=('SKIP')
+provides=('kaitai-struct-compiler')
+conflicts=('kaitai-struct-compiler')
+
+pkgver() {
+ cd ${pkgname}
+ # Remove 'v' prefix on tags; prefix revision with 'r'; replace all '-' with '.'
+ git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd ${pkgname}
+
+ # Pull in compiler and example formats submodules
+ git submodule update --init compiler/ formats/
+}
+
+build() {
+ # Build the kaitai-compiler
+ cd "${srcdir}/${pkgname}/compiler"
+ sbt compilerJVM/universal:packageBin
+}
+
+package() {
+ cd "${pkgdir}"
+ mkdir -p "usr/share/${pkgname}/"
+
+ # Unzip the compiler universal .zip into a temporary directory
+ unzip "${srcdir}/${pkgname}/compiler/jvm/target/universal/kaitai-struct-compiler-*.zip" -d compiler-unzip
+
+ # Copy all files out of the unzip directory into compiler-tmp/
+ mkdir -p compiler-tmp/
+ cp -a compiler-unzip/kaitai-struct-compiler-*/* "compiler-tmp/"
+
+ # Install ksy files into usr/share
+ mv "compiler-tmp/formats" "usr/share/${pkgname}/"
+
+ # Install java jar / classes
+ mkdir -p "${pkgdir}/usr/share/java/kaitai-struct-compiler/"
+ mv compiler-tmp/lib/*.jar "${pkgdir}/usr/share/java/kaitai-struct-compiler/"
+
+ # Install binaries
+ mkdir -p "${pkgdir}/usr/bin/"
+ mv compiler-tmp/bin/* "${pkgdir}/usr/bin/"
+
+ # Patch kaitai-struct-compiler binary to point to system lib instead of installdir lib
+ sed -ir 's/^declare -r lib_dir=.*/declare -r lib_dir="\/usr\/share\/java\/kaitai-struct-compiler"/' "${pkgdir}/usr/bin/kaitai-struct-compiler"
+
+ # Remove temporary directories
+ rm -rf "${pkgdir}/compiler-unzip"
+ rm -rf "${pkgdir}/compiler-tmp"
+
+ # Cleanup unused files
+ find "${pkgdir}" -type f -iname "*.bat" -delete
+}