From e6e1f55fe99852f510b979a16fc1bec0648a42d0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 3 Mar 2023 20:00:03 +0100 Subject: [PATCH] Use zlib-ng backend for flate2 by default Still allow disabling the feature to avoid the cmake dependency. --- Cargo.lock | 20 ++++++++++++++++++++ Cargo.toml | 4 ++++ TODO.md | 1 - 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 5adcd72..1137014 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,6 +105,15 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "cmake" +version = "0.1.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" +dependencies = [ + "cc", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -180,6 +189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", + "libz-ng-sys", "miniz_oxide", ] @@ -241,6 +251,16 @@ version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +[[package]] +name = "libz-ng-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4399ae96a9966bf581e726de86969f803a81b7ce795fcd5480e640589457e0f2" +dependencies = [ + "cmake", + "libc", +] + [[package]] name = "linux-raw-sys" version = "0.1.4" diff --git a/Cargo.toml b/Cargo.toml index 6f40d32..e719a80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,3 +19,7 @@ itertools = "0.10.5" num-integer = "0.1.45" serde = "1.0.152" zstd = "0.12.3" + +[features] +default = ["zlib-ng"] +zlib-ng = ["flate2/zlib-ng"] diff --git a/TODO.md b/TODO.md index e6c14f6..cb18d08 100644 --- a/TODO.md +++ b/TODO.md @@ -5,4 +5,3 @@ - To check: - fastnbt borrow - fastnbt from_reader - - flate2 backends