summaryrefslogtreecommitdiff
path: root/community/rubinius/PKGBUILD
blob: 593febc0a3ebf411307ac17d9e89f8d710db9522 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# $Id: PKGBUILD 102860 2013-12-22 14:20:57Z heftig $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgbase=rubinius
pkgname=(rubinius rubinius-ruby)
pkgver=2.2.2
pkgrel=1
pkgdesc="Ruby runtime written in Ruby, designed for concurrency"
arch=(i686 x86_64)
url="http://rubini.us"
license=(custom)
depends=(llvm-libs libffi openssl libyaml)
makedepends=(llvm ruby)
options=(!emptydirs)
source=(http://releases.rubini.us/${pkgbase}-${pkgver}.tar.bz2
        gemrc dirs.patch)
sha256sums=('a49d596f889405e4fc511da64b8afe5eccfafdcee5ea99be15d3ad36290ec2ba'
            '4bb7eb2fe66e396ed16b589cdb656831407b39ad4e138d88536754c0448ac614'
            '93f3918dc2a5679e281e724f9b3cb712ffa784c1e52e6fa7ce75f74ce6655a66')

prepare() {
  export GEM_HOME="$srcdir/gemdir"
  cd $pkgbase-$pkgver

  patch -Np1 -i ../dirs.patch

  mkdir -p "$GEM_HOME"
  gem install --no-user-install -N vendor/cache/bundler-*.gem

  "$GEM_HOME/bin/bundle" install --local
}

build() {
  export GEM_HOME="$srcdir/gemdir"
  cd $pkgbase-$pkgver

  ./configure --prefix=/usr \
    --mandir=/usr/share/man \
    --includedir=/usr/include/rubinius \
    --appdir=/usr/lib/rubinius \
    --gemsdir=/usr/lib/rubinius/gems \
    --preserve-prefix \
    --llvm-shared \
    --without-rpath
  rake build
}

check() {
  export GEM_HOME="$srcdir/gemdir"
  cd $pkgbase-$pkgver

  rake vm:test || :
}

package_rubinius() {
  optdepends=('ruby-docs: Ruby documentation')

  export GEM_HOME="$srcdir/gemdir"
  cd $pkgbase-$pkgver

  DESTDIR="$pkgdir" rake install

  mkdir -p "$pkgdir/usr/share/ri"
  ln -s 2.0.0 "$pkgdir/usr/share/ri/2.1"

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/rubinius/LICENSE"

### Split rubinius-ruby
  mkdir -p "$srcdir/ruby/usr/bin"
  for _f in "$pkgdir"/usr/bin/*; do
    [[ $_f == */rbx ]] && continue
    mv $_f "$srcdir/ruby/usr/bin"
  done
}

package_rubinius-ruby() {
  pkgdesc="Ruby compat for Rubinius"
  depends=(rubinius)
  provides=(ruby)
  conflicts=(ruby)
  backup=(etc/gemrc)

  mv ruby/* "$pkgdir"
  install -Dm644 gemrc "$pkgdir/etc/gemrc"
  install -d "$pkgdir/usr/share/licenses/rubinius-ruby"
  ln -s ../rubinius/LICENSE "$pkgdir/usr/share/licenses/rubinius-ruby/LICENSE"
}