swf: Remove 'libflate' feature

The 'flate2' crate already supports both C and pure Rust
backends, so we don't gain anything by supporting libflate
This commit is contained in:
Aaron Hill 2024-07-07 07:50:34 -04:00 committed by TÖRÖK Attila
parent ea0bbce184
commit c852990346
7 changed files with 2 additions and 77 deletions

52
Cargo.lock generated
View File

@ -33,12 +33,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "adler32"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.8.11" version = "0.8.11"
@ -1016,15 +1010,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "core2"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "core_maths" name = "core_maths"
version = "0.1.0" version = "0.1.0"
@ -1226,12 +1211,6 @@ dependencies = [
"syn 2.0.70", "syn 2.0.70",
] ]
[[package]]
name = "dary_heap"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca"
[[package]] [[package]]
name = "dasp" name = "dasp"
version = "0.11.0" version = "0.11.0"
@ -2870,30 +2849,6 @@ version = "0.2.155"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
[[package]]
name = "libflate"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e"
dependencies = [
"adler32",
"core2",
"crc32fast",
"dary_heap",
"libflate_lz77",
]
[[package]]
name = "libflate_lz77"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d"
dependencies = [
"core2",
"hashbrown",
"rle-decode-fast",
]
[[package]] [[package]]
name = "libloading" name = "libloading"
version = "0.7.4" version = "0.7.4"
@ -4306,12 +4261,6 @@ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]]
name = "rle-decode-fast"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422"
[[package]] [[package]]
name = "ron" name = "ron"
version = "0.8.1" version = "0.8.1"
@ -5195,7 +5144,6 @@ dependencies = [
"encoding_rs", "encoding_rs",
"enum-map", "enum-map",
"flate2", "flate2",
"libflate",
"log", "log",
"lzma-rs", "lzma-rs",
"num-derive", "num-derive",

View File

@ -401,8 +401,6 @@ Ruffle depends on third-party libraries with compatible licenses.
| [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2010 The Rust Project Developers | | [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2010 The Rust Project Developers |
| [lazycell](https://github.com/indiv0/lazycell) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) Alex Crichton <alex@alexcrichton.com>, Nikita Pekin <contact@nikitapek.in> | | [lazycell](https://github.com/indiv0/lazycell) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) Alex Crichton <alex@alexcrichton.com>, Nikita Pekin <contact@nikitapek.in> |
| [libc](https://github.com/rust-lang/libc) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014-2020 The Rust Project Developers | | [libc](https://github.com/rust-lang/libc) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014-2020 The Rust Project Developers |
| [libflate](https://github.com/sile/libflate) | [MIT](#MIT) | Copyright (c) 2016 Takeru Ohta <phjgt308@gmail.com> |
| [libflate_lz77](https://github.com/sile/libflate) | [MIT](#MIT) | Copyright (c) 2016 Takeru Ohta <phjgt308@gmail.com> |
| [libloading](https://github.com/nagisa/rust_libloading/) | [ISC](#ISC) | Copyright © 2015, Simonas Kazlauskas | | [libloading](https://github.com/nagisa/rust_libloading/) | [ISC](#ISC) | Copyright © 2015, Simonas Kazlauskas |
| [libnghttp2-sys](https://github.com/alexcrichton/nghttp2-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton | | [libnghttp2-sys](https://github.com/alexcrichton/nghttp2-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton |
| [libz-sys](https://github.com/rust-lang/libz-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton Copyright (c) 2020 Josh Triplett | | [libz-sys](https://github.com/rust-lang/libz-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton Copyright (c) 2020 Josh Triplett |

View File

@ -18,7 +18,6 @@ byteorder = "1.5"
encoding_rs = "0.8.34" encoding_rs = "0.8.34"
num-derive = { workspace = true } num-derive = { workspace = true }
num-traits = { workspace = true } num-traits = { workspace = true }
libflate = {version = "2.1", optional = true}
log = { workspace = true } log = { workspace = true }
flate2 = { workspace = true, optional = true} flate2 = { workspace = true, optional = true}
lzma-rs = {version = "0.3.0", optional = true } lzma-rs = {version = "0.3.0", optional = true }

View File

@ -9,8 +9,6 @@
#[cfg(feature = "flate2")] #[cfg(feature = "flate2")]
extern crate flate2; extern crate flate2;
#[cfg(feature = "libflate")]
extern crate libflate;
#[macro_use] #[macro_use]
extern crate num_derive; extern crate num_derive;
extern crate num_traits; extern crate num_traits;

View File

@ -179,14 +179,7 @@ fn make_zlib_reader<'a, R: Read + 'a>(input: R) -> Result<Box<dyn Read + 'a>> {
Ok(Box::new(ZlibDecoder::new(input))) Ok(Box::new(ZlibDecoder::new(input)))
} }
#[cfg(all(feature = "libflate", not(feature = "flate2")))] #[cfg(not(feature = "flate2"))]
fn make_zlib_reader<'a, R: Read + 'a>(input: R) -> Result<Box<dyn Read + 'a>> {
use libflate::zlib::Decoder;
let decoder = Decoder::new(input)?;
Ok(Box::new(decoder))
}
#[cfg(not(any(feature = "flate2", feature = "libflate")))]
fn make_zlib_reader<'a, R: Read + 'a>(_input: R) -> Result<Box<dyn Read + 'a>> { fn make_zlib_reader<'a, R: Read + 'a>(_input: R) -> Result<Box<dyn Read + 'a>> {
Err(Error::unsupported( Err(Error::unsupported(
"Support for Zlib compressed SWFs is not enabled.", "Support for Zlib compressed SWFs is not enabled.",

View File

@ -91,16 +91,7 @@ fn write_zlib_swf<W: Write>(mut output: W, swf_body: &[u8]) -> Result<()> {
Ok(()) Ok(())
} }
#[cfg(all(feature = "libflate", not(feature = "flate2")))] #[cfg(not(feature = "flate2"))]
fn write_zlib_swf<W: Write>(mut output: W, swf_body: &[u8]) -> Result<()> {
use libflate::zlib::Encoder;
let mut encoder = Encoder::new(&mut output)?;
encoder.write_all(&swf_body)?;
encoder.finish().into_result()?;
Ok(())
}
#[cfg(not(any(feature = "flate2", feature = "libflate")))]
fn write_zlib_swf<W: Write>(_output: W, _swf_body: &[u8]) -> Result<()> { fn write_zlib_swf<W: Write>(_output: W, _swf_body: &[u8]) -> Result<()> {
Err(Error::unsupported( Err(Error::unsupported(
"Support for Zlib compressed SWFs is not enabled.", "Support for Zlib compressed SWFs is not enabled.",

View File

@ -401,8 +401,6 @@ Ruffle depends on third-party libraries with compatible licenses.
| [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2010 The Rust Project Developers | | [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2010 The Rust Project Developers |
| [lazycell](https://github.com/indiv0/lazycell) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) Alex Crichton <alex@alexcrichton.com>, Nikita Pekin <contact@nikitapek.in> | | [lazycell](https://github.com/indiv0/lazycell) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) Alex Crichton <alex@alexcrichton.com>, Nikita Pekin <contact@nikitapek.in> |
| [libc](https://github.com/rust-lang/libc) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014-2020 The Rust Project Developers | | [libc](https://github.com/rust-lang/libc) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014-2020 The Rust Project Developers |
| [libflate](https://github.com/sile/libflate) | [MIT](#MIT) | Copyright (c) 2016 Takeru Ohta <phjgt308@gmail.com> |
| [libflate_lz77](https://github.com/sile/libflate) | [MIT](#MIT) | Copyright (c) 2016 Takeru Ohta <phjgt308@gmail.com> |
| [libloading](https://github.com/nagisa/rust_libloading/) | [ISC](#ISC) | Copyright © 2015, Simonas Kazlauskas | | [libloading](https://github.com/nagisa/rust_libloading/) | [ISC](#ISC) | Copyright © 2015, Simonas Kazlauskas |
| [libnghttp2-sys](https://github.com/alexcrichton/nghttp2-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton | | [libnghttp2-sys](https://github.com/alexcrichton/nghttp2-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton |
| [libz-sys](https://github.com/rust-lang/libz-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton Copyright (c) 2020 Josh Triplett | | [libz-sys](https://github.com/rust-lang/libz-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton Copyright (c) 2020 Josh Triplett |