forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.bzl
39 lines (34 loc) · 1.47 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
# 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):
return [(name, {"version": version, "sha256": sha})]
# Things we override from GitHub
def hazel_github_external(project, name, commit, sha):
return [(name, {"url": "https://github.com/" + project + "/" + name + "/archive/" + commit + ".zip", "sha256": sha, "stripPrefix": name + "-" + commit})]
# Things we get from the digital-asset GitHub
def hazel_github(name, commit, sha):
return hazel_github_external("digital-asset", name, commit, sha)