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 committed Mar 26, 2024
1 parent 6cfcd23 commit f97ea24
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 353 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
15 changes: 15 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module(name = "com_github_nelhage_rules_boost")

bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "boringssl", version = "0.0.0-20240126-22d349c")
bazel_dep(name = "bzip2", version = "1.0.8")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "xz", version = "5.4.5.bcr.1")
bazel_dep(name = "zlib", version = "1.3.1")
bazel_dep(name = "zstd", version = "1.5.5")

non_module_ros_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies")
use_repo(
non_module_ros_repositories,
"boost",
)
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 @@ -448,7 +448,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":asio",
"@openssl//:ssl",
"@boringssl//:ssl",
],
)

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

boost_library(
name = "python",
exclude_src = ["**/fabscript"],
exclude_src = ["**/fabscript"],
deps = [
"@python",
":config",
Expand Down Expand Up @@ -1148,9 +1148,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
55 changes: 0 additions & 55 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.5.0/bazel-skylib-1.5.0.tar.gz",
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
)

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://github.com/tukaani-project/xz/releases/download/v5.6.1/xz-5.6.1.tar.gz",
sha256 = "2398f4a8e53345325f44bdd9f0cc7401bd9025d736c6d43b372f4dea77bf75b8",
strip_prefix = "xz-5.6.1",
)

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.5/zstd-1.5.5.tar.gz",
sha256 = "9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4",
strip_prefix = "zstd-1.5.5",
)

maybe(
http_archive,
name = "boost",
Expand All @@ -163,12 +117,3 @@ def boost_deps():
sha256 = "4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95",
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/47cfe28a00a915b5e1078edfd992d8d5b0e484c5.tar.gz",
sha256 = "7477b99e4708dab676e1a36abfa5cbd1bf33e2166ce7f83b5e2dedade9486334",
strip_prefix = "boringssl-47cfe28a00a915b5e1078edfd992d8d5b0e484c5",
)
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_ros_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies")
use_repo(
non_module_ros_repositories,
"boost",
)
19 changes: 0 additions & 19 deletions test/WORKSPACE.bazel

This file was deleted.

59 changes: 0 additions & 59 deletions zlib.BUILD

This file was deleted.

Loading

0 comments on commit f97ea24

Please sign in to comment.