Make libz-sys available to product and vendor am: e50fd6c185

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/libz-sys/+/2476419

Change-Id: I25a8c54abb7d6ad45a979415a8b83f881a451080
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
tree: a952149182faf24c5a8bf376e988b94df981f63c
  1. src/
  2. .cargo_vcs_info.json
  3. .gitignore
  4. Android.bp
  5. build.rs
  6. build_zng.rs
  7. Cargo.toml
  8. Cargo.toml.orig
  9. cargo2android.json
  10. LICENSE-APACHE
  11. LICENSE-MIT
  12. METADATA
  13. MODULE_LICENSE_APACHE2
  14. OWNERS
  15. README-zng.md
  16. README.android
  17. README.md
  18. TEST_MAPPING
README.md

libz-sys

A common library for linking libz to rust programs (also known as zlib).

Documentation

This also serves as the source for the libz-ng-sys crate, which builds zlib-ng natively (not in zlib-compat mode). See README-zng.md for details.

High-level API

This crate provides bindings to the raw low-level C API. For a higher-level safe API to work with DEFLATE, zlib, or gzip streams, see flate2. flate2 also supports alternative implementations, including slower but pure Rust implementations.

zlib-ng

This crate supports building either the high-performance zlib-ng (in zlib-compat mode), or the widely available stock zlib.

By default, libz-sys uses stock zlib, primarily because doing so allows the use of a shared system zlib library if available.

Any application or library designed for zlib should work with zlib-ng in zlib-compat mode, as long as it doesn‘t make assumptions about the exact size or output of the deflated data (e.g. “compressing this data produces exactly this many bytes”), and as long as you don’t also dynamically pull in a copy of stock zlib (which will produce conflicting symbols). Nonetheless, for maximum compatibility, every library crate in a build must opt into allowing zlib-ng; if any library crate in your dependency graph wants stock zlib, libz-sys will use stock zlib.

Library crates depending on libz-sys should use:

libz-sys = { version = "1.1.0", default-features = false, features = ["libc"] }

(Omit the libc feature if you don't require the corresponding functions.)

This allows higher-level crates depending on your library to opt into zlib-ng if desired.

Building zlib-ng requires cmake.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in libz-sys by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.