summaryrefslogtreecommitdiff
path: root/community/rubinius/PKGBUILD
blob: fccc61828a7717fbf6d62a006373a1e277d4af28 (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
# $Id: PKGBUILD 113258 2014-06-16 18:49:59Z foutrelis $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgbase=rubinius
pkgname=(rubinius rubinius-ruby)
pkgver=2.2.9
pkgrel=2
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 rubinius-ruby)
options=(!emptydirs)
source=(http://releases.rubini.us/${pkgbase}-${pkgver}.tar.bz2
        gemrc dirs.patch)
sha256sums=('7b01a7f2508167e73b5273b4e55e6616fc7fd975e79c84c4d2e3ef83d849d2ce'
            '4bb7eb2fe66e396ed16b589cdb656831407b39ad4e138d88536754c0448ac614'
            'a9922b199730c059c26781af45adc46401811ff2e6840c4aeb49da4fa41acdd9')

prepare() {
  export GEM_HOME="$srcdir/gemdir" LANG="en_US.UTF-8"
  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" LANG="en_US.UTF-8"
  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 \
    --bin-link bundle --bin-link bundler
  rake build
}

check() {
  export GEM_HOME="$srcdir/gemdir" LANG="en_US.UTF-8"
  cd $pkgbase-$pkgver

  rake vm:test || :
}

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

  export GEM_HOME="$srcdir/gemdir" LANG="en_US.UTF-8"
  cd $pkgbase-$pkgver

  DESTDIR="$pkgdir" rake install

  mkdir -p "$pkgdir/usr/share/ri"
  ln -s 2.1.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=$pkgver-$pkgrel")
  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"
}