forked from tweag/rules_haskell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE
110 lines (95 loc) · 3.02 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
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:toolchain.bzl", "rules_haskell_toolchains")
rules_haskell_toolchains(version = "8.6.5")
load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
"nixpkgs_cc_configure",
"nixpkgs_python_configure",
)
nixpkgs_cc_configure(
nix_file = "@rules_haskell//nixpkgs:cc-toolchain.nix",
nix_file_deps = ["@rules_haskell//nixpkgs:default.nix"],
repository = "@rules_haskell//nixpkgs:default.nix",
)
nixpkgs_python_configure(
repository = "@rules_haskell//nixpkgs:default.nix",
)
# For the cat_hs example.
http_archive(
name = "zlib.hs",
build_file_content = """
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "zlib.hs",
# Import `:z` as `srcs` to enforce the library name `libz.so`. Otherwise,
# Bazel would mangle the library name and e.g. Cabal wouldn't recognize it.
srcs = [":z"],
hdrs = glob(["*.h"]),
includes = ["."],
visibility = ["//visibility:public"],
)
cc_library(name = "z", srcs = glob(["*.c"]), hdrs = glob(["*.h"]))
""",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = [
"https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz",
"http://zlib.net/zlib-1.2.11.tar.gz",
],
)
# 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.hs"]},
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"},
)