development/protobuf3: Updated for version 25.3.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Willy Sudiarto Raharjo 2024-03-01 15:48:47 +07:00
parent e58bc609f5
commit d0f41c315d
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
4 changed files with 79 additions and 26 deletions

View File

@ -0,0 +1,16 @@
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

@ -25,7 +25,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=protobuf3
VERSION=${VERSION:-3.20.1}
VERSION=${VERSION:-25.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -43,9 +43,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@ -85,27 +82,31 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
patch -p1 < $CWD/protobuf3.patch
patch -p1 < $CWD/protobuf-21.12-pep517.patch
patch -p1 < $CWD/soversion.patch
sed -e "s|c++14|c++17|" -i python/setup.py
./autogen.sh
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--disable-static \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--enable-static=no \
--build=$ARCH-slackware-linux
mkdir -p build
cd build
cmake \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_ABSL_PROVIDER=package \
-Dprotobuf_BUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release ..
make
make install DESTDIR=$PKG
make install/strip DESTDIR=$PKG
cd ..
# Install the python bindings
cd python
python setup.py install --root=$PKG
python3 setup.py install --root=$PKG
LDFLAGS+=" -L$TMP/$SRCNAM-$VERSION/build" \
PROTOC="$TMP/$SRCNAM-$VERSION/build/protoc" \
python3 -m build --wheel --no-isolation
python3 -m installer --destdir "$PKG" dist/*.whl
cd ..
rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/*.la
@ -114,7 +115,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a BUILD *.txt LICENSE *.md $PKG/usr/doc/$PRGNAM-$VERSION
cp -a *.txt LICENSE *.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install

View File

@ -1,10 +1,10 @@
PRGNAM="protobuf3"
VERSION="3.20.1"
VERSION="25.3"
HOMEPAGE="https://github.com/google/protobuf"
DOWNLOAD="https://github.com/google/protobuf/archive/v3.20.1/protobuf-3.20.1.tar.gz"
MD5SUM="2e0647d6be6730e9565acc1a16f4bc6a"
DOWNLOAD="https://github.com/google/protobuf/archive/v25.3/protobuf-25.3.tar.gz"
MD5SUM="5e82b6696d6bcacc2e60313f187f3551"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
REQUIRES="abseil-cpp python3-build python3-wheel"
MAINTAINER="Willy Sudiarto Raharjo"
EMAIL="willysr@slackbuilds.org"

View File

@ -0,0 +1,36 @@
diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake
index 9b1de677b4f..276c99c489e 100644
--- a/cmake/libprotobuf-lite.cmake
+++ b/cmake/libprotobuf-lite.cmake
@@ -30,6 +30,7 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf-lite PROPERTIES
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protobuf-lite
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)
diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake
index aa3efc9a68a..0f34d20b97d 100644
--- a/cmake/libprotobuf.cmake
+++ b/cmake/libprotobuf.cmake
@@ -33,6 +33,7 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf PROPERTIES
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protobuf
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf ALIAS libprotobuf)
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake
index 72b4a1abb92..91e8bbeb04e 100644
--- a/cmake/libprotoc.cmake
+++ b/cmake/libprotoc.cmake
@@ -24,6 +24,7 @@ endif()
set_target_properties(libprotoc PROPERTIES
COMPILE_DEFINITIONS LIBPROTOC_EXPORTS
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protoc
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotoc ALIAS libprotoc)