diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-08-17 17:43:15 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-08-17 17:44:37 +0200 |
commit | 73f1c44d18ceebd6e5a58b430adca41bb5e3fefb (patch) | |
tree | 7a2e0f5f45c26958e422394af8fb5ee3aefbdd0e /community/jruby/APKBUILD | |
parent | 5eb15b8927fc8bed20344fa52c43d50cb1051ce6 (diff) | |
download | aports-73f1c44d18ceebd6e5a58b430adca41bb5e3fefb.tar.bz2 aports-73f1c44d18ceebd6e5a58b430adca41bb5e3fefb.tar.xz |
community/jruby: move from testing
Diffstat (limited to 'community/jruby/APKBUILD')
-rw-r--r-- | community/jruby/APKBUILD | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/community/jruby/APKBUILD b/community/jruby/APKBUILD new file mode 100644 index 0000000000..59bd570fa1 --- /dev/null +++ b/community/jruby/APKBUILD @@ -0,0 +1,153 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +# Note: This abuild excludes Truffle, because it's still experimental, +# so it's probably not much usable for regular users. +pkgname=jruby +pkgver=9.1.2.0 +pkgrel=0 +pkgdesc="An implementation of Ruby on the JVM" +url="http://jruby.org" +# openjdk8 is currently built only for x86* +arch="x86 x86_64" +license="EPL GPL-2 LGPL-2.1 custom" +# libc6-compat: https://github.com/jnr/jnr-posix/issues/73 +depends="$pkgname-libs java-jffi-native>=1.2 libc6-compat>=1.1.12-r5 openjdk8-jre-base" +makedepends="openjdk8 zip" +subpackages="$pkgname-irb $pkgname-minitest $pkgname-rake $pkgname-rdoc + $pkgname-readline $pkgname-testunit $pkgname-libs" +# jruby (launch script): https://github.com/jruby/jruby/pull/1860 +source="https://s3.amazonaws.com/jruby.org/downloads/$pkgver/$pkgname-bin-$pkgver.tar.gz + jruby" +builddir="$srcdir/$pkgname-$pkgver" + +_destdir="/usr/share/$pkgname" +_bindir="$_destdir/bin" +_rubydir="$_destdir/lib/ruby" +_gemdir="$_rubydir/gems/shared" +_stdlibdir="$_rubydir/stdlib" + +case "$CARCH" in +arm*) _arch=arm;; +x86) _arch=i386;; +*) _arch="$CARCH";; +esac + +prepare() { + cd "$builddir/bin" + rm *.bat *.dll *.exe + rm jirb_swing jruby jruby+truffle jruby200.sh jruby.* + + cd "$builddir/lib/ruby/stdlib" + rm -r win32 Win32API.rb + find ./ffi/platform -type d -mindepth 1 ! -name "$_arch-linux" -exec rm -r {} + + + # Remove useless native binaries from JARs. + zip -qd jline/jline/*/jline-*.jar META-INF/native/* + zip -qd "$builddir"/lib/jruby.jar jni/* +} + +package() { + cd "$builddir" + + install -m644 -D "$builddir"/lib/jruby.jar \ + "$pkgdir"$_destdir/lib/jruby.jar || return 1 + + install -m755 -D "$srcdir"/jruby "$pkgdir"$_bindir/jruby || return 1 + + # Some of the below copied files will be moved to subpackages by split functions. + + install -dm755 "$pkgdir"$_rubydir + cp -r lib/ruby/gems lib/ruby/stdlib "$pkgdir"$_destdir/lib/ruby/ || return 1 + + cp bin/* "$pkgdir"$_bindir/ || return 1 + + install -dm755 "$pkgdir"/usr/bin + local file; for file in jgem jirb jruby jrubyc; do + ln -sf $_bindir/$file "$pkgdir"/usr/bin/$file || return 1 + done + + install -m644 -D COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING +} + +irb() { + pkgdesc="Interactive Ruby console" + depends="$pkgname $pkgname-readline" + + _mvgem irb + _mv $_bindir/irb usr/bin/jirb +} + +minitest() { + pkgdesc="Ruby testing tool supporting TDD, BDD, mocking, and benchmarking" + depends="$pkgname" + + _mvgem minitest +} + +rake() { + pkgdesc="Ruby based make-like utility." + depends="$pkgname" + + _mvgem rake || return 1 + _mv $_bindir/rake +} + +rdoc() { + pkgdesc="Ruby documentation tool" + depends="$pkgname $pkgname-irb" + + _mvgem rdoc || return 1 + _mv $_bindir/rdoc $_bindir/ri +} + +readline() { + pkgdesc="Readline support for JRuby" + depends="$pkgname java-jansi-native" + + _mv $_stdlibdir/jline || return 1 + mv "$pkgdir"$_stdlibdir/readline* "$subpkgdir"$_stdlibdir/ +} + +testunit() { + pkgdesc="Legacy xUnit family unit testing framework for Ruby." + depends="$pkgname" + + _mvgem test-unit || return 1 + _mv $_stdlibdir/test $_bindir/testrb +} + +libs() { + pkgdesc="JRuby's standard libraries" + depends="" + + _mv $_rubydir/gems $_rubydir/stdlib +} + + +_mv() { + local path; for path in "$@"; do + mkdir -p "$subpkgdir"/${path%/*} + mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/ || return 1 + done +} + +_mvgem() { + local name="$1" + local file + + cd "$pkgdir" + for file in ./$_stdlibdir/$name.rb \ + ./$_stdlibdir/$name \ + ./$_gemdir/gems/$name-* \ + ./$_gemdir/specifications/default/$name-*; do + [ -e "$pkgdir"/$file ] || continue + _mv "$file" || return 1 + done +} + +md5sums="749bb917dde9666e365e12bbe776a5c2 jruby-bin-9.1.2.0.tar.gz +7e6d8f6168f4a69109ea9d14e3e9f874 jruby" +sha256sums="60598a465883ab4c933f805de4a7f280052bddc793b95735465619c03ca43f35 jruby-bin-9.1.2.0.tar.gz +51794ecefb0d8fd3084ffb10867e2feffc9ccfadb45021af68520cf75fe58590 jruby" +sha512sums="cc6b1e1a2907c128dd04edf9da11933a54bbed5e861ab6f0208505bca5aa2aa9d9acdd04bfde65824346fbb435584081fc8ec2e2e9a3aeea1bef8047915e0c61 jruby-bin-9.1.2.0.tar.gz +d0f19f791274f00f5b35a5e9a5dfe885d58330ebd3fd959f7325e545357497609403b5646988651265d08ac7a08cfec8b88ec260da558bcb0db623d9b8ce5a20 jruby" |