summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 68232f9f3927b3f96e0b763b8fb0f20f8dd5e4b9 (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
90
91
92
93
# Maintainer: Celogeek <arch-aur-f5d67e@celogeek.com>
# Contributor: Jean Lucas <jean@4ray.co>
# Contributor: Anatol Pomozov <anatol.pomozov@gmail.com>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Sigmund Lahn <sigmund@lahn.no>

pkgname=rethinkdb
pkgver=2.4.1
_node=6.11.0
pkgrel=1
pkgdesc='Distributed NoSQL database for realtime applications'
arch=(x86_64)
url=https://www.rethinkdb.com
license=(Apache)
depends=(curl jemalloc)
makedepends=(clang boost git python2 make)
backup=(etc/rethinkdb/instances.d/default.conf)
install=rethinkdb.install
options=(!emptydirs)
source=(
  $pkgname::git+https://github.com/rethinkdb/rethinkdb.git#tag=v$pkgver
  https://nodejs.org/dist/v$_node/node-v$_node.tar.gz
  rethinkdb@.service
  rethinkdb.sysusers.d
  rethinkdb.tmpfiles.d
  mksnapshot_crash_fix.patch
  v8_g++7_build_fix.patch::https://github.com/nodejs/node/commit/66c1197f3aefd5b9f36533e6b617f2046acc2c0f.patch
  fix_assets.patch
)
noextract=(node-v$_node.tar.gz)
sha512sums=('SKIP'
            'a298232f6393735f2d459eb23f78089dd7eb1bae4907dfe61b286ceb8f93d3131c2dd45f09643089d00e2a4bef0f35739c9c8984f88b34c0ab515793f38eda46'
            'd0e86e86010fafcfdad7a58fe9ed9e93deefb1ab803aa283f60cccaf7a0ee11990c59b9ab01872b1c97b08418d7b53064e938b428e50a310442b32aa385277d9'
            'cab680a7e765e0a844b72ab3a57f19f3268d9a717bbe19230bd79537f0424179a56037c368326d2173a4a9cde075a67c85ce9b5a32733afb7d44806df1eac0ac'
            '112bc0f9ecfdfae6efba5d8cc3f773085b3f345d33d350188dc70609c425e6c656a0a3069ae5c66cdc684a94fd442e990a88c0ca8d1875f085f660c76c3d7250'
            '8deea735b2c7b6fc0221a49e818d4347869330fa9e35a94c15d54f7bc64ac0b8a573906fea6cc64c05a177f3065c96d8b4d0e2a3724b6137d7f12ba7a7b419f7'
            '15f1f9508adef9cd14320b6649f3b766a0dd8dd478290424e9af6343a7fd64e246aafbbf2f19109e5812decb2f15dcb283fec57875bc50a540737441a0fd248d'
            'b71d9a4ee892fadcc9471bd2bed31515b1cec796a19fa1fa616045088d21c0be6feba287e80b5c086a9e8a88dce5a9bcb7dbb367b92c4ff171aa8fa5de192cf7')

prepare() {
  # There are a ton of hard dependencies on Python 2
  # Let's KISS and pretend `python` points to Python 2

  if [ ! -f bin/python ]
  then
    mkdir -p bin
    ln -s /usr/bin/python2 bin/python
  fi

  cd $pkgname

  patch -p0 < ../mksnapshot_crash_fix.patch
  patch -p1 < ../fix_assets.patch

  PATH="$srcdir"/bin:$PATH ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --dynamic jemalloc \
    --allow-fetch \
    --fetch npm \
    --fetch protobuf \
    CXX=clang++

  # Manually fetch the Node version used, so we can patch it
  if [ ! -d external/node_$_node ]
  then
    cd external
    tar zxfp ../../node-v$_node.tar.gz
    mv node{-v,_}$_node
    cd node_$_node
    patch -p1 < "$srcdir"/v8_g++7_build_fix.patch
  fi
}

build() {
  cd $pkgname
  PATH="$srcdir"/bin:$PATH make -j`nproc`
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install
  rm -r "$pkgdir"/etc/init.d

  mv "$pkgdir"/etc/rethinkdb/default.conf.sample "$pkgdir"/etc/rethinkdb/instances.d/default.conf
  sed -r 's#\# (directory=.*)#\1#' -i "$pkgdir"/etc/rethinkdb/instances.d/default.conf

  install -Dm 644 ../rethinkdb@.service -t "$pkgdir"/usr/lib/systemd/system
  install -Dm 644 ../rethinkdb.sysusers.d "$pkgdir"/usr/lib/sysusers.d/rethinkdb.conf
  install -Dm 644 ../rethinkdb.tmpfiles.d "$pkgdir"/usr/lib/tmpfiles.d/rethinkdb.conf
}