Skip to content

Commit

Permalink
Add lz4 module definition (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
jondo2010 authored Oct 29, 2023
1 parent 0b823d1 commit a3fbd95
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/lz4/1.9.4/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module(
name = "lz4",
version = "1.9.4",
compatibility_level = 1,
)
bazel_dep(name = "rules_cc", version = "0.0.1")
62 changes: 62 additions & 0 deletions modules/lz4/1.9.4/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
--- /dev/null
+++ BUILD.bazel
@@ -0,0 +1,59 @@
+""" Builds lz4.
+"""
+
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
+cc_library(
+ name = "lz4",
+ srcs = [
+ "lib/lz4.c",
+ "lib/xxhash.c",
+ "lib/xxhash.h",
+ ],
+ hdrs = [
+ "lib/lz4.h",
+ ],
+ strip_include_prefix = "lib/",
+ visibility = ["//visibility:public"],
+)
+
+cc_library(
+ name = "lz4_lz4c_include",
+ hdrs = [
+ "lib/lz4.c",
+ ],
+ strip_include_prefix = "lib/",
+)
+
+cc_library(
+ name = "lz4_hc",
+ srcs = [
+ "lib/lz4hc.c",
+ ],
+ hdrs = [
+ "lib/lz4hc.h",
+ ],
+ strip_include_prefix = "lib/",
+ visibility = ["//visibility:public"],
+ deps = [
+ ":lz4",
+ ":lz4_lz4c_include",
+ ],
+)
+
+cc_library(
+ name = "lz4_frame",
+ srcs = [
+ "lib/lz4frame.c",
+ "lib/lz4frame_static.h",
+ ],
+ hdrs = [
+ "lib/lz4frame.h",
+ ],
+ strip_include_prefix = "lib/",
+ visibility = ["//visibility:public"],
+ deps = [
+ ":lz4",
+ ":lz4_hc",
+ ],
+)
9 changes: 9 additions & 0 deletions modules/lz4/1.9.4/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--- MODULE.bazel
+++ MODULE.bazel
@@ -0,0 +1,6 @@
+module(
+ name = "lz4",
+ version = "1.9.4",
+ compatibility_level = 1,
+)
+bazel_dep(name = "rules_cc", version = "0.0.1")
13 changes: 13 additions & 0 deletions modules/lz4/1.9.4/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
build_targets:
- "@lz4//:lz4"
10 changes: 10 additions & 0 deletions modules/lz4/1.9.4/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/lz4/lz4/releases/download/v1.9.4/lz4-1.9.4.tar.gz",
"integrity": "sha256-Cw46oHyMBj3fQLCCvffjehVivaQKD/UnKVfz6Yfg5Us=",
"strip_prefix": "lz4-1.9.4",
"patches": {
"add_build_file.patch": "sha256-v1zbuA4Ya6cX2rDv54qh/8kwM7dimnWuyg40vCik4FM=",
"module_dot_bazel.patch": "sha256-V8GT+T9/zjsD3c67mJ4qVJoOkR4VZlXnpXl6b/FKI/Y="
},
"patch_strip": 0
}
11 changes: 11 additions & 0 deletions modules/lz4/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"homepage": "https://github.com/lz4/lz4",
"maintainers": [],
"repository": [
"github:lz4/lz4"
],
"versions": [
"1.9.4"
],
"yanked_versions": {}
}

0 comments on commit a3fbd95

Please sign in to comment.