diff --git a/srcpkgs/rust/patches/lzma-sys-cross-ldflags.patch b/srcpkgs/rust/patches/lzma-sys-cross-ldflags.patch new file mode 100644 index 0000000000..82a2fc1886 --- /dev/null +++ b/srcpkgs/rust/patches/lzma-sys-cross-ldflags.patch @@ -0,0 +1,11 @@ +This allows lzma-sys to build in a cross-compiling environment. +--- rustc-1.33.0-src/vendor/lzma-sys/build.rs ++++ rustc-1.33.0-src/vendor/lzma-sys/build.rs +@@ -101,6 +101,7 @@ + } + cmd.env("CC", compiler.path()) + .env("CFLAGS", cflags) ++ .env("LDFLAGS", "") + .current_dir(&dst.join("build")) + .arg(sanitize_sh(&src.join("configure"))); + cmd.arg(format!("--prefix={}", sanitize_sh(&dst))); diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index 639526a958..433f8f20dc 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -1,7 +1,7 @@ # Template file for 'rust' pkgname=rust version=1.34.0 -revision=2 +revision=3 _rust_dist_version=1.33.0 _cargo_dist_version=0.33.0 # NB. if you push any(!) new version, don't forget to put a build @@ -114,6 +114,13 @@ post_extract() { fi } +# we need this because cargo verifies checksums of all files in vendor +# crates when it builds and gives us no way to override or update the +# file sanely... so just clear out the file list +_clear_vendor_checksums() { + sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json +} + post_patch() { if [ "$build_option_internal_llvm" ]; then # patches for Rust's bundled LLVM @@ -133,6 +140,10 @@ post_patch() { fi sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py + + # clear out all the checksum nonsense of patched vendor crates + _clear_vendor_checksums libc + _clear_vendor_checksums lzma-sys } do_configure() { @@ -148,6 +159,7 @@ do_configure() { --disable-rpath --disable-docs --disable-codegen-tests + --enable-vendor " if ! [ "$build_option_internal_llvm" ]; then @@ -199,7 +211,7 @@ pre_build() { # of the cross host. # Unset LDFLAGS, otherwise cross builds to the same arch will fail do_build() { - env CFLAGS_${RUST_BUILD}="${CFLAGS_host}" LDFLAGS='' make ${makejobs} ${make_build_args} + env CFLAGS_${RUST_BUILD}="${CFLAGS_host}" make ${makejobs} ${make_build_args} } do_install() {