repositories.bzl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License in the LICENSE file at the
  6. # root of this repository, or online at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. """Defines all of our third party C dependencies."""
  16. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
  17. load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
  18. def c_repositories():
  19. """
  20. We need to make sure the versions of libraries defined here stay in sync
  21. with the relevant Rust `*-sys` crates.
  22. TODO(parkmycar): Add automatic linting to detect mismatches.
  23. """
  24. BZIP2_VERSION = "1.0.8"
  25. BZIP2_INTEGRITY = "sha256-q1oDF27hBtPw+pDjgdpHjdrkBZGBU8yiSOaCzQxKImk="
  26. maybe(
  27. http_archive,
  28. name = "bzip2",
  29. build_file = Label("//misc/bazel/c_deps:BUILD.bzip2.bazel"),
  30. integrity = BZIP2_INTEGRITY,
  31. strip_prefix = "bzip2-{0}".format(BZIP2_VERSION),
  32. urls = [
  33. "https://mirror.bazel.build/sourceware.org/pub/bzip2/bzip2-{0}.tar.gz".format(BZIP2_VERSION),
  34. "https://sourceware.org/pub/bzip2/bzip2-{0}.tar.gz".format(BZIP2_VERSION),
  35. ],
  36. )
  37. LZ4_VERSION = "1.9.4"
  38. LZ4_INTEGRITY = "sha256-Cw46oHyMBj3fQLCCvffjehVivaQKD/UnKVfz6Yfg5Us="
  39. maybe(
  40. http_archive,
  41. name = "lz4",
  42. build_file = Label("//misc/bazel/c_deps:BUILD.lz4.bazel"),
  43. integrity = LZ4_INTEGRITY,
  44. strip_prefix = "lz4-{0}".format(LZ4_VERSION),
  45. urls = [
  46. "https://github.com/lz4/lz4/releases/download/v{0}/lz4-{0}.tar.gz".format(LZ4_VERSION),
  47. ],
  48. )
  49. JEMALLOC_VERSION = "5.3.0"
  50. JEMALLOC_INTEGRITY = "sha256-LbgtHnEZ3z5xt2QCGbbf6EeJvAU3mDw7esT3GJrs/qo="
  51. maybe(
  52. http_archive,
  53. name = "jemalloc",
  54. build_file = Label("//misc/bazel/c_deps:BUILD.jemalloc.bazel"),
  55. integrity = JEMALLOC_INTEGRITY,
  56. strip_prefix = "jemalloc-{0}".format(JEMALLOC_VERSION),
  57. urls = [
  58. "https://github.com/jemalloc/jemalloc/releases/download/{0}/jemalloc-{0}.tar.bz2".format(JEMALLOC_VERSION),
  59. ],
  60. )
  61. OPENSSL_VERSION = "3.3.1"
  62. OPENSSL_INTEGRITY = "sha256-d3zVlihMiDN1oqehG/XSeG/FQTJV76sgxQ1v/m0CC34="
  63. maybe(
  64. http_archive,
  65. name = "openssl",
  66. build_file = Label("//misc/bazel/c_deps:BUILD.openssl.bazel"),
  67. integrity = OPENSSL_INTEGRITY,
  68. strip_prefix = "openssl-{0}".format(OPENSSL_VERSION),
  69. urls = [
  70. "https://www.openssl.org/source/openssl-{0}.tar.gz".format(OPENSSL_VERSION),
  71. "https://github.com/openssl/openssl/releases/download/openssl-{0}/openssl-{0}.tar.gz".format(OPENSSL_VERSION),
  72. "https://mirror.bazel.build/www.openssl.org/source/openssl-{0}.tar.gz".format(OPENSSL_VERSION),
  73. ],
  74. )
  75. PROTOC_VERSION = "27.0"
  76. PROTOC_INTEGRITY = "sha256-2iiL8dqmwE0DqQUXgcqlKs65FjWGv/mqbPsS9puTlao="
  77. maybe(
  78. http_archive,
  79. name = "com_google_protobuf",
  80. integrity = PROTOC_INTEGRITY,
  81. strip_prefix = "protobuf-{}".format(PROTOC_VERSION),
  82. urls = [
  83. "https://github.com/protocolbuffers/protobuf/archive/v{}.tar.gz".format(PROTOC_VERSION),
  84. ],
  85. )
  86. ZLIB_VERSION = "1.3.1"
  87. ZLIB_INTEGRITY = "sha256-OO+WuN/lENQnB9nHgYd5FHklQRM+GHCEFGO/pz+IPjI="
  88. maybe(
  89. http_archive,
  90. name = "zlib",
  91. build_file = Label("//misc/bazel/c_deps:BUILD.zlib.bazel"),
  92. integrity = ZLIB_INTEGRITY,
  93. strip_prefix = "zlib-{0}".format(ZLIB_VERSION),
  94. urls = [
  95. "https://github.com/madler/zlib/releases/download/v{0}/zlib-{0}.tar.xz".format(ZLIB_VERSION),
  96. ],
  97. )
  98. ZSTD_VERSION = "1.5.6"
  99. ZSTD_INTEGRITY = "sha256-jCngbPQqrMHq/EB3ri7Gxvy5amJhV+BZPV6Co0/UA8E="
  100. maybe(
  101. http_archive,
  102. name = "zstd",
  103. build_file = Label("//misc/bazel/c_deps:BUILD.zstd.bazel"),
  104. integrity = ZSTD_INTEGRITY,
  105. strip_prefix = "zstd-{0}".format(ZSTD_VERSION),
  106. urls = [
  107. "https://github.com/facebook/zstd/releases/download/v{0}/zstd-{0}.tar.gz".format(ZSTD_VERSION),
  108. ],
  109. )