summaryrefslogtreecommitdiff
path: root/community/rubinius/PKGBUILD
blob: a2494068f29ed3f5b3753d5e31c73272a9070cbc (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
88
89
# $Id: PKGBUILD 98826 2013-10-19 20:58:03Z heftig $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgbase=rubinius
pkgname=(rubinius rubinius-ruby)
pkgver=2.1.1
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 chrpath)
options=(!emptydirs)
source=(http://releases.rubini.us/${pkgbase}-${pkgver}.tar.bz2
        http://rubygems.org/downloads/bundler-1.3.5.gem
        gemrc)
sha256sums=('e142c3f201e4ae9f3a6e6671298baabbd9bd906509c663adcf080bff4181ee96'
            '08b89047f7b829f3e197a28fb1bde74c3f5cfea1552f99dfba237fee30eaffe4'
            '4bb7eb2fe66e396ed16b589cdb656831407b39ad4e138d88536754c0448ac614')

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

  mkdir -p "$GEM_HOME"
  gem install --no-user-install -N ../bundler-1.3.5.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
  rake build
}

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

  rake vm:test || :
}

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

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

  DESTDIR="$pkgdir" rake install

  find "$pkgdir" -name "*.so" -exec chrpath -d {} +
  chrpath -d "$pkgdir/usr/bin/rbx"

  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"
}