blob: a3224f99d7b060901170f18a1b7b76866f71cac0 [file] [log] [blame]
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02001workspace(name = "nexantic")
Leopold Schabel5c80aca2019-10-22 15:48:58 +02002
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
5
6# Load skylib
7
8http_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
17load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
18
19bazel_skylib_workspace()
20
21# Assert minimum Bazel version
22
23load("@bazel_skylib//lib:versions.bzl", "versions")
24
Leopold Schabelb51250a2019-10-23 23:32:59 +020025versions.check(minimum_bazel_version = "1.1.0")
Leopold Schabel5c80aca2019-10-22 15:48:58 +020026
27# Go and Gazelle
28
29load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
30
31http_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
40http_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
49load("@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.
53load("@bazel_gazelle//:deps.bzl", "go_repository")
54
55go_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
62go_rules_dependencies()
63
Leopold Schabel60a85b62019-11-17 19:12:41 +010064go_register_toolchains(
65 go_version = "1.13",
66 nogo = "@//:nogo_vet",
67)
Leopold Schabel5c80aca2019-10-22 15:48:58 +020068
69load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
70
71gazelle_dependencies()
72
73# Load Gazelle-generated local dependencies
74
75# gazelle:repository_macro repositories.bzl%go_repositories
76load("//:repositories.bzl", "go_repositories")
77
78go_repositories()
79
80# Protobuf
81
82http_archive(
83 name = "com_google_protobuf",
84 sha256 = "758249b537abba2f21ebc2d02555bf080917f0f2f88f4cbe2903e0e28c4187ed",
85 strip_prefix = "protobuf-3.10.0",
86 urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.10.0.tar.gz"],
87)
88
89load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
90
91protobuf_deps()
92
93# External repository filegroup shortcut
94all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
95
96# Linux kernel
97
98linux_kernel_version = "4.19.72"
99
100http_archive(
101 name = "linux_kernel",
Leopold Schabel383d4bb2019-11-14 22:53:58 +0100102 build_file = "@//core/build/linux_kernel_repo:BUILD.repo",
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100103 patch_args = ["-p1"],
104 patches = [
105 # Fix is in mainline, but upstream hasn't backported it to 4.19.
106 # Will go away when we switch to 5.4 LTS
Leopold Schabel5f1d05f2019-11-06 13:58:40 +0000107 "@//core/build/linux_kernel_repo:0002-kbuild-add--fcf-protection-none-to-retpoline-flags.patch",
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100108 # Enable built-in cmdline for efistub
Leopold Schabel5f1d05f2019-11-06 13:58:40 +0000109 "@//core/build/linux_kernel_repo:0001-x86-Allow-built-in-command-line-to-work-in-early-ker.patch",
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100110 ],
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200111 sha256 = "f9fcb6b3bd29115ac55fc154e300c3dce2044502732f6842ad6c25e6f9f51f6d",
112 strip_prefix = "linux-" + linux_kernel_version,
113 urls = ["https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-%s.tar.xz" % linux_kernel_version],
114)
115
116# EDK2
117
118# edk2-stable201908
119new_git_repository(
120 name = "edk2",
Leopold Schabel383d4bb2019-11-14 22:53:58 +0100121 build_file = "@//core/build/edk2:BUILD.repo",
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200122 commit = "37eef91017ad042035090cae46557f9d6e2d5917",
123 init_submodules = True,
124 remote = "https://github.com/tianocore/edk2",
125 shallow_since = "1567048229 +0800",
126)
127
128# musl
129
130musl_version = "1.1.23"
131
132http_archive(
133 name = "musl",
134 build_file_content = all_content,
135 sha256 = "8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa",
136 strip_prefix = "musl-" + musl_version,
137 urls = ["https://www.musl-libc.org/releases/musl-%s.tar.gz" % musl_version],
138)
139
140# util-linux
141
142util_linux_version = "2.34"
143
144http_archive(
145 name = "util_linux",
146 build_file_content = all_content,
147 sha256 = "1d0c1a38f8c14a2c251681907203cccc78704f5702f2ef4b438bed08344242f7",
148 strip_prefix = "util-linux-" + util_linux_version,
149 urls = ["https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/snapshot/util-linux-%s.tar.gz" % util_linux_version],
150)
151
152# xfsprogs-dev
153
154xfsprogs_dev_version = "5.2.1"
155
156http_archive(
157 name = "xfsprogs_dev",
158 build_file_content = all_content,
159 patch_args = ["-p1"],
160 patches = [
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +0200161 "@//core/build/utils/xfsprogs_dev:0001-Fixes-for-static-compilation.patch",
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200162 ],
163 sha256 = "6187f25f1744d1ecbb028b0ea210ad586d0f2dae24e258e4688c67740cc861ef",
164 strip_prefix = "xfsprogs-dev-" + xfsprogs_dev_version,
165 urls = ["https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/snapshot/xfsprogs-dev-%s.tar.gz" % xfsprogs_dev_version],
166)
Lorenz Brun6c39ea12019-11-04 11:39:42 +0100167
168# Kubernetes
169k8s_version = "1.16.2"
170
171http_archive(
172 name = "kubernetes",
173 patch_args = ["-p1"],
174 patches = [
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100175 "@//core/build/kubernetes:0001-avoid-unexpected-keyword-error-by-using-positional-p.patch",
Lorenz Brun6c39ea12019-11-04 11:39:42 +0100176 ],
177 sha256 = "21d884b67abd1182958313474a40678ba8f3713e6b6f520401e42c02ba6ea302",
178 urls = ["https://dl.k8s.io/v%s/kubernetes-src.tar.gz" % k8s_version],
179)
180
181load("@kubernetes//build:workspace_mirror.bzl", "mirror")
182
183http_archive(
184 name = "io_k8s_repo_infra",
185 sha256 = "f6d65480241ec0fd7a0d01f432938b97d7395aeb8eefbe859bb877c9b4eafa56",
186 strip_prefix = "repo-infra-9f4571ad7242bf3ec4b47365062498c2528f9a5f",
187 urls = mirror("https://github.com/kubernetes/repo-infra/archive/9f4571ad7242bf3ec4b47365062498c2528f9a5f.tar.gz"),
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100188)