forked from ahrefs/ocaml-sodium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE.bzl
64 lines (58 loc) · 2.21 KB
/
WORKSPACE.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # buildifier: disable=load
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") # buildifier: disable=load
load("@obazl_rules_ocaml//ocaml:providers.bzl", "OpamConfig", "BuildConfig")
## WARNING: the makefile changed, for now we can only do 1.0.18-RELEASE
versions = {
"1.0.18-RELEASE": struct(
sha256 = "7728976ead51b0de60bede2421cd2a455c2bff3f1bc0320a1d61e240e693bce9",
url = "https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.zip",
commit = "940ef42797baa0278df6b7fd9e67c7590f87744b"
),
# "1.0.17": struct(
# commit = "b732443c442239c2e0184820e9b23cca0de0828c",
# url = "https://github.com/jedisct1/libsodium/archive/1.0.17.zip",
# sha256 = "a1734796725f9a2b5ca0316ace3ea0c02f3b239c4e61009ceb672a8d7de18465"
# )
}
def libsodium_fetch_repo(version):
maybe(
http_archive,
name="libsodium",
# url="https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.zip",
# type="zip",
# sha256="7728976ead51b0de60bede2421cd2a455c2bff3f1bc0320a1d61e240e693bce9",
# strip_prefix = "libsodium-1.0.18-RELEASE",
url=versions[version].url,
sha256=versions[version].sha256,
strip_prefix = "libsodium-" + version,
build_file_content = "\n".join([
"filegroup(name = \"all\",",
"srcs = glob([\"**\"]),",
"visibility = [\"//visibility:public\"])",
]),
)
################################################################
opam_pkgs = {
# "bigarray": [], ## not an opam pkg
# "bytes": [], ## not an opam pkg
"core_kernel": ["v0.12.3"],
"ctypes": ["0.17.1", ["ctypes.foreign", "ctypes.stubs"]],
"ocaml-compiler-libs": ["v0.11.0", ["compiler-libs.common"]],
"ounit2": ["2.2.3"],
}
opam = OpamConfig(
version = "2.0",
builds = {
"mina-0.1.0": BuildConfig(
default = True,
switch = "4.07.1",
compiler = "4.07.1",
packages = opam_pkgs,
verify = True
),
"4.07.1": BuildConfig(
compiler = "4.07.1",
packages = opam_pkgs
)
}
)