2023-09-11 23:38:12 +03:00
|
|
|
distributable:
|
|
|
|
url: git+https://github.com/grpc/grpc
|
|
|
|
ref: v{{version}}
|
|
|
|
|
|
|
|
versions:
|
|
|
|
github: grpc/grpc
|
|
|
|
|
|
|
|
provides:
|
|
|
|
- bin/grpc_csharp_plugin
|
|
|
|
- bin/grpc_node_plugin
|
|
|
|
- bin/grpc_cpp_plugin
|
|
|
|
- bin/grpc_python_plugin
|
|
|
|
- bin/grpc_objective_c_plugin
|
|
|
|
- bin/grpc_ruby_plugin
|
|
|
|
- bin/grpc_php_plugin
|
|
|
|
- bin/grpc_cli
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
abseil.io: '*'
|
|
|
|
c-ares.org: '*'
|
|
|
|
openssl.org: ^1.1
|
2024-03-08 21:56:39 +03:00
|
|
|
protobuf.dev: 25.2.0 # grpc links to specific versions, so we have to pick one.
|
2023-09-11 23:38:12 +03:00
|
|
|
github.com/google/re2: '*'
|
|
|
|
zlib.net: '*'
|
2024-03-31 00:24:58 +03:00
|
|
|
linux:
|
|
|
|
gnu.org/gcc: '*' # libstdc++
|
2023-09-11 23:38:12 +03:00
|
|
|
|
|
|
|
build:
|
|
|
|
dependencies:
|
|
|
|
gnu.org/autoconf: '*'
|
|
|
|
gnu.org/automake: '*'
|
|
|
|
gnu.org/libtool: '*'
|
|
|
|
cmake.org: ^3
|
|
|
|
freedesktop.org/pkg-config: ^0
|
|
|
|
git-scm.org: ^2
|
|
|
|
working-directory: cmake/build
|
|
|
|
script:
|
|
|
|
- run: git submodule update --init --recursive
|
|
|
|
working-directory: ../..
|
|
|
|
|
|
|
|
- cmake $COMMON_ARGS $ARGS ../..
|
|
|
|
- make install
|
|
|
|
|
|
|
|
# Build the cli
|
|
|
|
- cmake $COMMON_ARGS $CLI_ARGS ../..
|
|
|
|
- make grpc_cli
|
|
|
|
|
|
|
|
- cp grpc_cli "{{prefix}}/bin"
|
|
|
|
- cp libgrpc++_test_config.* "{{prefix}}/lib"
|
|
|
|
|
2024-04-26 20:04:41 +03:00
|
|
|
# grpc has libs and binaries that end up with name @rpath/libgrpc_plugin_support.{{version}}.dylib (offset 24)
|
|
|
|
# so we need to add @loader_path to the rpath
|
|
|
|
- run: |
|
|
|
|
for f in bin/* lib/libgrpc++_test_config.dylib; do
|
|
|
|
if test -f $f; then
|
|
|
|
install_name_tool -add_rpath @loader_path/../lib $f
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
working-directory: '{{prefix}}'
|
2023-09-11 23:38:12 +03:00
|
|
|
if: darwin
|
2024-04-26 20:04:41 +03:00
|
|
|
|
2023-09-11 23:38:12 +03:00
|
|
|
env:
|
|
|
|
COMMON_ARGS:
|
|
|
|
- -DCMAKE_BUILD_TYPE=Release
|
|
|
|
- -DCMAKE_INSTALL_PREFIX="{{prefix}}"
|
|
|
|
- -DCMAKE_INSTALL_RPATH={{prefix}}
|
|
|
|
- -DBUILD_SHARED_LIBS=ON
|
|
|
|
ARGS:
|
|
|
|
- -DCMAKE_CXX_STANDARD=17
|
|
|
|
- -DCMAKE_CXX_STANDARD_REQUIRED=TRUE
|
|
|
|
- -DgRPC_BUILD_TESTS=OFF
|
|
|
|
- -DgRPC_INSTALL=ON
|
|
|
|
- -DgRPC_ABSL_PROVIDER=package
|
|
|
|
- -DgRPC_CARES_PROVIDER=package
|
|
|
|
- -DgRPC_PROTOBUF_PROVIDER=package
|
|
|
|
- -DgRPC_SSL_PROVIDER=package
|
|
|
|
- -DgRPC_ZLIB_PROVIDER=package
|
|
|
|
- -DgRPC_RE2_PROVIDER=package
|
|
|
|
CLI_ARGS:
|
|
|
|
- -DgRPC_BUILD_TESTS=ON
|
2024-03-31 00:24:58 +03:00
|
|
|
# linux:
|
|
|
|
# # likely needs bumping to an unreleased abseil.io version
|
|
|
|
# # ld.lld: error: undefined reference due to --no-allow-shlib-undefined: absl::lts_20230802::Cord::Cord<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 0>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&)
|
|
|
|
# LDFLAGS: $LDFLAGS -Wl,--allow-shlib-undefined
|
|
|
|
# ARGS:
|
|
|
|
# - -DCMAKE_EXE_LINKER_FLAGS=-Wl,-lstdc++
|
2023-09-11 23:38:12 +03:00
|
|
|
|
|
|
|
test:
|
|
|
|
dependencies:
|
|
|
|
freedesktop.org/pkg-config: ^0
|
|
|
|
fixture: |
|
|
|
|
#include <grpc/grpc.h>
|
|
|
|
int main() {
|
|
|
|
grpc_init();
|
|
|
|
grpc_shutdown();
|
|
|
|
return GRPC_STATUS_OK;
|
|
|
|
}
|
|
|
|
script:
|
|
|
|
- cp $FIXTURE test.cpp
|
|
|
|
- PKG_CONFIG=$(pkg-config --cflags --libs libcares protobuf re2 grpc++)
|
2024-03-31 00:24:58 +03:00
|
|
|
- clang++ $PKG_CONFIG test.cpp -o test -lstdc++
|
2023-09-11 23:38:12 +03:00
|
|
|
- ./test
|
2024-03-31 00:24:58 +03:00
|
|
|
- (grpc_cli ls localhost:58931 2>&1 || true) | grep -E "(failed to connect to all addresses|rpc failed)"
|