* update protobuf to 28.1-1

This commit is contained in:
Alexander Baldeck 2024-10-01 07:16:06 +02:00
parent 7c3983d99d
commit d8655fda2a
6 changed files with 139 additions and 31 deletions

View File

@ -1,10 +1,14 @@
pkgbase = protobuf pkgbase = protobuf
pkgdesc = Protocol Buffers - Google's data interchange format pkgdesc = Protocol Buffers - Google's data interchange format
pkgver = 27.2 pkgver = 28.1
pkgrel = 1 pkgrel = 1
url = https://developers.google.com/protocol-buffers/ url = https://developers.google.com/protocol-buffers/
arch = x86_64 arch = x86_64
license = BSD arch = powerpc64le
arch = powerpc64
arch = powerpc
arch = riscv64
license = BSD-3-Clause
checkdepends = python-pytest checkdepends = python-pytest
checkdepends = python-numpy checkdepends = python-numpy
makedepends = bazel makedepends = bazel
@ -14,16 +18,20 @@ pkgbase = protobuf
makedepends = python-installer makedepends = python-installer
makedepends = python-setuptools makedepends = python-setuptools
makedepends = python-wheel makedepends = python-wheel
makedepends = ruby
makedepends = ruby-rake
makedepends = ruby-rake-compiler
depends = gcc-libs depends = gcc-libs
depends = glibc depends = glibc
depends = zlib depends = zlib
depends = abseil-cpp depends = abseil-cpp
source = https://github.com/protocolbuffers/protobuf/archive/v27.2/protobuf-27.2.tar.gz options = !lto
source = https://github.com/protocolbuffers/protobuf/commit/2e62ef1e.patch source = https://github.com/protocolbuffers/protobuf/archive/v28.1/protobuf-28.1.tar.gz
source = soversion.patch source = protobuf-fix-build-type-none.patch
sha512sums = 664c66b62cf1ed0c65d9b910d8e67d4d5d471113697f1b8edf1573cd5c0fc8e850ac53ce984e48e6c6b9cbbefa12f8530058384e7388e65a59c1e46d03772397 source = protobuf-25.3-ruby-disable-LTO.patch
sha512sums = 769ef61206e39336d93df786a25c08cdf1acb12f2f5818ae31afb268aad8b02076eeba15c41c68aadbf140c6e1653c0aaefc2a637278c7695ded1b5d72888d81
sha512sums = 18bc71031bbcbc3810a9985fa670465040f06a6c104ab8079b56bdfc499bb6cec40805a0cefd455031142490a576dc60aa8000523877ac0353b93558e9beabbd sha512sums = 18bc71031bbcbc3810a9985fa670465040f06a6c104ab8079b56bdfc499bb6cec40805a0cefd455031142490a576dc60aa8000523877ac0353b93558e9beabbd
sha512sums = f0813a415cff5639e4709400f15b0c5565294e7907ae164e620b76258734c643115d8e5170bf0e4aee264c347fb7e01ac4be60d19be2a91c0ce9c561dad8c8e9 sha512sums = 1ebdea4e533ee0f71baf1b3fe2623ca723b36a08c6b97475ea5996b10aeb6873cf94d9120596ddd1216bd2f6feb991f8c33078e8104008a5078ace5be5431efd
pkgname = protobuf pkgname = protobuf
provides = libprotoc.so provides = libprotoc.so
@ -33,5 +41,9 @@ pkgname = protobuf
pkgname = python-protobuf pkgname = python-protobuf
pkgdesc = Python 3 bindings for Google Protocol Buffers pkgdesc = Python 3 bindings for Google Protocol Buffers
depends = protobuf=27.2 depends = protobuf=28.1
depends = python depends = python
pkgname = ruby-google-protobuf
pkgdesc = Ruby bindings for Google Protocol Buffers
depends = ruby

5
protobuf/.nvchecker.toml Normal file
View File

@ -0,0 +1,5 @@
[protobuf]
source = "git"
git = "https://github.com/protocolbuffers/protobuf.git"
prefix = "v"
exclude_regex = ".*(pre|rc|alpha|beta|dev).*"

View File

@ -9,13 +9,13 @@
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us> # Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
pkgbase='protobuf' pkgbase='protobuf'
pkgname=('protobuf' 'python-protobuf') pkgname=('protobuf' 'python-protobuf' 'ruby-google-protobuf')
pkgver=27.2 pkgver=28.1
pkgrel=1 pkgrel=1
pkgdesc="Protocol Buffers - Google's data interchange format" pkgdesc="Protocol Buffers - Google's data interchange format"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64) arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://developers.google.com/protocol-buffers/' url='https://developers.google.com/protocol-buffers/'
license=('BSD') license=('BSD-3-Clause')
depends=( depends=(
'gcc-libs' 'gcc-libs'
'glibc' 'glibc'
@ -29,18 +29,28 @@ makedepends=(
'python-installer' 'python-installer'
'python-setuptools' 'python-setuptools'
'python-wheel' 'python-wheel'
'ruby'
'ruby-rake'
'ruby-rake-compiler'
) )
checkdepends=( checkdepends=(
python-pytest python-pytest
python-numpy python-numpy
) )
source=(https://github.com/protocolbuffers/protobuf/archive/v$pkgver/$pkgname-$pkgver.tar.gz source=(https://github.com/protocolbuffers/protobuf/archive/v$pkgver/$pkgname-$pkgver.tar.gz
https://github.com/protocolbuffers/protobuf/commit/2e62ef1e.patch) protobuf-fix-build-type-none.patch
sha512sums=('664c66b62cf1ed0c65d9b910d8e67d4d5d471113697f1b8edf1573cd5c0fc8e850ac53ce984e48e6c6b9cbbefa12f8530058384e7388e65a59c1e46d03772397' $pkgbase-25.3-ruby-disable-LTO.patch) # https://github.com/protocolbuffers/protobuf/issues/11935
'18bc71031bbcbc3810a9985fa670465040f06a6c104ab8079b56bdfc499bb6cec40805a0cefd455031142490a576dc60aa8000523877ac0353b93558e9beabbd') sha512sums=('769ef61206e39336d93df786a25c08cdf1acb12f2f5818ae31afb268aad8b02076eeba15c41c68aadbf140c6e1653c0aaefc2a637278c7695ded1b5d72888d81'
'18bc71031bbcbc3810a9985fa670465040f06a6c104ab8079b56bdfc499bb6cec40805a0cefd455031142490a576dc60aa8000523877ac0353b93558e9beabbd'
'1ebdea4e533ee0f71baf1b3fe2623ca723b36a08c6b97475ea5996b10aeb6873cf94d9120596ddd1216bd2f6feb991f8c33078e8104008a5078ace5be5431efd')
options=(!lto)
_gemname=google-protobuf
prepare() { prepare() {
patch -d $pkgname-$pkgver -p1 < 2e62ef1e.patch # Fix cmake config compatibility mode patch -d $pkgname-$pkgver -p1 < protobuf-fix-build-type-none.patch # Fix cmake config compatibility mode
patch -d $pkgbase-$pkgver -p1 < $pkgbase-25.3-ruby-disable-LTO.patch
} }
build() { build() {
@ -64,10 +74,56 @@ build() {
cmake "${cmake_options[@]}" cmake "${cmake_options[@]}"
cmake --build build --verbose cmake --build build --verbose
cd $pkgbase-$pkgver/python cd $pkgbase-$pkgver/python
LDFLAGS+=" -L${srcdir}/build" \ LDFLAGS+=" -L${srcdir}/build" \
PROTOC="$srcdir"/build/protoc \ PROTOC="$srcdir"/build/protoc \
python dist/setup.py build python dist/setup.py build
cd $srcdir/$pkgbase-$pkgver/ruby
local _gemdir="$(gem env gemdir)"
local _gemver=4.$pkgver
PROTOC="$srcdir"/build/protoc \
rake genproto
rake copy_third_party
gem build --verbose "${_gemname}.gemspec"
gem install \
--local \
--verbose \
--ignore-dependencies \
--no-user-install \
--install-dir "tmp_install${_gemdir}" \
--bindir "tmp_install/usr/bin" \
"${_gemname}-${_gemver}.gem"
# 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 "*.so" -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() { check() {
@ -99,3 +155,15 @@ package_python-protobuf() {
python dist/setup.py install --root=$pkgdir python dist/setup.py install --root=$pkgdir
install -vDm 644 $srcdir/$pkgbase-$pkgver/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" install -vDm 644 $srcdir/$pkgbase-$pkgver/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
} }
package_ruby-google-protobuf() {
pkgdesc='Ruby bindings for Google Protocol Buffers'
depends=(
'ruby'
)
cp -a $pkgbase-$pkgver/ruby/tmp_install/* "$pkgdir"
install -vDm 644 $pkgbase-$pkgver/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
install -Dm 0644 $pkgbase-$pkgver/ruby/*.md -t "$pkgdir/usr/share/doc/${pkgname}"
}

View File

@ -1,16 +0,0 @@
diff -ruN a/python/setup.py b/python/setup.py
--- a/python/setup.py 2022-12-13 01:03:12.000000000 +0100
+++ b/python/setup.py 2023-04-06 22:12:36.199029178 +0200
@@ -220,10 +220,10 @@
return False
-if __name__ == '__main__':
+if True:
ext_module_list = []
warnings_as_errors = '--warnings_as_errors'
- if GetOptionFromArgv('--cpp_implementation'):
+ if True:
# Link libprotobuf.a and libprotobuf-lite.a statically with the
# extension. Note that those libraries have to be compiled with
# -fPIC for this to work.

View File

@ -0,0 +1,14 @@
diff --git a/ruby/ext/google/protobuf_c/extconf.rb b/ruby/ext/google/protobuf_c/extconf.rb
index 4bb49bb..37266d7 100755
--- a/ruby/ext/google/protobuf_c/extconf.rb
+++ b/ruby/ext/google/protobuf_c/extconf.rb
@@ -14,7 +14,8 @@ end
if RUBY_PLATFORM =~ /linux/
# Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper.
- $LDFLAGS += " -Wl,-wrap,memcpy"
+ $CFLAGS += " -fno-lto"
+ $LDFLAGS += " -Wl,-wrap,memcpy -fno-lto"
end
$VPATH << "$(srcdir)/third_party/utf8_range"

View File

@ -0,0 +1,25 @@
From 2e62ef1eaa2e712afc5f87aa2c55d478fe96230d Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Wed, 5 Jul 2023 13:03:11 +0200
Subject: [PATCH] Handle BUILD_TYPE=None in protobuf-module.cmake
Fixes Protobuf_PROTOC_EXECUTABLE being undefined in that case.
---
cmake/protobuf-module.cmake.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in
index 0bb05e38fad8..e5b2b2e4b3af 100644
--- a/cmake/protobuf-module.cmake.in
+++ b/cmake/protobuf-module.cmake.in
@@ -153,6 +153,10 @@ if(NOT Protobuf_PROTOC_EXECUTABLE AND TARGET protobuf::protoc)
get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
IMPORTED_LOCATION_NOCONFIG)
endif()
+ if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
+ get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
+ IMPORTED_LOCATION_NONE)
+ endif()
endif()
# Version info variable