-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathWORKSPACE
111 lines (92 loc) · 2.92 KB
/
WORKSPACE
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
workspace(name = "rules_haskell_examples")
local_repository(
name = "rules_haskell",
path = "..",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies")
rules_haskell_dependencies()
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
haskell_register_ghc_nixpkgs(
repository = "@rules_haskell//nixpkgs:default.nix",
version = "8.6.5",
)
load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_toolchains")
rules_haskell_toolchains(version = "8.6.5")
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_cc_configure")
nixpkgs_cc_configure(
nix_file = "@rules_haskell//nixpkgs:cc-toolchain.nix",
repository = "@rules_haskell//nixpkgs:default.nix",
)
# For the cat_hs example.
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_package")
nixpkgs_package(
name = "nixpkgs_zlib",
attribute_path = "zlib",
repository = "@rules_haskell//nixpkgs:default.nix",
)
nixpkgs_package(
name = "zlib.dev",
build_file_content = """
cc_library(
name = "zlib",
srcs = ["@nixpkgs_zlib//:lib"],
hdrs = glob(["include/*.h"]),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)
""",
repository = "@rules_haskell//nixpkgs:default.nix",
)
# Demonstrates a vendored Stackage package to bump a version bound.
http_archive(
name = "split",
build_file_content = """
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
load("@stackage//:packages.bzl", "packages")
haskell_cabal_library(
name = "split",
version = packages["split"].version,
srcs = glob(["**"]),
deps = packages["split"].deps,
visibility = ["//visibility:public"],
)
""",
patch_args = ["-p1"],
patches = ["@rules_haskell_examples//:split.patch"],
sha256 = "1dcd674f7c5f276f33300f5fd59e49d1ac6fc92ae949fd06a0f6d3e9d9ac1413",
strip_prefix = "split-0.2.3.3",
urls = ["http://hackage.haskell.org/package/split-0.2.3.3/split-0.2.3.3.tar.gz"],
)
load("@rules_haskell//haskell:cabal.bzl", "stack_snapshot")
stack_snapshot(
name = "stackage",
extra_deps = {"zlib": ["@zlib.dev//:zlib"]},
flags = {
# Sets the default explicitly to demonstrate the flags attribute.
"zlib": [
"-non-blocking-ffi",
"-pkg-config",
],
},
packages = [
"base",
"bytestring",
"conduit",
"conduit-extra",
"hspec",
"optparse-applicative",
"text",
"text-show",
],
snapshot = "lts-14.0",
vendored_packages = {"split": "@split//:split"},
)
# For the rts example.
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_package")
nixpkgs_package(
name = "ghc",
attribute_path = "haskellPackages.ghc",
build_file = "@rules_haskell//haskell:ghc.BUILD",
repository = "@rules_haskell//nixpkgs:default.nix",
)