File tree Expand file tree Collapse file tree 4 files changed +25
-11
lines changed Expand file tree Collapse file tree 4 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ url = "2.0"
2020bitflags = " 1.1.0"
2121libc = " 0.2"
2222log = " 0.4.8"
23- libgit2-sys = { path = " libgit2-sys" , version = " 0.12.9 " }
23+ libgit2-sys = { path = " libgit2-sys" , version = " 0.12.10 " }
2424
2525[target ."cfg(all(unix, not(target_os = \"macos\")))" .dependencies ]
2626openssl-sys = { version = " 0.9.0" , optional = true }
@@ -39,6 +39,7 @@ ssh = ["libgit2-sys/ssh"]
3939https = [" libgit2-sys/https" , " openssl-sys" , " openssl-probe" ]
4040vendored-openssl = [" openssl-sys/vendored" ]
4141ssh_key_from_memory = [" libgit2-sys/ssh_key_from_memory" ]
42+ zlib-ng-compat = [" libgit2-sys/zlib-ng-compat" ]
4243
4344[workspace ]
4445members = [" systest" , " git2-curl" ]
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Intended to be used with the git2 crate.
1313edition = " 2018"
1414
1515[dependencies ]
16- curl = " 0.4"
16+ curl = " 0.4.33 "
1717url = " 2.0"
1818log = " 0.4"
1919git2 = { path = " .." , version = " 0.13" , default-features = false }
@@ -24,6 +24,9 @@ conduit = "0.8"
2424conduit-git-http-backend = " 0.8"
2525tempfile = " 3.0"
2626
27+ [features ]
28+ zlib-ng-compat = [" git2/zlib-ng-compat" , " curl/zlib-ng-compat" ]
29+
2730[[test ]]
2831name = " all"
2932harness = false
Original file line number Diff line number Diff line change 11[package ]
22name = " libgit2-sys"
3- version = " 0.12.9 +1.0.1"
3+ version = " 0.12.10 +1.0.1"
44authors = [" Josh Triplett <josh@joshtriplett.org>" , " Alex Crichton <alex@alexcrichton.com>" ]
55links = " git2"
66build = " build.rs"
@@ -18,8 +18,8 @@ path = "lib.rs"
1818
1919[dependencies ]
2020libc = " 0.2"
21- libssh2-sys = { version = " 0.2.11 " , optional = true }
22- libz-sys = " 1.0.22 "
21+ libssh2-sys = { version = " 0.2.19 " , optional = true }
22+ libz-sys = { version = " 1.1.0 " , default-features = false , features = [ " libc " ] }
2323
2424[build-dependencies ]
2525pkg-config = " 0.3.7"
@@ -32,3 +32,9 @@ openssl-sys = { version = "0.9", optional = true }
3232ssh = [" libssh2-sys" ]
3333https = [" openssl-sys" ]
3434ssh_key_from_memory = []
35+ # Cargo does not support requiring features on an optional dependency without
36+ # requiring the dependency. Rather than introduce additional complexity, we
37+ # just require libssh2 when using zlib-ng-compat. This will require building
38+ # libssh2, but it will not add code to the final binary without the "ssh"
39+ # feature enabled.
40+ zlib-ng-compat = [" libz-sys/zlib-ng" , " libssh2-sys/zlib-ng-compat" ]
Original file line number Diff line number Diff line change @@ -6,13 +6,17 @@ use std::process::Command;
66fn main ( ) {
77 let https = env:: var ( "CARGO_FEATURE_HTTPS" ) . is_ok ( ) ;
88 let ssh = env:: var ( "CARGO_FEATURE_SSH" ) . is_ok ( ) ;
9-
10- let mut cfg = pkg_config:: Config :: new ( ) ;
11- if let Ok ( lib) = cfg. atleast_version ( "1.0.0" ) . probe ( "libgit2" ) {
12- for include in & lib. include_paths {
13- println ! ( "cargo:root={}" , include. display( ) ) ;
9+ let zlib_ng_compat = env:: var ( "CARGO_FEATURE_ZLIB_NG_COMPAT" ) . is_ok ( ) ;
10+
11+ // To use zlib-ng in zlib-compat mode, we have to build libgit2 ourselves.
12+ if !zlib_ng_compat {
13+ let mut cfg = pkg_config:: Config :: new ( ) ;
14+ if let Ok ( lib) = cfg. atleast_version ( "1.0.0" ) . probe ( "libgit2" ) {
15+ for include in & lib. include_paths {
16+ println ! ( "cargo:root={}" , include. display( ) ) ;
17+ }
18+ return ;
1419 }
15- return ;
1620 }
1721
1822 if !Path :: new ( "libgit2/.git" ) . exists ( ) {
You can’t perform that action at this time.
0 commit comments