Skip to content

Commit 04ea1f4

Browse files
authored
fix bzlib header include (#1865)
it is expected that including bzip2 header included with angle brackets ```cpp #include <bzlib.h> ``` without this change and more modules get added to the bcr there will be a lot of theses kinds of patches https://github.com/bazelbuild/bazel-central-registry/pull/1846/files#diff-3d0ec8cf226f2e480a40e8c6126f6ed456555c147c2f4e1b3557fd81f4db4ab5 unfortunately I think this breaks `libarchive` with clang/gcc due to the patch linked above
1 parent 7690765 commit 04ea1f4

File tree

7 files changed

+80
-1
lines changed

7 files changed

+80
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module(
2+
name = "bzip2",
3+
version = "1.0.8.bcr.1",
4+
compatibility_level = 1,
5+
)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--- /dev/null
2+
+++ BUILD.bazel
3+
@@ -0,0 +1,34 @@
4+
+cc_binary(
5+
+ name = "bzip2",
6+
+ srcs = ["bzip2.c"],
7+
+ defines = [
8+
+ "_FILE_OFFSET_BITS=64",
9+
+ ],
10+
+ deps = [
11+
+ ":bz2",
12+
+ ],
13+
+ visibility = ["//visibility:public"],
14+
+)
15+
+
16+
+cc_library(
17+
+ name = "bz2",
18+
+ srcs = [
19+
+ "blocksort.c",
20+
+ "bzlib.c",
21+
+ "bzlib_private.h",
22+
+ "compress.c",
23+
+ "crctable.c",
24+
+ "decompress.c",
25+
+ "huffman.c",
26+
+ "randtable.c",
27+
+ ],
28+
+ hdrs = [
29+
+ "bzlib.h",
30+
+ ],
31+
+ defines = [
32+
+ "_FILE_OFFSET_BITS=64",
33+
+ ],
34+
+ includes = ["."],
35+
+ strip_include_prefix = "",
36+
+ visibility = ["//visibility:public"],
37+
+)
Lines changed: 8 additions & 0 deletions
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 = "bzip2",
6+
+ version = "1.0.8.bcr.1",
7+
+ compatibility_level = 1,
8+
+)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
matrix:
2+
platform:
3+
- centos7
4+
- debian10
5+
- ubuntu2004
6+
- macos
7+
- windows
8+
bazel: [6.x, 7.x]
9+
tasks:
10+
verify_targets:
11+
name: Verify build targets
12+
platform: ${{ platform }}
13+
bazel: ${{ bazel }}
14+
build_targets:
15+
- '@bzip2//:bzip2'
16+
- '@bzip2//:bz2'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"integrity": "sha256-q1oDF27hBtPw+pDjgdpHjdrkBZGBU8yiSOaCzQxKImk=",
3+
"patch_strip": 0,
4+
"patches": {
5+
"add_build_file.patch": "sha256-QPcAoslzyuAkL4VQgb18uhZaUu8A30/LUrD8wHaKZHY=",
6+
"module_dot_bazel.patch": "sha256-lfm8AQkGepyTCT/UQrNpojSPcuu9TnCpPEWykSew7r8="
7+
},
8+
"strip_prefix": "bzip2-1.0.8",
9+
"url": "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz"
10+
}

modules/bzip2/1.0.8/presubmit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ matrix:
55
- ubuntu2004
66
- macos
77
- windows
8+
bazel: [6.x, 7.x]
89
tasks:
910
verify_targets:
1011
name: Verify build targets
1112
platform: ${{ platform }}
13+
bazel: ${{ bazel }}
1214
build_targets:
1315
- '@bzip2//:bzip2'
1416
- '@bzip2//:bz2'

modules/bzip2/metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
}
88
],
99
"versions": [
10-
"1.0.8"
10+
"1.0.8",
11+
"1.0.8.bcr.1"
1112
],
1213
"yanked_versions": {}
1314
}

0 commit comments

Comments
 (0)