[arch-commits] Commit in flatbuffers/trunk (PKGBUILD)
Antonio Rojas
arojas at archlinux.org
Wed Apr 24 19:20:22 UTC 2019
Date: Wednesday, April 24, 2019 @ 19:20:22
Author: arojas
Revision: 453417
Merge python version
Modified:
flatbuffers/trunk/PKGBUILD
----------+
PKGBUILD | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2019-04-24 19:05:21 UTC (rev 453416)
+++ PKGBUILD 2019-04-24 19:20:22 UTC (rev 453417)
@@ -1,40 +1,53 @@
# Maintainer: Antonio Rojas <arojas at archlinux.org>
# Contributor: Daichi Shinozaki <dsdseg at gmail.com>
-pkgname=flatbuffers
+pkgbase=flatbuffers
+pkgname=(flatbuffers python-flatbuffers)
pkgver=1.11.0
-pkgrel=1
+pkgrel=2
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)
-source=($pkgname-$pkgver.tar.gz::https://github.com/google/$pkgname/archive/v$pkgver.tar.gz)
+makedepends=(cmake python-setuptools)
+source=($pkgbase-$pkgver.tar.gz::https://github.com/google/$pkgbase/archive/v$pkgver.tar.gz)
sha256sums=('3f4a286642094f45b1b77228656fbd7ea123964f19502f9ecfd29933fd23a50b')
prepare() {
- mkdir -p build
sed -i 's/-Werror=/-W/g;s/-Werror//g' $pkgname-$pkgver/CMakeLists.txt
}
build() {
- cd build
- cmake ../$pkgname-$pkgver \
+ cd $pkgbase-$pkgver
+ cmake . \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DFLATBUFFERS_BUILD_FLATLIB=OFF \
-DFLATBUFFERS_BUILD_SHAREDLIB=ON
make
+
+# Python bindings
+ cd ../$pkgbase-$pkgver/python
+ VERSION=$pkgver python setup.py build
}
check() {
- cd build
+ cd $pkgbase-$pkgver
make test
+ ./tests/PythonTest.sh
}
-package() {
- cd build
+package_flatbuffers() {
+ cd $pkgbase-$pkgver
make DESTDIR="$pkgdir" install
install -Dm755 flatc -t "$pkgdir"/usr/bin
}
+
+package_python-flatbuffers() {
+ pkgdesc='An efficient cross platform serialization library for Python'
+ depends=(python)
+
+ cd $pkgbase-$pkgver/python
+ VERSION=$pkgver python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+}
More information about the arch-commits
mailing list