Skip to content

Commit 3d4d460

Browse files

File tree

6 files changed

+150
-0
lines changed

6 files changed

+150
-0
lines changed

Diff for: modules/snappy/1.1.8/MODULE.bazel

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module(
2+
name = "snappy",
3+
version = "1.1.8",
4+
compatibility_level = 1,
5+
)

Diff for: modules/snappy/1.1.8/patches/add_build_file.patch

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
--- /dev/null
2+
+++ BUILD.bazel
3+
@@ -0,0 +1,92 @@
4+
+package(
5+
+ default_visibility = ["//visibility:public"],
6+
+ features = ["header_modules"],
7+
+)
8+
+
9+
+licenses(["notice"])
10+
+
11+
+cc_library(
12+
+ name = "snappy",
13+
+ srcs = [
14+
+ "config.h",
15+
+ "snappy.cc",
16+
+ "snappy-internal.h",
17+
+ "snappy-sinksource.cc",
18+
+ "snappy-stubs-internal.cc",
19+
+ "snappy-stubs-internal.h",
20+
+ "snappy-stubs-public.h",
21+
+ ],
22+
+ hdrs = [
23+
+ "snappy.h",
24+
+ "snappy-sinksource.h",
25+
+ ],
26+
+ copts = [
27+
+ "-DHAVE_CONFIG_H",
28+
+ "-Wno-sign-compare",
29+
+ ],
30+
+)
31+
+
32+
+genrule(
33+
+ name = "config_h",
34+
+ outs = ["config.h"],
35+
+ cmd = "\n".join([
36+
+ "cat <<'EOF' >$@",
37+
+ "#define HAVE_STDDEF_H 1",
38+
+ "#define HAVE_STDINT_H 1",
39+
+ "",
40+
+ "#ifdef __has_builtin",
41+
+ "# if !defined(HAVE_BUILTIN_EXPECT) && __has_builtin(__builtin_expect)",
42+
+ "# define HAVE_BUILTIN_EXPECT 1",
43+
+ "# endif",
44+
+ "# if !defined(HAVE_BUILTIN_CTZ) && __has_builtin(__builtin_ctzll)",
45+
+ "# define HAVE_BUILTIN_CTZ 1",
46+
+ "# endif",
47+
+ "#elif defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 4)",
48+
+ "# ifndef HAVE_BUILTIN_EXPECT",
49+
+ "# define HAVE_BUILTIN_EXPECT 1",
50+
+ "# endif",
51+
+ "# ifndef HAVE_BUILTIN_CTZ",
52+
+ "# define HAVE_BUILTIN_CTZ 1",
53+
+ "# endif",
54+
+ "#endif",
55+
+ "",
56+
+ "#ifdef __has_include",
57+
+ "# if !defined(HAVE_BYTESWAP_H) && __has_include(<byteswap.h>)",
58+
+ "# define HAVE_BYTESWAP_H 1",
59+
+ "# endif",
60+
+ "# if !defined(HAVE_UNISTD_H) && __has_include(<unistd.h>)",
61+
+ "# define HAVE_UNISTD_H 1",
62+
+ "# endif",
63+
+ "# if !defined(HAVE_SYS_ENDIAN_H) && __has_include(<sys/endian.h>)",
64+
+ "# define HAVE_SYS_ENDIAN_H 1",
65+
+ "# endif",
66+
+ "# if !defined(HAVE_SYS_MMAN_H) && __has_include(<sys/mman.h>)",
67+
+ "# define HAVE_SYS_MMAN_H 1",
68+
+ "# endif",
69+
+ "# if !defined(HAVE_SYS_UIO_H) && __has_include(<sys/uio.h>)",
70+
+ "# define HAVE_SYS_UIO_H 1",
71+
+ "# endif",
72+
+ "#endif",
73+
+ "",
74+
+ "#ifndef SNAPPY_IS_BIG_ENDIAN",
75+
+ "# ifdef __s390x__",
76+
+ "# define SNAPPY_IS_BIG_ENDIAN 1",
77+
+ "# elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__",
78+
+ "# define SNAPPY_IS_BIG_ENDIAN 1",
79+
+ "# endif",
80+
+ "#endif",
81+
+ "EOF",
82+
+ ]),
83+
+)
84+
+
85+
+genrule(
86+
+ name = "snappy_stubs_public_h",
87+
+ srcs = ["snappy-stubs-public.h.in"],
88+
+ outs = ["snappy-stubs-public.h"],
89+
+ cmd = ("sed " +
90+
+ "-e 's/$${\\(.*\\)_01}/\\1/g' " +
91+
+ "-e 's/$${SNAPPY_MAJOR}/1/g' " +
92+
+ "-e 's/$${SNAPPY_MINOR}/1/g' " +
93+
+ "-e 's/$${SNAPPY_PATCHLEVEL}/4/g' " +
94+
+ "$< >$@"),
95+
+)

Diff for: modules/snappy/1.1.8/patches/module_dot_bazel.patch

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--- MODULE.bazel
2+
+++ MODULE.bazel
3+
@@ -0,0 +1,5 @@
4+
+module(
5+
+ name = "snappy",
6+
+ version = "1.1.8",
7+
+ compatibility_level = 1,
8+
+)

Diff for: modules/snappy/1.1.8/presubmit.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
matrix:
2+
platform:
3+
- debian10
4+
- ubuntu2004
5+
- macos
6+
- macos_arm64
7+
bazel:
8+
- 7.x
9+
- 6.x
10+
tasks:
11+
verify_targets:
12+
name: Verify build targets
13+
platform: ${{ platform }}
14+
bazel: ${{ bazel }}
15+
build_targets:
16+
- '@snappy//...'

Diff for: modules/snappy/1.1.8/source.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"url": "https://github.com/google/snappy/archive/refs/tags/1.1.8.tar.gz",
3+
"integrity": "sha256-FrZ38HgyphKwg2F42383TkFPlGV8E45pk8v8XcxYZR8=",
4+
"strip_prefix": "snappy-1.1.8",
5+
"patches": {
6+
"add_build_file.patch": "sha256-DmKamYCCHDTyEhnmwsYqRFIhXcbmUcXhxG3qYONIaGQ=",
7+
"module_dot_bazel.patch": "sha256-vVCIcqnQ9mQec3Bg/YLcY+SWwXXaAKWnt2eWJjIxWtU="
8+
},
9+
"patch_strip": 0
10+
}

Diff for: modules/snappy/metadata.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"homepage": "https://github.com/google/snappy",
3+
"maintainers": [
4+
{
5+
"email": "[email protected]",
6+
"name": "No Maintainer Specified"
7+
}
8+
],
9+
"repository": [
10+
"github:google/snappy"
11+
],
12+
"versions": [
13+
"1.1.8"
14+
],
15+
"yanked_versions": {}
16+
}

0 commit comments

Comments
 (0)