108 lines · plain
1# This file is licensed under the Apache License v2.0 with LLVM Exceptions.2# See https://llvm.org/LICENSE.txt for license information.3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception4 5"""bzlmod extensions for llvm-project"""6 7load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")8load("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")9load(":vulkan_sdk.bzl", "vulkan_sdk_setup")10 11def _llvm_repos_extension_impl(module_ctx):12 if any([m.is_root and m.name == "llvm-project-overlay" for m in module_ctx.modules]):13 new_local_repository(14 name = "llvm-raw",15 build_file_content = "# empty",16 path = "../../",17 )18 19 http_archive(20 name = "vulkan_headers",21 build_file = "@llvm-raw//utils/bazel/third_party_build:vulkan_headers.BUILD",22 sha256 = "19f491784ef0bc73caff877d11c96a48b946b5a1c805079d9006e3fbaa5c1895",23 strip_prefix = "Vulkan-Headers-9bd3f561bcee3f01d22912de10bb07ce4e23d378",24 urls = [25 "https://github.com/KhronosGroup/Vulkan-Headers/archive/9bd3f561bcee3f01d22912de10bb07ce4e23d378.tar.gz",26 ],27 )28 29 vulkan_sdk_setup(name = "vulkan_sdk")30 31 http_archive(32 name = "gmp",33 urls = [34 "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz",35 "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz",36 ],37 build_file = "@llvm-raw//utils/bazel/third_party_build:gmp.BUILD",38 sha256 = "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2",39 strip_prefix = "gmp-6.2.1",40 )41 42 http_archive(43 name = "mpfr",44 urls = [45 "https://www.mpfr.org/mpfr-current/mpfr-4.2.2.tar.gz",46 ],47 sha256 = "826cbb24610bd193f36fde172233fb8c009f3f5c2ad99f644d0dea2e16a20e42",48 strip_prefix = "mpfr-4.2.2",49 build_file = "@llvm-raw//utils/bazel/third_party_build:mpfr.BUILD",50 )51 52 http_archive(53 name = "mpc",54 urls = [55 "https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz",56 ],57 sha256 = "ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8",58 strip_prefix = "mpc-1.3.1",59 build_file = "@llvm-raw//utils/bazel/third_party_build:mpc.BUILD",60 )61 62 http_archive(63 name = "pfm",64 urls = [65 "https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.13.0.tar.gz",66 ],67 sha256 = "d18b97764c755528c1051d376e33545d0eb60c6ebf85680436813fa5b04cc3d1",68 strip_prefix = "libpfm-4.13.0",69 build_file = "@llvm-raw//utils/bazel/third_party_build:pfm.BUILD",70 )71 72 http_archive(73 name = "pybind11",74 url = "https://github.com/pybind/pybind11/archive/v2.10.3.zip",75 sha256 = "201966a61dc826f1b1879a24a3317a1ec9214a918c8eb035be2f30c3e9cfbdcb",76 strip_prefix = "pybind11-2.10.3",77 build_file = "@llvm-raw//utils/bazel/third_party_build:pybind.BUILD",78 )79 80 http_archive(81 name = "pyyaml",82 url = "https://github.com/yaml/pyyaml/archive/refs/tags/5.1.zip",83 sha256 = "f0a35d7f282a6d6b1a4f3f3965ef5c124e30ed27a0088efb97c0977268fd671f",84 strip_prefix = "pyyaml-5.1/lib3",85 build_file = "@llvm-raw//utils/bazel/third_party_build:pyyaml.BUILD",86 )87 88 # TODO: bump to robin-map-1.4.089 http_archive(90 name = "robin_map",91 build_file = "@llvm-raw//utils/bazel/third_party_build:robin_map.BUILD",92 sha256 = "a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236",93 strip_prefix = "robin-map-1.3.0",94 url = "https://github.com/Tessil/robin-map/archive/refs/tags/v1.3.0.tar.gz",95 )96 97 http_archive(98 name = "nanobind",99 build_file = "@llvm-raw//utils/bazel/third_party_build:nanobind.BUILD",100 sha256 = "8ce3667dce3e64fc06bfb9b778b6f48731482362fb89a43da156632266cd5a90",101 strip_prefix = "nanobind-2.9.2",102 url = "https://github.com/wjakob/nanobind/archive/refs/tags/v2.9.2.tar.gz",103 )104 105llvm_repos_extension = module_extension(106 implementation = _llvm_repos_extension_impl,107)108