Skip to content

Commit c28edaa

Browse files
committed
hack the Cargo.toml file
1 parent 434ca4c commit c28edaa

File tree

5 files changed

+25
-20
lines changed

5 files changed

+25
-20
lines changed

zstd-safe/Cargo.toml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,31 @@ exclude = ["update_consts.sh"]
1717
features = ["experimental", "arrays", "std", "zdict_builder", "doc-cfg"]
1818

1919
[dependencies]
20-
zstd-sys = { path = "zstd-sys", version = "2.0.15", default-features = false }
20+
# zstd-sys = { path = "zstd-sys", version = "2.0.15", default-features = false }
21+
zstd-sys = { git = "https://github.com/trifectatechfoundation/libzstd-rs-sys.git", rev = "edd8e07b9fe21e477848e9221efed2bd39e32013", package = "libzstd-rs-sys" }
2122

2223
[features]
23-
default = ["legacy", "arrays", "zdict_builder"]
24+
default = ["legacy", "arrays", "zdict_builder", "libzstd-rs-sys"]
25+
libzstd-rs-sys = []
2426

25-
bindgen = ["zstd-sys/bindgen"]
26-
debug = ["zstd-sys/debug"]
27-
experimental = ["zstd-sys/experimental"]
28-
legacy = ["zstd-sys/legacy"]
29-
pkg-config = ["zstd-sys/pkg-config"]
30-
std = ["zstd-sys/std"] # Implements WriteBuf for std types like Cursor and Vec.
31-
zstdmt = ["zstd-sys/zstdmt"]
32-
thin = ["zstd-sys/thin"]
27+
bindgen = []
28+
debug = []
29+
experimental = []
30+
legacy = []
31+
pkg-config = []
32+
std = [] # Implements WriteBuf for std types like Cursor and Vec.
33+
zstdmt = []
34+
thin = []
3335
arrays = []
34-
no_asm = ["zstd-sys/no_asm"]
36+
no_asm = []
3537
doc-cfg = []
36-
zdict_builder = ["zstd-sys/zdict_builder"]
37-
seekable = ["zstd-sys/seekable"]
38+
zdict_builder = []
39+
seekable = []
3840

3941
# These two are for cross-language LTO.
4042
# Will only work if `clang` is used to build the C library.
41-
fat-lto = ["zstd-sys/fat-lto"]
42-
thin-lto = ["zstd-sys/thin-lto"]
43+
fat-lto = []
44+
thin-lto = []
4345

4446
[lints.rust]
4547
non_upper_case_globals = "allow"

zstd-safe/src/constants.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// This file has been generated by ./update_consts.sh
2-
pub const BLOCKSIZELOG_MAX: u32 = zstd_sys::ZSTD_BLOCKSIZELOG_MAX;
3-
pub const BLOCKSIZE_MAX: u32 = zstd_sys::ZSTD_BLOCKSIZE_MAX;
1+
// This file has been generated by update_consts.sh
2+
pub const BLOCKSIZELOG_MAX: u32 = zstd_sys::ZSTD_BLOCKSIZELOG_MAX as u32;
3+
pub const BLOCKSIZE_MAX: u32 = zstd_sys::ZSTD_BLOCKSIZE_MAX as u32;
44
pub const CLEVEL_DEFAULT: CompressionLevel = zstd_sys::ZSTD_CLEVEL_DEFAULT as CompressionLevel;
55
pub const CONTENTSIZE_ERROR: u64 = zstd_sys::ZSTD_CONTENTSIZE_ERROR as u64;
66
pub const CONTENTSIZE_UNKNOWN: u64 = zstd_sys::ZSTD_CONTENTSIZE_UNKNOWN as u64;

zstd-safe/src/constants_experimental.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file has been generated by ./update_consts.sh
1+
// This file has been generated by update_consts.sh
22
pub const BLOCKSIZE_MAX_MIN: u32 = zstd_sys::ZSTD_BLOCKSIZE_MAX_MIN;
33
pub const BLOCKSPLITTER_LEVEL_MAX: u32 = zstd_sys::ZSTD_BLOCKSPLITTER_LEVEL_MAX;
44
pub const CHAINLOG_MAX_32: u32 = zstd_sys::ZSTD_CHAINLOG_MAX_32;

zstd-safe/src/constants_seekable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file has been generated by ./update_consts.sh
1+
// This file has been generated by update_consts.sh
22
pub const SEEKABLE_FRAMEINDEX_TOOLARGE: u64 = zstd_sys::ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE as u64;
33
pub const SEEKABLE_MAGICNUMBER: u32 = zstd_sys::ZSTD_SEEKABLE_MAGICNUMBER;
44
pub const SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE: u32 = zstd_sys::ZSTD_SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE;

zstd-safe/update_consts.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ varTypes[CONTENTSIZE_ERROR]=u64
66
# This is originally (0ULL-2) and gets falsely translated to -2 by bindgen.
77
# Casting it to u64 "fixes" this to the right number
88
varTypes[SEEKABLE_FRAMEINDEX_TOOLARGE]=u64
9+
# zlib-rs defines these as i32, this crate expects u32
10+
varTypes[BLOCKSIZELOG_MAX]=u32
11+
varTypes[BLOCKSIZE_MAX]=u32
912

1013
header() {
1114
echo "// This file has been generated by $0"

0 commit comments

Comments
 (0)