1# Copyright 2024 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15"""Contains the external dependencies for rp2040.""" 16 17load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") 18load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 19load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") 20 21def pigweed_rp2_deps(): 22 """Instantiates the dependencies of the rp2040 rules.""" 23 maybe( 24 http_archive, 25 name = "platforms", 26 urls = [ 27 "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz", 28 "https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz", 29 ], 30 sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74", 31 ) 32 maybe( 33 http_archive, 34 name = "rules_platform", 35 sha256 = "0aadd1bd350091aa1f9b6f2fbcac8cd98201476289454e475b28801ecf85d3fd", 36 url = "https://github.com/bazelbuild/rules_platform/releases/download/0.1.0/rules_platform-0.1.0.tar.gz", 37 ) 38 39 # Pinned to 2.0.0 releases. 40 maybe( 41 http_archive, 42 name = "pico-sdk", 43 sha256 = "626db87779fa37f7f9c7cfe3e152f7e828fe19c486730af2e7c80836b6b57e1d", 44 url = "https://github.com/raspberrypi/pico-sdk/releases/download/2.0.0/pico-sdk-2.0.0.tar.gz", 45 ) 46 47 maybe( 48 http_archive, 49 name = "picotool", 50 sha256 = "9392c4a31f16b80b70f861c37a029701d3212e212840daa097c8a3720282ce65", 51 url = "https://github.com/raspberrypi/picotool/releases/download/2.0.0/picotool-2.0.0.tar.gz", 52 ) 53 54 maybe( 55 git_repository, 56 name = "rules_libusb", 57 commit = "eb8c39291104b08d5a2ea69d31d79c61a85a8485", 58 remote = "https://pigweed.googlesource.com/pigweed/rules_libusb", 59 ) 60 maybe( 61 http_archive, 62 name = "libusb", 63 build_file = "@rules_libusb//:libusb.BUILD", 64 sha256 = "ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575", 65 strip_prefix = "libusb-1.0.27", 66 url = "https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.tar.bz2", 67 ) 68 maybe( 69 http_archive, 70 name = "tinyusb", 71 build_file = "@pico-sdk//src/rp2_common/tinyusb:tinyusb.BUILD", 72 sha256 = "ac57109bba00d26ffa33312d5f334990ec9a9a4d82bf890ed8b825b4610d1da2", 73 strip_prefix = "tinyusb-86c416d4c0fb38432460b3e11b08b9de76941bf5", 74 url = "https://github.com/hathach/tinyusb/archive/86c416d4c0fb38432460b3e11b08b9de76941bf5.zip", 75 ) 76