summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 13910ae92b0f65710931317e305d47b71facd222 (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
# Maintainer: Daichi Shinozaki <dsdseg@gmail.com>
pkgname=fbthrift
pkgver=0.31.0
pkgrel=1
pkgdesc="Facebook's branch of Apache Thrift, including a new C++ server"
arch=('i686' 'x86_64')
url="https://github.com/facebook/fbthrift"
license=('Apache')
depends=('folly' 'krb5' 'numactl' 'python2')
conflicts=('thrift')
provides=('thrift')
makedepends=('scons')
options=('!emptydirs' 'staticlibs')
source=("https://github.com/facebook/$pkgname/archive/v${pkgver}.tar.gz"
'BinaryProtocol.h.patch'
'CompactProtocol.h.patch'
'Serializer.h.patch'
'Krb5CredentialsCacheManager.cpp.patch'
#'t_rb_generator.cc.patch'
'GeneratedCodeHelper.h.patch'
)
md5sums=('80d180ea65b03c7f68834159ab45a7ae'
         '5a410a5ffdd4813f9844c06b37cdd048'
         '067b4fc38a9e73cc06bd8d29eeb95c4f'
         'ae028ff57127ee3f3c44b5b592b09199'
         'bda963346b5171e59bacc0034868fa63'
         '15166953d352fdf64c1009a5b7dbdc6c')

prepare() {
  cd "$pkgname-$pkgver/thrift"
  patch -p2 --verbose < $srcdir/BinaryProtocol.h.patch
  patch -p2 --verbose < $srcdir/CompactProtocol.h.patch
  patch -p2 --verbose < $srcdir/Serializer.h.patch
  patch -p2 --verbose < $srcdir/Krb5CredentialsCacheManager.cpp.patch
#  patch -p2 --verbose < $srcdir/t_rb_generator.cc.patch
  cd lib/cpp2
  patch -p0 --verbose < $srcdir/GeneratedCodeHelper.h.patch
  cd ../../

  sed -ie '1 s/python/python2/' ./compiler/py/main.py
  # ArchLinux system has both libboost_python.so and libboost3_python.so.
  # Use python2 for build, so prevent libboost3_python.so to be chosen
  sed -i -e 's/libboost_python\*.so\*/libboost_python.so\*/' ./m4/ax_boost_python.m4
  autoreconf -ivf 
}

build() {
	cd "$pkgname-$pkgver/thrift"
	PYTHON=/usr/bin/python2 ./configure --prefix=/usr
  sed --in-place -e 's/python\( -mthrift_compiler.main\)/python2 \1/g' ./lib/cpp2/Makefile
  make
}

#check() {
#	cd "$pkgname-$pkgver/$pkgname"
#	make check
#}

package() {
  cd "$pkgname-$pkgver/thrift"
  make \
    PY_INSTALL_HOME="$pkgdir/usr" \
    PY_INSTALL_ARGS="--root '${pkgdir}' --prefix=/usr" \
    DESTDIR="$pkgdir" \
    install
}