2020-04-23 13:58:11 +03:00
|
|
|
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
#
|
|
|
|
# The dependencies of the daml workspace.
|
|
|
|
# This allows using the daml workspace externally
|
|
|
|
# from another bazel workspace.
|
|
|
|
#
|
|
|
|
# For example, another Bazel project can depend on
|
|
|
|
# targets in the daml repository by doing:
|
|
|
|
# ---
|
|
|
|
# local_repository(
|
|
|
|
# name = "com_github_digital_asset_daml",
|
|
|
|
# path = "/path/to/daml"
|
|
|
|
# )
|
|
|
|
# load("@com_github_digital_asset_daml//:deps.bzl", "daml_deps")
|
|
|
|
# daml_deps()
|
|
|
|
# ---
|
|
|
|
#
|
|
|
|
# A 3rd-party consumer would also need to register relevant
|
|
|
|
# toolchains and repositories in order to build targets.
|
|
|
|
# That is, copy some setup calls from WORKSPACE into the
|
|
|
|
# other WORKSPACE.
|
|
|
|
#
|
|
|
|
# Make sure to reference repository local files with the full
|
|
|
|
# prefix: @com_github_digital_asset_daml//..., as these won't
|
|
|
|
# be resolvable from external workspaces otherwise.
|
|
|
|
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
2020-05-05 20:40:03 +03:00
|
|
|
load(
|
|
|
|
"@daml//:deps.bzl",
|
|
|
|
"buildifier_sha256",
|
|
|
|
"buildifier_version",
|
|
|
|
"rules_haskell_sha256",
|
|
|
|
"rules_haskell_version",
|
|
|
|
"rules_nixpkgs_sha256",
|
|
|
|
"rules_nixpkgs_version",
|
2020-05-13 11:39:51 +03:00
|
|
|
"rules_nodejs_sha256",
|
|
|
|
"rules_nodejs_version",
|
2020-05-05 20:40:03 +03:00
|
|
|
"zlib_sha256",
|
|
|
|
"zlib_version",
|
|
|
|
)
|
2020-04-23 13:58:11 +03:00
|
|
|
|
|
|
|
def daml_deps():
|
|
|
|
if "rules_haskell" not in native.existing_rules():
|
|
|
|
http_archive(
|
|
|
|
name = "rules_haskell",
|
|
|
|
strip_prefix = "rules_haskell-%s" % rules_haskell_version,
|
|
|
|
urls = ["https://github.com/tweag/rules_haskell/archive/%s.tar.gz" % rules_haskell_version],
|
2020-04-28 17:06:36 +03:00
|
|
|
patches = [
|
|
|
|
"@daml//bazel_tools:haskell-strict-source-names.patch",
|
|
|
|
"@daml//bazel_tools:haskell-windows-remove-fake-libs.patch",
|
|
|
|
"@daml//bazel_tools:haskell-windows-extra-libraries.patch",
|
2020-05-07 10:36:45 +03:00
|
|
|
"@daml//bazel_tools:haskell-pgmc.patch",
|
2020-04-28 17:06:36 +03:00
|
|
|
],
|
|
|
|
patch_args = ["-p1"],
|
2020-04-23 13:58:11 +03:00
|
|
|
sha256 = rules_haskell_sha256,
|
|
|
|
)
|
|
|
|
|
|
|
|
if "io_tweag_rules_nixpkgs" not in native.existing_rules():
|
|
|
|
http_archive(
|
|
|
|
name = "io_tweag_rules_nixpkgs",
|
|
|
|
strip_prefix = "rules_nixpkgs-%s" % rules_nixpkgs_version,
|
|
|
|
urls = ["https://github.com/tweag/rules_nixpkgs/archive/%s.tar.gz" % rules_nixpkgs_version],
|
|
|
|
sha256 = rules_nixpkgs_sha256,
|
2020-05-18 19:03:51 +03:00
|
|
|
patches = [
|
|
|
|
# Remove once https://github.com/tweag/rules_nixpkgs/pull/128
|
|
|
|
# has been merged
|
|
|
|
"@daml//bazel_tools:nixpkgs-hermetic-cc-toolchain.patch",
|
|
|
|
],
|
|
|
|
patch_args = ["-p1"],
|
2020-04-23 13:58:11 +03:00
|
|
|
)
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
|
|
if "com_github_bazelbuild_buildtools" not in native.existing_rules():
|
|
|
|
http_archive(
|
|
|
|
name = "com_github_bazelbuild_buildtools",
|
|
|
|
sha256 = buildifier_sha256,
|
|
|
|
strip_prefix = "buildtools-{}".format(buildifier_version),
|
|
|
|
url = "https://github.com/bazelbuild/buildtools/archive/{}.tar.gz".format(buildifier_version),
|
|
|
|
)
|
2020-05-05 20:40:03 +03:00
|
|
|
|
|
|
|
if "com_github_madler_zlib" not in native.existing_rules():
|
|
|
|
http_archive(
|
|
|
|
name = "com_github_madler_zlib",
|
|
|
|
build_file = "@daml//3rdparty/c:zlib.BUILD",
|
|
|
|
strip_prefix = "zlib-{}".format(zlib_version),
|
|
|
|
urls = ["https://github.com/madler/zlib/archive/{}.tar.gz".format(zlib_version)],
|
|
|
|
sha256 = zlib_sha256,
|
|
|
|
)
|
2020-05-13 11:39:51 +03:00
|
|
|
|
|
|
|
if "build_bazel_rules_nodejs" not in native.existing_rules():
|
|
|
|
http_archive(
|
|
|
|
name = "build_bazel_rules_nodejs",
|
|
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/{}/rules_nodejs-{}.tar.gz".format(rules_nodejs_version, rules_nodejs_version)],
|
|
|
|
sha256 = rules_nodejs_sha256,
|
|
|
|
patches = [
|
|
|
|
# Work around for https://github.com/bazelbuild/rules_nodejs/issues/1565
|
|
|
|
"@daml//bazel_tools:rules_nodejs_npm_cli_path.patch",
|
2020-05-19 19:58:00 +03:00
|
|
|
# Enforces a dependency of the rules_nodejs workspace on the
|
|
|
|
# workspace providing node.
|
|
|
|
"@daml//bazel_tools:rules_nodejs_node_dependency.patch",
|
2020-05-13 11:39:51 +03:00
|
|
|
],
|
|
|
|
patch_args = ["-p1"],
|
|
|
|
)
|