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"
20
20
bitflags = " 1.1.0"
21
21
libc = " 0.2"
22
22
log = " 0.4.8"
23
- libgit2-sys = { path = " libgit2-sys" , version = " 0.12.9 " }
23
+ libgit2-sys = { path = " libgit2-sys" , version = " 0.12.10 " }
24
24
25
25
[target ."cfg(all(unix, not(target_os = \"macos\")))" .dependencies ]
26
26
openssl-sys = { version = " 0.9.0" , optional = true }
@@ -39,6 +39,7 @@ ssh = ["libgit2-sys/ssh"]
39
39
https = [" libgit2-sys/https" , " openssl-sys" , " openssl-probe" ]
40
40
vendored-openssl = [" openssl-sys/vendored" ]
41
41
ssh_key_from_memory = [" libgit2-sys/ssh_key_from_memory" ]
42
+ zlib-ng-compat = [" libgit2-sys/zlib-ng-compat" ]
42
43
43
44
[workspace ]
44
45
members = [" 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.
13
13
edition = " 2018"
14
14
15
15
[dependencies ]
16
- curl = " 0.4"
16
+ curl = " 0.4.33 "
17
17
url = " 2.0"
18
18
log = " 0.4"
19
19
git2 = { path = " .." , version = " 0.13" , default-features = false }
@@ -24,6 +24,9 @@ conduit = "0.8"
24
24
conduit-git-http-backend = " 0.8"
25
25
tempfile = " 3.0"
26
26
27
+ [features ]
28
+ zlib-ng-compat = [" git2/zlib-ng-compat" , " curl/zlib-ng-compat" ]
29
+
27
30
[[test ]]
28
31
name = " all"
29
32
harness = false
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " libgit2-sys"
3
- version = " 0.12.9 +1.0.1"
3
+ version = " 0.12.10 +1.0.1"
4
4
authors = [" Josh Triplett <josh@joshtriplett.org>" , " Alex Crichton <alex@alexcrichton.com>" ]
5
5
links = " git2"
6
6
build = " build.rs"
@@ -18,8 +18,8 @@ path = "lib.rs"
18
18
19
19
[dependencies ]
20
20
libc = " 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 " ] }
23
23
24
24
[build-dependencies ]
25
25
pkg-config = " 0.3.7"
@@ -32,3 +32,9 @@ openssl-sys = { version = "0.9", optional = true }
32
32
ssh = [" libssh2-sys" ]
33
33
https = [" openssl-sys" ]
34
34
ssh_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;
6
6
fn main ( ) {
7
7
let https = env:: var ( "CARGO_FEATURE_HTTPS" ) . is_ok ( ) ;
8
8
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 ;
14
19
}
15
- return ;
16
20
}
17
21
18
22
if !Path :: new ( "libgit2/.git" ) . exists ( ) {
You can’t perform that action at this time.
0 commit comments