WORKSPACE 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. workspace(name = "io_tweag_inline_java")
  2. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
  3. http_archive(
  4. name = "rules_haskell",
  5. sha256 = "2b36e26fde296dc9fbaeed087c898fdce23af0247592e897c317d19345b0e259",
  6. strip_prefix = "rules_haskell-7a7f8545789dc4f3bc0780d5725e1337bb494ea6",
  7. urls = ["https://github.com/tweag/rules_haskell/archive/7a7f8545789dc4f3bc0780d5725e1337bb494ea6.zip"],
  8. )
  9. load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies")
  10. rules_haskell_dependencies()
  11. load(
  12. "@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
  13. "nixpkgs_local_repository",
  14. "nixpkgs_package",
  15. "nixpkgs_python_configure",
  16. )
  17. nixpkgs_local_repository(
  18. name = "nixpkgs",
  19. nix_file = "//:nixpkgs.nix",
  20. )
  21. nixpkgs_python_configure(repository = "@nixpkgs")
  22. nixpkgs_package(
  23. name = "alex",
  24. attribute_path = "haskellPackages.alex",
  25. repository = "@nixpkgs",
  26. )
  27. #nixpkgs_package(
  28. # name = "stack_ignore_global_hints",
  29. # attribute_path = "stack_ignore_global_hints",
  30. # repository = "@nixpkgs",
  31. #)
  32. #
  33. #load("//:config_settings/setup.bzl", "config_settings")
  34. #config_settings(name = "config_settings")
  35. #load("@config_settings//:info.bzl", "ghc_version")
  36. load("@rules_haskell//haskell:cabal.bzl", "stack_snapshot")
  37. stack_snapshot(
  38. name = "stackage",
  39. packages = [
  40. "Cabal",
  41. "aeson",
  42. "async",
  43. "base",
  44. "bytestring",
  45. "choice",
  46. "constraints",
  47. "containers",
  48. "criterion",
  49. "deepseq",
  50. "directory",
  51. "distributed-closure",
  52. "exceptions",
  53. "filemanip",
  54. "filepath",
  55. "ghc",
  56. "hspec",
  57. "inline-c",
  58. "language-java",
  59. "monad-logger",
  60. "mtl",
  61. "process",
  62. "QuickCheck",
  63. "quickcheck-text",
  64. "quickcheck-unicode",
  65. "split",
  66. "streaming",
  67. "template-haskell",
  68. "temporary",
  69. "text",
  70. "time",
  71. "vector",
  72. "unix",
  73. # dependencies of th-desugar
  74. "fail",
  75. "ghc-prim",
  76. "linear-base",
  77. "ordered-containers",
  78. "semigroups",
  79. "singletons",
  80. "singletons-base",
  81. "stm",
  82. "syb",
  83. "th-abstraction",
  84. "th-lift",
  85. "th-orphans",
  86. "transformers-compat",
  87. # dependencies of singletons
  88. "ghc-boot-th",
  89. "pretty",
  90. "transformers",
  91. ],
  92. extra_deps = { "zlib" : ["@zlib.dev//:zlib"] },
  93. components_dependencies = {
  94. "attoparsec": """{"lib:attoparsec": ["lib:attoparsec-internal"]}""",
  95. },
  96. components =
  97. {
  98. "attoparsec": [
  99. "lib",
  100. "lib:attoparsec-internal",
  101. ],
  102. },
  103. local_snapshot = "//:snapshot-9.0.2.yaml",
  104. # stack = "@stack_ignore_global_hints//:bin/stack" if ghc_version == "9.0.1" else None,
  105. )
  106. load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
  107. nixpkgs_package(
  108. name = "glibc_locales",
  109. attribute_path = "glibcLocales",
  110. build_file_content = """
  111. package(default_visibility = ["//visibility:public"])
  112. filegroup(
  113. name = "locale-archive",
  114. srcs = ["lib/locale/locale-archive"],
  115. )
  116. """,
  117. repository = "@nixpkgs",
  118. )
  119. haskell_register_ghc_nixpkgs(
  120. attribute_path = "haskell.compiler.ghc902",
  121. locale_archive = "@glibc_locales//:locale-archive",
  122. repositories = {"nixpkgs": "@nixpkgs"},
  123. version = "9.0.2",
  124. compiler_flags = [
  125. "-Werror",
  126. "-Wall",
  127. "-Wcompat",
  128. "-Wincomplete-record-updates",
  129. "-Wredundant-constraints",
  130. ],
  131. )
  132. nixpkgs_package(
  133. name = "sed",
  134. attribute_path = "gnused",
  135. repository = "@nixpkgs",
  136. )
  137. nixpkgs_package(
  138. name = "hspec-discover",
  139. attribute_path = "haskellPackages.hspec-discover",
  140. repository = "@nixpkgs",
  141. )
  142. nixpkgs_package(
  143. name = "nixpkgs_zlib",
  144. attribute_path = "zlib",
  145. repository = "@nixpkgs",
  146. )
  147. nixpkgs_package(
  148. name = "zlib.dev",
  149. repository = "@nixpkgs",
  150. build_file_content = """
  151. load("@rules_cc//cc:defs.bzl", "cc_library")
  152. filegroup(
  153. name = "include",
  154. srcs = glob(["include/*.h"]),
  155. visibility = ["//visibility:public"],
  156. )
  157. cc_library(
  158. name = "zlib",
  159. srcs = ["@nixpkgs_zlib//:lib"],
  160. hdrs = [":include"],
  161. linkstatic = 1,
  162. strip_include_prefix = "include",
  163. visibility = ["//visibility:public"],
  164. )
  165. """,
  166. )
  167. nixpkgs_package(
  168. name = "openjdk",
  169. attribute_path = "openjdk11",
  170. repository = "@nixpkgs",
  171. build_file_content = """
  172. filegroup(
  173. name = "bin",
  174. srcs = ["bin/javac"],
  175. visibility = ["//visibility:public"],
  176. )
  177. filegroup(
  178. name = "libjvm",
  179. srcs = select(
  180. { "@bazel_tools//src/conditions:darwin": ["lib/server/libjvm.dylib"],
  181. "@bazel_tools//src/conditions:linux_x86_64": ["lib/openjdk/lib/server/libjvm.so"],
  182. }),
  183. visibility = ["//visibility:public"],
  184. )
  185. cc_library(
  186. name = "lib",
  187. srcs = [":libjvm"],
  188. hdrs = ["include/jni.h", "include/jni_md.h"],
  189. strip_include_prefix = "include",
  190. linkstatic = 1,
  191. visibility = ["//visibility:public"],
  192. )
  193. # XXX Temporary workaround for
  194. # https://github.com/bazelbuild/bazel/issues/8180.
  195. genrule(
  196. name = "rpath",
  197. srcs = ["@openjdk//:libjvm"],
  198. cmd = "libjvm=$(location :libjvm); echo -rpath $$(dirname $$(realpath $$libjvm)) > $@",
  199. outs = ["openjdk_response_file"],
  200. visibility = ["//visibility:public"],
  201. )
  202. """,
  203. )
  204. RULES_JVM_EXTERNAL_TAG = "3.3"
  205. RULES_JVM_EXTERNAL_SHA = "d85951a92c0908c80bd8551002d66cb23c3434409c814179c0ff026b53544dab"
  206. http_archive(
  207. name = "rules_jvm_external",
  208. strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
  209. sha256 = RULES_JVM_EXTERNAL_SHA,
  210. url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
  211. )
  212. load("@rules_jvm_external//:defs.bzl", "maven_install")
  213. maven_install(
  214. artifacts = [
  215. "org.apache.commons:commons-collections4:4.1",
  216. "com.wizzardo:http:0.3",
  217. "com.wizzardo:epoll:0.3.4",
  218. "com.wizzardo:reactive-pg-client:0.10.2.1",
  219. "com.wizzardo.tools:tools-collections:0.23",
  220. "com.wizzardo.tools:tools-interfaces:0.23",
  221. ],
  222. repositories = [
  223. "https://maven.google.com",
  224. "https://repo1.maven.org/maven2",
  225. ],
  226. )
  227. http_archive(
  228. name = "inline_java",
  229. # sha256 = "2b36e26fde296dc9fbaeed087c898fdce23af0247592e897c317d19345b0e259",
  230. strip_prefix = "inline-java-1e2ce404b98ef84de7737665541aa73a426f5523",
  231. urls = ["https://github.com/tweag/inline-java/archive/1e2ce404b98ef84de7737665541aa73a426f5523.zip"],
  232. )