diff options
Diffstat (limited to 'libraries/grpc')
-rw-r--r-- | libraries/grpc/README | 3 | ||||
-rw-r--r-- | libraries/grpc/grpc-use-shell-loop-instead-makefile-function.patch | 25 | ||||
-rw-r--r-- | libraries/grpc/grpc.SlackBuild | 92 | ||||
-rw-r--r-- | libraries/grpc/grpc.info | 16 |
4 files changed, 63 insertions, 73 deletions
diff --git a/libraries/grpc/README b/libraries/grpc/README index 4cd80295c7..03152b0b7c 100644 --- a/libraries/grpc/README +++ b/libraries/grpc/README @@ -2,3 +2,6 @@ gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems. + +This SlackBuild builds gRPC in C++. python3-grpcio contains the Python 3 +build of gRPC. diff --git a/libraries/grpc/grpc-use-shell-loop-instead-makefile-function.patch b/libraries/grpc/grpc-use-shell-loop-instead-makefile-function.patch deleted file mode 100644 index 2d1c98fe1d..0000000000 --- a/libraries/grpc/grpc-use-shell-loop-instead-makefile-function.patch +++ /dev/null @@ -1,25 +0,0 @@ -From fe221f7d6fcf04e296f3b8598f57abc9e3dea821 Mon Sep 17 00:00:00 2001 -From: Sergey Avseyev <sergey.avseyev@gmail.com> -Date: Wed, 16 Jan 2019 20:00:40 +0300 -Subject: [PATCH 3/4] use shell loop instead makefile function - -this avoids failure when too long string passed to exec ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 2bdfa6395d..51614620af 100644 ---- a/Makefile -+++ b/Makefile -@@ -2950,7 +2950,7 @@ install-headers_c: - install-headers_cxx: - $(E) "[INSTALL] Installing public C++ headers" - $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 -- $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 -+ $(Q) for h in $(PUBLIC_HEADERS_CXX); do $(INSTALL) $$h $(prefix)/$$h; done || exit 1 - - install-static: install-static_c install-static_cxx - --- -2.21.0 diff --git a/libraries/grpc/grpc.SlackBuild b/libraries/grpc/grpc.SlackBuild index 17bd561ab5..6908460166 100644 --- a/libraries/grpc/grpc.SlackBuild +++ b/libraries/grpc/grpc.SlackBuild @@ -3,6 +3,7 @@ # Slackware build script for grpc # Copyright 2019-2020 Larry Hajali <larryhaja[at]gmail[dot]com> +# Copyright 2024 Isaac Yu <isaacyu@protonmail.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -26,8 +27,8 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=grpc -VERSION=${VERSION:-1.28.1} -CPP_VERSION=${UPB_VERSION:-20200225.2} +VERSION=${VERSION:-1.66.1} +OPENCENSUS_VERSION=${OPENCENSUS_VERSION:-0.3.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -40,9 +41,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 @@ -74,9 +72,12 @@ cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION -rm -rf third_party/abseil-cpp -tar xvf $CWD/abseil-cpp-${CPP_VERSION}.tar.gz -C third_party -ln -s abseil-cpp-${CPP_VERSION} third_party/abseil-cpp + +# Use third party opencensus-proto tarball +rm -rf third_party/opencensus-proto +tar xvf $CWD/opencensus-proto-${OPENCENSUS_VERSION}.tar.gz -C third_party +ln -s opencensus-proto-${OPENCENSUS_VERSION} third_party/opencensus-proto + chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -84,44 +85,55 @@ 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 {} \; -# Fix Makefile -# Ref: https://github.com/grpc/grpc/issues/14844 -patch -p1 < $CWD/grpc-use-shell-loop-instead-makefile-function.patch - -sed -i 's|^prefix ?= .*|prefix ?= /usr|' Makefile -sed -i "s|\$(prefix)/lib|\$(prefix)/lib${LIBDIRSUFFIX}|" Makefile -sed -i "/libdir/s|/lib|/lib${LIBDIRSUFFIX}|" Makefile -sed -i 's|^GTEST_LIB =.*||' Makefile - -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -make shared plugins V=1 -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -make install prefix=$PKG/usr V=1 -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -make install-grpc-cli prefix=$PKG/usr V=1 - -if $(python3 -c 'import Cython' 2>/dev/null); then - GRPC_PYTHON_BUILD_WITH_CYTHON=True \ - GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True \ - GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True \ - GRPC_PYTHON_BUILD_SYSTEM_CARES=True \ - CFLAGS="$SLKCFLAGS" \ - python3 setup.py install --root=$PKG -fi +sed -i 's|^prefix ?= /usr/local|prefix ?= /usr|' Makefile + +# Build instructions adapted from the Arch Linux PKGBUILD: +# https://gitlab.archlinux.org/archlinux/packaging/packages/grpc/-/blob/main/PKGBUILD +# However, this SlackBuild does not build tests (therefore, grpc-cli will not be installed) +cmake -Bbuild \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DgRPC_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \ + -DgRPC_INSTALL_CMAKEDIR=lib${LIBDIRSUFFIX}/cmake/$PRGNAM \ + -DCMAKE_BUILD_TYPE=Release \ + -DgRPC_INSTALL=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_SKIP_INSTALL_RPATH=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DgRPC_BUILD_CODEGEN=ON \ + -DgRPC_ZLIB_PROVIDER='package' \ + -DgRPC_CARES_PROVIDER='package' \ + -DgRPC_RE2_PROVIDER='package' \ + -DgRPC_SSL_PROVIDER='package' \ + -DgRPC_PROTOBUF_PROVIDER='package' \ + -DgRPC_BENCHMARK_PROVIDER:STRING='package' \ + -DgRPC_ABSL_PROVIDER:STRING='package' \ + -DgRPC_USE_PROTO_LITE=OFF \ + -DgRPC_BUILD_GRPC_CPP_PLUGIN=ON \ + -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=ON \ + -DgRPC_BUILD_GRPC_NODE_PLUGIN=ON \ + -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=ON \ + -DgRPC_BUILD_GRPC_PHP_PLUGIN=ON \ + -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=ON \ + -DgRPC_BUILD_GRPC_RUBY_PLUGIN=ON \ + -GNinja + +cd build + cmake --build . + cmake --install . --prefix "$PKG/usr" +cd ../ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -# Clean up -find $PKG -type f -name '*.a' -exec rm -f {} \; -find $PKG/usr/include -type f -exec chmod 0644 {} \; -find $PKG/usr/share -type f -exec chmod 0644 {} \; +# All the .md files +MD=( BUILDING.md CODE-OF-CONDUCT.md CONCEPTS.md CONTRIBUTING.md \ + GOVERNANCE.md MAINTAINERS.md MANIFEST.md README.md SECURITY.md TROUBLESHOOTING.md) mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS *.md LICENSE OWNERS $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS ${MD[@]} LICENSE $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/libraries/grpc/grpc.info b/libraries/grpc/grpc.info index 1bc67997ff..1d0c0c0d38 100644 --- a/libraries/grpc/grpc.info +++ b/libraries/grpc/grpc.info @@ -1,12 +1,12 @@ PRGNAM="grpc" -VERSION="1.28.1" +VERSION="1.66.1" HOMEPAGE="https://grpc.io/" -DOWNLOAD="https://github.com/grpc/grpc/archive/v1.28.1/grpc-1.28.1.tar.gz \ - https://github.com/abseil/abseil-cpp/archive/20200225.2/abseil-cpp-20200225.2.tar.gz" -MD5SUM="db08d431023d116089bcaba4059bc583 \ - 73f2b6e72f1599a9139170c29482ddc4" +DOWNLOAD="https://github.com/grpc/grpc/archive/v1.66.1/grpc-1.66.1.tar.gz \ + https://github.com/census-instrumentation/opencensus-proto/archive/v0.3.0/opencensus-proto-0.3.0.tar.gz" +MD5SUM="93b5c17163d51517308a798221d3a563 \ + 0b208800a68548cbf2d4bff763c050a2" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="protobuf3 gflags" -MAINTAINER="Larry Hajali" -EMAIL="larryhaja[at]gmail[dot]com" +REQUIRES="protobuf3 re2" +MAINTAINER="Isaac Yu" +EMAIL="isaacyu@protonmail.com" |