Skip to content

Commit

Permalink
Merge pull request #425 from cuviper/libgit2-0.28
Browse files Browse the repository at this point in the history
Update to libgit2 0.28.2
  • Loading branch information
alexcrichton authored Jun 3, 2019
2 parents 146332a + 734c0a3 commit d04a23f
Show file tree
Hide file tree
Showing 19 changed files with 227 additions and 279 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "libgit2-sys/libgit2"]
path = libgit2-sys/libgit2
url = https://github.com/libgit2/libgit2
branch = maint/v0.28
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "git2"
version = "0.8.0"
version = "0.9.0"
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand All @@ -23,7 +23,7 @@ url = "1.0"
bitflags = "1.0"
libc = "0.2"
log = "0.4"
libgit2-sys = { path = "libgit2-sys", version = "0.7.11" }
libgit2-sys = { path = "libgit2-sys", version = "0.8.0" }

[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies]
openssl-sys = { version = "0.9.0", optional = true }
Expand All @@ -39,10 +39,9 @@ thread-id = "3.3.0" # remove when we work with minimal-versions without it

[features]
unstable = []
default = ["ssh", "https", "curl", "ssh_key_from_memory"]
default = ["ssh", "https", "ssh_key_from_memory"]
ssh = ["libgit2-sys/ssh"]
https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"]
curl = ["libgit2-sys/curl"]
vendored-openssl = ["openssl-sys/vendored"]
ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ version of Rust known to pass tests.

## Version of libgit2

Currently this library requires libgit2 0.25.1. The source for libgit2 is
Currently this library requires libgit2 0.28.0. The source for libgit2 is
included in the libgit2-sys crate so there's no need to pre-install the libgit2
library, the libgit2-sys crate will figure that and/or build that for you.

Expand Down
4 changes: 2 additions & 2 deletions git2-curl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "git2-curl"
version = "0.9.0"
version = "0.10.0"
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-lang/git2-rs"
Expand All @@ -16,7 +16,7 @@ Intended to be used with the git2 crate.
curl = "0.4"
url = "1.0"
log = "0.4"
git2 = { path = "..", version = "0.8", default-features = false }
git2 = { path = "..", version = "0.9", default-features = false }

[dev-dependencies]
civet = "0.11"
Expand Down
6 changes: 2 additions & 4 deletions libgit2-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libgit2-sys"
version = "0.7.11"
version = "0.8.0"
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
links = "git2"
build = "build.rs"
Expand All @@ -16,13 +16,12 @@ name = "libgit2_sys"
path = "lib.rs"

[dependencies]
curl-sys = { version = "0.4.10", optional = true }
libc = "0.2"
libssh2-sys = { version = "0.2.11", optional = true }
libz-sys = "1.0.22"

[build-dependencies]
pkg-config = "0.3"
pkg-config = "0.3.7"
cc = "1.0.25"

[target.'cfg(unix)'.dependencies]
Expand All @@ -31,5 +30,4 @@ openssl-sys = { version = "0.9", optional = true }
[features]
ssh = ["libssh2-sys"]
https = ["openssl-sys"]
curl = ["curl-sys"]
ssh_key_from_memory = []
26 changes: 11 additions & 15 deletions libgit2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ use std::process::Command;
fn main() {
let https = env::var("CARGO_FEATURE_HTTPS").is_ok();
let ssh = env::var("CARGO_FEATURE_SSH").is_ok();
let curl = env::var("CARGO_FEATURE_CURL").is_ok();

if env::var("LIBGIT2_SYS_USE_PKG_CONFIG").is_ok() {
if pkg_config::find_library("libgit2").is_ok() {
let mut cfg = pkg_config::Config::new();
if let Ok(lib) = cfg.atleast_version("0.28.0").probe("libgit2") {
for include in &lib.include_paths {
println!("cargo:root={}", include.display());
}
return
}
}
Expand Down Expand Up @@ -121,21 +124,14 @@ fn main() {
}
}
} else {
cfg.file("libgit2/src/hash/hash_generic.c");
features.push_str("#define GIT_SHA1_COLLISIONDETECT 1\n");
cfg.define("SHA1DC_NO_STANDARD_INCLUDES", "1");
cfg.define("SHA1DC_CUSTOM_INCLUDE_SHA1_C", "\"common.h\"");
cfg.define("SHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C", "\"common.h\"");
cfg.file("libgit2/src/hash/sha1dc/sha1.c");
cfg.file("libgit2/src/hash/sha1dc/ubc_check.c");
}

if curl {
features.push_str("#define GIT_CURL 1\n");
if let Some(path) = env::var_os("DEP_CURL_INCLUDE") {
cfg.include(path);
}
// Handle dllimport/dllexport on windows by making sure that if we built
// curl statically (as told to us by the `curl-sys` crate) we define the
// correct values for curl's header files.
if env::var_os("DEP_CURL_STATIC").is_some() {
cfg.define("CURL_STATICLIB", None);
}
}
if let Some(path) = env::var_os("DEP_Z_INCLUDE") {
cfg.include(path);
}
Expand Down
Loading

0 comments on commit d04a23f

Please sign in to comment.