Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 1 | workspace(name = "nexantic") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 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", |
Leopold Schabel | 383d4bb | 2019-11-14 22:53:58 +0100 | [diff] [blame] | 99 | build_file = "@//core/build/linux_kernel_repo:BUILD.repo", |
Lorenz Brun | 0bcaaee | 2019-11-06 12:42:39 +0100 | [diff] [blame] | 100 | patch_args = ["-p1"], |
| 101 | patches = [ |
| 102 | # Fix is in mainline, but upstream hasn't backported it to 4.19. |
| 103 | # Will go away when we switch to 5.4 LTS |
Leopold Schabel | 5f1d05f | 2019-11-06 13:58:40 +0000 | [diff] [blame] | 104 | "@//core/build/linux_kernel_repo:0002-kbuild-add--fcf-protection-none-to-retpoline-flags.patch", |
Lorenz Brun | 0bcaaee | 2019-11-06 12:42:39 +0100 | [diff] [blame] | 105 | # Enable built-in cmdline for efistub |
Leopold Schabel | 5f1d05f | 2019-11-06 13:58:40 +0000 | [diff] [blame] | 106 | "@//core/build/linux_kernel_repo:0001-x86-Allow-built-in-command-line-to-work-in-early-ker.patch", |
Lorenz Brun | 0bcaaee | 2019-11-06 12:42:39 +0100 | [diff] [blame] | 107 | ], |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 108 | sha256 = "f9fcb6b3bd29115ac55fc154e300c3dce2044502732f6842ad6c25e6f9f51f6d", |
| 109 | strip_prefix = "linux-" + linux_kernel_version, |
| 110 | urls = ["https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-%s.tar.xz" % linux_kernel_version], |
| 111 | ) |
| 112 | |
| 113 | # EDK2 |
| 114 | |
| 115 | # edk2-stable201908 |
| 116 | new_git_repository( |
| 117 | name = "edk2", |
Leopold Schabel | 383d4bb | 2019-11-14 22:53:58 +0100 | [diff] [blame] | 118 | build_file = "@//core/build/edk2:BUILD.repo", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 119 | commit = "37eef91017ad042035090cae46557f9d6e2d5917", |
| 120 | init_submodules = True, |
| 121 | remote = "https://github.com/tianocore/edk2", |
| 122 | shallow_since = "1567048229 +0800", |
| 123 | ) |
| 124 | |
| 125 | # musl |
| 126 | |
| 127 | musl_version = "1.1.23" |
| 128 | |
| 129 | http_archive( |
| 130 | name = "musl", |
| 131 | build_file_content = all_content, |
| 132 | sha256 = "8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa", |
| 133 | strip_prefix = "musl-" + musl_version, |
| 134 | urls = ["https://www.musl-libc.org/releases/musl-%s.tar.gz" % musl_version], |
| 135 | ) |
| 136 | |
| 137 | # util-linux |
| 138 | |
| 139 | util_linux_version = "2.34" |
| 140 | |
| 141 | http_archive( |
| 142 | name = "util_linux", |
| 143 | build_file_content = all_content, |
| 144 | sha256 = "1d0c1a38f8c14a2c251681907203cccc78704f5702f2ef4b438bed08344242f7", |
| 145 | strip_prefix = "util-linux-" + util_linux_version, |
| 146 | urls = ["https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/snapshot/util-linux-%s.tar.gz" % util_linux_version], |
| 147 | ) |
| 148 | |
| 149 | # xfsprogs-dev |
| 150 | |
| 151 | xfsprogs_dev_version = "5.2.1" |
| 152 | |
| 153 | http_archive( |
| 154 | name = "xfsprogs_dev", |
| 155 | build_file_content = all_content, |
| 156 | patch_args = ["-p1"], |
| 157 | patches = [ |
Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 158 | "@//core/build/utils/xfsprogs_dev:0001-Fixes-for-static-compilation.patch", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 159 | ], |
| 160 | sha256 = "6187f25f1744d1ecbb028b0ea210ad586d0f2dae24e258e4688c67740cc861ef", |
| 161 | strip_prefix = "xfsprogs-dev-" + xfsprogs_dev_version, |
| 162 | urls = ["https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/snapshot/xfsprogs-dev-%s.tar.gz" % xfsprogs_dev_version], |
| 163 | ) |
Lorenz Brun | 6c39ea1 | 2019-11-04 11:39:42 +0100 | [diff] [blame] | 164 | |
| 165 | # Kubernetes |
| 166 | k8s_version = "1.16.2" |
| 167 | |
| 168 | http_archive( |
| 169 | name = "kubernetes", |
| 170 | patch_args = ["-p1"], |
| 171 | patches = [ |
Lorenz Brun | 0bcaaee | 2019-11-06 12:42:39 +0100 | [diff] [blame] | 172 | "@//core/build/kubernetes:0001-avoid-unexpected-keyword-error-by-using-positional-p.patch", |
Lorenz Brun | 6c39ea1 | 2019-11-04 11:39:42 +0100 | [diff] [blame] | 173 | ], |
| 174 | sha256 = "21d884b67abd1182958313474a40678ba8f3713e6b6f520401e42c02ba6ea302", |
| 175 | urls = ["https://dl.k8s.io/v%s/kubernetes-src.tar.gz" % k8s_version], |
| 176 | ) |
| 177 | |
| 178 | load("@kubernetes//build:workspace_mirror.bzl", "mirror") |
| 179 | |
| 180 | http_archive( |
| 181 | name = "io_k8s_repo_infra", |
| 182 | sha256 = "f6d65480241ec0fd7a0d01f432938b97d7395aeb8eefbe859bb877c9b4eafa56", |
| 183 | strip_prefix = "repo-infra-9f4571ad7242bf3ec4b47365062498c2528f9a5f", |
| 184 | urls = mirror("https://github.com/kubernetes/repo-infra/archive/9f4571ad7242bf3ec4b47365062498c2528f9a5f.tar.gz"), |
Lorenz Brun | 0bcaaee | 2019-11-06 12:42:39 +0100 | [diff] [blame] | 185 | ) |