Skip to content

Commit

Permalink
Add BLAKE3 @ 1.3.3 repo (#698)
Browse files Browse the repository at this point in the history
* Add BLAKE3 @ 1.3.3 repo

* Fix presubmit?

* Amend
  • Loading branch information
tylerwilliams committed Jul 1, 2023
1 parent cb6e292 commit 8ad7d05
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/blake3/1.3.3/MODULE.bazel
@@ -0,0 +1,6 @@
module(
name = "blake3",
version = "1.3.3",
compatibility_level = 1,
)
bazel_dep(name = "rules_cc", version = "0.0.6")
51 changes: 51 additions & 0 deletions modules/blake3/1.3.3/patches/add_build_file.patch
@@ -0,0 +1,51 @@
--- /dev/null
+++ BUILD.bazel
@@ -0,0 +1,48 @@
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
+
+cc_library(
+ name = "blake3",
+ srcs = [
+ "c/blake3.c",
+ "c/blake3_dispatch.c",
+ "c/blake3_portable.c",
+ ] + select({
+ "@bazel_tools//src/conditions:linux_x86_64": [
+ "c/blake3_avx2_x86-64_unix.S",
+# "c/blake3_avx512_x86-64_unix.S",
+ "c/blake3_sse2_x86-64_unix.S",
+ "c/blake3_sse41_x86-64_unix.S",
+ ],
+ "@bazel_tools//src/conditions:windows_x64": [
+ "c/blake3_avx2_x86-64_windows_msvc.asm",
+ "c/blake3_avx512_x86-64_windows_msvc.asm",
+ "c/blake3_sse2_x86-64_windows_msvc.asm",
+ "c/blake3_sse41_x86-64_windows_msvc.asm",
+ ],
+ "@bazel_tools//src/conditions:darwin_arm64": [
+ "c/blake3_neon.c",
+ ],
+ "//conditions:default": [],
+ }),
+ hdrs = [
+ "c/blake3.h",
+ "c/blake3_impl.h",
+ ],
+ copts = select({
+ "@bazel_tools//src/conditions:linux_x86_64": [
+ "-DBLAKE3_NO_AVX512",
+ ],
+ "@bazel_tools//src/conditions:windows_x64": [],
+ "@bazel_tools//src/conditions:darwin_arm64": [
+ "-DBLAKE3_USE_NEON=1",
+ ],
+ "//conditions:default": [
+ "-DBLAKE3_NO_SSE2",
+ "-DBLAKE3_NO_SSE41",
+ "-DBLAKE3_NO_AVX2",
+ "-DBLAKE3_NO_AVX512",
+ ],
+ }),
+ includes = ["."],
+ visibility = ["//visibility:public"],
+)
9 changes: 9 additions & 0 deletions modules/blake3/1.3.3/patches/module.patch
@@ -0,0 +1,9 @@
--- MODULE.bazel
+++ MODULE.bazel
@@ -0,0 +1,6 @@
+module(
+ name = "blake3",
+ version = "1.3.3",
+ compatibility_level = 1,
+)
+bazel_dep(name = "rules_cc", version = "0.0.6")
12 changes: 12 additions & 0 deletions modules/blake3/1.3.3/presubmit.yml
@@ -0,0 +1,12 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- windows
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
build_targets:
- '@blake3//:blake3'
10 changes: 10 additions & 0 deletions modules/blake3/1.3.3/source.json
@@ -0,0 +1,10 @@
{
"url": "https://github.com/BLAKE3-team/BLAKE3/archive/refs/tags/1.3.3.tar.gz",
"integrity": "sha256-J9K8TuWUW6dUNIWVIQQslJRj7nUU/xeq7zKOI++D/sA=",
"strip_prefix": "BLAKE3-1.3.3",
"patches": {
"module.patch": "sha256-v+o2/wBuH3VB6NXAVkerymbSvG1i9BVWmteTIS9FykI=",
"add_build_file.patch": "sha256-oB3I3fbGNPG7BY/eAfNsSSmEHwQJEOD7oUbptVSNDi4="
},
"patch_strip": 0
}
11 changes: 11 additions & 0 deletions modules/blake3/metadata.json
@@ -0,0 +1,11 @@
{
"homepage": "https://github.com/BLAKE3-team/BLAKE3",
"maintainers": [],
"repository": [
"github:BLAKE3-team/BLAKE3"
],
"versions": [
"1.3.3"
],
"yanked_versions": {}
}

0 comments on commit 8ad7d05

Please sign in to comment.