2021-01-01 21:49:51 +03:00
|
|
|
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2019-11-22 17:24:08 +03:00
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
|
|
# Defines external Haskell dependencies.
|
|
|
|
|
#
|
|
|
|
|
# Add Stackage dependencies to the `packages` attribute of the `@stackage`
|
|
|
|
|
# `stack_snapshot` in the very bottom of this file. If a package or version is
|
|
|
|
|
# not available on Stackage, add it to the custom stack snapshot in
|
|
|
|
|
# `stack-snapshot.yaml`. If a library requires patching, then add it as an
|
|
|
|
|
# `http_archive` and add it to the `vendored_packages` attribute of
|
|
|
|
|
# `stack_snapshot`. Executables are defined in an `http_archive` using
|
|
|
|
|
# `haskell_cabal_binary`.
|
|
|
|
|
|
|
|
|
|
load("@bazel_skylib//lib:dicts.bzl", "dicts")
|
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
2021-10-12 14:43:20 +03:00
|
|
|
|
load("@os_info//:os_info.bzl", "is_linux", "is_windows")
|
2019-11-22 20:27:42 +03:00
|
|
|
|
load("@dadew//:dadew.bzl", "dadew_tool_home")
|
2019-11-22 17:24:08 +03:00
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "stack_snapshot")
|
|
|
|
|
|
2021-12-15 16:57:09 +03:00
|
|
|
|
GHC_LIB_REV = "f5cf141584658d543cbc34da7fbb2848"
|
|
|
|
|
GHC_LIB_SHA256 = "7e0480670b9e96b7ce160b59e0b0cf188b57bab59916c4c9e160a472038f2d02"
|
2021-11-30 21:11:33 +03:00
|
|
|
|
GHC_LIB_VERSION = "8.8.1"
|
2021-12-15 16:57:09 +03:00
|
|
|
|
GHC_LIB_PARSER_REV = "f5cf141584658d543cbc34da7fbb2848"
|
|
|
|
|
GHC_LIB_PARSER_SHA256 = "1962e9e0a726fa4a0dfe41a9b53e930ab5b9ee0eebff20f77e0d93c12574c32a"
|
2021-11-30 21:11:33 +03:00
|
|
|
|
GHC_LIB_PARSER_VERSION = "8.8.1"
|
2021-11-03 13:28:52 +03:00
|
|
|
|
GHCIDE_REV = "e04b5386b3741b839eb5c3d2a2586fd2aa97229c"
|
|
|
|
|
GHCIDE_SHA256 = "1d27926e0ad3c2a9536f23b454875a385ecc766ae68ce48a0ec88d0867884b46"
|
2020-02-18 19:53:27 +03:00
|
|
|
|
JS_JQUERY_VERSION = "3.3.1"
|
|
|
|
|
JS_DGTABLE_VERSION = "0.5.2"
|
|
|
|
|
JS_FLOT_VERSION = "0.8.3"
|
|
|
|
|
SHAKE_VERSION = "0.18.5"
|
2021-06-30 15:16:12 +03:00
|
|
|
|
ZIP_VERSION = "1.7.1"
|
2021-02-01 18:11:06 +03:00
|
|
|
|
GRPC_HASKELL_REV = "641f0bab046f2f03e5350a7c5f2044af1e19a5b1"
|
|
|
|
|
GRPC_HASKELL_SHA256 = "d850d804d7af779bb8717ebe4ea2ac74903a30adeb5262477a2e7a1536f4ca81"
|
2021-06-30 15:16:12 +03:00
|
|
|
|
XML_CONDUIT_VERSION = "1.9.1.1"
|
2021-08-04 22:33:52 +03:00
|
|
|
|
LSP_TYPES_VERSION = "1.2.0.0"
|
2019-11-22 17:24:08 +03:00
|
|
|
|
|
|
|
|
|
def daml_haskell_deps():
|
|
|
|
|
"""Load all Haskell dependencies of the DAML repository."""
|
|
|
|
|
|
|
|
|
|
# XXX: We do not have access to an integer-simple version of GHC on Windows.
|
|
|
|
|
# For the time being we build with GMP. See https://github.com/digital-asset/daml/issues/106
|
|
|
|
|
use_integer_simple = not is_windows
|
|
|
|
|
|
|
|
|
|
#
|
2021-08-26 11:41:58 +03:00
|
|
|
|
# Vendored Packages
|
2019-11-22 17:24:08 +03:00
|
|
|
|
#
|
|
|
|
|
|
2021-08-04 22:33:52 +03:00
|
|
|
|
http_archive(
|
|
|
|
|
name = "lsp-types",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "lsp-types",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
version = packages["lsp-types"].version,
|
2021-08-04 22:33:52 +03:00
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
deps = packages["lsp-types"].deps,
|
|
|
|
|
visibility = ["//visibility:public"],
|
2021-08-26 11:41:58 +03:00
|
|
|
|
)""",
|
2021-08-04 22:33:52 +03:00
|
|
|
|
patch_args = ["-p1"],
|
|
|
|
|
patches = [
|
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:lsp-types-normalisation.patch",
|
|
|
|
|
],
|
|
|
|
|
sha256 = "637a85878d7b8c895311eb6878f19c43038ef93db1e4de4820b04fa7bc30b4ab",
|
|
|
|
|
strip_prefix = "lsp-types-{}".format(LSP_TYPES_VERSION),
|
|
|
|
|
urls = ["http://hackage.haskell.org/package/lsp-types-{version}/lsp-types-{version}.tar.gz".format(version = LSP_TYPES_VERSION)],
|
|
|
|
|
)
|
|
|
|
|
|
2019-11-22 17:24:08 +03:00
|
|
|
|
# ghc-lib based ghcide - injected into `@stackage` and used for DAML IDE.
|
|
|
|
|
http_archive(
|
|
|
|
|
name = "ghcide_ghc_lib",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@rules_haskell//haskell:defs.bzl", "haskell_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "ghcide",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
version = packages["ghcide"].version,
|
2019-11-22 17:24:08 +03:00
|
|
|
|
srcs = glob(["**"]),
|
2020-01-06 13:24:15 +03:00
|
|
|
|
haddock = False,
|
2021-08-26 11:41:58 +03:00
|
|
|
|
flags = packages["ghcide"].flags,
|
|
|
|
|
deps = packages["ghcide"].deps,
|
2019-11-22 17:24:08 +03:00
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
|
|
|
|
haskell_library(
|
|
|
|
|
name = "testing",
|
|
|
|
|
srcs = glob(["test/src/**/*.hs"]),
|
|
|
|
|
src_strip_prefix = "test/src",
|
|
|
|
|
deps = [
|
2021-06-30 15:16:12 +03:00
|
|
|
|
"@stackage//:aeson",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"@stackage//:base",
|
|
|
|
|
"@stackage//:extra",
|
|
|
|
|
"@stackage//:containers",
|
2021-06-30 15:16:12 +03:00
|
|
|
|
"@stackage//:lsp-types",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"@stackage//:lens",
|
|
|
|
|
"@stackage//:lsp-test",
|
|
|
|
|
"@stackage//:parser-combinators",
|
|
|
|
|
"@stackage//:tasty-hunit",
|
|
|
|
|
"@stackage//:text",
|
|
|
|
|
],
|
|
|
|
|
compiler_flags = [
|
|
|
|
|
"-XBangPatterns",
|
|
|
|
|
"-XDeriveFunctor",
|
|
|
|
|
"-XDeriveGeneric",
|
|
|
|
|
"-XGeneralizedNewtypeDeriving",
|
|
|
|
|
"-XLambdaCase",
|
|
|
|
|
"-XNamedFieldPuns",
|
|
|
|
|
"-XOverloadedStrings",
|
|
|
|
|
"-XRecordWildCards",
|
|
|
|
|
"-XScopedTypeVariables",
|
|
|
|
|
"-XStandaloneDeriving",
|
|
|
|
|
"-XTupleSections",
|
|
|
|
|
"-XTypeApplications",
|
|
|
|
|
"-XViewPatterns",
|
|
|
|
|
],
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
2021-08-26 11:41:58 +03:00
|
|
|
|
""",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
patch_args = ["-p1"],
|
2020-07-24 17:29:25 +03:00
|
|
|
|
patches = [
|
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:haskell-ghcide-binary-q.patch",
|
|
|
|
|
],
|
2019-11-22 17:24:08 +03:00
|
|
|
|
sha256 = GHCIDE_SHA256,
|
2020-10-15 18:11:15 +03:00
|
|
|
|
strip_prefix = "daml-ghcide-%s" % GHCIDE_REV,
|
|
|
|
|
urls = ["https://github.com/digital-asset/daml-ghcide/archive/%s.tar.gz" % GHCIDE_REV],
|
2019-11-22 17:24:08 +03:00
|
|
|
|
)
|
|
|
|
|
|
2021-11-30 21:11:33 +03:00
|
|
|
|
http_archive(
|
|
|
|
|
name = "ghc_lib",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "ghc-lib",
|
|
|
|
|
version = packages["ghc-lib"].version,
|
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
haddock = False,
|
|
|
|
|
flags = packages["ghc-lib"].flags,
|
|
|
|
|
deps = packages["ghc-lib"].deps,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
tools = packages["ghc-lib"].tools,
|
|
|
|
|
)
|
|
|
|
|
""",
|
|
|
|
|
sha256 = GHC_LIB_SHA256,
|
|
|
|
|
strip_prefix = "ghc-lib-%s" % GHC_LIB_VERSION,
|
|
|
|
|
urls = ["https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-%s.tar.gz" % GHC_LIB_REV],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
|
name = "ghc_lib_parser",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "ghc-lib-parser",
|
|
|
|
|
version = packages["ghc-lib-parser"].version,
|
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
haddock = False,
|
|
|
|
|
flags = packages["ghc-lib-parser"].flags,
|
|
|
|
|
deps = packages["ghc-lib-parser"].deps,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
tools = packages["ghc-lib-parser"].tools,
|
|
|
|
|
)
|
|
|
|
|
""",
|
|
|
|
|
sha256 = GHC_LIB_PARSER_SHA256,
|
|
|
|
|
strip_prefix = "ghc-lib-parser-%s" % GHC_LIB_PARSER_VERSION,
|
|
|
|
|
urls = ["https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-parser-%s.tar.gz" % GHC_LIB_PARSER_REV],
|
|
|
|
|
)
|
|
|
|
|
|
2021-10-12 14:43:20 +03:00
|
|
|
|
cbit_dep = ":fat_cbits" if is_windows else ":needed-cbits-clib" if is_linux else ":cbits"
|
|
|
|
|
grpc_dep = "@com_github_grpc_grpc//:grpc" if is_windows else "@grpc_nix//:grpc_lib"
|
|
|
|
|
|
2021-01-25 14:53:53 +03:00
|
|
|
|
http_archive(
|
|
|
|
|
name = "grpc_haskell_core",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@com_github_digital_asset_daml//bazel_tools:fat_cc_library.bzl", "fat_cc_library")
|
|
|
|
|
load("@com_github_digital_asset_daml//bazel_tools:haskell.bzl", "c2hs_suite")
|
|
|
|
|
load("@rules_haskell//haskell:defs.bzl", "haskell_library")
|
|
|
|
|
c2hs_suite(
|
|
|
|
|
name = "grpc-haskell-core",
|
|
|
|
|
srcs = [
|
|
|
|
|
"src/Network/GRPC/Unsafe/Constants.hsc",
|
|
|
|
|
] + glob(["src/**/*.hs"]),
|
|
|
|
|
c2hs_src_strip_prefix = "src",
|
|
|
|
|
hackage_deps = ["clock", "managed", "base", "sorted-list", "bytestring", "containers", "stm", "transformers"],
|
|
|
|
|
c2hs_srcs = [
|
|
|
|
|
"src/Network/GRPC/Unsafe/Time.chs",
|
|
|
|
|
"src/Network/GRPC/Unsafe/ChannelArgs.chs",
|
|
|
|
|
"src/Network/GRPC/Unsafe/Slice.chs",
|
|
|
|
|
"src/Network/GRPC/Unsafe/ByteBuffer.chs",
|
|
|
|
|
"src/Network/GRPC/Unsafe/Metadata.chs",
|
|
|
|
|
"src/Network/GRPC/Unsafe/Op.chs",
|
|
|
|
|
"src/Network/GRPC/Unsafe.chs",
|
|
|
|
|
"src/Network/GRPC/Unsafe/Security.chs",
|
|
|
|
|
],
|
|
|
|
|
compiler_flags = ["-XCPP", "-Wno-unused-imports", "-Wno-unused-record-wildcards"],
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
deps = [
|
2021-10-12 14:43:20 +03:00
|
|
|
|
"{cbit_dep}",
|
2021-01-25 14:53:53 +03:00
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2021-10-12 14:43:20 +03:00
|
|
|
|
cc_library(
|
|
|
|
|
name = "needed-cbits-clib",
|
|
|
|
|
srcs = [":libneeded-cbits.so"],
|
|
|
|
|
deps = ["{grpc_dep}"],
|
|
|
|
|
hdrs = glob(["include/*.h"]),
|
|
|
|
|
includes = ["include/"],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Bazel produces cbits without NEEDED entries which makes
|
|
|
|
|
# ghci unhappy. We cannot use fat_cbits on the nix-built grpc
|
|
|
|
|
# since it lacks static libs but we can patchelf the cbits to add
|
|
|
|
|
# the NEEDED entry.
|
|
|
|
|
# Apparently this is not needed on macos for whatever reason and patchelf
|
|
|
|
|
# doesn’t work there anyway so we only use it on Linux.
|
|
|
|
|
genrule(
|
|
|
|
|
name = "needed-cbits",
|
|
|
|
|
srcs = [":cbits", "@grpc_nix//:grpc_file"],
|
|
|
|
|
outs = ["libneeded-cbits.so"],
|
|
|
|
|
tools = ["@patchelf_nix//:bin/patchelf"],
|
|
|
|
|
cmd = '''
|
|
|
|
|
set -eou pipefail
|
|
|
|
|
# We get 3 libs. We want the shared lib which comes last.
|
|
|
|
|
CBITS=$$(echo $(locations :cbits) | cut -f 3 -d ' ')
|
|
|
|
|
OLD_RPATH=$$($(location @patchelf_nix//:bin/patchelf) --print-rpath $$CBITS)
|
|
|
|
|
GRPC_RPATH=$$(dirname $$(readlink -f $$(echo $(locations @grpc_nix//:grpc_file) | cut -f 1 -d ' ')))
|
2021-12-01 15:01:46 +03:00
|
|
|
|
$(location @patchelf_nix//:bin/patchelf) $$CBITS --add-needed libgrpc.so.20 --output $(location libneeded-cbits.so)
|
2021-10-12 14:43:20 +03:00
|
|
|
|
$(location @patchelf_nix//:bin/patchelf) $(location libneeded-cbits.so) --set-rpath "$$OLD_RPATH:$$GRPC_RPATH"
|
|
|
|
|
'''
|
|
|
|
|
)
|
|
|
|
|
|
2019-11-26 20:47:39 +03:00
|
|
|
|
fat_cc_library(
|
2021-01-25 14:53:53 +03:00
|
|
|
|
name = "fat_cbits",
|
|
|
|
|
input_lib = "cbits",
|
2019-11-26 20:47:39 +03:00
|
|
|
|
)
|
2021-01-25 14:53:53 +03:00
|
|
|
|
cc_library(
|
|
|
|
|
name = "cbits",
|
|
|
|
|
srcs = glob(["cbits/*.c"]),
|
|
|
|
|
hdrs = glob(["include/*.h"]),
|
|
|
|
|
includes = ["include/"],
|
|
|
|
|
deps = [
|
2021-10-12 14:43:20 +03:00
|
|
|
|
"{grpc_dep}",
|
2021-01-25 14:53:53 +03:00
|
|
|
|
]
|
|
|
|
|
)
|
2021-10-12 14:43:20 +03:00
|
|
|
|
""".format(cbit_dep = cbit_dep, grpc_dep = grpc_dep),
|
2021-01-25 14:53:53 +03:00
|
|
|
|
patch_args = ["-p1"],
|
|
|
|
|
patches = [
|
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:grpc-haskell-core-cpp-options.patch",
|
2021-02-01 18:11:06 +03:00
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:grpc-haskell-core-upgrade.patch",
|
2021-01-25 14:53:53 +03:00
|
|
|
|
],
|
2021-02-01 18:11:06 +03:00
|
|
|
|
sha256 = GRPC_HASKELL_SHA256,
|
|
|
|
|
strip_prefix = "gRPC-haskell-{}/core".format(GRPC_HASKELL_REV),
|
|
|
|
|
urls = ["https://github.com/awakesecurity/gRPC-haskell/archive/{}.tar.gz".format(GRPC_HASKELL_REV)],
|
2021-01-25 14:53:53 +03:00
|
|
|
|
)
|
2019-11-26 20:47:39 +03:00
|
|
|
|
|
2019-11-22 17:24:08 +03:00
|
|
|
|
http_archive(
|
2021-01-25 14:53:53 +03:00
|
|
|
|
name = "grpc_haskell",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:defs.bzl", "haskell_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_library(
|
|
|
|
|
name = "grpc-haskell",
|
|
|
|
|
srcs = glob(["src/**/*.hs"]),
|
|
|
|
|
deps = packages["grpc-haskell"].deps,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
|
|
|
|
""",
|
2021-02-01 18:11:06 +03:00
|
|
|
|
sha256 = GRPC_HASKELL_SHA256,
|
|
|
|
|
strip_prefix = "gRPC-haskell-{}".format(GRPC_HASKELL_REV),
|
|
|
|
|
urls = ["https://github.com/awakesecurity/gRPC-haskell/archive/{}.tar.gz".format(GRPC_HASKELL_REV)],
|
2021-01-25 14:53:53 +03:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
|
name = "proto3-suite",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
2021-01-25 14:53:53 +03:00
|
|
|
|
name = "proto3-suite",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
version = packages["proto3-suite"].version,
|
2021-01-25 14:53:53 +03:00
|
|
|
|
srcs = glob(["src/**", "test-files/*.bin", "tests/*", "proto3-suite.cabal"]),
|
|
|
|
|
haddock = False,
|
|
|
|
|
deps = packages["proto3-suite"].deps,
|
|
|
|
|
verbose = False,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
2021-08-26 11:41:58 +03:00
|
|
|
|
# XXX: haskell_cabal_binary inexplicably fails with
|
|
|
|
|
# realgcc.exe: error: CreateProcess: No such file or directory
|
|
|
|
|
# So we use haskell_binary instead.
|
|
|
|
|
load("@rules_haskell//haskell:defs.bzl", "haskell_binary")
|
|
|
|
|
haskell_binary(
|
|
|
|
|
name = "compile-proto-file",
|
|
|
|
|
srcs = ["tools/compile-proto-file/Main.hs"],
|
|
|
|
|
compiler_flags = ["-w", "-optF=-w"],
|
|
|
|
|
deps = [":proto3-suite"] + packages["proto3-suite"].deps,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
2021-01-25 14:53:53 +03:00
|
|
|
|
""",
|
|
|
|
|
sha256 = "b294ff0fe24c6c256dc8eca1d44c2a9a928b9a1bc70ddce6a1d059499edea119",
|
|
|
|
|
strip_prefix = "proto3-suite-0af901f9ef3b9719e08eae4fab8fd700d6c8047a",
|
|
|
|
|
urls = ["https://github.com/awakesecurity/proto3-suite/archive/0af901f9ef3b9719e08eae4fab8fd700d6c8047a.tar.gz"],
|
2021-01-29 14:01:55 +03:00
|
|
|
|
patches = ["@com_github_digital_asset_daml//bazel_tools:haskell_proto3_suite_deriving_defaults.patch"],
|
|
|
|
|
patch_args = ["-p1"],
|
2021-01-25 14:53:53 +03:00
|
|
|
|
)
|
|
|
|
|
|
2020-02-18 19:53:27 +03:00
|
|
|
|
# Note (MK)
|
|
|
|
|
# We vendor Shake and its JS dependencies
|
|
|
|
|
# so that we can replace the data-files with file-embed.
|
|
|
|
|
# This is both to workaround bugs in rules_haskell where data-files
|
|
|
|
|
# are not propagated correctly to non-cabal targets and to
|
|
|
|
|
# make sure that they are shipped in the SDK.
|
|
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
|
name = "js_jquery",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "js-jquery",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
version = packages["js-jquery"].version,
|
2020-02-18 19:53:27 +03:00
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
haddock = False,
|
|
|
|
|
deps = packages["js-jquery"].deps,
|
|
|
|
|
verbose = False,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
2021-08-26 11:41:58 +03:00
|
|
|
|
""",
|
2020-02-18 19:53:27 +03:00
|
|
|
|
patch_args = ["-p1"],
|
|
|
|
|
patches = [
|
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:haskell-js-jquery.patch",
|
|
|
|
|
],
|
|
|
|
|
sha256 = "e0e0681f0da1130ede4e03a051630ea439c458cb97216cdb01771ebdbe44069b",
|
|
|
|
|
strip_prefix = "js-jquery-{}".format(JS_JQUERY_VERSION),
|
|
|
|
|
urls = ["http://hackage.haskell.org/package/js-jquery-{version}/js-jquery-{version}.tar.gz".format(version = JS_JQUERY_VERSION)],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
|
name = "js_dgtable",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "js-dgtable",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
version = packages["js-dgtable"].version,
|
2020-02-18 19:53:27 +03:00
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
haddock = False,
|
|
|
|
|
deps = packages["js-dgtable"].deps,
|
|
|
|
|
verbose = False,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
2021-08-26 11:41:58 +03:00
|
|
|
|
""",
|
2020-02-18 19:53:27 +03:00
|
|
|
|
patch_args = ["-p1"],
|
|
|
|
|
patches = [
|
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:haskell-js-dgtable.patch",
|
|
|
|
|
],
|
|
|
|
|
sha256 = "e28dd65bee8083b17210134e22e01c6349dc33c3b7bd17705973cd014e9f20ac",
|
|
|
|
|
strip_prefix = "js-dgtable-{}".format(JS_DGTABLE_VERSION),
|
|
|
|
|
urls = ["http://hackage.haskell.org/package/js-dgtable-{version}/js-dgtable-{version}.tar.gz".format(version = JS_DGTABLE_VERSION)],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
|
name = "js_flot",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "js-flot",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
version = packages["js-flot"].version,
|
2020-02-18 19:53:27 +03:00
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
haddock = False,
|
|
|
|
|
deps = packages["js-flot"].deps,
|
|
|
|
|
verbose = False,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
2021-08-26 11:41:58 +03:00
|
|
|
|
""",
|
2020-02-18 19:53:27 +03:00
|
|
|
|
patch_args = ["-p1"],
|
|
|
|
|
patches = [
|
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:haskell-js-flot.patch",
|
|
|
|
|
],
|
|
|
|
|
sha256 = "1ba2f2a6b8d85da76c41f526c98903cbb107f8642e506c072c1e7e3c20fe5e7a",
|
|
|
|
|
strip_prefix = "js-flot-{}".format(JS_FLOT_VERSION),
|
|
|
|
|
urls = ["http://hackage.haskell.org/package/js-flot-{version}/js-flot-{version}.tar.gz".format(version = JS_FLOT_VERSION)],
|
|
|
|
|
)
|
|
|
|
|
|
2021-06-30 15:16:12 +03:00
|
|
|
|
http_archive(
|
|
|
|
|
name = "xml-conduit",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "xml-conduit",
|
|
|
|
|
version = packages["xml-conduit"].version,
|
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
haddock = False,
|
|
|
|
|
deps = packages["xml-conduit"].deps,
|
|
|
|
|
# For some reason we need to manually add the setup dep here.
|
|
|
|
|
setup_deps = ["@stackage//:cabal-doctest"],
|
|
|
|
|
verbose = False,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
|
|
|
|
""",
|
|
|
|
|
sha256 = "bdb117606c0b56ca735564465b14b50f77f84c9e52e31d966ac8d4556d3ff0ff",
|
|
|
|
|
strip_prefix = "xml-conduit-{}".format(XML_CONDUIT_VERSION),
|
|
|
|
|
urls = ["http://hackage.haskell.org/package/xml-conduit-{version}/xml-conduit-{version}.tar.gz".format(version = XML_CONDUIT_VERSION)],
|
|
|
|
|
)
|
|
|
|
|
|
2020-02-18 19:53:27 +03:00
|
|
|
|
http_archive(
|
|
|
|
|
name = "shake",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "shake",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
version = packages["shake"].version,
|
2020-02-18 19:53:27 +03:00
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
haddock = False,
|
|
|
|
|
deps = packages["shake"].deps,
|
|
|
|
|
verbose = False,
|
|
|
|
|
visibility = ["//visibility:public"],
|
2021-08-26 11:41:58 +03:00
|
|
|
|
flags = packages["shake"].flags,
|
2020-02-18 19:53:27 +03:00
|
|
|
|
)
|
2021-08-26 11:41:58 +03:00
|
|
|
|
""",
|
2020-02-18 19:53:27 +03:00
|
|
|
|
patch_args = ["-p1"],
|
|
|
|
|
patches = [
|
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:haskell-shake.patch",
|
|
|
|
|
],
|
|
|
|
|
sha256 = "576ab57f53b8051f67ceeb97bd9abf2e0926f592334a7a1c27c07b36afca240f",
|
|
|
|
|
strip_prefix = "shake-{}".format(SHAKE_VERSION),
|
|
|
|
|
urls = ["http://hackage.haskell.org/package/shake-{version}/shake-{version}.tar.gz".format(version = SHAKE_VERSION)],
|
|
|
|
|
)
|
|
|
|
|
|
2020-04-20 11:35:11 +03:00
|
|
|
|
http_archive(
|
|
|
|
|
name = "zip",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
|
|
|
|
|
load("@stackage//:packages.bzl", "packages")
|
|
|
|
|
haskell_cabal_library(
|
|
|
|
|
name = "zip",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
version = packages["zip"].version,
|
2020-04-20 11:35:11 +03:00
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
haddock = False,
|
2021-08-26 11:41:58 +03:00
|
|
|
|
deps = packages["zip"].deps,
|
2020-04-20 11:35:11 +03:00
|
|
|
|
verbose = False,
|
|
|
|
|
visibility = ["//visibility:public"],
|
2021-08-26 11:41:58 +03:00
|
|
|
|
flags = packages["zip"].flags,
|
2020-04-20 11:35:11 +03:00
|
|
|
|
)
|
2021-08-26 11:41:58 +03:00
|
|
|
|
""",
|
2020-04-20 11:35:11 +03:00
|
|
|
|
patch_args = ["-p1"],
|
|
|
|
|
patches = [
|
|
|
|
|
"@com_github_digital_asset_daml//bazel_tools:haskell-zip.patch",
|
|
|
|
|
],
|
2021-06-30 15:16:12 +03:00
|
|
|
|
sha256 = "0d7f02bbdf6c49e9a33d2eca4b3d7644216a213590866dafdd2b47ddd38eb746",
|
2020-04-20 11:35:11 +03:00
|
|
|
|
strip_prefix = "zip-{}".format(ZIP_VERSION),
|
|
|
|
|
urls = ["http://hackage.haskell.org/package/zip-{version}/zip-{version}.tar.gz".format(version = ZIP_VERSION)],
|
|
|
|
|
)
|
|
|
|
|
|
2019-11-22 20:27:42 +03:00
|
|
|
|
#
|
|
|
|
|
# Stack binary
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# On Windows the stack binary is provisioned using dadew.
|
|
|
|
|
if is_windows:
|
|
|
|
|
native.new_local_repository(
|
|
|
|
|
name = "stack_windows",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
exports_files(["stack.exe"], visibility = ["//visibility:public"])
|
|
|
|
|
""",
|
|
|
|
|
path = dadew_tool_home("stack"),
|
|
|
|
|
)
|
|
|
|
|
|
2019-11-22 17:24:08 +03:00
|
|
|
|
#
|
|
|
|
|
# Stack Snapshots
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
stack_snapshot(
|
|
|
|
|
name = "stackage",
|
|
|
|
|
extra_deps = {
|
|
|
|
|
"digest": ["@com_github_madler_zlib//:libz"],
|
|
|
|
|
"zlib": ["@com_github_madler_zlib//:libz"],
|
|
|
|
|
},
|
|
|
|
|
flags = dicts.add(
|
|
|
|
|
{
|
|
|
|
|
"ghcide": ["ghc-lib"],
|
2020-01-22 14:25:51 +03:00
|
|
|
|
"ghc-lib-parser-ex": ["ghc-lib"],
|
2021-08-26 11:41:58 +03:00
|
|
|
|
"hlint": ["ghc-lib"],
|
|
|
|
|
"shake": ["embed-files"],
|
2021-06-30 15:16:12 +03:00
|
|
|
|
"zip": ["disable-bzip2", "disable-zstd"],
|
2019-11-22 17:24:08 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"blaze-textual": ["integer-simple"],
|
|
|
|
|
"cryptonite": ["-integer-gmp"],
|
|
|
|
|
"hashable": ["-integer-gmp"],
|
|
|
|
|
"integer-logarithms": ["-integer-gmp"],
|
|
|
|
|
"scientific": ["integer-simple"],
|
2021-08-26 11:41:58 +03:00
|
|
|
|
"text": ["integer-simple"],
|
2019-11-22 17:24:08 +03:00
|
|
|
|
} if use_integer_simple else {},
|
|
|
|
|
),
|
2020-01-06 13:24:15 +03:00
|
|
|
|
haddock = False,
|
2019-11-22 17:24:08 +03:00
|
|
|
|
local_snapshot = "//:stack-snapshot.yaml",
|
2020-09-24 15:03:15 +03:00
|
|
|
|
stack_snapshot_json =
|
|
|
|
|
"//:stackage_snapshot_windows.json" if is_windows else "//:stackage_snapshot.json",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
packages = [
|
|
|
|
|
"aeson",
|
2020-04-17 19:42:24 +03:00
|
|
|
|
"aeson-extra",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"aeson-pretty",
|
|
|
|
|
"ansi-terminal",
|
|
|
|
|
"ansi-wl-pprint",
|
|
|
|
|
"async",
|
|
|
|
|
"base",
|
|
|
|
|
"base16-bytestring",
|
2021-03-18 14:17:38 +03:00
|
|
|
|
"base64",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"base64-bytestring",
|
|
|
|
|
"binary",
|
|
|
|
|
"blaze-html",
|
|
|
|
|
"bytestring",
|
2020-06-10 18:21:31 +03:00
|
|
|
|
"c2hs",
|
2020-01-20 20:47:47 +03:00
|
|
|
|
"case-insensitive",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"clock",
|
|
|
|
|
"cmark-gfm",
|
|
|
|
|
"conduit",
|
|
|
|
|
"conduit-extra",
|
|
|
|
|
"connection",
|
|
|
|
|
"containers",
|
|
|
|
|
"cryptohash",
|
|
|
|
|
"cryptonite",
|
|
|
|
|
"data-default",
|
|
|
|
|
"Decimal",
|
|
|
|
|
"deepseq",
|
|
|
|
|
"directory",
|
|
|
|
|
"dlist",
|
|
|
|
|
"either",
|
|
|
|
|
"exceptions",
|
|
|
|
|
"extra",
|
|
|
|
|
"fast-logger",
|
|
|
|
|
"file-embed",
|
2021-05-11 19:36:19 +03:00
|
|
|
|
"filelock",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"filepath",
|
|
|
|
|
"filepattern",
|
2020-01-22 14:25:51 +03:00
|
|
|
|
"ghc-lib-parser-ex",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"gitrev",
|
|
|
|
|
"hashable",
|
|
|
|
|
"haskeline",
|
|
|
|
|
"haskell-src-exts",
|
|
|
|
|
"hlint",
|
|
|
|
|
"hpp",
|
2020-04-07 11:22:15 +03:00
|
|
|
|
"hspec",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"http-client",
|
|
|
|
|
"http-client-tls",
|
|
|
|
|
"http-conduit",
|
|
|
|
|
"http-types",
|
|
|
|
|
"jwt",
|
|
|
|
|
"lens",
|
|
|
|
|
"lens-aeson",
|
|
|
|
|
"lifted-async",
|
|
|
|
|
"lifted-base",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
"lsp",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"lsp-test",
|
|
|
|
|
"main-tester",
|
|
|
|
|
"megaparsec",
|
|
|
|
|
"memory",
|
|
|
|
|
"monad-control",
|
|
|
|
|
"monad-logger",
|
|
|
|
|
"monad-loops",
|
|
|
|
|
"mtl",
|
|
|
|
|
"network",
|
|
|
|
|
"network-uri",
|
|
|
|
|
"nsis",
|
|
|
|
|
"open-browser",
|
|
|
|
|
"optparse-applicative",
|
|
|
|
|
"parser-combinators",
|
|
|
|
|
"path",
|
|
|
|
|
"path-io",
|
|
|
|
|
"pretty",
|
|
|
|
|
"prettyprinter",
|
|
|
|
|
"pretty-show",
|
|
|
|
|
"process",
|
|
|
|
|
"proto3-wire",
|
|
|
|
|
"random",
|
|
|
|
|
"recursion-schemes",
|
|
|
|
|
"regex-tdfa",
|
2020-04-01 16:13:46 +03:00
|
|
|
|
"repline",
|
2020-01-20 13:00:10 +03:00
|
|
|
|
"resourcet",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"retry",
|
|
|
|
|
"rope-utf16-splay",
|
|
|
|
|
"safe",
|
|
|
|
|
"safe-exceptions",
|
|
|
|
|
"scientific",
|
2020-04-03 13:43:04 +03:00
|
|
|
|
"semigroupoids",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"semver",
|
2020-04-07 11:22:15 +03:00
|
|
|
|
"silently",
|
2020-05-20 09:08:18 +03:00
|
|
|
|
"simple-smt",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"sorted-list",
|
|
|
|
|
"split",
|
|
|
|
|
"stache",
|
|
|
|
|
"stm",
|
2021-01-28 20:57:09 +03:00
|
|
|
|
"stm-chans",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
"stm-conduit",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"syb",
|
|
|
|
|
"system-filepath",
|
|
|
|
|
"tagged",
|
|
|
|
|
"tar",
|
|
|
|
|
"tar-conduit",
|
|
|
|
|
"tasty",
|
|
|
|
|
"tasty-ant-xml",
|
2020-04-28 20:29:14 +03:00
|
|
|
|
"tasty-expected-failure",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"tasty-golden",
|
|
|
|
|
"tasty-hunit",
|
|
|
|
|
"tasty-quickcheck",
|
|
|
|
|
"template-haskell",
|
|
|
|
|
"temporary",
|
|
|
|
|
"terminal-progress-bar",
|
|
|
|
|
"text",
|
|
|
|
|
"time",
|
|
|
|
|
"tls",
|
|
|
|
|
"transformers",
|
|
|
|
|
"transformers-base",
|
|
|
|
|
"typed-process",
|
|
|
|
|
"uniplate",
|
|
|
|
|
"unix-compat",
|
|
|
|
|
"unliftio",
|
|
|
|
|
"unliftio-core",
|
|
|
|
|
"unordered-containers",
|
|
|
|
|
"uri-encode",
|
|
|
|
|
"utf8-string",
|
|
|
|
|
"uuid",
|
|
|
|
|
"vector",
|
|
|
|
|
"xml",
|
|
|
|
|
"yaml",
|
|
|
|
|
"zip-archive",
|
|
|
|
|
] + (["unix"] if not is_windows else ["Win32"]),
|
2020-06-10 18:21:31 +03:00
|
|
|
|
components = {
|
|
|
|
|
"hpp": ["lib", "exe"],
|
|
|
|
|
},
|
2019-11-22 20:27:42 +03:00
|
|
|
|
stack = "@stack_windows//:stack.exe" if is_windows else None,
|
2019-11-22 17:24:08 +03:00
|
|
|
|
vendored_packages = {
|
|
|
|
|
"ghcide": "@ghcide_ghc_lib//:ghcide",
|
2021-11-30 21:11:33 +03:00
|
|
|
|
"ghc-lib": "@ghc_lib//:ghc-lib",
|
|
|
|
|
"ghc-lib-parser": "@ghc_lib_parser//:ghc-lib-parser",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
"grpc-haskell-core": "@grpc_haskell_core//:grpc-haskell-core",
|
2021-01-25 14:53:53 +03:00
|
|
|
|
"grpc-haskell": "@grpc_haskell//:grpc-haskell",
|
2020-02-18 19:53:27 +03:00
|
|
|
|
"js-dgtable": "@js_dgtable//:js-dgtable",
|
|
|
|
|
"js-flot": "@js_flot//:js-flot",
|
2021-08-26 11:41:58 +03:00
|
|
|
|
"js-jquery": "@js_jquery//:js-jquery",
|
|
|
|
|
"lsp-types": "@lsp-types//:lsp-types",
|
2021-01-25 14:53:53 +03:00
|
|
|
|
"proto3-suite": "@proto3-suite//:proto3-suite",
|
2020-02-18 19:53:27 +03:00
|
|
|
|
"shake": "@shake//:shake",
|
2021-06-30 15:16:12 +03:00
|
|
|
|
"xml-conduit": "@xml-conduit//:xml-conduit",
|
2020-04-20 11:35:11 +03:00
|
|
|
|
"zip": "@zip//:zip",
|
2019-11-22 17:24:08 +03:00
|
|
|
|
},
|
|
|
|
|
)
|
2020-07-16 19:30:09 +03:00
|
|
|
|
|
|
|
|
|
stack_snapshot(
|
|
|
|
|
name = "ghcide",
|
|
|
|
|
extra_deps = {
|
|
|
|
|
"zlib": ["@com_github_madler_zlib//:libz"],
|
|
|
|
|
},
|
|
|
|
|
flags = {
|
|
|
|
|
"hashable": ["-integer-gmp"],
|
|
|
|
|
"integer-logarithms": ["-integer-gmp"],
|
|
|
|
|
"scientific": ["integer-simple"],
|
2021-08-26 11:41:58 +03:00
|
|
|
|
"text": ["integer-simple"],
|
2020-07-16 19:30:09 +03:00
|
|
|
|
} if use_integer_simple else {},
|
|
|
|
|
haddock = False,
|
|
|
|
|
local_snapshot = "//:ghcide-snapshot.yaml",
|
2020-09-24 15:03:15 +03:00
|
|
|
|
stack_snapshot_json =
|
|
|
|
|
"//:ghcide_snapshot_windows.json" if is_windows else "//:ghcide_snapshot.json",
|
2020-07-16 19:30:09 +03:00
|
|
|
|
packages = [
|
|
|
|
|
"ghcide",
|
|
|
|
|
],
|
|
|
|
|
components = {"ghcide": ["lib", "exe"]},
|
|
|
|
|
stack = "@stack_windows//:stack.exe" if is_windows else None,
|
|
|
|
|
vendored_packages = {
|
|
|
|
|
"zip": "@zip//:zip",
|
|
|
|
|
},
|
|
|
|
|
)
|