summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e5e1dadf23aa1f657377b3515f778381e3a4fe82 (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
# Maintainer: Lee Mracek <lee@leemracek.com>
# Contributor: Jameson Pugh <imntreal@gmail.com>

pkgbase=flatbuffers-git
_gitbase=flatbuffers
pkgname=(flatbuffers-git python-flatbuffers-git)
pkgver=1856
pkgrel=1
pkgdesc='An efficient cross platform serialization library for C++, with support for Java, C# and Go'
arch=(x86_64)
url='https://google.github.io/flatbuffers/'
license=(Apache)
depends=(gcc-libs)
makedepends=(cmake python-setuptools)
source=(git+https://github.com/google/flatbuffers)
sha256sums=('SKIP')

pkgver() {
  cd ${srcdir}/${_gitbase}
  git rev-list --count HEAD
}

prepare() {
  sed -i 's/-Werror=/-W/g;s/-Werror//g' $_gitbase/CMakeLists.txt
}

build() {
  cd $_gitbase
  cmake . \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DFLATBUFFERS_BUILD_FLATLIB=OFF \
    -DFLATBUFFERS_BUILD_SHAREDLIB=ON
  make

# Python bindings
  cd ../$_gitbase/python
  VERSION=$pkgver python setup.py build
}

check() {
  cd $_gitbase
  make test
  ./tests/PythonTest.sh
}

package_flatbuffers-git() {
  conflicts=('flatbuffers')
  provides=('flatbuffers')
  cd $_gitbase
  make DESTDIR="$pkgdir" install
  install -Dm755 flatc -t "$pkgdir"/usr/bin
}

package_python-flatbuffers-git() {
  pkgdesc='An efficient cross platform serialization library for Python'
  conflicts=('python-flatbuffers')
  depends=(python)
  provides=('python-flatbuffers')

  cd $_gitbase/python
  VERSION=$pkgver python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}