diff options
Diffstat (limited to 'libraries/grpc')
-rw-r--r-- | libraries/grpc/README | 10 | ||||
-rw-r--r-- | libraries/grpc/grpc-use-shell-loop-instead-makefile-function.patch | 25 | ||||
-rw-r--r-- | libraries/grpc/grpc.SlackBuild | 107 | ||||
-rw-r--r-- | libraries/grpc/grpc.info | 16 |
4 files changed, 80 insertions, 78 deletions
diff --git a/libraries/grpc/README b/libraries/grpc/README index ed21fd9f2e..03152b0b7c 100644 --- a/libraries/grpc/README +++ b/libraries/grpc/README @@ -1,5 +1,7 @@ -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. +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. -Optional: python3-Cython +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 ac9cc25af0..520fe59c11 100644 --- a/libraries/grpc/grpc.SlackBuild +++ b/libraries/grpc/grpc.SlackBuild @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for grpc -# Copyright 2019 Larry Hajali <larryhaja[at]gmail[dot]com> +# 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 @@ -23,11 +24,14 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=grpc -VERSION=${VERSION:-1.24.1} -UPB_VERSION=${UPB_VERSION:-931bbecbd3230ae7f22efa5d203639facc47f719} +VERSION=${VERSION:-1.62.2} +OPENCENSUS_VERSION=${OPENCENSUS_VERSION:-0.3.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -37,7 +41,11 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -64,9 +72,12 @@ cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION -rm -rf third_party/upb -tar xvf $CWD/upb-${UPB_VERSION}.tar.gz -C third_party -ln -s upb-${UPB_VERSION} third_party/upb + +# 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 \ @@ -74,48 +85,62 @@ 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_BUILD_CSHARP_EXT=ON \ + -DgRPC_BACKWARDS_COMPATIBILITY_MODE=OFF \ + -DgRPC_ZLIB_PROVIDER='package' \ + -DgRPC_CARES_PROVIDER='package' \ + -DgRPC_RE2_PROVIDER='package' \ + -DgRPC_SSL_PROVIDER='package' \ + -DgRPC_PROTOBUF_PROVIDER='package' \ + -DgRPC_PROTOBUF_PACKAGE_TYPE='MODULE' \ + -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 cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/libraries/grpc/grpc.info b/libraries/grpc/grpc.info index 5047b17c49..7aea95c747 100644 --- a/libraries/grpc/grpc.info +++ b/libraries/grpc/grpc.info @@ -1,12 +1,12 @@ PRGNAM="grpc" -VERSION="1.24.1" +VERSION="1.62.2" HOMEPAGE="https://grpc.io/" -DOWNLOAD="https://github.com/grpc/grpc/archive/v1.24.1/grpc-1.24.1.tar.gz \ - https://github.com/protocolbuffers/upb/archive/931bbecbd3230ae7f22efa5d203639facc47f719/upb-931bbecbd3230ae7f22efa5d203639facc47f719.tar.gz" -MD5SUM="907baa235c152a05e83a198403f336c6 \ - bf1e541dd7467e0621e2c2e6241ced2b" +DOWNLOAD="https://github.com/grpc/grpc/archive/v1.62.2/grpc-1.62.2.tar.gz \ + https://github.com/census-instrumentation/opencensus-proto/archive/v0.3.0/opencensus-proto-0.3.0.tar.gz" +MD5SUM="0cabd7727133de65d9d1c7d521b6b05f \ + 0b208800a68548cbf2d4bff763c050a2" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="c-ares protobuf3 gflags" -MAINTAINER="Larry Hajali" -EMAIL="larryhaja[at]gmail[dot]com" +REQUIRES="protobuf3 re2" +MAINTAINER="Isaac Yu" +EMAIL="isaacyu@protonmail.com" |