Skip to content

Commit

Permalink
Port project to bzlmod.
Browse files Browse the repository at this point in the history
  • Loading branch information
finn-ball authored and Finn Ball committed May 16, 2024
1 parent 5d04542 commit e2ae4f9
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 292 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bazel-*
.DS_Store
MODULE.bazel.lock
16 changes: 16 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module(name = "com_github_nelhage_rules_boost")

bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "boringssl", version = "0.0.0-20240530-2db0eb3")
bazel_dep(name = "bzip2", version = "1.0.8")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "xz", version = "5.4.5.bcr.2")
# bazel_dep(name = "zlib", version = "1.3.1")
bazel_dep(name = "zstd", version = "1.5.6")

non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies")
use_repo(
non_module_boost_repositories,
"boost",
"zlib",
)
1 change: 0 additions & 1 deletion WORKSPACE.bazel

This file was deleted.

10 changes: 5 additions & 5 deletions boost.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":asio",
"@openssl//:ssl",
"@boringssl//:ssl",
],
)

Expand Down Expand Up @@ -999,7 +999,7 @@ boost_library(

boost_library(
name = "python",
exclude_src = ["**/fabscript"],
exclude_src = ["**/fabscript"],
deps = [
"@python",
":config",
Expand Down Expand Up @@ -1149,9 +1149,9 @@ boost_library(
":type",
":type_traits",
":utility",
"@com_github_facebook_zstd//:zstd",
"@org_bzip_bzip2//:bz2lib",
"@org_lzma_lzma//:lzma",
"@bzip2//:bz2",
"@xz//:lzma",
"@zstd",
"@zlib",
],
)
Expand Down
59 changes: 6 additions & 53 deletions boost/boost.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -107,52 +107,6 @@ def boost_so_library(
)

def boost_deps():
maybe(
http_archive,
name = "bazel_skylib",
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/1.6.1/bazel-skylib-1.6.1.tar.gz",
sha256 = "9f38886a40548c6e96c106b752f242130ee11aaa068a56ba7e56f4511f33e4f2",
)

maybe(
http_archive,
name = "zlib",
build_file = "@com_github_nelhage_rules_boost//:zlib.BUILD",
url = "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz",
sha256 = "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e",
strip_prefix = "zlib-1.3",
)

maybe(
http_archive,
name = "org_bzip_bzip2",
build_file = "@com_github_nelhage_rules_boost//:bzip2.BUILD",
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
strip_prefix = "bzip2-1.0.8",
urls = [
"https://mirror.bazel.build/sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
"https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
],
)

maybe(
http_archive,
name = "org_lzma_lzma",
build_file = "@com_github_nelhage_rules_boost//:lzma.BUILD",
url = "https://src.fedoraproject.org/lookaside/extras/xz/xz-5.4.6.tar.gz/sha512/b08a61d8d478d3b4675cb1ddacdbbd98dc6941a55bcdd81a28679e54e9367d3a595fa123ac97874a17da571c1b712e2a3e901c2737099a9d268616a1ba3de497/xz-5.4.6.tar.gz",
sha256 = "aeba3e03bf8140ddedf62a0a367158340520f6b384f75ca6045ccc6c0d43fd5c",
strip_prefix = "xz-5.4.6",
)

maybe(
http_archive,
name = "com_github_facebook_zstd",
build_file = "@com_github_nelhage_rules_boost//:zstd.BUILD",
url = "https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz",
sha256 = "8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1",
strip_prefix = "zstd-1.5.6",
)

maybe(
http_archive,
name = "boost",
Expand All @@ -164,11 +118,10 @@ def boost_deps():
strip_prefix = "boost-1.84.0",
)

# We're pointing at hedronvision's mirror of google/boringssl:master-with-bazel to get Renovate auto-update. Otherwise, Renovate will keep moving us back to master, which doesn't support Bazel. See https://github.com/renovatebot/renovate/discussions/24854
maybe(
http_archive,
name = "openssl",
url = "https://github.com/hedronvision/boringssl/archive/0f1a639954dd7ab86f5f4ddd8b4e2edbea492acd.tar.gz",
sha256 = "7ce152bdce1b85344cc36c6b255aab36905d39187c2c2f797a69d5ad220076ee",
strip_prefix = "boringssl-0f1a639954dd7ab86f5f4ddd8b4e2edbea492acd",
http_archive(
name = "zlib",
build_file = "@com_github_nelhage_rules_boost//:zlib.BUILD",
url = "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz",
sha256 = "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e",
strip_prefix = "zlib-1.3",
)
8 changes: 8 additions & 0 deletions boost/repositories.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")

def _non_module_dependencies_impl(_ctx):
boost_deps()

non_module_dependencies = module_extension(
implementation = _non_module_dependencies_impl,
)
39 changes: 0 additions & 39 deletions bzip2.BUILD

This file was deleted.

121 changes: 0 additions & 121 deletions lzma.BUILD

This file was deleted.

11 changes: 11 additions & 0 deletions test/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
bazel_dep(name = "com_github_nelhage_rules_boost")
local_path_override(
module_name = "com_github_nelhage_rules_boost",
path = "..",
)

non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies")
use_repo(
non_module_boost_repositories,
"boost",
)
19 changes: 0 additions & 19 deletions test/WORKSPACE.bazel

This file was deleted.

54 changes: 0 additions & 54 deletions zstd.BUILD

This file was deleted.

0 comments on commit e2ae4f9

Please sign in to comment.