mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-28 21:02:25 +01:00
179 lines
4.1 KiB
Plaintext
179 lines
4.1 KiB
Plaintext
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
|
|
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
|
pkgname=ruby
|
|
pkgver=2.3.3
|
|
_abiver=2.3.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=""
|
|
depends_dev="gmp-dev"
|
|
makedepends="$depends_dev zlib-dev libressl-dev gdbm-dev db-dev readline-dev
|
|
libffi-dev coreutils yaml-dev linux-headers autoconf"
|
|
# Maybe its a good idea to split dep libs to seperate pkgs.
|
|
subpackages="$pkgname-doc $pkgname-dev $pkgname-irb::noarch
|
|
$pkgname-rdoc::noarch $pkgname-rake::noarch $pkgname-bigdecimal::noarch
|
|
$pkgname-io-console:io_console $pkgname-minitest::noarch
|
|
$pkgname-json $pkgname-libs
|
|
"
|
|
source="ftp://ftp.ruby-lang.org/pub/ruby/${pkgver%.*}/$pkgname-$pkgver.tar.bz2"
|
|
options="!fhs"
|
|
replaces="ruby-gems"
|
|
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"
|
|
export CPPFLAGS="$CPPFLAGS -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 \
|
|
|| return 1
|
|
make || return 1
|
|
make test || return 1
|
|
}
|
|
|
|
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 -m 644 -D COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
|
|
}
|
|
|
|
rake() {
|
|
pkgdesc="Ruby based make-like utility"
|
|
depends="$pkgname"
|
|
|
|
_mvgem rake || return 1
|
|
_mv usr/bin/rake
|
|
}
|
|
|
|
irb() {
|
|
pkgdesc="The Interactive Ruby"
|
|
replaces="$pkgname"
|
|
depends="$pkgname"
|
|
|
|
cd "$pkgdir"
|
|
_mv usr/bin/irb \
|
|
usr/lib/ruby/$_abiver/irb*
|
|
}
|
|
|
|
rdoc() {
|
|
pkgdesc="Ruby documentation tool"
|
|
depends="$pkgname $pkgname-json"
|
|
|
|
_mvgem rdoc || return 1
|
|
_mv usr/bin/ri \
|
|
usr/bin/rdoc
|
|
}
|
|
|
|
bigdecimal() {
|
|
pkgdesc="Ruby arbitrary-precision floating point decimal arithmetic"
|
|
depends="$pkgname"
|
|
|
|
_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"
|
|
|
|
_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/${1}-* \
|
|
./$_gemdir/specifications/default/${1}-* ; do
|
|
[ ! -e "$pkgdir/$path" ] || _mv "$path"
|
|
done
|
|
}
|
|
|
|
md5sums="04b9c461a2bc1eec0535ad1947cad4fb ruby-2.3.3.tar.bz2"
|
|
sha256sums="882e6146ed26c6e78c02342835f5d46b86de95f0dc4e16543294bc656594cc5b ruby-2.3.3.tar.bz2"
|
|
sha512sums="88f7782effd35bfe0b4c33140b5eb147d09b63fbb35b9c42d2200c010f387e2b70984ead1eca86569e8ec31f08b35289d440c0ca76b662dadb760f848e863d91 ruby-2.3.3.tar.bz2"
|