From 9ac4b7fa1d4f3f05f59b571fe9cf8a9058ae6a9f Mon Sep 17 00:00:00 2001 From: Carbo Kuo Date: Fri, 5 Jul 2024 13:42:43 -0400 Subject: [PATCH] Create 0.8.2.bcr.1 and modify "linkopts" for "websocketpp" depending on the operating system. This change fixes the build on Mac OS X. According to the original CMakeLists.txt, "rt" is not linked on Mac OS X. if (NOT APPLE) set (WEBSOCKETPP_PLATFORM_LIBS pthread rt) else() set (WEBSOCKETPP_PLATFORM_LIBS pthread) endif() --- modules/websocketpp/0.8.2.bcr.1/MODULE.bazel | 9 ++++++ .../0.8.2.bcr.1/patches/add_build_file.patch | 28 +++++++++++++++++++ .../patches/module_dot_bazel.patch | 12 ++++++++ modules/websocketpp/0.8.2.bcr.1/presubmit.yml | 14 ++++++++++ modules/websocketpp/0.8.2.bcr.1/source.json | 10 +++++++ modules/websocketpp/metadata.json | 3 +- 6 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 modules/websocketpp/0.8.2.bcr.1/MODULE.bazel create mode 100644 modules/websocketpp/0.8.2.bcr.1/patches/add_build_file.patch create mode 100644 modules/websocketpp/0.8.2.bcr.1/patches/module_dot_bazel.patch create mode 100644 modules/websocketpp/0.8.2.bcr.1/presubmit.yml create mode 100644 modules/websocketpp/0.8.2.bcr.1/source.json diff --git a/modules/websocketpp/0.8.2.bcr.1/MODULE.bazel b/modules/websocketpp/0.8.2.bcr.1/MODULE.bazel new file mode 100644 index 00000000000..80b7df1d2c8 --- /dev/null +++ b/modules/websocketpp/0.8.2.bcr.1/MODULE.bazel @@ -0,0 +1,9 @@ +module( + name = "websocketpp", + version = "0.8.2.bcr.1", + compatibility_level = 1, +) +bazel_dep(name = "asio", version = "1.28.2") +bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "zlib", version = "1.3") +bazel_dep(name = "platforms", version = "0.0.10") diff --git a/modules/websocketpp/0.8.2.bcr.1/patches/add_build_file.patch b/modules/websocketpp/0.8.2.bcr.1/patches/add_build_file.patch new file mode 100644 index 00000000000..699e064de9e --- /dev/null +++ b/modules/websocketpp/0.8.2.bcr.1/patches/add_build_file.patch @@ -0,0 +1,28 @@ +--- /dev/null ++++ BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@rules_cc//cc:defs.bzl", "cc_library") ++ ++cc_library( ++ name = "websocketpp", ++ hdrs = glob(["websocketpp/**/*.hpp"]), ++ defines = [ ++ "ASIO_STANDALONE", ++ "_WEBSOCKETPP_CPP11_STL_", ++ ], ++ includes = ["."], ++ linkopts = select({ ++ "@platforms//os:osx": [ ++ "-lpthread", ++ ], ++ "//conditions:default": [ ++ "-lpthread", ++ "-lrt", ++ ], ++ }), ++ visibility = ["//visibility:public"], ++ deps = [ ++ "@asio", ++ "@zlib", ++ ], ++) diff --git a/modules/websocketpp/0.8.2.bcr.1/patches/module_dot_bazel.patch b/modules/websocketpp/0.8.2.bcr.1/patches/module_dot_bazel.patch new file mode 100644 index 00000000000..ee6cb6c388f --- /dev/null +++ b/modules/websocketpp/0.8.2.bcr.1/patches/module_dot_bazel.patch @@ -0,0 +1,12 @@ +--- /dev/null ++++ MODULE.bazel +@@ -0,0 +1,9 @@ ++module( ++ name = "websocketpp", ++ version = "0.8.2.bcr.1", ++ compatibility_level = 1, ++) ++bazel_dep(name = "asio", version = "1.28.2") ++bazel_dep(name = "rules_cc", version = "0.0.9") ++bazel_dep(name = "zlib", version = "1.3") ++bazel_dep(name = "platforms", version = "0.0.10") diff --git a/modules/websocketpp/0.8.2.bcr.1/presubmit.yml b/modules/websocketpp/0.8.2.bcr.1/presubmit.yml new file mode 100644 index 00000000000..6bfae8061f5 --- /dev/null +++ b/modules/websocketpp/0.8.2.bcr.1/presubmit.yml @@ -0,0 +1,14 @@ +matrix: + platform: + - debian10 + - ubuntu2004 + - macos + - macos_arm64 + bazel: [6.x, 7.x] +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - "@websocketpp" diff --git a/modules/websocketpp/0.8.2.bcr.1/source.json b/modules/websocketpp/0.8.2.bcr.1/source.json new file mode 100644 index 00000000000..5649507556b --- /dev/null +++ b/modules/websocketpp/0.8.2.bcr.1/source.json @@ -0,0 +1,10 @@ +{ + "url": "https://github.com/zaphoyd/websocketpp/archive/refs/tags/0.8.2.tar.gz", + "integrity": "sha256-bOiJ2F7Nwtj6B0CNZ4fnNSUQdQ2qZrWtRKrLR76nZ1U=", + "strip_prefix": "websocketpp-0.8.2", + "patches": { + "add_build_file.patch": "sha256-KhVOfO47POB3xqoHdeOs+dYbn0dp0aAQddYt8ZWZqcI=", + "module_dot_bazel.patch": "sha256-Bq9+2iYvtN8TR5zGaKTIdS3vYsx/gEP0pM2xLWuMO2U=" + }, + "patch_strip": 0 +} diff --git a/modules/websocketpp/metadata.json b/modules/websocketpp/metadata.json index 03f92869a58..278043c9c1f 100644 --- a/modules/websocketpp/metadata.json +++ b/modules/websocketpp/metadata.json @@ -10,7 +10,8 @@ "github:zaphoyd/websocketpp" ], "versions": [ - "0.8.2" + "0.8.2", + "0.8.2.bcr.1" ], "yanked_versions": {} }