PKGBUILDs/extra/protobuf/PKGBUILD

92 lines
2.9 KiB
Bash
Raw Normal View History

2018-08-08 23:39:17 +00:00
# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Aleksey Filippov <sarum9in@gmail.com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Thomas S Hatch <thatch45@gmail.com>
# Contributor: Geoffroy Carrier <geoffroy@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2019-01-05 03:35:08 +00:00
# - explicitly link v5/v6 with libatomic
2018-08-08 23:39:17 +00:00
pkgbase='protobuf'
pkgname=('protobuf' 'python2-protobuf' 'python-protobuf')
2019-01-05 03:35:08 +00:00
pkgver=3.6.1.3
2018-08-08 23:39:17 +00:00
_gtestver=1.8.0
pkgrel=1
pkgdesc="Protocol Buffers - Google's data interchange format"
arch=('x86_64')
url='https://developers.google.com/protocol-buffers/'
license=('BSD')
depends=('gcc-libs' 'zlib')
2019-01-05 03:35:08 +00:00
makedepends=('unzip' 'python-setuptools' 'python2-setuptools')
2018-08-08 23:39:17 +00:00
source=("$pkgbase-$pkgver.tgz::https://github.com/google/${pkgbase}/archive/v${pkgver}.tar.gz"
"gtest-${_gtestver}.tar.gz::https://github.com/google/googletest/archive/release-${_gtestver}.tar.gz")
2019-01-05 03:35:08 +00:00
md5sums=('df2b44d14d8745c06232d90f35845765'
2018-08-08 23:39:17 +00:00
'16877098823401d1bf2ed7891d7dce36')
prepare() {
cd "$pkgbase-$pkgver"
cp -r "$srcdir/googletest-release-${_gtestver}/googletest" third_party/googletest/googletest
cp -r "$srcdir/googletest-release-${_gtestver}/googlemock" third_party/googletest/googlemock
sed -r 's|/usr/bin/env python|/usr/bin/env python2|' -i third_party/googletest/googletest/scripts/*.py
}
build() {
cd "$srcdir/$pkgbase-$pkgver"
./autogen.sh
cd "$srcdir/$pkgbase-$pkgver/third_party/googletest/googletest"
autoreconf -fiv
./configure
make
cd "$srcdir/$pkgbase-$pkgver/third_party/googletest/googlemock"
autoreconf -fiv
./configure
make
cd "$srcdir/$pkgbase-$pkgver"
2019-01-05 03:35:08 +00:00
[[ $CARCH == "arm" || $CARCH == "armv6h" ]] && LIBS="-latomic"
2018-08-08 23:39:17 +00:00
LIBS=$LIBS ./configure --prefix=/usr
make
}
check() {
make -C "$srcdir/$pkgbase-$pkgver" check
}
package_protobuf() {
replaces=('protobuf-cpp')
cd "$srcdir/$pkgbase-$pkgver"
make DESTDIR="$pkgdir" install
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 editors/protobuf-mode.el "$pkgdir"/usr/share/emacs/site-lisp/protobuf-mode.el
}
package_python2-protobuf() {
pkgdesc='Python 2 bindings for Google Protocol Buffers'
depends=('python2' 'python2-six' "protobuf=$pkgver")
cd "$srcdir/$pkgbase-$pkgver/python"
2019-01-05 03:35:08 +00:00
python2 setup.py install --root="$pkgdir" --cpp_implementation
2018-08-08 23:39:17 +00:00
install -d "$pkgdir/usr/share/licenses/$pkgname"
ln -s "/usr/share/licenses/$pkgbase/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}
package_python-protobuf() {
pkgdesc='Python 3 bindings for Google Protocol Buffers'
depends=('python' 'python-six' "protobuf=$pkgver")
cd "$srcdir/$pkgbase-$pkgver/python"
2019-01-05 03:35:08 +00:00
python3 setup.py install --root="$pkgdir" --cpp_implementation
2018-08-08 23:39:17 +00:00
install -d "$pkgdir/usr/share/licenses/$pkgname"
ln -s "/usr/share/licenses/$pkgbase/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}