mirror of
				https://gitlab.alpinelinux.org/alpine/aports.git
				synced 2025-10-31 08:21:49 +01:00 
			
		
		
		
	The cargo vars are now set in abuild.conf by default.
Newlines done with:
    find . -name APKBUILD -exec sed -i '/^$/N;/^\n$/D' {} \;
See also: https://stackoverflow.com/a/4522043
		
	
			
		
			
				
	
	
		
			153 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			153 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| # Contributor: Jakub Jirutka <jakub@jirutka.cz>
 | |
| # Maintainer: Jakub Jirutka <jakub@jirutka.cz>
 | |
| pkgname=jruby
 | |
| pkgver=9.3.4.0
 | |
| pkgrel=0
 | |
| pkgdesc="An implementation of Ruby on the JVM"
 | |
| url="https://www.jruby.org/"
 | |
| # all arches blocked by java-jffi
 | |
| arch="noarch !armhf !armv7 !ppc64le !x86 !s390x !riscv64"
 | |
| license="EPL-2.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later AND Ruby"
 | |
| # libc6-compat: https://github.com/jnr/jnr-posix/issues/73
 | |
| depends="$pkgname-libs=$pkgver-r$pkgrel
 | |
| 	libc6-compat>=1.1.12-r5
 | |
| 	java-jffi-native>=1.2
 | |
| 	java-jre-headless
 | |
| 	"
 | |
| makedepends="openjdk11 zip"
 | |
| subpackages="
 | |
| 	$pkgname-irb
 | |
| 	$pkgname-rake
 | |
| 	$pkgname-rdoc
 | |
| 	$pkgname-readline
 | |
| 	$pkgname-webrick::noarch
 | |
| 	$pkgname-libs
 | |
| 	"
 | |
| # jruby (launch script): https://github.com/jruby/jruby/pull/1860
 | |
| source="https://s3.amazonaws.com/jruby.org/downloads/$pkgver/jruby-bin-$pkgver.tar.gz
 | |
| 	jruby
 | |
| 	"
 | |
| 
 | |
| _destdir="/usr/share/$pkgname"
 | |
| _bindir="$_destdir/bin"
 | |
| _rubydir="$_destdir/lib/ruby"
 | |
| _gemdir="$_rubydir/gems/shared"
 | |
| _stdlibdir="$_rubydir/stdlib"
 | |
| 
 | |
| prepare() {
 | |
| 	cd "$builddir"/bin
 | |
| 	rm *.bat *.dll *.exe
 | |
| 	rm jirb_swing jruby jruby.*
 | |
| 
 | |
| 	cd "$builddir"/lib/ruby/stdlib
 | |
| 	rm -r win32 Win32API.rb
 | |
| 
 | |
| 	# Remove useless native binaries from JARs.
 | |
| 	zip -qd jline/jline/*/jline-*.jar META-INF/native/*
 | |
| 	zip -qd "$builddir"/lib/jruby.jar jni/*
 | |
| 
 | |
| 	default_prepare
 | |
| }
 | |
| 
 | |
| check() (
 | |
| 	cd "$srcdir"
 | |
| 
 | |
| 	export JRUBY_HOME="$builddir"
 | |
| 	sh jruby --version
 | |
| 	sh jruby -e 'puts "Hello, world!"'
 | |
| )
 | |
| 
 | |
| package() {
 | |
| 	install -m644 -D "$builddir"/lib/jruby.jar \
 | |
| 		"$pkgdir"$_destdir/lib/jruby.jar
 | |
| 
 | |
| 	install -m755 -D "$srcdir"/jruby "$pkgdir"$_bindir/jruby
 | |
| 
 | |
| 	# 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/
 | |
| 
 | |
| 	cp bin/* "$pkgdir"$_bindir/
 | |
| 
 | |
| 	install -dm755 "$pkgdir"/usr/bin
 | |
| 	local file; for file in jgem jirb jruby jrubyc; do
 | |
| 		ln -sf $_bindir/$file "$pkgdir"/usr/bin/$file
 | |
| 	done
 | |
| 
 | |
| 	install -m644 -D COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
 | |
| }
 | |
| 
 | |
| irb() {
 | |
| 	pkgdesc="Interactive JRuby console"
 | |
| 	depends="$pkgname $pkgname-readline"
 | |
| 
 | |
| 	_mvgem irb
 | |
| 	_mv $_bindir/irb usr/bin/jirb
 | |
| }
 | |
| 
 | |
| rake() {
 | |
| 	pkgdesc="Ruby based make-like utility."
 | |
| 	depends="$pkgname"
 | |
| 
 | |
| 	_mvgem rake
 | |
| 	_mv $_bindir/rake
 | |
| }
 | |
| 
 | |
| rdoc() {
 | |
| 	pkgdesc="Ruby documentation tool"
 | |
| 	depends="$pkgname $pkgname-irb"
 | |
| 
 | |
| 	_mvgem rdoc
 | |
| 	_mv $_bindir/rdoc $_bindir/ri
 | |
| }
 | |
| 
 | |
| readline() {
 | |
| 	pkgdesc="Readline support for JRuby"
 | |
| 	depends="$pkgname java-jansi-native"
 | |
| 
 | |
| 	_mvgem jruby-readline
 | |
| 	_mv $_stdlibdir/jline
 | |
| 	mv "$pkgdir"$_stdlibdir/readline* "$subpkgdir"$_stdlibdir/
 | |
| }
 | |
| 
 | |
| webrick() {
 | |
| 	pkgdesc="HTTP server toolkit for JRuby"
 | |
| 	depends="$pkgname"
 | |
| 
 | |
| 	_mvgem webrick
 | |
| }
 | |
| 
 | |
| 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%/*}/
 | |
| 	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"
 | |
| 	done
 | |
| }
 | |
| 
 | |
| sha512sums="
 | |
| 6b09decf412a76578179cefaabf01cc8740f70ab5324954e6aa43b1d8b81c37db7a99b1f94d6ced2b459f1c44c3086892b9a2c06b3ea838baf75a8fd5e0447c8  jruby-bin-9.3.4.0.tar.gz
 | |
| 836a73b46b9ea107b3ab51da9fea73cecd8664b7d72c4024c491c67312e6c094c215aa9d22d1e3f9f2402816bc0200dd4060d1895f4ba28424228d6cdbac8a9d  jruby
 | |
| "
 |