Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 1 | workspace(name = "smalltown") |
| 2 | |
| 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 4 | load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") |
| 5 | |
| 6 | # Load skylib |
| 7 | |
| 8 | http_archive( |
| 9 | name = "bazel_skylib", |
| 10 | sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", |
| 11 | urls = [ |
| 12 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", |
| 13 | "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", |
| 14 | ], |
| 15 | ) |
| 16 | |
| 17 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 18 | |
| 19 | bazel_skylib_workspace() |
| 20 | |
| 21 | # Assert minimum Bazel version |
| 22 | |
| 23 | load("@bazel_skylib//lib:versions.bzl", "versions") |
| 24 | |
Leopold Schabel | b51250a | 2019-10-23 23:32:59 +0200 | [diff] [blame] | 25 | versions.check(minimum_bazel_version = "1.1.0") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 26 | |
| 27 | # Go and Gazelle |
| 28 | |
| 29 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 30 | |
| 31 | http_archive( |
| 32 | name = "io_bazel_rules_go", |
| 33 | sha256 = "842ec0e6b4fbfdd3de6150b61af92901eeb73681fd4d185746644c338f51d4c0", |
| 34 | urls = [ |
| 35 | "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz", |
| 36 | "https://github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz", |
| 37 | ], |
| 38 | ) |
| 39 | |
| 40 | http_archive( |
| 41 | name = "bazel_gazelle", |
| 42 | sha256 = "41bff2a0b32b02f20c227d234aa25ef3783998e5453f7eade929704dcff7cd4b", |
| 43 | urls = [ |
| 44 | "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.0/bazel-gazelle-v0.19.0.tar.gz", |
| 45 | "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.0/bazel-gazelle-v0.19.0.tar.gz", |
| 46 | ], |
| 47 | ) |
| 48 | |
| 49 | load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") |
| 50 | |
| 51 | # golang.org/x/sys is overridden by the go_rules protobuf dependency -> declare it first, since |
| 52 | # we need a newer version of it for the netlink package which would fail to compile otherwise. |
| 53 | load("@bazel_gazelle//:deps.bzl", "go_repository") |
| 54 | |
| 55 | go_repository( |
| 56 | name = "org_golang_x_sys", |
| 57 | importpath = "golang.org/x/sys", |
| 58 | sum = "h1:ZtoklVMHQy6BFRHkbG6JzK+S6rX82//Yeok1vMlizfQ=", |
| 59 | version = "v0.0.0-20191018095205-727590c5006e", |
| 60 | ) |
| 61 | |
| 62 | go_rules_dependencies() |
| 63 | |
| 64 | go_register_toolchains() |
| 65 | |
| 66 | load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") |
| 67 | |
| 68 | gazelle_dependencies() |
| 69 | |
| 70 | # Load Gazelle-generated local dependencies |
| 71 | |
| 72 | # gazelle:repository_macro repositories.bzl%go_repositories |
| 73 | load("//:repositories.bzl", "go_repositories") |
| 74 | |
| 75 | go_repositories() |
| 76 | |
| 77 | # Protobuf |
| 78 | |
| 79 | http_archive( |
| 80 | name = "com_google_protobuf", |
| 81 | sha256 = "758249b537abba2f21ebc2d02555bf080917f0f2f88f4cbe2903e0e28c4187ed", |
| 82 | strip_prefix = "protobuf-3.10.0", |
| 83 | urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.10.0.tar.gz"], |
| 84 | ) |
| 85 | |
| 86 | load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") |
| 87 | |
| 88 | protobuf_deps() |
| 89 | |
| 90 | # External repository filegroup shortcut |
| 91 | all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])""" |
| 92 | |
| 93 | # Linux kernel |
| 94 | |
| 95 | linux_kernel_version = "4.19.72" |
| 96 | |
| 97 | http_archive( |
| 98 | name = "linux_kernel", |
| 99 | build_file_content = all_content, |
| 100 | sha256 = "f9fcb6b3bd29115ac55fc154e300c3dce2044502732f6842ad6c25e6f9f51f6d", |
| 101 | strip_prefix = "linux-" + linux_kernel_version, |
| 102 | urls = ["https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-%s.tar.xz" % linux_kernel_version], |
| 103 | ) |
| 104 | |
| 105 | # EDK2 |
| 106 | |
| 107 | # edk2-stable201908 |
| 108 | new_git_repository( |
| 109 | name = "edk2", |
| 110 | build_file = "@//build/edk2:BUILD", |
| 111 | commit = "37eef91017ad042035090cae46557f9d6e2d5917", |
| 112 | init_submodules = True, |
| 113 | remote = "https://github.com/tianocore/edk2", |
| 114 | shallow_since = "1567048229 +0800", |
| 115 | ) |
| 116 | |
| 117 | # musl |
| 118 | |
| 119 | musl_version = "1.1.23" |
| 120 | |
| 121 | http_archive( |
| 122 | name = "musl", |
| 123 | build_file_content = all_content, |
| 124 | sha256 = "8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa", |
| 125 | strip_prefix = "musl-" + musl_version, |
| 126 | urls = ["https://www.musl-libc.org/releases/musl-%s.tar.gz" % musl_version], |
| 127 | ) |
| 128 | |
| 129 | # util-linux |
| 130 | |
| 131 | util_linux_version = "2.34" |
| 132 | |
| 133 | http_archive( |
| 134 | name = "util_linux", |
| 135 | build_file_content = all_content, |
| 136 | sha256 = "1d0c1a38f8c14a2c251681907203cccc78704f5702f2ef4b438bed08344242f7", |
| 137 | strip_prefix = "util-linux-" + util_linux_version, |
| 138 | urls = ["https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/snapshot/util-linux-%s.tar.gz" % util_linux_version], |
| 139 | ) |
| 140 | |
| 141 | # xfsprogs-dev |
| 142 | |
| 143 | xfsprogs_dev_version = "5.2.1" |
| 144 | |
| 145 | http_archive( |
| 146 | name = "xfsprogs_dev", |
| 147 | build_file_content = all_content, |
| 148 | patch_args = ["-p1"], |
| 149 | patches = [ |
| 150 | "@//build/utils/xfsprogs_dev:0001-Fixes-for-static-compilation.patch", |
| 151 | ], |
| 152 | sha256 = "6187f25f1744d1ecbb028b0ea210ad586d0f2dae24e258e4688c67740cc861ef", |
| 153 | strip_prefix = "xfsprogs-dev-" + xfsprogs_dev_version, |
| 154 | urls = ["https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/snapshot/xfsprogs-dev-%s.tar.gz" % xfsprogs_dev_version], |
| 155 | ) |