blob: 7abd0c6676759f835a8af6cb72fda7c2989cc2cb [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
64go_register_toolchains()
65
66load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
67
68gazelle_dependencies()
69
70# Load Gazelle-generated local dependencies
71
72# gazelle:repository_macro repositories.bzl%go_repositories
73load("//:repositories.bzl", "go_repositories")
74
75go_repositories()
76
77# Protobuf
78
79http_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
86load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
87
88protobuf_deps()
89
90# External repository filegroup shortcut
91all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
92
93# Linux kernel
94
95linux_kernel_version = "4.19.72"
96
Lorenz Brun0bcaaee2019-11-06 12:42:39 +010097# If we don't do this we're double-building Linux, once for the toolchain and once for the target
98make_gen_init_cpio_available = """
99load("@rules_cc//cc:defs.bzl", "cc_binary")
100cc_binary(name = "gen_init_cpio", srcs = ["usr/gen_init_cpio.c"], visibility = ["//visibility:public"])
101"""
102
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200103http_archive(
104 name = "linux_kernel",
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100105 build_file_content = all_content + "\n" + make_gen_init_cpio_available,
106 patch_args = ["-p1"],
107 patches = [
108 # Fix is in mainline, but upstream hasn't backported it to 4.19.
109 # Will go away when we switch to 5.4 LTS
110 "@//core/build/linux_kernel:kbuild-add--fcf-protection-none-to-retpoline-flags.patch",
111 # Enable built-in cmdline for efistub
112 "@//core/build/linux_kernel:0001-x86-Allow-built-in-command-line-to-work-in-early-ker.patch",
113 ],
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200114 sha256 = "f9fcb6b3bd29115ac55fc154e300c3dce2044502732f6842ad6c25e6f9f51f6d",
115 strip_prefix = "linux-" + linux_kernel_version,
116 urls = ["https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-%s.tar.xz" % linux_kernel_version],
117)
118
119# EDK2
120
121# edk2-stable201908
122new_git_repository(
123 name = "edk2",
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +0200124 build_file = "@//core/build/edk2:BUILD",
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200125 commit = "37eef91017ad042035090cae46557f9d6e2d5917",
126 init_submodules = True,
127 remote = "https://github.com/tianocore/edk2",
128 shallow_since = "1567048229 +0800",
129)
130
131# musl
132
133musl_version = "1.1.23"
134
135http_archive(
136 name = "musl",
137 build_file_content = all_content,
138 sha256 = "8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa",
139 strip_prefix = "musl-" + musl_version,
140 urls = ["https://www.musl-libc.org/releases/musl-%s.tar.gz" % musl_version],
141)
142
143# util-linux
144
145util_linux_version = "2.34"
146
147http_archive(
148 name = "util_linux",
149 build_file_content = all_content,
150 sha256 = "1d0c1a38f8c14a2c251681907203cccc78704f5702f2ef4b438bed08344242f7",
151 strip_prefix = "util-linux-" + util_linux_version,
152 urls = ["https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/snapshot/util-linux-%s.tar.gz" % util_linux_version],
153)
154
155# xfsprogs-dev
156
157xfsprogs_dev_version = "5.2.1"
158
159http_archive(
160 name = "xfsprogs_dev",
161 build_file_content = all_content,
162 patch_args = ["-p1"],
163 patches = [
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +0200164 "@//core/build/utils/xfsprogs_dev:0001-Fixes-for-static-compilation.patch",
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200165 ],
166 sha256 = "6187f25f1744d1ecbb028b0ea210ad586d0f2dae24e258e4688c67740cc861ef",
167 strip_prefix = "xfsprogs-dev-" + xfsprogs_dev_version,
168 urls = ["https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/snapshot/xfsprogs-dev-%s.tar.gz" % xfsprogs_dev_version],
169)
Lorenz Brun6c39ea12019-11-04 11:39:42 +0100170
171# Kubernetes
172k8s_version = "1.16.2"
173
174http_archive(
175 name = "kubernetes",
176 patch_args = ["-p1"],
177 patches = [
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100178 "@//core/build/kubernetes:0001-avoid-unexpected-keyword-error-by-using-positional-p.patch",
Lorenz Brun6c39ea12019-11-04 11:39:42 +0100179 ],
180 sha256 = "21d884b67abd1182958313474a40678ba8f3713e6b6f520401e42c02ba6ea302",
181 urls = ["https://dl.k8s.io/v%s/kubernetes-src.tar.gz" % k8s_version],
182)
183
184load("@kubernetes//build:workspace_mirror.bzl", "mirror")
185
186http_archive(
187 name = "io_k8s_repo_infra",
188 sha256 = "f6d65480241ec0fd7a0d01f432938b97d7395aeb8eefbe859bb877c9b4eafa56",
189 strip_prefix = "repo-infra-9f4571ad7242bf3ec4b47365062498c2528f9a5f",
190 urls = mirror("https://github.com/kubernetes/repo-infra/archive/9f4571ad7242bf3ec4b47365062498c2528f9a5f.tar.gz"),
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100191)