Skip to content

Commit

Permalink
civetweb@1.16 (#1886)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorel-35 committed May 6, 2024
1 parent 05d172d commit 52ed9e5
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/civetweb/1.16/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module(
name = "civetweb",
version = "1.16",
compatibility_level = 1,
)

bazel_dep(
name = "boringssl",
version = "0.0.0-20230215-5c22014",
)
bazel_dep(
name = "platforms",
version = "0.0.8",
)
108 changes: 108 additions & 0 deletions modules/civetweb/1.16/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
--- /dev/null
+++ BUILD.bazel
@@ -0,0 +1,105 @@
+licenses(["notice"]) # MIT license
+
+config_setting(
+ name = "osx",
+ constraint_values = [
+ "@platforms//os:osx",
+ ],
+)
+
+config_setting(
+ name = "windows",
+ constraint_values = [
+ "@platforms//os:windows",
+ ],
+)
+
+config_setting(
+ name = "with_ssl",
+ define_values = {
+ "with_civetweb_ssl": "true",
+ },
+ visibility = ["//visibility:public"],
+)
+
+COPTS = [
+ "-DUSE_IPV6",
+ "-DNDEBUG",
+ "-DNO_CGI",
+ "-DNO_CACHING",
+ "-DNO_FILES",
+ "-UDEBUG",
+] + select({
+ ":with_ssl": [
+ "-DOPENSSL_API_1_1",
+ "-DNO_SSL_DL",
+ ],
+ "//conditions:default": [
+ "-DNO_SSL",
+ ],
+})
+
+DEPS = select({
+ ":with_ssl": [
+ "@boringssl//:crypto",
+ "@boringssl//:ssl",
+ ],
+ "//conditions:default": [],
+})
+
+cc_library(
+ name = "civetweb",
+ srcs = [
+ "src/civetweb.c",
+ ],
+ hdrs = [
+ "include/civetweb.h",
+ ],
+ copts = COPTS,
+ includes = [
+ "include",
+ ],
+ linkopts = select({
+ ":windows": [],
+ "//conditions:default": ["-lpthread"],
+ }) + select({
+ ":osx": [],
+ ":windows": [],
+ "//conditions:default": ["-lrt"],
+ }),
+ textual_hdrs = [
+ "src/handle_form.inl",
+ "src/match.inl",
+ "src/md5.inl",
+ "src/response.inl",
+ "src/sort.inl",
+ ],
+ visibility = ["//visibility:public"],
+ deps = DEPS,
+)
+
+cc_library(
+ name = "civetserver",
+ srcs = [
+ "src/CivetServer.cpp",
+ ],
+ hdrs = [
+ "include/CivetServer.h",
+ ],
+ copts = COPTS,
+ includes = [
+ "include",
+ ],
+ linkopts = select({
+ ":windows": [],
+ "//conditions:default": ["-lpthread"],
+ }) + select({
+ ":osx": [],
+ ":windows": [],
+ "//conditions:default": ["-lrt"],
+ }),
+ visibility = ["//visibility:public"],
+ deps = [
+ ":civetweb",
+ ],
+)
17 changes: 17 additions & 0 deletions modules/civetweb/1.16/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- MODULE.bazel
+++ MODULE.bazel
@@ -0,0 +1,14 @@
+module(
+ name = "civetweb",
+ version = "1.16",
+ compatibility_level = 1,
+)
+
+bazel_dep(
+ name = "boringssl",
+ version = "0.0.0-20230215-5c22014",
+)
+bazel_dep(
+ name = "platforms",
+ version = "0.0.8",
+)
17 changes: 17 additions & 0 deletions modules/civetweb/1.16/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel:
- 7.x
- 6.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@civetweb//...'
10 changes: 10 additions & 0 deletions modules/civetweb/1.16/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/civetweb/civetweb/archive/v1.16.tar.gz",
"integrity": "sha256-8ORxwb9OeASmz7QeqdE+fWI7K8x7weKk3VSVGiTWAoU=",
"strip_prefix": "civetweb-1.16",
"patches": {
"add_build_file.patch": "sha256-0R40p5wAtmQ/MLvqI9XzF9H5BRpxC85lUdXHlW1teIQ=",
"module_dot_bazel.patch": "sha256-xbUEcDhFEMv7bJHQpFKzPdqDog1yLfH2f5+lt191on8="
},
"patch_strip": 0
}
16 changes: 16 additions & 0 deletions modules/civetweb/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"homepage": "https://github.com/civetweb/civetweb",
"maintainers": [
{
"email": "bcr-maintainers@bazel.build",
"name": "No Maintainer Specified"
}
],
"repository": [
"github:civetweb/civetweb"
],
"versions": [
"1.16"
],
"yanked_versions": {}
}

0 comments on commit 52ed9e5

Please sign in to comment.