Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haikuports/haikuports
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 74035f19f8b3
Choose a base ref
...
head repository: haikuports/haikuports
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cd2c736ffbc6
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Oct 17, 2021

  1. grpc: new recipe

    korli committed Oct 17, 2021
    Copy the full SHA
    cd2c736 View commit details
Showing with 227 additions and 0 deletions.
  1. +128 −0 net-libs/grpc/grpc-1.41.0.recipe
  2. +99 −0 net-libs/grpc/patches/grpc-1.41.0.patchset
128 changes: 128 additions & 0 deletions net-libs/grpc/grpc-1.41.0.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
SUMMARY="A RPC library and framework"
DESCRIPTION="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."
HOMEPAGE="https://grpc.io/"
COPYRIGHT="2015-2021 The gRPC Authors"
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://github.com/grpc/grpc/archive/v$portVersion/grpc-$portVersion.tar.gz"
CHECKSUM_SHA256="e5fb30aae1fa1cffa4ce00aa0bbfab908c0b899fcf0bbc30e268367d660d8656"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

libVersion="19.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
grpc$secondaryArchSuffix = $portVersion
cmd:grpc_cpp_plugin
lib:libaddress_sorting$secondaryArchSuffix = $libVersionCompat
lib:libgpr$secondaryArchSuffix = $libVersionCompat
lib:libgrpc$secondaryArchSuffix = $libVersionCompat
lib:libgrpc_plugin_support$secondaryArchSuffix = $libVersionCompat
lib:libgrpc_unsecure$secondaryArchSuffix = $libVersionCompat
lib:libgrpc++$secondaryArchSuffix = $libVersionCompat
lib:libgrpc++_alts$secondaryArchSuffix = $libVersionCompat
lib:libgrpc++_error_details$secondaryArchSuffix = $libVersionCompat
lib:libgrpc++_reflection$secondaryArchSuffix = $libVersionCompat
lib:libgrpc++_unsecure$secondaryArchSuffix = $libVersionCompat
lib:libgrpcpp_channelz$secondaryArchSuffix = $libVersionCompat
lib:libupb$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libabsl_exponential_biased$secondaryArchSuffix
# the list of libabsl dependencies is too long
lib:libcares$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libprotobuf$secondaryArchSuffix
lib:libprotobufc$secondaryArchSuffix
lib:libre2$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"

PROVIDES_devel="
grpc${secondaryArchSuffix}_devel = $portVersion
devel:libaddress_sorting$secondaryArchSuffix = $libVersionCompat
devel:libgpr$secondaryArchSuffix = $libVersionCompat
devel:libgrpc$secondaryArchSuffix = $libVersionCompat
devel:libgrpc_unsecure$secondaryArchSuffix = $libVersionCompat
devel:libgrpc++$secondaryArchSuffix = $libVersionCompat
devel:libgrpc++_alts$secondaryArchSuffix = $libVersionCompat
devel:libgrpc++_error_details$secondaryArchSuffix = $libVersionCompat
devel:libgrpc++_reflection$secondaryArchSuffix = $libVersionCompat
devel:libgrpc++_unsecure$secondaryArchSuffix = $libVersionCompat
devel:libgrpcpp_channelz$secondaryArchSuffix = $libVersionCompat
devel:libupb$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
grpc$secondaryArchSuffix == $portVersion base
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libabsl_synchronization$secondaryArchSuffix
devel:libcares$secondaryArchSuffix
devel:libprotobuf$secondaryArchSuffix
devel:libre2$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
"

BUILD()
{
cmake -Bbuild -S . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DBUILD_SHARED_LIBS=ON \
-DgRPC_INSTALL_BINDIR=$relativeBinDir \
-DgRPC_INSTALL_INCLUDEDIR=$relativeIncludeDir \
-DgRPC_INSTALL_LIBDIR=$relativeLibDir \
-DgRPC_INSTALL_CMAKEDIR=$relativeLibDir/cmake/grpc \
-DgRPC_INSTALL_SHAREDIR=$relativeDataDir/grpc \
-DgRPC_ABSL_PROVIDER='package' \
-DgRPC_CARES_PROVIDER='package' \
-DgRPC_ZLIB_PROVIDER='package' \
-DgRPC_PROTOBUF_PROVIDER='package' \
-DgRPC_PROTOBUF_PACKAGE_TYPE='MODULE' \
-DgRPC_RE2_PROVIDER='package' \
-DgRPC_SSL_PROVIDER='package' \
-DgRPC_ZLIB_PROVIDER='package' \
-DgRPC_USE_PROTO_LITE=OFF \
-DgRPC_BUILD_GRPC_CPP_PLUGIN=ON \
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
-GNinja
unset -f cmake
cmake --build build $jobArgs
}

INSTALL()
{
unset -f cmake
cmake --install build

prepareInstalledDevelLibs libaddress_sorting libgpr libgrpc \
libgrpc_unsecure libgrpc++ libgrpc++_alts libgrpc++_error_details \
libgrpc++_reflection libgrpc++_unsecure libgrpcpp_channelz libupb
fixPkgconfig

packageEntries devel \
"$developDir" \
"$libDir"/cmake
}
99 changes: 99 additions & 0 deletions net-libs/grpc/patches/grpc-1.41.0.patchset
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
From 43dcbea98e45c60994137c0dc8b5538dca92cab3 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 16 Oct 2021 21:33:26 +0200
Subject: Haiku: port


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e8fbde..832a49c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -269,7 +269,7 @@ if(_gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS)
set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread)
elseif(_gRPC_PLATFORM_ANDROID)
set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m)
-elseif(UNIX)
+elseif(UNIX AND NOT HAIKU)
set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} rt m pthread)
endif()

@@ -11654,6 +11654,7 @@ if(gRPC_BUILD_CODEGEN AND gRPC_BUILD_GRPC_CPP_PLUGIN)
add_executable(grpc_cpp_plugin
src/compiler/cpp_plugin.cc
)
+set_property(TARGET grpc_cpp_plugin PROPERTY POSITION_INDEPENDENT_CODE FALSE)

target_include_directories(grpc_cpp_plugin
PRIVATE
diff --git a/include/grpc/event_engine/port.h b/include/grpc/event_engine/port.h
index 9424586..5ee5327 100644
--- a/include/grpc/event_engine/port.h
+++ b/include/grpc/event_engine/port.h
@@ -20,7 +20,7 @@
#if defined(GPR_ANDROID) || defined(GPR_LINUX) || defined(GPR_APPLE) || \
defined(GPR_FREEBSD) || defined(GPR_OPENBSD) || defined(GPR_SOLARIS) || \
defined(GPR_AIX) || defined(GPR_NACL) || defined(GPR_FUCHSIA) || \
- defined(GRPC_POSIX_SOCKET)
+ defined(GPR_HAIKU) || defined(GRPC_POSIX_SOCKET)
#define GRPC_EVENT_ENGINE_POSIX
#include <arpa/inet.h>
#include <netdb.h>
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index 8b9831b..d4dad67 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -393,6 +393,30 @@
#define GPR_HAS_PTHREAD_H 1
#define GPR_GETPID_IN_UNISTD_H 1
#define GRPC_ROOT_PEM_PATH "/config/ssl/cert.pem"
+#elif defined(__HAIKU__)
+#define GPR_PLATFORM_STRING "haiku"
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE
+#endif
+#define GPR_HAIKU 1
+#define GPR_CPU_POSIX 1
+#define GPR_GCC_ATOMIC 1
+#define GPR_POSIX_LOG 1
+#define GPR_POSIX_ENV 1
+#define GPR_POSIX_TMPFILE 1
+#define GPR_POSIX_STAT 1
+#define GPR_POSIX_STRING 1
+#define GPR_POSIX_SUBPROCESS 1
+#define GPR_POSIX_SYNC 1
+#define GPR_POSIX_TIME 1
+#define GPR_HAS_PTHREAD_H 1
+#define GPR_GETPID_IN_UNISTD_H 1
+#define GPR_SUPPORT_CHANNELS_FROM_FD 1
+#ifdef _LP64
+#define GPR_ARCH_64 1
+#else /* _LP64 */
+#define GPR_ARCH_32 1
+#endif /* _LP64 */
#else
#error "Could not auto-detect platform"
#endif
diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h
index 3e32429..28e9b11 100644
--- a/src/core/lib/iomgr/port.h
+++ b/src/core/lib/iomgr/port.h
@@ -180,6 +180,16 @@
// TODO(rudominer) Check this does something we want.
#define GRPC_POSIX_SOCKETUTILS 1
#define GRPC_TIMER_USE_GENERIC 1
+#elif defined(GPR_HAIKU)
+#define GRPC_HAVE_ARPA_NAMESER 1
+#define GRPC_HAVE_IFADDRS 1
+#define GRPC_HAVE_IPV6_RECVPKTINFO 1
+#define GRPC_HAVE_UNIX_SOCKET 1
+#define GRPC_POSIX_FORK 1
+#define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1
+#define GRPC_POSIX_SOCKET 1
+#define GRPC_POSIX_SOCKETUTILS 1
+#define GRPC_POSIX_WAKEUP_FD 1
#elif !defined(GPR_NO_AUTODETECT_PLATFORM)
#error "Platform not recognized"
#endif
--
2.30.2