diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-01-27 18:07:28 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-01-27 18:07:28 +0000 |
commit | 67f76a858f1ac826bd8a550d756d9ec6e340ed4f (patch) | |
tree | 45f4ada6be05bc180a14e017c9d5c6b58a0eec6e /dev-lang/rust | |
parent | 38b7258d086dd5e263c3bbe3880c8c956676bc71 (diff) |
gentoo resync : 27.01.2018
Diffstat (limited to 'dev-lang/rust')
-rw-r--r-- | dev-lang/rust/Manifest | 4 | ||||
-rw-r--r-- | dev-lang/rust/files/1.23.0-separate-libdir.patch | 180 | ||||
-rw-r--r-- | dev-lang/rust/metadata.xml | 2 | ||||
-rw-r--r-- | dev-lang/rust/rust-1.23.0-r1.ebuild | 172 |
4 files changed, 357 insertions, 1 deletions
diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest index 687e38caa169..af03111d09c4 100644 --- a/dev-lang/rust/Manifest +++ b/dev-lang/rust/Manifest @@ -1,3 +1,4 @@ +AUX 1.23.0-separate-libdir.patch 7268 BLAKE2B 9bd685bb53a98329826da86335bc9524c8969b8bc529eb98c14889d42edc32fd7ac85446f5a6dc68c4262461c32d01f11d093945833714a93376c5acab9000c0 SHA512 7bb0975706f6b6e47a3145bee895bd3ef648c2478f265e82dfccb745d968277dc499ec480ccf29d99093f395d48cd86d55dd15fe613fb73a062c5f3836893634 DIST cargo-0.19.0-i686-unknown-linux-gnu.tar.gz 5068212 BLAKE2B 4fd16e33b220ae496603cd5a16055557d96cbbf04943040c36f6121eb3b7e53d5644a6e0cd8794d3485bb323f0a719e921be8a944f466cd4dc317d82b1b8deea SHA512 bfe5df682eb566c91995b8c00b5e8edb5d2c3410d1baa5be2ede2e39260b653d34b7723c6c3e8f07d8102ffab50b13e62f9f2d816dad8fba9f39b7bec984181e DIST cargo-0.19.0-x86_64-unknown-linux-gnu.tar.gz 5133993 BLAKE2B 39eed4905b06a9f28340b1ca0362dd9d592b5ab6a11ceb8a749069827b65b25c34b8020ca434b3174733dcdda2c38b460c7c0d9b877ff2fed1a790f5f70d9c5a SHA512 6fedb8f83d70dc4fb93a29d400577a5578ceed1448f4e85e8a9509b98b037a125532ebfb6a7e6bc9411501ea74774d2c47ac7e2bcb7ac82baeb925abc46609e8 DIST rust-1.22.0-i686-unknown-linux-gnu.tar.gz 151889962 BLAKE2B cf2f30fdc01cbcf45de427b5a5a226b8482f3fc13e122cc4f021a75f648678b23a789706b54b6425346bdba57224898809102d97bfee8b143f90763ea985b6c3 SHA512 b46eb37f918833f1dbf3700fe156f26eff19dc90534434add5aa2d86b8ccc02aef273cba6a8291deaa89d27d2bd4af1529655b6463f44736a9f521a67cccc4f0 @@ -17,5 +18,6 @@ DIST rustc-1.23.0-src.tar.gz 60010149 BLAKE2B 64bba97fd1a16d3162b65b0d8dd2024ca0 EBUILD rust-1.15.1.ebuild 3984 BLAKE2B 282c07c0a78dcac9e862dc2c8788c3231d93a64e6276569ef4a609b155e30917d0412b9603a245fa818807d1726941a11ee335e15f17fbfe1e8f1d94e8d0d8de SHA512 a6b14e295a562308f5d9bfa2e5087c5ede31c93a99cc41b37fcabca42042ed958384660e51486372127d2262feb1071e3ffd386c974d86ad7647eb9c0ef8648d EBUILD rust-1.16.0.ebuild 3840 BLAKE2B 163ebba85b39e44406fd8b7dc9e5c1f9e929702a167f8ccb00605dd7e97f3e57101bc04ceb13887c3bfe1a79bd80f52f26f9f98727b1b2ceddb7a69bfd0c7924 SHA512 8c661074f6a53f6d8397d712c8236dfc34f18c386e699a1ab1db9a9eceba9e776c09c733ad615a1897916f1268c46e58a56c5f80cd2efe787fca5f8fdc8591e4 EBUILD rust-1.19.0.ebuild 4145 BLAKE2B 0a8abe73955900466c432df65d77d18bc7d01fa570f5b3c7876f4cf465f2c1cc5821d554352343a62fd0e1330cb97735665821ed8cc8223d98667292e05a00d0 SHA512 0da72a60a704d7215a3dea336e780c81473253ea3ccbfc41c1cef4cf2b2f86a791a41f42356a8958088d6522e6c3a917cfa196d14556feef5f56667b92012739 +EBUILD rust-1.23.0-r1.ebuild 4433 BLAKE2B 486915352c87a05677f58b9b0a87a8ec3cf956176db7cb34adbff4c86d9548bbf0d6a95e2ab5e7bf75f715ca1f307496e83bc07773a0e27a9cfc8a7386f052c9 SHA512 3d7db4d28f5fa66e8909be2d5deda2a09e45d97f4ef5d318e3b35650e0a768b278115a0c2624cfaff9b8e86504f9d3db5dc31633884736dbbfb444e591bda4e9 EBUILD rust-1.23.0.ebuild 4494 BLAKE2B 10bb2d2bf83471ef0e78887265ec8fed165decf68034a1760d8ae6400dc93c8eb02d7e5cd36c096e1b11ee63eeca672fe4d609f49941fe42e4e8a72e0a549b8e SHA512 07dddcee213e0c655e4308f7702b9e8f447ae91fa9dfc5e2ecbaa0cd5c9dc2ebe9ec8406d553f33940ad09fb7bc7a122e385916e273e25b170ce6a11e419fb0c -MISC metadata.xml 681 BLAKE2B 7d0307b56ec14694217b342794496b44a8b74cde85b710c7dddaa157d6553764b46d1c090921d25a62fc45adac8ee20042d423e24a575ac5771d695e6db5cec3 SHA512 c9afbd24ea1d2f1d68ef15d7fa1443b71bc396691bcd3e724ef74a84bb346145d236e7021e9beb9df512c859cae9bf741bfd6e7582b0a7df273ba05a8774d999 +MISC metadata.xml 793 BLAKE2B fbeeb3bb440bfb25a146d8bfc6de612acfec8400b911d444b1f70a161bee6c8cbbe66ccfa161421dfa03c7f1697e9658a3b592ca79647e3cc891fab8bcd60666 SHA512 fc98caa78085b3d35c5ccb31c339e893e422cc9a9c7a2e4d50c9c88d7670311db4125420cd483e7c468179a11962700ad9038ebd054039fce74adb4c8ab058c0 diff --git a/dev-lang/rust/files/1.23.0-separate-libdir.patch b/dev-lang/rust/files/1.23.0-separate-libdir.patch new file mode 100644 index 000000000000..dcf1762d2fa5 --- /dev/null +++ b/dev-lang/rust/files/1.23.0-separate-libdir.patch @@ -0,0 +1,180 @@ +From c520b2dd277f13dc09e8e72c486e5c58fb97017d Mon Sep 17 00:00:00 2001 +From: O01eg <o01eg@yandex.ru> +Date: Wed, 29 Nov 2017 12:32:03 +0300 +Subject: [PATCH] Fix #45345. + +Re-implement + +```bash +CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` +``` + +from old `configure` script. + +Accept verbosity in rustdoc. + +Stage 1 and later use relative libdir. + +Build all stages with relative libdirs. + +Add library path for real rustdoc with `RUSTDOC_LIBDIR` environment variable. + +Remove unused argument `rustc_cargo`. + +Remove unused configuration parameter `libdir_relative`. +--- + src/bootstrap/bin/rustdoc.rs | 13 ++++++++++++- + src/bootstrap/builder.rs | 9 ++++++--- + src/bootstrap/check.rs | 2 +- + src/bootstrap/compile.rs | 13 ++++--------- + src/bootstrap/config.rs | 1 - + src/bootstrap/doc.rs | 2 +- + 6 files changed, 24 insertions(+), 16 deletions(-) + +diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs +index 4e975adc97..24312b50ec 100644 +--- a/src/bootstrap/bin/rustdoc.rs ++++ b/src/bootstrap/bin/rustdoc.rs +@@ -23,10 +23,17 @@ use std::path::PathBuf; + fn main() { + let args = env::args_os().skip(1).collect::<Vec<_>>(); + let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set"); +- let libdir = env::var_os("RUSTC_LIBDIR").expect("RUSTC_LIBDIR was not set"); ++ let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set"); + let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set"); + let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set"); + ++ use std::str::FromStr; ++ ++ let verbose = match env::var("RUSTC_VERBOSE") { ++ Ok(s) => usize::from_str(&s).expect("RUSTC_VERBOSE should be an integer"), ++ Err(_) => 0, ++ }; ++ + let mut dylib_path = bootstrap::util::dylib_path(); + dylib_path.insert(0, PathBuf::from(libdir)); + +@@ -59,6 +66,10 @@ fn main() { + .arg("--crate-version").arg(version); + } + ++ if verbose > 1 { ++ eprintln!("rustdoc command: {:?}", cmd); ++ } ++ + std::process::exit(match cmd.status() { + Ok(s) => s.code().unwrap_or(1), + Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e), +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index c76900882b..1927a604c5 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -357,8 +357,8 @@ impl<'a> Builder<'a> { + + fn run(self, builder: &Builder) -> Interned<PathBuf> { + let compiler = self.compiler; +- let lib = if compiler.stage >= 2 && builder.build.config.libdir_relative.is_some() { +- builder.build.config.libdir_relative.clone().unwrap() ++ let lib = if compiler.stage >= 1 && builder.build.config.libdir.is_some() { ++ builder.build.config.libdir.clone().unwrap() + } else { + PathBuf::from("lib") + }; +@@ -416,7 +416,7 @@ impl<'a> Builder<'a> { + let compiler = self.compiler(self.top_stage, host); + cmd.env("RUSTC_STAGE", compiler.stage.to_string()) + .env("RUSTC_SYSROOT", self.sysroot(compiler)) +- .env("RUSTC_LIBDIR", self.sysroot_libdir(compiler, self.build.build)) ++ .env("RUSTDOC_LIBDIR", self.sysroot_libdir(compiler, self.build.build)) + .env("CFG_RELEASE_CHANNEL", &self.build.config.channel) + .env("RUSTDOC_REAL", self.rustdoc(host)) + .env("RUSTDOC_CRATE_VERSION", self.build.rust_version()) +@@ -496,6 +496,9 @@ impl<'a> Builder<'a> { + if let Some(target_linker) = self.build.linker(target) { + cargo.env("RUSTC_TARGET_LINKER", target_linker); + } ++ if cmd != "build" { ++ cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(self.compiler(2, self.build.build))); ++ } + + if mode != Mode::Tool { + // Tools don't get debuginfo right now, e.g. cargo and rls don't +diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs +index 4d69b19c73..d926c2b901 100644 +--- a/src/bootstrap/check.rs ++++ b/src/bootstrap/check.rs +@@ -1171,7 +1171,7 @@ impl Step for Crate { + } + Mode::Librustc => { + builder.ensure(compile::Rustc { compiler, target }); +- compile::rustc_cargo(build, &compiler, target, &mut cargo); ++ compile::rustc_cargo(build, target, &mut cargo); + ("librustc", "rustc-main") + } + _ => panic!("can only test libraries"), +diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs +index db013691bb..d60feb1aff 100644 +--- a/src/bootstrap/compile.rs ++++ b/src/bootstrap/compile.rs +@@ -485,7 +485,7 @@ impl Step for Rustc { + build.clear_if_dirty(&stage_out, &libtest_stamp(build, compiler, target)); + + let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "build"); +- rustc_cargo(build, &compiler, target, &mut cargo); ++ rustc_cargo(build, target, &mut cargo); + run_cargo(build, + &mut cargo, + &librustc_stamp(build, compiler, target)); +@@ -500,7 +500,6 @@ impl Step for Rustc { + + /// Same as `std_cargo`, but for libtest + pub fn rustc_cargo(build: &Build, +- compiler: &Compiler, + target: Interned<String>, + cargo: &mut Command) { + cargo.arg("--features").arg(build.rustc_features()) +@@ -514,13 +513,9 @@ pub fn rustc_cargo(build: &Build, + .env("CFG_VERSION", build.rust_version()) + .env("CFG_PREFIX", build.config.prefix.clone().unwrap_or_default()); + +- if compiler.stage == 0 { +- cargo.env("CFG_LIBDIR_RELATIVE", "lib"); +- } else { +- let libdir_relative = +- build.config.libdir_relative.clone().unwrap_or(PathBuf::from("lib")); +- cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative); +- } ++ let libdir_relative = ++ build.config.libdir.clone().unwrap_or(PathBuf::from("lib")); ++ cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative); + + // If we're not building a compiler with debugging information then remove + // these two env vars which would be set otherwise. +diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs +index 35e62f17f2..1ca19187cf 100644 +--- a/src/bootstrap/config.rs ++++ b/src/bootstrap/config.rs +@@ -119,7 +119,6 @@ pub struct Config { + pub docdir: Option<PathBuf>, + pub bindir: Option<PathBuf>, + pub libdir: Option<PathBuf>, +- pub libdir_relative: Option<PathBuf>, + pub mandir: Option<PathBuf>, + pub codegen_tests: bool, + pub nodejs: Option<PathBuf>, +diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs +index 3c12cfc4c7..1314d967d8 100644 +--- a/src/bootstrap/doc.rs ++++ b/src/bootstrap/doc.rs +@@ -616,7 +616,7 @@ impl Step for Rustc { + t!(symlink_dir_force(&my_out, &out_dir)); + + let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "doc"); +- compile::rustc_cargo(build, &compiler, target, &mut cargo); ++ compile::rustc_cargo(build, target, &mut cargo); + + if build.config.compiler_docs { + // src/rustc/Cargo.toml contains a bin crate called rustc which +-- +2.13.6 + diff --git a/dev-lang/rust/metadata.xml b/dev-lang/rust/metadata.xml index 050e235f7195..c1882e581cf9 100644 --- a/dev-lang/rust/metadata.xml +++ b/dev-lang/rust/metadata.xml @@ -7,6 +7,8 @@ </maintainer> <use> <flag name="clang">Use <pkg>sys-devel/clang</pkg> for building</flag> + <flag name="extended">Build and install rls, rustfmt and cargo + alongside the compiler and stdlib</flag> <flag name="libcxx">Use <pkg>sys-libs/libcxx</pkg> as standard library when building with <pkg>sys-devel/clang</pkg></flag> <flag name="system-llvm">Use system <pkg>sys-devel/llvm</pkg> in diff --git a/dev-lang/rust/rust-1.23.0-r1.ebuild b/dev-lang/rust/rust-1.23.0-r1.ebuild new file mode 100644 index 000000000000..0f20423bb664 --- /dev/null +++ b/dev-lang/rust/rust-1.23.0-r1.ebuild @@ -0,0 +1,172 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) + +inherit python-any-r1 versionator toolchain-funcs + +if [[ ${PV} = *beta* ]]; then + betaver=${PV//*beta} + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" + MY_P="rustc-beta" + SLOT="beta/${PV}" + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.gz" + KEYWORDS="" +else + ABI_VER="$(get_version_component_range 1-2)" + SLOT="stable/${ABI_VER}" + MY_P="rustc-${PV}" + SRC="${MY_P}-src.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +CHOST_amd64=x86_64-unknown-linux-gnu +CHOST_x86=i686-unknown-linux-gnu + +RUST_STAGE0_VERSION="1.$(($(get_version_component_range 2) - 1)).0" +RUST_STAGE0_amd64="rust-${RUST_STAGE0_VERSION}-${CHOST_amd64}" +RUST_STAGE0_x86="rust-${RUST_STAGE0_VERSION}-${CHOST_x86}" + +CARGO_DEPEND_VERSION="0.$(($(get_version_component_range 2) + 1)).0" + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="http://www.rust-lang.org/" + +SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.gz + amd64? ( https://static.rust-lang.org/dist/${RUST_STAGE0_amd64}.tar.gz ) + x86? ( https://static.rust-lang.org/dist/${RUST_STAGE0_x86}.tar.gz ) +" + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" + +IUSE="debug doc extended +jemalloc" + +RDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 + jemalloc? ( dev-libs/jemalloc )" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + || ( + >=sys-devel/gcc-4.7 + >=sys-devel/clang-3.5 + ) + dev-util/cmake +" +PDEPEND="!extended? ( >=dev-util/cargo-${CARGO_DEPEND_VERSION} )" + +PATCHES=( "${FILESDIR}/1.23.0-separate-libdir.patch" ) + +S="${WORKDIR}/${MY_P}-src" + +toml_usex() { + usex "$1" true false +} + +src_prepare() { + local rust_stage0_root="${WORKDIR}"/rust-stage0 + + local rust_stage0_name="RUST_STAGE0_${ARCH}" + local rust_stage0="${!rust_stage0_name}" + + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die + + default +} + +src_configure() { + local rust_stage0_root="${WORKDIR}"/rust-stage0 + + local rust_target_name="CHOST_${ARCH}" + local rust_target="${!rust_target_name}" + + cat <<- EOF > "${S}"/config.toml + [llvm] + optimize = $(toml_usex !debug) + release-debuginfo = $(toml_usex debug) + assertions = $(toml_usex debug) + [build] + build = "${rust_target}" + host = ["${rust_target}"] + target = ["${rust_target}"] + cargo = "${rust_stage0_root}/bin/cargo" + rustc = "${rust_stage0_root}/bin/rustc" + docs = $(toml_usex doc) + submodules = false + python = "${EPYTHON}" + locked-deps = true + vendor = true + verbose = 2 + extended = $(toml_usex extended) + [install] + prefix = "${EPREFIX}/usr" + libdir = "$(get_libdir)" + docdir = "share/doc/${P}" + mandir = "share/${P}/man" + [rust] + optimize = $(toml_usex !debug) + debuginfo = $(toml_usex debug) + debug-assertions = $(toml_usex debug) + use-jemalloc = $(toml_usex jemalloc) + default-linker = "$(tc-getCC)" + rpath = false + [target.${rust_target}] + cc = "$(tc-getBUILD_CC)" + cxx = "$(tc-getBUILD_CXX)" + linker = "$(tc-getCC)" + ar = "$(tc-getAR)" + EOF +} + +src_compile() { + ./x.py build --verbose --config="${S}"/config.toml || die +} + +src_install() { + env DESTDIR="${D}" ./x.py install || die + + mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die + mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die + mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die + mv "${D}/usr/bin/rust-lldb" "${D}/usr/bin/rust-lldb-${PV}" || die + + dodoc COPYRIGHT + + cat <<-EOF > "${T}"/50${P} + LDPATH="/usr/$(get_libdir)/${P}" + MANPATH="/usr/share/${P}/man" + EOF + doenvd "${T}"/50${P} + + cat <<-EOF > "${T}/provider-${P}" + /usr/bin/rustdoc + /usr/bin/rust-gdb + /usr/bin/rust-lldb + EOF + dodir /etc/env.d/rust + insinto /etc/env.d/rust + doins "${T}/provider-${P}" +} + +pkg_postinst() { + eselect rust update --if-unset + + elog "Rust installs a helper script for calling GDB and LLDB," + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." + + if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then + elog "install app-emacs/rust-mode to get emacs support for rust." + fi + + if has_version app-editors/gvim || has_version app-editors/vim; then + elog "install app-vim/rust-vim to get vim support for rust." + fi + + if has_version 'app-shells/zsh'; then + elog "install app-shells/rust-zshcomp to get zsh completion for rust." + fi +} + +pkg_postrm() { + eselect rust unset --if-invalid +} |