cargo: update to 0.44.0

The libgit2-sys crate now requires 1.0.0 via pkg-config and
dropped the env var usage, so just default to that.
This commit is contained in:
q66 2020-05-03 18:39:30 +02:00 committed by Daniel Kolesa
parent a7a551d1c8
commit 85b730d5e3
3 changed files with 20 additions and 167 deletions

View file

@ -1,96 +0,0 @@
From 647ae9f8a7f9907244a8c86bceb383cbf61eb505 Mon Sep 17 00:00:00 2001
From: Johannes Brechtmann <johannes@jnbr.me>
Date: Fri, 27 Dec 2019 18:48:31 +0100
Subject: [PATCH] Revert "Fix wrong directories in PATH on Windows"
This reverts commit 61188d791a29c1baae868f2ba0880c9d6db4092e.
---
.../compiler/build_context/target_info.rs | 43 +++++++++----------
src/cargo/core/compiler/compilation.rs | 4 +-
2 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs
index 3c23d2d8b..d6e5e66f8 100644
--- src/cargo/core/compiler/build_context/target_info.rs
+++ src/cargo/core/compiler/build_context/target_info.rs
@@ -29,12 +29,8 @@ pub struct TargetInfo {
crate_types: RefCell<HashMap<String, Option<(String, String)>>>,
/// `cfg` information extracted from `rustc --print=cfg`.
cfg: Vec<Cfg>,
- /// Path to the "lib" or "bin" directory that rustc uses for its dynamic
- /// libraries.
- pub sysroot_host_libdir: PathBuf,
- /// Path to the "lib" directory in the sysroot which rustc uses for linking
- /// target libraries.
- pub sysroot_target_libdir: PathBuf,
+ /// Path to the "lib" directory in the sysroot.
+ pub sysroot_libdir: PathBuf,
/// Extra flags to pass to `rustc`, see `env_args`.
pub rustflags: Vec<String>,
/// Extra flags to pass to `rustdoc`, see `env_args`.
@@ -134,20 +130,24 @@ impl TargetInfo {
output_err_info(&process, &output, &error)
),
};
- let mut sysroot_host_libdir = PathBuf::from(line);
- if cfg!(windows) {
- sysroot_host_libdir.push("bin");
- } else {
- sysroot_host_libdir.push("lib");
- }
- let mut sysroot_target_libdir = PathBuf::from(line);
- sysroot_target_libdir.push("lib");
- sysroot_target_libdir.push("rustlib");
- sysroot_target_libdir.push(match &kind {
- CompileKind::Host => rustc.host.as_str(),
- CompileKind::Target(target) => target.short_name(),
- });
- sysroot_target_libdir.push("lib");
+ let mut rustlib = PathBuf::from(line);
+ let sysroot_libdir = match kind {
+ CompileKind::Host => {
+ if cfg!(windows) {
+ rustlib.push("bin");
+ } else {
+ rustlib.push("lib");
+ }
+ rustlib
+ }
+ CompileKind::Target(target) => {
+ rustlib.push("lib");
+ rustlib.push("rustlib");
+ rustlib.push(target.short_name());
+ rustlib.push("lib");
+ rustlib
+ }
+ };
let cfg = lines
.map(|line| Ok(Cfg::from_str(line)?))
@@ -162,8 +162,7 @@ impl TargetInfo {
Ok(TargetInfo {
crate_type_process,
crate_types: RefCell::new(map),
- sysroot_host_libdir,
- sysroot_target_libdir,
+ sysroot_libdir,
// recalculate `rustflags` from above now that we have `cfg`
// information
rustflags: env_args(
diff --git a/src/cargo/core/compiler/compilation.rs b/src/cargo/core/compiler/compilation.rs
index 140a024b1..86afe35ac 100644
--- src/cargo/core/compiler/compilation.rs
+++ src/cargo/core/compiler/compilation.rs
@@ -101,8 +101,8 @@ impl<'cfg> Compilation<'cfg> {
root_output: PathBuf::from("/"),
deps_output: PathBuf::from("/"),
host_deps_output: PathBuf::from("/"),
- host_dylib_path: bcx.info(default_kind).sysroot_host_libdir.clone(),
- target_dylib_path: bcx.info(default_kind).sysroot_target_libdir.clone(),
+ host_dylib_path: bcx.info(CompileKind::Host).sysroot_libdir.clone(),
+ target_dylib_path: bcx.info(default_kind).sysroot_libdir.clone(),
tests: Vec::new(),
binaries: Vec::new(),
extra_env: HashMap::new(),
--
2.24.1

View file

@ -1,32 +0,0 @@
Source: FreeBSD
Revert to libgit2 0.28 API per https://github.com/rust-lang/git2-rs/issues/458
--- libgit2-sys/lib.rs
+++ libgit2-sys/lib.rs
@@ -331,7 +331,6 @@ pub struct git_remote_callbacks {
pub push_negotiation: Option<git_push_negotiation>,
pub transport: Option<git_transport_cb>,
pub payload: *mut c_void,
- pub resolve_url: Option<git_url_resolve_cb>,
}
#[repr(C)]
@@ -385,8 +384,6 @@ pub type git_push_negotiation =
pub type git_push_update_reference_cb =
extern "C" fn(*const c_char, *const c_char, *mut c_void) -> c_int;
-pub type git_url_resolve_cb =
- extern "C" fn(*mut git_buf, *const c_char, c_int, *mut c_void) -> c_int;
#[repr(C)]
pub struct git_push_update {
@@ -2233,7 +2230,7 @@ extern "C" {
source: *const git_tree,
) -> c_int;
pub fn git_treebuilder_clear(bld: *mut git_treebuilder);
- pub fn git_treebuilder_entrycount(bld: *mut git_treebuilder) -> size_t;
+ pub fn git_treebuilder_entrycount(bld: *mut git_treebuilder) -> c_uint;
pub fn git_treebuilder_free(bld: *mut git_treebuilder);
pub fn git_treebuilder_get(
bld: *mut git_treebuilder,

View file

@ -1,25 +1,25 @@
# Template file for 'cargo'
pkgname=cargo
version=0.42.0
revision=2
version=0.44.0
revision=1
wrksrc="cargo-${version}"
build_helper=rust
hostmakedepends="rust python curl cmake pkg-config"
makedepends="libcurl-devel libgit2-devel"
makedepends="libcurl-devel"
depends="rust"
short_desc="Rust package manager"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://crates.io/"
_libgit2_ver=0.9.2
_git2_ver=0.10.2
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz
https://github.com/rust-lang/git2-rs/archive/libgit2-sys-${_libgit2_ver}.tar.gz"
checksum="22e60eca84d0f146ef45534e592b1c829a0cdf23452c2a23d2cde40d6c793b8a
61e1329785a2957721b28ec7d13c22749553f67179d7dde8e5793c4872eec48a"
_cargo_dist_version=0.41.0
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
checksum="c6da7d1d21eacf112c55dc8cc2647f2ccf7b41f9865dfa542e08ab41d1c20170"
_cargo_dist_version=0.44.0
build_options="static"
if [ -z "$build_option_static" ]; then
makedepends+=" libgit2-devel"
fi
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" cargo"
makedepends+=" rust"
@ -27,7 +27,7 @@ else
_bootstrap_url="https://static.rust-lang.org/dist"
case "$XBPS_MACHINE" in
x86_64*|i686|ppc64le|ppc) ;;
x86_64*|i686|ppc64le) ;;
ppc*) _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles" ;;
*) broken="unsupported host: ${XBPS_MACHINE}" ;;
esac
@ -38,39 +38,39 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
c48bc132f4025ff39b1b6dc52aef9d406c3f926ce05fe92d943ceab7a5fd6058"
b60abb4d89f645ec80f83f1514758c6f374e0d86ba44d9d36966aa4262eae5e5"
;;
x86_64)
checksum+="
9b6ae643fa240c5ecbc1dc390f4020b6a683f25bac6f7437ebd4b9d32a8d0b6c"
b0b97b21aae588dd7c73508dcd14ae094f45d5c5b33299859adde1b2e241271c"
;;
x86_64-musl)
checksum+="
848646326474392bdac70a5bfa06efda4c36e2bbbf088f07456f98c7575844e1"
ba6da59754bc113eb61bcfdb384ef3b458a16fe212124252830d83968480a07b"
;;
ppc64le)
checksum+="
7705f21d938a72ba6f01818661b2dea29183209940a335f18d1761e1e03d3710"
4f90cd6cbcf9e9d6ba11830e093092e4e6c3d156ffde2e729933869b7a039ff9"
;;
ppc64le-musl)
checksum+="
0fbe481d284a14b84cc63ccb50caeb248200f238d2c3e449c2b8a8bf49c951ce"
a85e8c9714a8bb7c17cd23993c677f51d9e0d6f5e85ab10f53ec1639b19bbbd4"
;;
ppc64)
checksum+="
23a7967b0c1c762cdbea4f850cacbb462e386977203c0d5ff060275c526d80d7"
983e2fbec9c4bfe66bab37ad64cdd5b47918378e421d9bf639e938f120650199"
;;
ppc64-musl)
checksum+="
d5a808fdb50068a14d6578f052c9e21ae7881d4ecdcf9e098c5e2c2b1ae65786"
f974893d1cac6c799345bece08c7f796eb50e1a77c4b9bc2a6451d161a57c660"
;;
ppc)
checksum+="
295030192cf5b7e1fce75845a1961619a5f701185400ad816cf950d4e18f0646"
48f4419300fe758ebe024e6449a5ca1dff07803047a815b3d3909170baa7adcc"
;;
ppc-musl)
checksum+="
91cc5d6f0192f68d5053fb460dd8347b28cb29b4a63a6e648d6b754795b5c4e8"
bbb93a757e75d09cb5f6d6dd837e32212acd8888426406352eccf52f329386f1"
;;
esac
fi
@ -80,25 +80,10 @@ post_extract() {
mkdir -p target/snapshot
cp ../cargo-${_cargo_dist_version}-${RUST_TARGET}/cargo/bin/cargo cargo
fi
mv ${XBPS_BUILDDIR}/git2-rs-libgit2-sys-${_libgit2_ver} .
mv git2-rs-libgit2-sys-${_libgit2_ver}/libgit2-sys .
}
post_patch() {
# but only use the patched libgit2 when not static; when static, bundled
# libgit2 is used and this would not work (libgit2 sources are not there)
if [ ! "$build_option_static" ]; then
cat >> Cargo.toml <<- EOF
[patch.crates-io]
libgit2-sys = { path = './libgit2-sys' }
EOF
fi
}
do_build() {
if [ "$build_option_static" ]; then
unset LIBGIT2_SYS_USE_PKG_CONFIG
unset LIBSSH2_SYS_USE_PKG_CONFIG
export OPENSSL_STATIC=1
# rust-openssl can not be linked static if pkg-config is used
@ -112,10 +97,6 @@ do_build() {
cargo="./cargo"
fi
# gotta pin out libgit2-sys at the version
$cargo update
$cargo update --package git2 --precise ${_git2_ver}
$cargo update --package libgit2-sys --precise ${_libgit2_ver}
$cargo build --release $(vopt_if static --features="all-static")
}