Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow linking against system zlib-ng #83

Open
figsoda opened this issue Nov 11, 2021 · 4 comments
Open

Allow linking against system zlib-ng #83

figsoda opened this issue Nov 11, 2021 · 4 comments

Comments

@figsoda
Copy link

figsoda commented Nov 11, 2021

Currently it always(*) builds the vendored zlib-ng when zlib-ng feature is enabled

@happysalada
Copy link

I am interested in this feature too.
Some environment_variable like ZLIB_NG_DIR or something in the like would be amazing.
Happy to implement this if there it is allowed.

@chenrui333
Copy link

any updates on this?

@musicinmybrain
Copy link

I don’t have a nice upstreamable patch for conditionalizing this, but I can at least share how we unconditionally link the system library in Fedora’s rust-libz-ng-sys package. Working from the released libz-ng-sys crate:

  1. Remove src/zlib-ng/ to prove it’s not used.
  2. Remove cmake from the build-dependencies in Cargo.toml since we don’t need to build our own copy of zlib-ng.
  3. Entirely replace build_zng.rs with the following trivial version:
fn main() {
    println!("cargo:rustc-link-lib=dylib=z-ng");
    println!("cargo:rustc-cfg=zng");
}

Hope that’s helpful for some people.

@musicinmybrain
Copy link

The above comment was written based on 1.1.15. For the just-released 1.1.16, the script replaces zng/cmake.rs instead of build_zng.rs.

Also, you may consider the trivial script in #83 (comment) to be contributed under the same MIT OR Apache-2.0 license as the crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants