aboutsummaryrefslogtreecommitdiffstats
path: root/community/ruby2.1
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-08-18 00:18:17 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-08-18 00:18:17 +0200
commit29b1a74db71505db76b6dc137b0127666654496b (patch)
treed8c37cf17ecb1550532ec3792045f131e54537b4 /community/ruby2.1
parent069df6eb1dca4d452e0ad5c4800531d89fd0e60d (diff)
downloadaports-29b1a74db71505db76b6dc137b0127666654496b.tar.bz2
aports-29b1a74db71505db76b6dc137b0127666654496b.tar.xz
community/ruby2.1: move from testing
Diffstat (limited to 'community/ruby2.1')
-rw-r--r--community/ruby2.1/APKBUILD183
1 files changed, 183 insertions, 0 deletions
diff --git a/community/ruby2.1/APKBUILD b/community/ruby2.1/APKBUILD
new file mode 100644
index 000000000..d46395cb5
--- /dev/null
+++ b/community/ruby2.1/APKBUILD
@@ -0,0 +1,183 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=ruby2.1
+_pkgname=ruby
+_majorver=${pkgname#ruby}
+pkgver="$_majorver.10"
+_pkgver=${pkgver/_/-}
+_abiver="$_majorver.0"
+pkgrel=0
+pkgdesc="An object-oriented language for quick and easy programming"
+url="http://www.ruby-lang.org/en/"
+arch="all"
+license="Ruby"
+depends=""
+makedepends="zlib-dev openssl-dev gdbm-dev db-dev readline-dev
+ libffi-dev coreutils yaml-dev autoconf"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-irb
+ $pkgname-rdoc $pkgname-rake $pkgname-bigdecimal
+ $pkgname-io-console:io_console $pkgname-minitest
+ $pkgname-json $pkgname-libs
+ "
+source="ftp://ftp.ruby-lang.org/pub/ruby/${pkgver%.*}/$_pkgname-$_pkgver.tar.bz2"
+options="!fhs"
+builddir="$srcdir/$_pkgname-$_pkgver"
+
+_gemdir="/usr/lib/ruby/gems/$_abiver"
+_rubydir="/usr/lib/ruby/$_abiver"
+_chost="${CHOST/-alpine-/-}"
+
+case "$CARCH" in
+ x86) _arch="i386";;
+ *) _arch="$CARCH";;
+esac
+
+prepare() {
+ default_prepare || return 1
+
+ cd "$builddir"
+ autoconf
+}
+
+build() {
+ cd "$builddir"
+
+ # -fomit-frame-pointer makes ruby segfault, see gentoo bug #150413
+ # In many places aliasing rules are broken; play it safe
+ # as it's risky with newer compilers to leave it as it is.
+ export CFLAGS="$CFLAGS -fno-omit-frame-pointer -fno-strict-aliasing"
+
+ # ruby saves path to install. we want use $PATH
+ export INSTALL=install
+
+ # the configure script does not detect isnan/isinf as macros
+ export ac_cv_func_isnan=yes
+ export ac_cv_func_isinf=yes
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --with-sitedir='/usr/local/lib/site_ruby' \
+ --with-search-path="/usr/lib/site_ruby/\$(ruby_ver)/$_arch-linux" \
+ --enable-pthread \
+ --disable-rpath \
+ --enable-shared \
+ --with-mantype=man \
+ --program-suffix=$_majorver \
+ --with-soname=$pkgname \
+ || return 1
+ make || return 1
+ make test
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install || return 1
+
+ if [ -d "$pkgdir"/usr/local ]; then
+ local f=$(cd "$pkgdir" ; find usr/local -type f)
+ if [ -n "$f" ]; then
+ error "Found files in /usr/local:"
+ echo "$f"
+ return 1
+ fi
+ fi
+ install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
+}
+
+rake() {
+ pkgdesc="Ruby based make-like utility"
+ depends="$pkgname"
+ arch="noarch"
+
+ _mvgem rake || return 1
+ _mv usr/bin/rake$_majorver
+}
+
+irb() {
+ pkgdesc="The Interactive Ruby"
+ replaces="$pkgname"
+ depends="$pkgname"
+ arch="noarch"
+
+ cd "$pkgdir"
+ _mv usr/bin/irb$_majorver \
+ usr/lib/ruby/$_abiver/irb*
+}
+
+rdoc() {
+ pkgdesc="Ruby documentation tool"
+ depends="$pkgname $pkgname-json"
+ arch="noarch"
+
+ _mvgem rdoc || return 1
+ _mv usr/bin/ri$_majorver \
+ usr/bin/rdoc$_majorver
+}
+
+bigdecimal() {
+ pkgdesc="Ruby arbitrary-precision floating point decimal arithmetic"
+ depends="$pkgname"
+ arch="noarch"
+
+ _mvgem bigdecimal
+}
+
+io_console() {
+ pkgdesc="Ruby simple console IO library"
+ depends="$pkgname"
+
+ _mvgem io-console
+ _mv $_rubydir/io \
+ $_rubydir/$_chost/io/console.so
+}
+
+minitest() {
+ pkgdesc="Ruby suite of testing facilities"
+ depends="$pkgname"
+ arch="noarch"
+
+ _mvgem minitest
+}
+
+json() {
+ pkgdesc="JSON implementation as a Ruby extension in C"
+ depends="$pkgname"
+
+ _mvgem json
+}
+
+libs() {
+ pkgdesc="Libraries necessary to run Ruby"
+ depends=""
+
+ mkdir -p "$subpkgdir"/usr
+ mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
+}
+
+_mv() {
+ local i; for i in "$@"; do
+ mkdir -p "$subpkgdir"/${i%/*}
+ mv "$pkgdir"/${i} "$subpkgdir"/${i%/*}/ || return 1
+ done
+}
+
+_mvgem() {
+ cd "$pkgdir"
+ local path; for path in ./$_rubydir/${1}.rb \
+ ./$_rubydir/${1} \
+ ./$_rubydir/$_chost/${1} \
+ ./$_gemdir/gems/${1}-* \
+ ./$_gemdir/specifications/default/${1}-* ; do
+ [ -e "$pkgdir/$path" ] && _mv "$path"
+ done
+}
+
+md5sums="5155c624807ff2418a9e9f15202954d0 ruby-2.1.10.tar.bz2"
+sha256sums="a74675578a9a801ac25eb7152bef3023432d6267f875b198eb9cd6944a5bf4f1 ruby-2.1.10.tar.bz2"
+sha512sums="4b7213695416876e4de3cbce912f61ac89db052c74f0daa8424477991cfc49b07300e960177ff576b634a97ee8afef3c5aded5d5806329dbd01d0ce7b42b9b63 ruby-2.1.10.tar.bz2"