| Name |
protobuf |
| Description |
Protocol Buffers - Google's data interchange format |
| Version |
33.1-3 |
| Package Base |
protobuf |
| Homepage |
https://developers.google.com/protocol-buffers/ |
| Maintainers |
['Christian Heusel <gromit@archlinux.org>', 'Lukas Fleischer <lfleischer@archlinux.org>'] |
| Contributors |
['Aleksey Filippov <sarum9in@gmail.com>', 'Bartłomiej Piotrowski <bpiotrowski@archlinux.org>', 'Daniel J Griffiths <ghost1227@archlinux.us>', 'David Runge <dvzrv@archlinux.org>', 'Geoffroy Carrier <geoffroy@archlinux.org>', 'Sven-Hendrik Haase <svenstaro@archlinux.org>', 'Thomas S Hatch <thatch45@gmail.com>'] |
| Distro-repo |
https://gitlab.archlinux.org/archlinux/packaging/packages/protobuf |
| Sources |
['git+https://github.com/protocolbuffers/protobuf.git#tag=v33.1', 'protobuf-33-patch-enum-traits-impl.patch', 'protobuf-fix-build-type-none.patch'] |
| Dependencies |
['abseil-cpp', 'gcc-libs', 'glibc', 'zlib'] |
| Optional-Dependencies |
[] |
| Build-Dependencies |
['bazelisk', 'cmake', 'git', 'gtest', 'python-build', 'python-installer', 'python-setuptools', 'python-wheel', 'ruby', 'ruby-erb', 'ruby-ffi-compiler', 'ruby-rake', 'ruby-rake-compiler'] |
| Provides |
['libprotoc.so', 'libprotobuf.so', 'libprotobuf-lite.so'] |
| Builddate |
08-01-2026 00:59:13 |
| Architecture |
x86_64 |
| Distro-Version |
|
| Licenses |
['BSD-3-Clause'] |
| Hash |
6cc4e2bff0e20c453e12272c83751b6f689adc8ce9efb29009d9de8981d40be5 |
# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Maintainer: Christian Heusel <gromit@archlinux.org>
# Contributor: David Runge <dvzrv@archlinux.org>
# Contributor: Aleksey Filippov <sarum9in@gmail.com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Thomas S Hatch <thatch45@gmail.com>
# Contributor: Geoffroy Carrier <geoffroy@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
pkgbase='protobuf'
pkgname=('protobuf' 'python-protobuf' 'ruby-google-protobuf')
pkgver=33.1
pkgrel=3
pkgdesc="Protocol Buffers - Google's data interchange format"
arch=('x86_64')
url='https://developers.google.com/protocol-buffers/'
license=('BSD-3-Clause')
depends=(
'gcc-libs'
'glibc'
'zlib'
'abseil-cpp'
)
makedepends=(
'bazelisk'
'cmake'
'git'
'gtest'
'python-build'
'python-installer'
'python-setuptools'
'python-wheel'
'ruby'
'ruby-erb'
'ruby-ffi-compiler'
'ruby-rake'
'ruby-rake-compiler'
)
checkdepends=(
python-pytest
python-numpy
)
source=(
git+https://github.com/protocolbuffers/protobuf.git#tag=v$pkgver
protobuf-fix-build-type-none.patch
protobuf-33-patch-enum-traits-impl.patch
)
sha512sums=('2dba565a0101090b5ab173f1343eed5b1fbe46d94590b88425a9687224fe496aef1eddf4b322c0d265a1bee492d644c5ffe317ecba798f0bda28247bfc756600'
'18bc71031bbcbc3810a9985fa670465040f06a6c104ab8079b56bdfc499bb6cec40805a0cefd455031142490a576dc60aa8000523877ac0353b93558e9beabbd'
'8f7b8cb3829490962668bbb0eb8104f565a16bb336669e03afdc355c7ad50efb094851f7f78eba0d0a9704290b1c45ec56c9e6d6677cbf96ccfbfb659c014756')
options=(!lto)
_gemname=google-protobuf
prepare() {
cd "$pkgname"
bazel --version
patch -p1 < ../protobuf-fix-build-type-none.patch # Fix cmake config compatibility mode
patch -p1 < ../protobuf-33-patch-enum-traits-impl.patch
}
build() {
local cmake_options=(
-B build
-D CMAKE_BUILD_TYPE=None
-D CMAKE_INSTALL_PREFIX=/usr
-D CMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects"
-D CMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects"
-D protobuf_BUILD_SHARED_LIBS=ON
-D protobuf_USE_EXTERNAL_GTEST=ON
-D protobuf_ABSL_PROVIDER=package
-S "$pkgbase"
-W no-dev
)
cmake "${cmake_options[@]}"
cmake --build build --verbose
cd "$pkgbase"
local bazel_options=(
--noenable_bzlmod
--enable_workspace
)
# protobuf has both osx-aarch_64 and linux-aarch_64 platforms
# so we need to explicitly specify the target CPU when building
# for aarch64
[[ $CARCH == "aarch64" ]] && bazel_options+=(--cpu=linux-aarch_64)
bazel build //python/dist:binary_wheel "${bazel_options[@]}"
cd ruby
local _gemdir="$(gem env gemdir)"
local _gemver=4.$pkgver
local _gemplatform=$(ruby -e "puts Gem::Platform.local")
local _rubyapi=$(ruby -e 'require "rbconfig"; puts RbConfig::CONFIG["RUBY_API_VERSION"]')
PROTOC="$srcdir"/build/protoc \
rake
rake gem
gem install \
--local \
--verbose \
--ignore-dependencies \
--no-user-install \
--install-dir "tmp_install${_gemdir}" \
--bindir "tmp_install/usr/bin" \
"pkg/${_gemname}-${_gemver}.gem"
# install shared libraries to standard location and symlink to that location from custom location Gem requires
install -D lib/google/protobuf_c.so \
"tmp_install${_gemdir}/extensions/${_gemplatform}/${_rubyapi}/${_gemname}-${_gemver}"/protobuf_c.so
install -d "tmp_install${_gemdir}/gems/${_gemname}-${_gemver}"/lib/google/${_rubyapi}
ln -s "${_gemdir}/extensions/${_gemplatform}/${_rubyapi}/${_gemname}-${_gemver}"/protobuf_c.so \
"tmp_install${_gemdir}/gems/${_gemname}-${_gemver}"/lib/google/${_rubyapi}/protobuf_c.so
mv "tmp_install${_gemdir}/gems/${_gemname}-${_gemver}"/ext/google/protobuf_c/${_gemplatform}/libprotobuf_c_ffi.so \
"tmp_install${_gemdir}/extensions/${_gemplatform}/${_rubyapi}/${_gemname}-${_gemver}"
ln -s "${_gemdir}/extensions/${_gemplatform}/${_rubyapi}/${_gemname}-${_gemver}"/libprotobuf_c_ffi.so \
"tmp_install${_gemdir}/gems/${_gemname}-${_gemver}"/ext/google/protobuf_c/${_gemplatform}/libprotobuf_c_ffi.so
# remove unrepreducible files
rm --force --recursive --verbose \
"tmp_install${_gemdir}/cache/" \
"tmp_install${_gemdir}/gems/${_gemname}-${_gemver}/vendor/" \
"tmp_install${_gemdir}/doc/${_gemname}-${_gemver}/ri/ext/"
find "tmp_install${_gemdir}/gems/" \
-type f \
\( \
-iname "*.o" -o \
-iname "*.c" -o \
-iname "*.time" -o \
-iname "gem.build_complete" -o \
-iname "Makefile" \
\) \
-delete
find "tmp_install${_gemdir}/extensions/" \
-type f \
\( \
-iname "mkmf.log" -o \
-iname "gem_make.out" \
\) \
-delete
}
check() {
ctest --test-dir build
}
package_protobuf() {
replaces=('protobuf-cpp')
provides=('libprotoc.so' 'libprotobuf.so' 'libprotobuf-lite.so')
DESTDIR="$pkgdir" cmake --install build
cd $pkgbase
install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
install -vDm 644 editors/protobuf-mode.el \
-t "$pkgdir/usr/share/emacs/site-lisp/"
install -vDm 644 editors/proto.vim \
-t "${pkgdir}/usr/share/vim/vimfiles/syntax"
}
package_python-protobuf() {
pkgdesc='Python 3 bindings for Google Protocol Buffers'
depends=(
"protobuf=$pkgver"
'python'
)
python -m installer --destdir="$pkgdir" "$pkgbase"/bazel-bin/python/dist/*.whl
install -vDm 644 $pkgbase/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
package_ruby-google-protobuf() {
pkgdesc='Ruby bindings for Google Protocol Buffers'
depends=(
'ruby'
'ruby-bigdecimal'
'ruby-rake'
)
cp -a $pkgbase/ruby/tmp_install/* "$pkgdir"
install -vDm 644 $pkgbase/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
install -Dm 0644 $pkgbase/ruby/*.md -t "$pkgdir/usr/share/doc/${pkgname}"
}