From 10b39b74571d02aa3b76b7dd5be8b78ca71c2944 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 3 Jan 2017 23:26:21 +0100 Subject: [PATCH] rust: update to 1.14.0. Build docs again, else build fails... --- srcpkgs/rust-doc | 1 + srcpkgs/rust/patches/link-llvm-static.patch | 10 --- .../rust/patches/link-musl-dynamically.patch | 68 +++++-------------- srcpkgs/rust/template | 39 +++++++---- 4 files changed, 43 insertions(+), 75 deletions(-) create mode 120000 srcpkgs/rust-doc delete mode 100644 srcpkgs/rust/patches/link-llvm-static.patch diff --git a/srcpkgs/rust-doc b/srcpkgs/rust-doc new file mode 120000 index 00000000000..6ef8575b5fa --- /dev/null +++ b/srcpkgs/rust-doc @@ -0,0 +1 @@ +rust \ No newline at end of file diff --git a/srcpkgs/rust/patches/link-llvm-static.patch b/srcpkgs/rust/patches/link-llvm-static.patch deleted file mode 100644 index 52d7622c8d1..00000000000 --- a/srcpkgs/rust/patches/link-llvm-static.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- rustc-1.12.0/src/librustc_llvm/build.rs.orig -+++ rustc-1.12.0/src/librustc_llvm/build.rs -@@ -128,6 +128,7 @@ - // of llvm-config, not the target that we're attempting to link. - let mut cmd = Command::new(&llvm_config); - cmd.arg("--libs"); -+ cmd.arg("--link-static"); - if !is_crossed { - cmd.arg("--system-libs"); - } diff --git a/srcpkgs/rust/patches/link-musl-dynamically.patch b/srcpkgs/rust/patches/link-musl-dynamically.patch index d688b9810d9..7454bafcb4f 100644 --- a/srcpkgs/rust/patches/link-musl-dynamically.patch +++ b/srcpkgs/rust/patches/link-musl-dynamically.patch @@ -1,15 +1,19 @@ -From: Jakub Jirutka -Date: Thu, 04 Aug 2016 17:53:00 +0200 -Subject: [PATCH] Do not link musl statically - -Static linking of rustc on Alpine doesn't work yet. - -This patch is ported from -https://gist.github.com/japaric/52b8816a4c86f5a4699bcc50ebc3e020. - ---- a/src/bootstrap/sanity.rs -+++ b/src/bootstrap/sanity.rs -@@ -115,27 +115,6 @@ +--- src/bootstrap/compile.rs.orig ++++ src/bootstrap/compile.rs +@@ -89,10 +89,6 @@ + t!(fs::create_dir_all(&libdir)); + } + add_to_sysroot(&out_dir, &libdir); +- +- if target.contains("musl") && !target.contains("mips") { +- copy_musl_third_party_objects(build, target, &libdir); +- } + } + + /// Copies the crt(1,i,n).o startup objects +--- src/bootstrap/sanity.rs.orig ++++ src/bootstrap/sanity.rs +@@ -132,27 +132,6 @@ panic!("the iOS target is only supported on OSX"); } @@ -27,8 +31,8 @@ https://gist.github.com/japaric/52b8816a4c86f5a4699bcc50ebc3e020. - } - } - None => { -- panic!("when targeting MUSL either the build.musl-root \ -- option or the target.$TARGET.musl-root one must \ +- panic!("when targeting MUSL either the rust.musl-root \ +- option or the target.$TARGET.musl-root option must \ - be specified in config.toml") - } - } @@ -37,39 +41,3 @@ https://gist.github.com/japaric/52b8816a4c86f5a4699bcc50ebc3e020. if target.contains("msvc") { // There are three builds of cmake on windows: MSVC, MinGW, and // Cygwin. The Cygwin build does not have generators for Visual ---- a/src/liblibc/src/unix/mod.rs -+++ b/src/liblibc/src/unix/mod.rs -@@ -197,9 +197,6 @@ - } else if #[cfg(all(not(stdbuild), feature = "use_std"))] { - // cargo build, don't pull in anything extra as the libstd dep - // already pulls in all libs. -- } else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] { -- #[link(name = "c", kind = "static")] -- extern {} - } else if #[cfg(target_os = "emscripten")] { - #[link(name = "c")] - extern {} ---- a/src/librustc_back/target/x86_64_unknown_linux_musl.rs -+++ b/src/librustc_back/target/x86_64_unknown_linux_musl.rs -@@ -11,7 +11,7 @@ - use target::{Target, TargetResult}; - - pub fn target() -> TargetResult { -- let mut base = super::linux_musl_base::opts(); -+ let mut base = super::linux_base::opts(); - base.cpu = "x86-64".to_string(); - base.max_atomic_width = 64; - base.pre_link_args.push("-m64".to_string()); ---- a/src/libunwind/build.rs -+++ b/src/libunwind/build.rs -@@ -16,9 +16,7 @@ - let target = env::var("TARGET").unwrap(); - - if target.contains("linux") { -- if target.contains("musl") && !target.contains("mips") { -- println!("cargo:rustc-link-lib=static=unwind"); -- } else if !target.contains("android") { -+ if !target.contains("android") { - println!("cargo:rustc-link-lib=gcc_s"); - } - } else if target.contains("freebsd") { diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index c7248471f1e..81f51a3655a 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -1,6 +1,6 @@ # Template file for 'rust' pkgname=rust -version=1.13.0 +version=1.14.0 revision=1 # NB. if you push any(!) new version, don't forget to put a build # output of musl to https://repo.voidlinux.eu/distfiles/ @@ -17,29 +17,29 @@ maintainer="Juan RP " homepage="http://www.rust-lang.org/" license="MIT, Apache-2.0" distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz" -checksum=ecb84775ca977a5efec14d0cad19621a155bfcbbf46e8050d18721bb1e3e5084 +checksum=c790edd2e915bd01bea46122af2942108479a2fda9a6f76d1094add520ac3b6b case "$XBPS_MACHINE" in x86_64-musl) distfiles+=" - https://repo.voidlinux.eu/distfiles/rustc-1.12.1-x86_64-unknown-linux-musl.tar.gz - https://repo.voidlinux.eu/distfiles/rust-std-1.12.1-x86_64-unknown-linux-musl.tar.gz + https://repo.voidlinux.eu/distfiles/rustc-1.13.0-x86_64-unknown-linux-musl.tar.gz + https://repo.voidlinux.eu/distfiles/rust-std-1.13.0-x86_64-unknown-linux-musl.tar.gz https://alpine.geeknet.cz/distfiles/cargo-0.11.0-nightly-x86_64-alpine-linux-musl.tar.gz" checksum+=" - 96733254cebd2dfacbfc774d7d788cb3df4d30cdfacd3f9c7883b0ffd104821d - dcc68b2d920947f8795c46239f141dfc876803e7b90f34852dea15d51db13322 + 40e86108823d541c823f898962ae62580ee6209d7f08699f50a9f14810f997e8 + ed28dd3cdea193fe05d7e1aa72e6f6e04210f0c7e93dcfdbe157d385a545eb3c 587172026c0565e839d96b0c1d4c68c000927817398241f96682dca47fa8c3b9" ;; x86_64) # extract from src/stage0.txt distfiles+=" - https://static.rust-lang.org/dist/2016-10-20/rustc-1.12.1-x86_64-unknown-linux-gnu.tar.gz - https://static.rust-lang.org/dist/2016-10-20/rust-std-1.12.1-x86_64-unknown-linux-gnu.tar.gz - https://static.rust-lang.org/cargo-dist/2016-08-21/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz" + https://static.rust-lang.org/dist/2016-11-08/rustc-1.13.0-x86_64-unknown-linux-gnu.tar.gz + https://static.rust-lang.org/dist/2016-11-08/rust-std-1.13.0-x86_64-unknown-linux-gnu.tar.gz + https://static.rust-lang.org/cargo-dist/2016-11-02/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz" checksum+=" - a753e3b6cfa8417978e4bfc0d3282f22be4abc5e106af39f4cb54dc775f64546 - 2d428042fd0b6cc1b08584341b2ad81dabe7abdfadcb0eb5082cfbc93e1ab90b - cf47787fd50bf6c7f68db290eab054e493e4619d42a8faf66565431449055f1c" + 0b092ba6750be89aad32b231ad9c625a11b040fae3cad5aa3ef32aaf213332d4 + de1c616c5ac955f92e4fa4e50ed0485771726d97c7106875a931a8d3c3ed6a09 + bf91da07e7cf81c5ba2d0fc453cb21edbf0d26def4f1a28093bf10851cc017c0" ;; esac @@ -78,6 +78,9 @@ EOF pre_build() { export CARGO_HOME="$wrksrc/.cargo" export LD_LIBRARY_PATH="$wrksrc/stage0/lib" + export PATH="$wrksrc/stage0/bin:$PATH" + export MUSL_ROOT=/usr + export RUST_BACKTRACE=1 } do_configure() { @@ -94,7 +97,6 @@ do_configure() { --host=${_triplet} --build=${_triplet} --release-channel=stable - --disable-docs --disable-rpath --enable-ccache --enable-rustbuild @@ -112,6 +114,7 @@ do_install() { vmkdir usr tar xf build/dist/rustc-*-*-*.tar.gz -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in tar xf build/dist/rust-std-*-*-*.tar.gz -C "$DESTDIR/usr/lib" --strip-components=3 --exclude=manifest.in + tar xf build/dist/rust-docs-*-*-*.tar.gz -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in vlicense COPYRIGHT vlicense LICENSE-APACHE @@ -119,6 +122,12 @@ do_install() { cd ${DESTDIR}/usr/lib ln -sf rustlib/*/lib/*.so . # symlinks instead of copies - - rm -rf ${DESTDIR}/usr/share/doc/rust +} + +rust-doc_package() { + short_desc+=" - documentation" + noarch=yes + pkg_install() { + vmove usr/share/doc + } }