forked from tweag/rules_haskell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE
204 lines (172 loc) · 4.96 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
workspace(name = "io_tweag_rules_haskell")
load("@io_tweag_rules_haskell//haskell:repositories.bzl", "haskell_repositories")
haskell_repositories()
http_archive(
name = "io_tweag_rules_nixpkgs",
strip_prefix = "rules_nixpkgs-0.2.2",
urls = ["https://github.com/tweag/rules_nixpkgs/archive/v0.2.2.tar.gz"],
)
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
"nixpkgs_git_repository",
"nixpkgs_package",
)
nixpkgs_git_repository(
name = "nixpkgs",
# To make protobuf support work we need packages such as
# lens-labels_0_2_0_0 to be available in nixpkgs. This means we need to
# use a version of nixpkgs that is newer than 18.03.
# Keep this value in sync with `nixpkgs.nix`
revision = "7c3dc2f53fc837be79426f11c9133f73d15a05c4",
)
nixpkgs_package(
name = "ghc",
repository = "@nixpkgs",
nix_file = "//tests:ghc.nix",
build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup(
name = "bin",
srcs = glob(["bin/*"]),
)
cc_library(
name = "threaded-rts",
srcs = select({
"@bazel_tools//src/conditions:darwin":
glob([
"lib/ghc-*/rts/libHSrts_thr-ghc*.dylib",
"lib/ghc-*/rts/libffi.dylib",
]),
"//conditions:default":
glob([
"lib/ghc-*/rts/libHSrts_thr-ghc*.so",
"lib/ghc-*/rts/libffi.so.6",
]),
}),
hdrs = glob(["lib/ghc-*/include/**/*.h"]),
strip_include_prefix = glob(["lib/ghc-*/include"], exclude_directories=0)[0],
)
""",
)
http_archive(
name = "com_google_protobuf",
sha256 = "cef7f1b5a7c5fba672bec2a319246e8feba471f04dcebfe362d55930ee7c1c30",
strip_prefix = "protobuf-3.5.0",
urls = ["https://github.com/google/protobuf/archive/v3.5.0.zip"],
)
nixpkgs_package(
name = "protoc_gen_haskell",
repository = "@nixpkgs",
nix_file = "//tests:protoc_gen_haskell.nix",
)
nixpkgs_package(
name = "doctest",
repository = "@nixpkgs",
attribute_path = "haskell.packages.ghc822.doctest",
)
nixpkgs_package(
name = "c2hs",
repository = "@nixpkgs",
attribute_path = "haskell.packages.ghc822.c2hs",
)
register_toolchains(
"//tests:ghc",
"//tests:doctest-toolchain",
"//tests:protobuf-toolchain",
)
nixpkgs_package(
name = "zlib",
repository = "@nixpkgs",
build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup (
name = "lib",
srcs = glob([
"lib/*.so",
"lib/*.so.*",
"lib/*.dylib",
]),
testonly = 1,
)
""",
)
nixpkgs_package(
name = "zlib.dev",
repository = "@nixpkgs",
build_file_content = """
load("@io_tweag_rules_haskell//haskell:haskell.bzl", "haskell_cc_import")
package(default_visibility = ["//visibility:public"])
filegroup (
name = "include",
srcs = glob(["include/*.h"]),
testonly = 1,
)
haskell_cc_import(
name = "zlib",
shared_library = "@zlib//:lib",
hdrs = [":include"],
testonly = 1,
strip_include_prefix = "include",
)
""",
)
nixpkgs_package(
name = "glib_locales",
repository = "@nixpkgs",
attribute_path = "glibcLocales",
build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup(
name = "locale-archive",
srcs = ["lib/locale/locale-archive"],
)
"""
)
# zlib as a Haskell library
new_http_archive(
name = "haskell_zlib",
build_file = "tests/BUILD.zlib",
strip_prefix = "zlib-0.6.2",
urls = ["https://hackage.haskell.org/package/zlib-0.6.2/zlib-0.6.2.tar.gz"],
)
maven_jar(
name = "org_apache_spark_spark_core_2_10",
artifact = "org.apache.spark:spark-core_2.10:1.6.0",
)
# For Skydoc
http_archive(
name = "io_bazel_rules_sass",
strip_prefix = "rules_sass-0.0.3",
urls = ["https://github.com/bazelbuild/rules_sass/archive/0.0.3.tar.gz"],
)
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_repositories")
sass_repositories()
http_archive(
name = "io_bazel_skydoc",
strip_prefix = "skydoc-b374449408e759e32e010fa6a20585fe9fabd523",
urls = ["https://github.com/mrkkrp/skydoc/archive/b374449408e759e32e010fa6a20585fe9fabd523.tar.gz"],
)
load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories")
skydoc_repositories()
# For buildifier
# XXX Need a patched version of rules_go to workaround warnings fixed
# by https://github.com/NixOS/nixpkgs/pull/28029 on NixOS. Revert to
# official release once fix hits Nixpkgs master.
http_archive(
name = "io_bazel_rules_go",
strip_prefix = "rules_go-6a2b1f780b475a75a7baae5b441635c566f0ed8a",
urls = ["https://github.com/mboes/rules_go/archive/6a2b1f780b475a75a7baae5b441635c566f0ed8a.tar.gz"],
)
http_archive(
name = "com_github_bazelbuild_buildtools",
strip_prefix = "buildtools-588d90030bc8054b550967aa45a8a8d170deba0b",
urls = ["https://github.com/bazelbuild/buildtools/archive/588d90030bc8054b550967aa45a8a8d170deba0b.tar.gz"],
)
load(
"@io_bazel_rules_go//go:def.bzl",
"go_rules_dependencies",
"go_register_toolchains",
)
go_rules_dependencies()
# Use host version because none of the SDK's that rules_go knows about
# are compatible with NixOS.
go_register_toolchains(go_version = "host")