From a26590b00c4f6915cccf54cc08f7e05119b8be2c Mon Sep 17 00:00:00 2001 From: Leonardo Romor Date: Mon, 30 Sep 2024 21:14:08 +0200 Subject: [PATCH] feat: nlohmann_json add single_header package --- modules/nlohmann_json/3.11.3.bcr.1/MODULE.bazel | 5 +++++ .../patches/add_singleheader_target.patch | 15 +++++++++++++++ .../3.11.3.bcr.1/patches/module_dot_bazel.patch | 8 ++++++++ modules/nlohmann_json/3.11.3.bcr.1/presubmit.yml | 14 ++++++++++++++ modules/nlohmann_json/3.11.3.bcr.1/source.json | 9 +++++++++ modules/nlohmann_json/metadata.json | 3 ++- 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 modules/nlohmann_json/3.11.3.bcr.1/MODULE.bazel create mode 100644 modules/nlohmann_json/3.11.3.bcr.1/patches/add_singleheader_target.patch create mode 100644 modules/nlohmann_json/3.11.3.bcr.1/patches/module_dot_bazel.patch create mode 100644 modules/nlohmann_json/3.11.3.bcr.1/presubmit.yml create mode 100644 modules/nlohmann_json/3.11.3.bcr.1/source.json diff --git a/modules/nlohmann_json/3.11.3.bcr.1/MODULE.bazel b/modules/nlohmann_json/3.11.3.bcr.1/MODULE.bazel new file mode 100644 index 00000000000..7eea9402424 --- /dev/null +++ b/modules/nlohmann_json/3.11.3.bcr.1/MODULE.bazel @@ -0,0 +1,5 @@ +module( + name = "nlohmann_json", + version = "3.11.3.bcr.1", + compatibility_level = 1, +) diff --git a/modules/nlohmann_json/3.11.3.bcr.1/patches/add_singleheader_target.patch b/modules/nlohmann_json/3.11.3.bcr.1/patches/add_singleheader_target.patch new file mode 100644 index 00000000000..86974b23667 --- /dev/null +++ b/modules/nlohmann_json/3.11.3.bcr.1/patches/add_singleheader_target.patch @@ -0,0 +1,15 @@ +--- BUILD.bazel ++++ BUILD.bazel +@@ -51,3 +51,12 @@ + visibility = ["//visibility:public"], + alwayslink = True, + ) ++ ++cc_library( ++ name = "singleheader/json", ++ hdrs = [ ++ "single_include/nlohmann/json.hpp", ++ ], ++ includes = ["single_include"], ++ visibility = ["//visibility:public"], ++) diff --git a/modules/nlohmann_json/3.11.3.bcr.1/patches/module_dot_bazel.patch b/modules/nlohmann_json/3.11.3.bcr.1/patches/module_dot_bazel.patch new file mode 100644 index 00000000000..f060aaf87d5 --- /dev/null +++ b/modules/nlohmann_json/3.11.3.bcr.1/patches/module_dot_bazel.patch @@ -0,0 +1,8 @@ +--- MODULE.bazel ++++ MODULE.bazel +@@ -0,0 +1,5 @@ ++module( ++ name = "nlohmann_json", ++ version = "3.11.3.bcr.1", ++ compatibility_level = 1, ++) diff --git a/modules/nlohmann_json/3.11.3.bcr.1/presubmit.yml b/modules/nlohmann_json/3.11.3.bcr.1/presubmit.yml new file mode 100644 index 00000000000..e3bad672668 --- /dev/null +++ b/modules/nlohmann_json/3.11.3.bcr.1/presubmit.yml @@ -0,0 +1,14 @@ +matrix: + platform: + - centos7 + - debian10 + - ubuntu2004 + - macos + - windows +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + build_targets: + - '@nlohmann_json//:json' + - '@nlohmann_json//:singleheader/json' diff --git a/modules/nlohmann_json/3.11.3.bcr.1/source.json b/modules/nlohmann_json/3.11.3.bcr.1/source.json new file mode 100644 index 00000000000..08de7a7cb62 --- /dev/null +++ b/modules/nlohmann_json/3.11.3.bcr.1/source.json @@ -0,0 +1,9 @@ +{ + "url": "https://github.com/nlohmann/json/releases/download/v3.11.3/include.zip", + "integrity": "sha256-oiRh0TEZrFx48gXT3x2xNAPljOG7F5TtyTE2dzE/Sp0=", + "patches": { + "module_dot_bazel.patch": "sha256-hPXI9p5q2IsjLrlh75uXr4zaNpsVkSxRebNg8FjgyS8=", + "add_singleheader_target.patch": "sha256-R1EUE5FIaDwmVXsuLFQ9d0vsjAxuWcGgVmSXJ7DcX6I=" + }, + "patch_strip": 0 +} diff --git a/modules/nlohmann_json/metadata.json b/modules/nlohmann_json/metadata.json index e4034eff8c7..26862f56b60 100644 --- a/modules/nlohmann_json/metadata.json +++ b/modules/nlohmann_json/metadata.json @@ -13,7 +13,8 @@ "versions": [ "3.6.1", "3.11.2", - "3.11.3" + "3.11.3", + "3.11.3.bcr.1" ], "yanked_versions": {} }