MODULE.bazel 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. module(
  2. name = "pico-sdk",
  3. version = "2.1.1",
  4. )
  5. bazel_dep(name = "platforms", version = "0.0.9")
  6. bazel_dep(name = "bazel_skylib", version = "1.6.1")
  7. bazel_dep(name = "rules_python", version = "0.36.0")
  8. bazel_dep(name = "picotool", version = "2.1.1")
  9. bazel_dep(name = "rules_cc", version = "0.0.10")
  10. http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
  11. http_archive(
  12. name = "arm_gcc_linux-aarch64",
  13. build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
  14. sha256 = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a",
  15. strip_prefix = "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi",
  16. url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
  17. )
  18. http_archive(
  19. name = "arm_gcc_linux-x86_64",
  20. build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
  21. sha256 = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb",
  22. strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi",
  23. url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
  24. )
  25. http_archive(
  26. name = "arm_gcc_win-x86_64",
  27. build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
  28. sha256 = "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f",
  29. strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi",
  30. url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
  31. )
  32. http_archive(
  33. name = "arm_gcc_mac-x86_64",
  34. build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
  35. sha256 = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc",
  36. strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi",
  37. url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
  38. )
  39. http_archive(
  40. name = "arm_gcc_mac-aarch64",
  41. build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
  42. sha256 = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279",
  43. strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi",
  44. url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
  45. )
  46. http_archive(
  47. name = "clang_linux-x86_64",
  48. build_file = "//bazel/toolchain:clang.BUILD",
  49. sha256 = "82302f8f0d9cb1062e60756147403c1525e965e1d7b777fab8076c74c7a5a19b",
  50. type = "zip",
  51. url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/linux-amd64/+/git_revision:910be4ff90d7d07bd4518ea03b85c0974672bf9c",
  52. )
  53. http_archive(
  54. name = "clang_win-x86_64",
  55. build_file = "//bazel/toolchain:clang.BUILD",
  56. sha256 = "2e9b8ac889838754e5305b6fd73c7bba7a6ec7364f1ce8ac60268b6d3bc61e6c",
  57. type = "zip",
  58. # Windows doesn't like `:` in the produced filename, so replace it with `%3A`.
  59. url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/windows-amd64/+/git_revision:910be4ff90d7d07bd4518ea03b85c0974672bf9c".replace("git_revision:", "git_revision%3A"),
  60. )
  61. http_archive(
  62. name = "clang_mac-x86_64",
  63. build_file = "//bazel/toolchain:clang.BUILD",
  64. sha256 = "d3f2ef6f391ef66141092cfdf07facd18d2587a25616e1251e6e6b13b05ab3df",
  65. type = "zip",
  66. url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-amd64/+/git_revision:910be4ff90d7d07bd4518ea03b85c0974672bf9c",
  67. )
  68. http_archive(
  69. name = "clang_mac-aarch64",
  70. build_file = "//bazel/toolchain:clang.BUILD",
  71. sha256 = "61109b8464e9213ef8b9bfe55ce56298b94d4c66eaea308cf2b6556b0b85429e",
  72. type = "zip",
  73. url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-arm64/+/git_revision:910be4ff90d7d07bd4518ea03b85c0974672bf9c",
  74. )
  75. new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
  76. # TODO: Provide tinyusb as a proper Bazel module.
  77. new_git_repository(
  78. name = "tinyusb",
  79. build_file = "//src/rp2_common/tinyusb:tinyusb.BUILD",
  80. commit = "86ad6e56c1700e85f1c5678607a762cfe3aa2f47", # keep-in-sync-with-submodule: lib/tinyusb
  81. remote = "https://github.com/hathach/tinyusb.git",
  82. )
  83. # TODO: Provide btstack as a proper Bazel module.
  84. new_git_repository(
  85. name = "btstack",
  86. build_file = "//src/rp2_common/pico_btstack:btstack.BUILD",
  87. commit = "501e6d2b86e6c92bfb9c390bcf55709938e25ac1", # keep-in-sync-with-submodule: lib/btstack
  88. remote = "https://github.com/bluekitchen/btstack.git",
  89. )
  90. # TODO: Provide cyw43-driver as a proper Bazel module.
  91. new_git_repository(
  92. name = "cyw43-driver",
  93. build_file = "//src/rp2_common/pico_cyw43_driver:cyw43-driver.BUILD",
  94. commit = "c1075d4bc440422cf2b2fd12c64a1f53f77660ee", # keep-in-sync-with-submodule: lib/cyw43-driver
  95. remote = "https://github.com/georgerobotics/cyw43-driver.git",
  96. )
  97. # TODO: Provide lwip as a proper Bazel module.
  98. new_git_repository(
  99. name = "lwip",
  100. build_file = "//src/rp2_common/pico_lwip:lwip.BUILD",
  101. commit = "0a0452b2c39bdd91e252aef045c115f88f6ca773", # keep-in-sync-with-submodule: lib/lwip
  102. remote = "https://github.com/lwip-tcpip/lwip.git",
  103. )
  104. register_toolchains(
  105. "//bazel/toolchain:linux-aarch64-rp2040",
  106. "//bazel/toolchain:linux-aarch64-rp2350",
  107. "//bazel/toolchain:linux-x86_64-rp2040",
  108. "//bazel/toolchain:linux-x86_64-rp2350",
  109. "//bazel/toolchain:win-x86_64-rp2040",
  110. "//bazel/toolchain:win-x86_64-rp2350",
  111. "//bazel/toolchain:mac-x86_64-rp2040",
  112. "//bazel/toolchain:mac-x86_64-rp2350",
  113. "//bazel/toolchain:mac-aarch64-rp2040",
  114. "//bazel/toolchain:mac-aarch64-rp2350",
  115. # Require users to opt-in to the Pico SDK's toolchains.
  116. dev_dependency = True,
  117. )
  118. python = use_extension("@rules_python//python/extensions:python.bzl", "python")
  119. python.toolchain(
  120. configure_coverage_tool = True,
  121. python_version = "3.9",
  122. )
  123. use_repo(python, "pythons_hub")
  124. register_toolchains(
  125. "@pythons_hub//:all",
  126. dev_dependency = True,
  127. )
  128. register_toolchains(
  129. "@rules_python//python/runtime_env_toolchains:all",
  130. dev_dependency = True,
  131. )