108 lines
2.9 KiB
Bash
108 lines
2.9 KiB
Bash
# Template file for 'protobuf'
|
|
pkgname=protobuf
|
|
version=21.9
|
|
revision=1
|
|
create_wrksrc="yes"
|
|
build_wrksrc="${pkgname}-${version}"
|
|
build_style=gnu-configure
|
|
hostmakedepends="pkg-config automake libtool"
|
|
makedepends="zlib-devel"
|
|
short_desc="Protocol buffers compiler"
|
|
maintainer="Andrew J. Hesford <ajh@sideband.org>"
|
|
license="BSD-3-Clause"
|
|
homepage="https://developers.google.com/protocol-buffers/"
|
|
changelog="https://raw.githubusercontent.com/google/protobuf/master/CHANGES.txt"
|
|
_googletest_commit="5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081"
|
|
distfiles="https://github.com/protocolbuffers/protobuf/archive/v${version}.tar.gz
|
|
https://github.com/google/googletest/archive/${_googletest_commit}.tar.gz"
|
|
checksum="0aa7df8289c957a4c54cbe694fbabe99b180e64ca0f8fdb5e2f76dcf56ff2422
|
|
0e2f36e8e403c125fd0ab02171bdb786d3b6b3875b6ccf3b2eb7969be8faecd0"
|
|
|
|
# Switch to versioned package
|
|
conflicts="protobuf18>=0 protobuf23>=0 protobuf24>=0
|
|
protobuf25>=0 protobuf26>=0 protobuf28>=0"
|
|
replaces="${conflicts}"
|
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
# needs host protoc
|
|
hostmakedepends+=" ${pkgname}"
|
|
configure_args+=" --with-protoc=/usr/bin/protoc"
|
|
fi
|
|
|
|
if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
|
|
makedepends+=" libatomic-devel"
|
|
LDFLAGS+=" -latomic"
|
|
fi
|
|
|
|
post_extract() {
|
|
rmdir "${build_wrksrc}/third_party/googletest"
|
|
mv "googletest-${_googletest_commit}" "${build_wrksrc}/third_party/googletest"
|
|
}
|
|
|
|
pre_configure() {
|
|
autoreconf -fi
|
|
}
|
|
|
|
post_install() {
|
|
vlicense LICENSE
|
|
}
|
|
|
|
libprotobuf_package() {
|
|
short_desc="Protocol buffers C++ library"
|
|
pkg_install() {
|
|
vmove "usr/lib/libprotobuf.so.*"
|
|
vlicense LICENSE
|
|
}
|
|
}
|
|
|
|
libprotobuf-lite_package() {
|
|
short_desc="Protocol buffers C++ library (lite version)"
|
|
pkg_install() {
|
|
vmove "usr/lib/libprotobuf-lite.so.*"
|
|
vlicense LICENSE
|
|
}
|
|
}
|
|
|
|
libprotoc_package() {
|
|
short_desc="Protocol buffers compiler library"
|
|
pkg_install() {
|
|
vmove "usr/lib/libprotoc.so.*"
|
|
vlicense LICENSE
|
|
}
|
|
}
|
|
|
|
libprotoc-devel_package() {
|
|
depends="libprotoc-${version}_${revision}"
|
|
short_desc="Protocol buffers compiler library - development files"
|
|
# Switch to versioned package
|
|
conflicts="libprotoc18-devel>=0 libprotoc23-devel>=0
|
|
libprotoc24-devel>=0 libprotoc25-devel>=0
|
|
libprotoc26-devel>=0 libprotoc28-devel>=0"
|
|
replaces="${conflicts}"
|
|
pkg_install() {
|
|
vmove usr/lib/libprotoc.a
|
|
vmove usr/lib/libprotoc.so
|
|
vmove usr/include/google/protobuf/compiler
|
|
}
|
|
}
|
|
|
|
protobuf-devel_package() {
|
|
depends="zlib-devel
|
|
libprotobuf-${version}_${revision}
|
|
libprotobuf-lite-${version}_${revision}"
|
|
short_desc="Protocol buffers C++ library - development files"
|
|
# Switch to versioned package
|
|
conflicts="protobuf18-devel>=0 protobuf23-devel>=0
|
|
protobuf24-devel>=0 protobuf25-devel>=0
|
|
protobuf26-devel>=0 protobuf28-devel>=0"
|
|
replaces="${conflicts}"
|
|
pkg_install() {
|
|
vmove usr/include
|
|
vmove usr/lib/libprotobuf.a
|
|
vmove usr/lib/libprotobuf-lite.a
|
|
vmove usr/lib/libprotobuf.so
|
|
vmove usr/lib/libprotobuf-lite.so
|
|
vmove usr/lib/pkgconfig
|
|
}
|
|
}
|