Skip to content

Commit

Permalink
update registry for brpc
Browse files Browse the repository at this point in the history
  • Loading branch information
oathdruid committed Oct 17, 2024
1 parent 51dc6c0 commit 0af607c
Show file tree
Hide file tree
Showing 21 changed files with 342 additions and 136 deletions.
8 changes: 8 additions & 0 deletions registry/modules/boost.uuid/1.83.0.bcr.1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module(
name = "boost.uuid",
version = "1.83.0.bcr.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 108300,
)

bazel_dep(name = "rules_cc", version = "0.0.9")
12 changes: 12 additions & 0 deletions registry/modules/boost.uuid/1.83.0.bcr.1/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "boost.uuid",
hdrs = glob([
"include/**/*.hpp",
"include/**/*.ipp",
"include/**/*.h",
]),
includes = ["include"],
visibility = ["//visibility:public"],
)
18 changes: 18 additions & 0 deletions registry/modules/boost.uuid/1.83.0.bcr.1/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
matrix:
platform:
- debian10
- debian11
- macos
- macos_arm64
- ubuntu2004
- ubuntu2204
- windows
bazel:
- 7.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@boost.uuid//:boost.uuid'
10 changes: 10 additions & 0 deletions registry/modules/boost.uuid/1.83.0.bcr.1/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/boostorg/uuid/archive/refs/tags/boost-1.83.0.tar.gz",
"integrity": "sha256-D9kSkan1QR0Jf4gR5hNz3xPU4b6EWNWLLIas9CYVPBY=",
"strip_prefix": "uuid-boost-1.83.0",
"patch_strip": 0,
"overlay": {
"BUILD.bazel": "sha256-QOWCk45CZMvrkDTYkA1hatLCCprZ6WbZu78GK+YLuRY=",
"MODULE.bazel": "sha256-Gv5u8Mtyn1lnrRVKbLbu5GvP5f/nhtg3W7wV+vK0MkA="
}
}
2 changes: 1 addition & 1 deletion registry/modules/leveldb/1.23/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ module(
compatibility_level = 1,
)

bazel_dep(name = 'rules_foreign_cc', version = '0.8.0')
bazel_dep(name = 'crc32c', version = '1.1.0')
bazel_dep(name = 'rules_foreign_cc', version = '0.8.0')
bazel_dep(name = 'snappy', version = '1.1.8')
41 changes: 41 additions & 0 deletions registry/modules/leveldb/1.23/overlay/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package(
default_visibility = ['//:__pkg__'],
)

load('@rules_foreign_cc//foreign_cc:defs.bzl', 'cmake')

filegroup(
name = 'all_srcs',
srcs = glob(['**'], exclude = ['bazel-*/**']),
)

SYMLINK2REAL_SCRIPT = """bash -c '
set -ex
shopt -s globstar
for file in $INSTALLDIR/** ; do
if [ -L $file ]; then
target=`readlink -f $file`
echo $file $target
rm $file
cp $target $file
fi
done
'"""

cmake(
name = 'leveldb',
lib_source = ':all_srcs',
cache_entries = {
'LEVELDB_BUILD_TESTS': 'OFF',
'LEVELDB_BUILD_BENCHMARKS': 'OFF',
'CMAKE_CXX_FLAGS': '-I$$EXT_BUILD_DEPS$$/include',
'CMAKE_EXE_LINKER_FLAGS': '-L$$EXT_BUILD_DEPS$$/lib',
},
postfix_script = SYMLINK2REAL_SCRIPT,
lib_name = 'libleveldb',
visibility = ['//visibility:public'],
deps = [
'@crc32c',
'@snappy',
],
)
62 changes: 0 additions & 62 deletions registry/modules/leveldb/1.23/patches/add-build.patch

This file was deleted.

15 changes: 15 additions & 0 deletions registry/modules/leveldb/1.23/patches/modify-cmakelist.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8285b8..1bf7b99 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,8 +38,9 @@ include(CheckIncludeFile)
check_include_file("unistd.h" HAVE_UNISTD_H)

include(CheckLibraryExists)
+include(CheckIncludeFileCXX)
check_library_exists(crc32c crc32c_value "" HAVE_CRC32C)
-check_library_exists(snappy snappy_compress "" HAVE_SNAPPY)
+check_include_file_cxx("snappy.h" HAVE_SNAPPY)
check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC)

include(CheckCXXSymbolExists)
5 changes: 4 additions & 1 deletion registry/modules/leveldb/1.23/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"integrity": "sha256-mjf4phdPCb1iK8cjtViB3FQc1QdHy9CIMcKoLWIPbXY=",
"patch_strip": 1,
"patches": {
"add-build.patch": "sha256-gwN67RMJVwmzg1C3gOI+kJqFCrWpi2bAgxsSXin1MpI="
"modify-cmakelist.patch": "sha256-wRlhYk8ADW3HpTNeOTVnSNC/Puz6P2RYtp+3sLOBhwg="
},
"overlay": {
"BUILD": "sha256-85nEZ7MgnlJwej0UKssVFGIFVi/PNvWDYrRTQG/A1IQ="
}
}
4 changes: 2 additions & 2 deletions registry/modules/libevent/2.1.12/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module(
compatibility_level = 1,
)

bazel_dep(name = 'rules_foreign_cc', version = '0.8.0')
bazel_dep(name = 'openssl', version = '3.3.1')
bazel_dep(name = 'rules_foreign_cc', version = '0.9.0')
bazel_dep(name = 'openssl', version = '3.3.2')
53 changes: 53 additions & 0 deletions registry/modules/libevent/2.1.12/overlay/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package(
default_visibility = ['//:__pkg__'],
)

load('@rules_foreign_cc//foreign_cc:defs.bzl', 'cmake')

filegroup(
name = 'all_srcs',
srcs = glob(['**'], exclude = ['bazel-*/**']),
)

SYMLINK2REAL_SCRIPT = """bash -c '
set -ex
shopt -s globstar
for file in $INSTALLDIR/** ; do
if [ -L $file ]; then
target=`readlink -f $file`
echo $file $target
rm $file
cp $target $file
fi
done
'"""

alias(
name = 'event',
actual = 'libevent',
visibility = ['//visibility:public'],
)

cmake(
name = 'libevent',
lib_source = ':all_srcs',
cache_entries = {
'EVENT__DISABLE_BENCHMARK': 'ON',
'EVENT__DISABLE_TESTS': 'ON',
'EVENT__DISABLE_SAMPLES': 'ON',
'EVENT__LIBRARY_TYPE': 'STATIC',
'OPENSSL_ROOT_DIR': '$$EXT_BUILD_DEPS$$/openssl',
},
postfix_script = SYMLINK2REAL_SCRIPT,
out_static_libs = [
'libevent.a',
'libevent_core.a',
'libevent_extra.a',
'libevent_openssl.a',
'libevent_pthreads.a',
],
deps = [
'@openssl',
],
visibility = ['//visibility:public'],
)
67 changes: 0 additions & 67 deletions registry/modules/libevent/2.1.12/patches/add-build.patch

This file was deleted.

5 changes: 2 additions & 3 deletions registry/modules/libevent/2.1.12/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"url": "https://github.com/libevent/libevent/archive/refs/tags/release-2.1.12-stable.tar.gz",
"strip_prefix": "libevent-release-2.1.12-stable",
"integrity": "sha256-cYCpeaqnAA4SZNpIT3EtQD/Pdnmx6SEsTj0J9ck+/CQ=",
"patch_strip": 1,
"patches": {
"add-build.patch": "sha256-b1y8kMCSqA8kCHXbyTCsQS976Xr7IgicI8GVomCattw="
"overlay": {
"BUILD": "sha256-ITVQMrYpCCgBU6kIAFFkg4Ow0Ur2yjIaTkOO9B3ZpVQ="
}
}
8 changes: 8 additions & 0 deletions registry/modules/openssl/3.3.2/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module(
name = 'openssl',
version = '3.3.2',
compatibility_level = 1,
)

bazel_dep(name = 'rules_foreign_cc', version = '0.8.0')
bazel_dep(name = 'zlib', version = '1.2.13')
46 changes: 46 additions & 0 deletions registry/modules/openssl/3.3.2/overlay/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package(
default_visibility = ['//:__pkg__'],
)

load('@rules_foreign_cc//foreign_cc:defs.bzl', 'configure_make')

filegroup(
name = 'all_srcs',
srcs = glob(['**'], exclude = ['bazel-*/**']),
)

CONFIGURE_OPTIONS = [
'no-shared',
'zlib',
'--with-zlib-include=$$EXT_BUILD_DEPS$$/include',
'--with-zlib-lib=$$EXT_BUILD_DEPS$$/lib',
]

alias(
name = 'ssl',
actual = 'openssl',
visibility = ['//visibility:public'],
)

alias(
name = 'crypto',
actual = 'openssl',
visibility = ['//visibility:public'],
)

configure_make(
name = 'openssl',
lib_source = ':all_srcs',
configure_command = 'Configure',
configure_options = CONFIGURE_OPTIONS,
targets = ['install_dev'],
out_lib_dir = 'lib64',
out_static_libs = [
'libssl.a',
'libcrypto.a',
],
deps = [
'@zlib',
],
visibility = ['//visibility:public'],
)
Loading

0 comments on commit 0af607c

Please sign in to comment.