forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.bzl
46 lines (41 loc) · 1.69 KB
/
util.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
# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Helpers for setting up Hazel rules
# Our ghc-lib libraries
def hazel_ghclibs(version, shaParser, shaLibrary):
return [
# Read [Working on ghc-lib] for ghc-lib update instructions at
# https://github.com/DACH-NY/daml/blob/master/ghc-lib/working-on-ghc-lib.md
(
"ghc-lib-parser",
{
"url": "https://digitalassetsdk.bintray.com/ghc-lib/ghc-lib-parser-" + version + ".tar.gz",
"stripPrefix": "ghc-lib-parser-" + version,
"sha256": shaParser,
},
),
(
"ghc-lib",
{
"url": "https://digitalassetsdk.bintray.com/ghc-lib/ghc-lib-" + version + ".tar.gz",
"stripPrefix": "ghc-lib-" + version,
"sha256": shaLibrary,
},
),
]
# Things we override from Hackage
def hazel_hackage(name, version, sha, **kwargs):
return [(name, {"version": version, "sha256": sha} + kwargs)]
# Things we override from GitHub
def hazel_github_external(project, repoName, commit, sha, directory = "", name = None):
return [(
name or repoName,
{
"url": "https://github.com/" + project + "/" + repoName + "/archive/" + commit + ".zip",
"sha256": sha,
"stripPrefix": repoName + "-" + commit + directory,
},
)]
# Things we get from the digital-asset GitHub
def hazel_github(repoName, commit, sha, directory = "", name = None):
return hazel_github_external("digital-asset", repoName, commit, sha, directory = directory, name = name)