summaryrefslogtreecommitdiffstats
path: root/development/protobuf3
diff options
context:
space:
mode:
Diffstat (limited to 'development/protobuf3')
-rw-r--r--development/protobuf3/protobuf3.SlackBuild55
-rw-r--r--development/protobuf3/protobuf3.info10
-rw-r--r--development/protobuf3/protobuf3.patch10
-rw-r--r--development/protobuf3/soversion.patch36
4 files changed, 69 insertions, 42 deletions
diff --git a/development/protobuf3/protobuf3.SlackBuild b/development/protobuf3/protobuf3.SlackBuild
index 0cef90a454..dac9033819 100644
--- a/development/protobuf3/protobuf3.SlackBuild
+++ b/development/protobuf3/protobuf3.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for protobuf3
-# Copyright 2017-2022 Willy Sudiarto Raharjo <willysr@slackbuilds.org>
+# Copyright 2017-2024 Willy Sudiarto Raharjo <willysr@slackbuilds.org>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,7 +25,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=protobuf3
-VERSION=${VERSION:-3.20.1}
+VERSION=${VERSION:-27.1}
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
@@ -84,28 +81,30 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-patch -p1 < $CWD/protobuf3.patch
-
-./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
-
-make
-make install DESTDIR=$PKG
-
-# Install the python bindings
-cd python
-python setup.py install --root=$PKG
-python3 setup.py install --root=$PKG
+patch -p1 < $CWD/soversion.patch
+
+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/strip DESTDIR=$PKG
+cd ..
+
+# Install the python bindings:
+tar xvf $CWD/$SRCNAM-5.$VERSION.tar.gz
+cd $SRCNAM-5.$VERSION
+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 +113,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
diff --git a/development/protobuf3/protobuf3.info b/development/protobuf3/protobuf3.info
index 4b9b8065b3..b2ed2c2f81 100644
--- a/development/protobuf3/protobuf3.info
+++ b/development/protobuf3/protobuf3.info
@@ -1,10 +1,12 @@
PRGNAM="protobuf3"
-VERSION="3.20.1"
+VERSION="27.1"
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/v27.1/protobuf-27.1.tar.gz \
+https://files.pythonhosted.org/packages/20/5f/00d891817d4031bbf4e846a99834bf949a76714c10a726833aa184176772/protobuf-5.27.1.tar.gz"
+MD5SUM="0dcd097a07265dd1871f63d06bcbbba0 \
+1accbc0a4023f0056558a1811c38447e"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES=""
+REQUIRES="abseil-cpp python3-build python3-wheel"
MAINTAINER="Willy Sudiarto Raharjo"
EMAIL="willysr@slackbuilds.org"
diff --git a/development/protobuf3/protobuf3.patch b/development/protobuf3/protobuf3.patch
deleted file mode 100644
index a69862dd63..0000000000
--- a/development/protobuf3/protobuf3.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- protobuf-3.10.1/src/google/protobuf/text_format.h.orig 2019-10-13 10:42:21.345593616 +0700
-+++ protobuf-3.10.1/src/google/protobuf/text_format.h 2019-10-13 10:42:34.151188015 +0700
-@@ -42,6 +42,7 @@
- #include <memory>
- #include <string>
- #include <vector>
-+#include <cmath>
-
- #include <google/protobuf/stubs/common.h>
- #include <google/protobuf/descriptor.h>
diff --git a/development/protobuf3/soversion.patch b/development/protobuf3/soversion.patch
new file mode 100644
index 0000000000..7e1b42de12
--- /dev/null
+++ b/development/protobuf3/soversion.patch
@@ -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)