Skip to content

Commit a8491a1

Browse files
Fix libdeflate feature selection (#219)
1 parent 1cac8fd commit a8491a1

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bzip2 = ["hts-sys/bzip2"]
3636
lzma = ["hts-sys/lzma"]
3737
bindgen = ["hts-sys/bindgen"]
3838
curl = ["hts-sys/curl"]
39-
libdeflate = ["hts-sys/libdeflate-sys"]
39+
libdeflate = ["hts-sys/libdeflate"]
4040
s3 = ["hts-sys/s3"]
4141
gcs = ["hts-sys/gcs"]
4242
static = ["hts-sys/static"]

hts-sys/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ libz-sys = { version = "1.0.25", features = ["static"] }
2121
bzip2-sys = { version = "0.1.8", optional = true }
2222
lzma-sys = { version = "0.1.16", optional = true, features = ["static"] }
2323
curl-sys = { version = "0.4.31", optional = true, features = ["static-curl", "static-ssl", "protocol-ftp"] }
24-
libdeflate-sys = { version = "0.5", optional = true }
24+
libdeflate-sys = { version = "0.5.0", optional = true }
2525

2626
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
2727
openssl-sys = { version = "0.9", optional = true }
@@ -31,6 +31,7 @@ default = ["bzip2", "lzma", "curl"]
3131
bzip2 = ["bzip2-sys"]
3232
lzma = ["lzma-sys"]
3333
curl = ["curl-sys", "openssl-sys"]
34+
libdeflate = ["libdeflate-sys"]
3435
gcs = ["curl"] # Google Cloud Storage support
3536
s3 = ["curl"] # Amazon S3 support
3637
static = [] # Don't dynamically link to other libraries

hts-sys/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ fn main() {
108108
}
109109
}
110110

111-
let use_libdeflater = env::var("CARGO_FEATURE_LIBDEFLATER").is_ok();
112-
if use_libdeflater {
111+
let use_libdeflate = env::var("CARGO_FEATURE_LIBDEFLATE").is_ok();
112+
if use_libdeflate {
113113
if let Ok(inc) = env::var("DEP_LIBDEFLATE_INCLUDE").map(PathBuf::from) {
114114
cfg.include(inc);
115115
config_lines.push("#define HAVE_LIBDEFLATE 1");

hts-sys/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
extern crate libz_sys;
99
#[cfg(feature = "bzip2")]
1010
extern crate bzip2_sys;
11-
#[cfg(feature = "libdeflater")]
12-
extern crate libdeflater;
11+
#[cfg(feature = "libdeflate")]
12+
extern crate libdeflate_sys;
1313
#[cfg(feature = "lzma")]
1414
extern crate lzma_sys;
1515
#[cfg(feature = "curl")]

src/bam/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,12 +1687,12 @@ CCCCCCCCCCCCCCCCCCC"[..],
16871687
println!("testing compression leves: {:?}", levels_to_test);
16881688
println!("got compressed sizes: {:?}", file_sizes);
16891689

1690-
// libdeflater comes out with a slightly bigger file on Max compression
1690+
// libdeflate comes out with a slightly bigger file on Max compression
16911691
// than on Level(6), so skip that check
1692-
#[cfg(feature = "libdeflater")]
1692+
#[cfg(feature = "libdeflate")]
16931693
assert!(file_sizes[1..].windows(2).all(|size| size[0] <= size[1]));
16941694

1695-
#[cfg(not(feature = "libdeflater"))]
1695+
#[cfg(not(feature = "libdeflate"))]
16961696
assert!(file_sizes.windows(2).all(|size| size[0] <= size[1]));
16971697

16981698
tmp.close().expect("Failed to delete temp dir");

0 commit comments

Comments
 (0)