Add new package: brpc (#16309)

* Add new package: brpc

* change a patch for brpc

* refine brpc version

* refine brpc patch constraint
This commit is contained in:
darmac 2020-04-29 22:58:35 +08:00 committed by GitHub
parent 5697894b22
commit 42d7fd30c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,33 @@
diff --git a/src/butil/containers/case_ignored_flat_map.cpp b/src/butil/containers/case_ignored_flat_map.cpp
index 7f2fadc5..a7471561 100644
--- a/src/butil/containers/case_ignored_flat_map.cpp
+++ b/src/butil/containers/case_ignored_flat_map.cpp
@@ -19,7 +19,7 @@
namespace butil {
-static const char g_tolower_map_base[] = {
+static const signed char g_tolower_map_base[] = {
-128, -127, -126, -125, -124, -123, -122, -121, -120,
-119, -118, -117, -116, -115, -114, -113, -112, -111, -110,
-109, -108, -107, -106, -105, -104, -103, -102, -101, -100,
@@ -48,6 +48,6 @@ static const char g_tolower_map_base[] = {
120, 121, 122, 123, 124, 125, 126, 127
};
-extern const char* const g_tolower_map = g_tolower_map_base + 128;
+extern const signed char* const g_tolower_map = g_tolower_map_base + 128;
} // namespace butil
diff --git a/src/butil/containers/case_ignored_flat_map.h b/src/butil/containers/case_ignored_flat_map.h
index ed6e58b4..6bc1a9af 100644
--- a/src/butil/containers/case_ignored_flat_map.h
+++ b/src/butil/containers/case_ignored_flat_map.h
@@ -27,7 +27,7 @@ namespace butil {
// NOTE: Using ascii_tolower instead of ::tolower shortens 150ns in
// FlatMapTest.perf_small_string_map (with -O2 added, -O0 by default)
inline char ascii_tolower(char c) {
- extern const char* const g_tolower_map;
+ extern const signed char* const g_tolower_map;
return g_tolower_map[(int)c];
}

View file

@ -0,0 +1,26 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Brpc(CMakePackage):
"""An industrial-grade RPC framework used throughout Baidu, with
1,000,000+ instances(not counting clients) and thousands kinds of
services, called "baidu-rpc" inside Baidu. Only C++ implementatioo
on is opensourced right now."""
homepage = "https://github.com/apache/incubator-brpc"
url = "https://github.com/apache/incubator-brpc/archive/0.9.7.tar.gz"
version('0.9.7', sha256='722cd342baf3b05189ca78ecf6c56ea6ffec22e62fc2938335e4e5bab545a49c')
version('0.9.6', sha256='b872ca844999e0ba768acd823b409761f126590fb34cb0183da915a595161446')
version('0.9.5', sha256='11ca8942242a4c542c11345b7463a4aea33a11ca33e91d9a2f64f126df8c70e9')
depends_on('gflags')
depends_on('protobuf')
depends_on('leveldb')
patch('narrow.patch', sha256='d7393029443853ddda6c09e3d2185ac2f60920a36a8b685eb83b6b80c1535539', when='@:0.9.7')