dev-lang/rust: bump to 1.42.0
authorGeorgy Yakovlev <gyakovlev@gentoo.org>
Wed, 18 Mar 2020 23:35:35 +0000 (16:35 -0700)
committerGeorgy Yakovlev <gyakovlev@gentoo.org>
Thu, 19 Mar 2020 04:55:29 +0000 (21:55 -0700)
Bug: https://bugs.gentoo.org/713198
Package-Manager: Portage-2.3.94, Repoman-2.3.21
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
dev-lang/rust/Manifest
dev-lang/rust/metadata.xml
dev-lang/rust/rust-1.42.0.ebuild [new file with mode: 0644]

index c26da6db2c7e5b2e5bdb9d1607f6179f697d75e3..1f07666b244af854b8c6de81f6367cfb2839dd97 100644 (file)
@@ -68,8 +68,23 @@ DIST rust-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz 87972788 BLAKE2B ad1e460db
 DIST rust-1.40.0-s390x-unknown-linux-gnu.tar.xz 95398844 BLAKE2B e897ac3e1f46a63c7ad14e0e5229b7028ac325256e084439bcad0ced631eb26d50ca72710c46e59accb0e3d0574d08a9c15455be59a8d78173387d35ddd3bed7 SHA512 e71d3a1d85975653b6d972a4854c9e53be7f2d093a601145261c97f7917f869399fbc6322a04f63b782a5a28b91c3be40041a8c77367d19dec8d0e857cbbef14
 DIST rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz 110186516 BLAKE2B ad89d8cecbd565b23c98ec095bad218de971cb4bb89924bbcb012df6c9ecf0db2b50d624abdf6b050fe1f5067aea9311dc01852950a5ca5e993e99f913fc5dbc SHA512 11a2ad1d8b9e91cbe9ee6a1954d46ac75eeaa83f0c2425a8ad70d191727b02e86ead33d6464222effca6f5134c31a165801a854aa57bdb5f12944d605de3c1d1
 DIST rust-1.40.0-x86_64-unknown-linux-musl.tar.xz 96869284 BLAKE2B 61cdf2eab51455e377e079e7013959ee51358c9846f8442f81a3240062af573f452a0f5f007e63cbbcdd0db98ac22ab0d4f3006f6ef30327b609d303410cba8c SHA512 3e6d7cf7b24c09d13266e06f20ab317c5ffb68de3242719c71e95c3d778269c4076e06badfb488e8fc223b822246ebbeb888d4168ddf6e2401793e23e77810bb
+DIST rust-1.41.1-aarch64-unknown-linux-gnu.tar.xz 96755608 BLAKE2B f8635737089bb028cfac6d6478c4226a78c2c8a8aa12f28cba267744e2e915e062f49edb505f26b6deaeca0d2fdb4ec4b83e791f87bf1eab6c0536dc41e2c641 SHA512 54eac5c380b418c1714931ead7d6284b225bb427fcc501e147240000b71d31b667e308aea7f38f3299b1311ab04f19011b914d37a4581c7a64028965569cd58e
+DIST rust-1.41.1-arm-unknown-linux-gnueabi.tar.xz 98856136 BLAKE2B dbb3996a9ae302290886bf1cd4642d99a9b3f883f9d39817bb15f105565147e416e23d19e0d08314b08ed441f1ac528c20d8bee27ccef68cb585d8ef64a19e45 SHA512 1b01acd430af3cf99d838aa367dec4f6e4bfcec91388d4a2323cd781d53246edae0f14687b087b73b87c349f243e3acabe193538ce31303f07d59c6a03c31565
+DIST rust-1.41.1-arm-unknown-linux-gnueabihf.tar.xz 99107336 BLAKE2B 0dd84e7ad6081b8fdcfcb2691496ed3a493e08db4757e6d3bb2aa9a36fc6f020772a84bc21d0c60efeecf635512f25737b8d6b49a53020c4045c89c5b89881d7 SHA512 462e6d354a4b3b848781bb059decc5eb1ebb4d8a31651623d076a2654e2c8fd02f0f87ddafb124efa40cb134c9438eb252035c2b5bfdf936881b14a23bfbfe9f
+DIST rust-1.41.1-armv7-unknown-linux-gnueabihf.tar.xz 103399676 BLAKE2B da35342be05e58c11e6f96ab566b6a2f334d6975d4251deb2f41069d4a549ebf58aba43e1f07b99dedf0426ab0a8e8616b32799ca54a5f601d70910deca3efaf SHA512 400bf8d013fe5030243bc0ccb7066ea3d03a2c10727e04b6830ab91dfe9b04f78cfef10794a1c7bb6276fb00c86f1e1c42a74faba19f3125859b3464726d01c2
+DIST rust-1.41.1-i686-unknown-linux-gnu.tar.xz 120834812 BLAKE2B 4615eeb7c63392f66487243743fc57677654e232c786f9f970a9be9996dcb08e265631f6764e09e0444f8bb767b9c76366a26fe8fca9dcc149c81df5c2a3dd18 SHA512 c6d74b2653c537043eb2ea721095ff053def592b4c330bdc104690cfb51d648f515288cc0451743d94260f18a55d6757bcb8eb1e6c0217da3498d08b681ca6af
+DIST rust-1.41.1-mips-unknown-linux-gnu.tar.xz 92620720 BLAKE2B dff1be71d459e0256a19fb88f324e59cbf2e10fda693157802a63a08329c7dd4feca4b260510b3a1d6afb4afc9ed9dc549b741f598f3aedf50a982810d0bd140 SHA512 4fdca72b98a4fd25a2ddf33e0f31d9549c39fae9dfad6f1648556f144f82cfb2a487f6777d61476ad18bb0a0ac63810b99bb09a18719ec5344e89fccb16ac693
+DIST rust-1.41.1-mips64-unknown-linux-gnuabi64.tar.xz 96215100 BLAKE2B c52d564010d56df01bac6b2f447d56c00855c52ed8ebe6a2ac1b7786e8c73a1d529be7e7d5a4f7b427892494782aadcc4c8cc54157287d43f58938b0a57486c6 SHA512 2ed84ade11c6f4961e83e06a61d998a7abc9165cc384cc69470658e8244dc399e30c3f983a9f11b0bf88032d855bc47fe6d71f5db95cc7168e6f810c69095633
+DIST rust-1.41.1-mipsel-unknown-linux-gnu.tar.xz 93365592 BLAKE2B cd0d16f99a0976076530fa601f9bfeb61e1204bc278f78db015bc8d1629ce8f19da61a12573fdf9cf0d3d29e56f6915338aeaea3ef4d9b374eeb4095189fe71c SHA512 a0b7cc55ffeb0911d1d82d93cf2f4ea2a683ee76a783952b2f42c0b3c3d02b2bfc7df6f5762af91e6d02963e22a08ba26f143f594dfd6d41ad8198f7e8a862c0
+DIST rust-1.41.1-powerpc-unknown-linux-gnu.tar.xz 98530136 BLAKE2B 41399fcc9f1d88cc5a6fe0651012e4ebd1addde428c22611c30918a09ddad3640fb326bf48f94e5d12a610d2709eecf95c5d023f10bc6636eb6de1808a104e48 SHA512 545b2a4459bbfa7049755cbb63ad6e2917bf03cb9568eccbf3b01ea8f846263fbdc97ad29b42c440fa92dd9737b398196c1cdaf96c9716bba2f9e1d4a3a20125
+DIST rust-1.41.1-powerpc64-unknown-linux-gnu.tar.xz 104058752 BLAKE2B 10b3e3e4970fc05952f83e80e7d133d308045bdd3342199e885d2e6add113ada7959a93010046f48b1fedfe85f0346793fc54e0bf0c55d096f82622e198a928c SHA512 50367685783085cc384be944d4321dfde850f3a0e94de0625a08f17160af2c0b795276f96574d1bea84092cbc1cd3cde619d97fe2e37b07ead17f49164e1c995
+DIST rust-1.41.1-powerpc64le-unknown-linux-gnu.tar.xz 110594504 BLAKE2B eaf9c92ea9599314d12c5f9d0b654b523ceb8f40cc779cdbc2d50b4b07e0a37cd42d34000f0ace9c19154a1bd17110c097e30ee2b617f3a29de4966bb9303301 SHA512 1b2bf6d35321dd0a0fc9735005317f09f8b9a81b520612484530e29156ea254d5cada583e44f7e4a840edde09d70c34f7ead1208d8aa6037c652540dfa38cede
+DIST rust-1.41.1-s390x-unknown-linux-gnu.tar.xz 114814112 BLAKE2B ef22c377e1d89ef4ebe78df19d91bcf042e2e1d8997be80d7d40998b18f6b44f8bb1232b1f72e42e3ffb6d1ff235f3cd2f04854e996bbf7be8f6d5d7299e8514 SHA512 f809adc626876df5c6e050362d59189ede5e3991ac41fd129922540abeb728f618e1a3f3925cee34895de5e037141aabb1f8c2b94d4069945d174e38446e8153
+DIST rust-1.41.1-x86_64-unknown-linux-gnu.tar.xz 111202140 BLAKE2B 226c68b1e97cc9be82e81f6c9e065e08514166a65a57159c2f63527063ae5f514650afc2591e0c4854ecd0239dc82cbc9a97b99412608645aca879a71354d857 SHA512 c75d4a18cf9300c6ab480d34c5e4b41be971535931455239330cb2a0e927bcf9cf102498cad5dd1d5d802fd1d9c9d214b80e8ff15aa6be68d3e7f41420cad666
+DIST rust-1.41.1-x86_64-unknown-linux-musl.tar.xz 96076684 BLAKE2B 3672e24a83c1e4c97a0844f9522a9fced19d5ef01c89d44e54bba8683514a86f7a14ea2e8c2f28d03c65b7e2e0358ff3cea2f85de1e69eb5334c55e18a8c8e4f SHA512 29e7b2aae35017d7f4313e0a482712390ffec752e62d8b1bda95d56a1f93ba882a8f610b469b5d2d7fa3d6d35c2cdc4e45d219ad85b8a3f71ba6ce04b1add48b
 DIST rustc-1.37.0-src.tar.xz 98654252 BLAKE2B ddee92c7959a0e1ee11ffe5ded6017703cfac7bbf2a00dc46c37ed28f1cd1d31e1d5b62cc1a5ae2d55d64f8705d0cb282f4968deddf36c3152e5e0cfdfbea67d SHA512 bfee43f578e6d44ead950b870b9fd31087e1bd3f917611f5dce7ad56504b83185edf43e297e8d1304e9e97b9a580d1e6adf6608ab8ed6dee0dc8c5153cdbc5d4
 DIST rustc-1.38.0-src.tar.xz 96163304 BLAKE2B 1e900b44db64727477ccf8e58e0ebb9ec209bbeb349816b5f7937e58c165db8befae33c5667732e5aaaa677c5a6c1e0229d9969ab8967fda9b8d7a593e6c5eb6 SHA512 b756d29a7a222bc7b5c7f42ff397346ab840f78e559f93e6e36b65e76eea525cf429899fe4de9fb8966623a2225b552feef9fa831bee50f9e25c976fa2af8c0a
 DIST rustc-1.39.0-src.tar.xz 96495140 BLAKE2B 6df6bf0c3b38c28753713acdc477ea6929740c32893171dd9b8620992439e45730ef6f9489a6fc411ff5884c661ac4c07b7b93f5a4174207ed53351d2dea09bf SHA512 8610b2ec77722087c572bd84ac562a5b7c5f1a644aea58c5d5daa07a9aed242703b7816e73e2eaa049f773d5907859e259744a0de700622df005584fd798dab0
 DIST rustc-1.40.0-src.tar.xz 92306352 BLAKE2B 762b9592414e5c816540f6fd37d07b3b0ffe97a151968cc8ae77be2fda03a6d66905192985edc65055cc7811dbd90faa2b2c056481f72161c6f7ccbcce13671a SHA512 b5ac3079acefb62d3c985b77f624d7fb68de23a59396fed9ccb292db61641c064f3146ee54d3cf59067b17ebfaadd14a6b2b466def60316bb5b13ba3aef01e1f
 DIST rustc-1.41.1-src.tar.xz 93754192 BLAKE2B 235ece650d0c75e1c8700ce73d3811997cd0d827b850a6dd435a269f3f86d85849d54755ea346c5ddcbe0d1224836fd78213f6abeab4a9a8c4c3e2d8a05ff7b4 SHA512 ef33565c9cf4e27ca279072bfed3301e0276c09407d49727640746ba78d289de285278d64b1cce8708461fd6c97c7ab2ea8d56e7a4c4a23b2e66e2d164c35fc9
+DIST rustc-1.42.0-src.tar.xz 94186592 BLAKE2B 82298ef3da44188546bb945bcbfc1af630e6a4466b643667da08a04a33c6417afd68fc86302bdd22ab36c208fdb13cbc479e762d1217c05507bbfeb13bfbef7e SHA512 589bfdc92deedd33b8ea0df7f7c64c2a9a085fbea64936eff92f81e812309c060ed7a7adc96f6010d7adf62a68434a230da0f6c5b3540df4e0a5c6de05a31b16
index 70279a4bbfdf6634dbdaaf8cd2de315face40dee..0d0d683b8b444f2852edcd2c5679ff6c34472a56 100644 (file)
        </maintainer>
        <use>
                <flag name="clippy">Install clippy component</flag>
-               <flag name="system-llvm">Use the system LLVM install</flag>
+               <flag name="miri">Install miri component (requires USE=nightly)</flag>
                <flag name="nightly">Enable nightly (UNSTABLE) features</flag>
                <flag name="parallel-compiler">Build a multi-threaded rustc</flag>
                <flag name="rls">Install rls component</flag>
                <flag name="rustfmt">Install rustfmt component</flag>
                <flag name="system-bootstrap">Bootstrap using installed rust compiler</flag>
+               <flag name="system-llvm">Use the system LLVM install</flag>
                <flag name="wasm">Build support for the wasm32-unknown-unknown
                target</flag>
        </use>
diff --git a/dev-lang/rust/rust-1.42.0.ebuild b/dev-lang/rust/rust-1.42.0.ebuild
new file mode 100644 (file)
index 0000000..ec4ae6c
--- /dev/null
@@ -0,0 +1,380 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7} )
+
+inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain 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.xz"
+else
+       ABI_VER="$(ver_cut 1-2)"
+       SLOT="stable/${ABI_VER}"
+       MY_P="rustc-${PV}"
+       SRC="${MY_P}-src.tar.xz"
+       KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+fi
+
+RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).1"
+
+DESCRIPTION="Systems programming language from Mozilla"
+HOMEPAGE="https://www.rust-lang.org/"
+
+SRC_URI="
+       https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz
+       !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
+"
+
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+       NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
+
+IUSE="clippy cpu_flags_x86_sse2 debug doc libressl miri nightly parallel-compiler rls rustfmt system-bootstrap system-llvm wasm ${ALL_LLVM_TARGETS[*]}"
+
+# Please keep the LLVM dependency block separate. Since LLVM is slotted,
+# we need to *really* make sure we're not pulling more than one slot
+# simultaneously.
+
+# How to use it:
+# 1. List all the working slots (with min versions) in ||, newest first.
+# 2. Update the := to specify *max* version, e.g. < 10.
+# 3. Specify LLVM_MAX_SLOT, e.g. 9.
+LLVM_DEPEND="
+       || (
+               sys-devel/llvm:9[${LLVM_TARGET_USEDEPS// /,}]
+               wasm? ( =sys-devel/lld-9* )
+       )
+       <sys-devel/llvm-10:=
+"
+LLVM_MAX_SLOT=9
+
+BOOTSTRAP_DEPEND="|| ( >=dev-lang/rust-1.$(($(ver_cut 2) - 1)).0-r1 >=dev-lang/rust-bin-1.$(($(ver_cut 2) - 1)) )"
+
+COMMON_DEPEND="
+       net-libs/libssh2:=
+       net-libs/http-parser:=
+       net-misc/curl:=[ssl]
+       sys-libs/zlib:=
+       !libressl? ( dev-libs/openssl:0= )
+       libressl? ( dev-libs/libressl:0= )
+       elibc_musl? ( sys-libs/libunwind )
+       system-llvm? (
+               ${LLVM_DEPEND}
+       )
+"
+
+DEPEND="${COMMON_DEPEND}
+       ${PYTHON_DEPS}
+       || (
+               >=sys-devel/gcc-4.7
+               >=sys-devel/clang-3.5
+       )
+       system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
+       !system-llvm? (
+               dev-util/cmake
+               dev-util/ninja
+       )
+"
+
+RDEPEND="${COMMON_DEPEND}
+       >=app-eselect/eselect-rust-20190311
+"
+
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
+       miri? ( nightly )
+       parallel-compiler? ( nightly )
+       wasm? ( llvm_targets_WebAssembly )
+       x86? ( cpu_flags_x86_sse2 )
+"
+
+QA_FLAGS_IGNORED="
+       usr/bin/.*-${PV}
+       usr/lib.*/lib.*.so
+       usr/lib/rustlib/.*/codegen-backends/librustc_codegen_llvm-llvm.so
+       usr/lib/rustlib/.*/lib/lib.*.so
+"
+
+QA_SONAME="usr/lib.*/librustc_macros.*.so"
+
+PATCHES=(
+       "${FILESDIR}"/1.40.0-add-soname.patch
+)
+
+S="${WORKDIR}/${MY_P}-src"
+
+toml_usex() {
+       usex "$1" true false
+}
+
+pre_build_checks() {
+       CHECKREQS_DISK_BUILD="9G"
+       eshopts_push -s extglob
+       if is-flagq '-g?(gdb)?([1-9])'; then
+               CHECKREQS_DISK_BUILD="15G"
+       fi
+       eshopts_pop
+       check-reqs_pkg_setup
+}
+
+pkg_pretend() {
+       pre_build_checks
+}
+
+pkg_setup() {
+       pre_build_checks
+       python-any-r1_pkg_setup
+
+       # use bundled for now, #707746
+       # will need dev-libs/libgit2 slotted dep if re-enabled
+       #export LIBGIT2_SYS_USE_PKG_CONFIG=1
+       export LIBSSH2_SYS_USE_PKG_CONFIG=1
+       export PKG_CONFIG_ALLOW_CROSS=1
+
+       if use system-llvm; then
+               llvm_pkg_setup
+
+               local llvm_config="$(get_llvm_prefix "$LLVM_MAX_SLOT")/bin/llvm-config"
+
+               export LLVM_LINK_SHARED=1
+               export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
+       fi
+}
+
+src_prepare() {
+       if ! use system-bootstrap; then
+               local rust_stage0_root="${WORKDIR}"/rust-stage0
+               local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
+
+               "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
+                       --destdir="${rust_stage0_root}" --prefix=/ || die
+       fi
+
+       default
+}
+
+src_configure() {
+       local rust_target="" rust_targets="" arch_cflags
+
+       # Collect rust target names to compile standard libs for all ABIs.
+       for v in $(multilib_get_enabled_abi_pairs); do
+               rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
+       done
+       if use wasm; then
+               rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
+       fi
+       rust_targets="${rust_targets#,}"
+
+       local extended="true" tools="\"cargo\","
+       if use clippy; then
+               tools="\"clippy\",$tools"
+       fi
+       if use miri; then
+               tools="\"miri\",$tools"
+       fi
+       if use rls; then
+               tools="\"rls\",\"analysis\",\"src\",$tools"
+       fi
+       if use rustfmt; then
+               tools="\"rustfmt\",$tools"
+       fi
+
+       local rust_stage0_root
+       if use system-bootstrap; then
+               rust_stage0_root="$(rustc --print sysroot)"
+       else
+               rust_stage0_root="${WORKDIR}"/rust-stage0
+       fi
+
+       rust_target="$(rust_abi)"
+
+       cat <<- EOF > "${S}"/config.toml
+               [llvm]
+               optimize = $(toml_usex !debug)
+               release-debuginfo = $(toml_usex debug)
+               assertions = $(toml_usex debug)
+               targets = "${LLVM_TARGETS// /;}"
+               experimental-targets = ""
+               link-shared = $(toml_usex system-llvm)
+               [build]
+               build = "${rust_target}"
+               host = ["${rust_target}"]
+               target = [${rust_targets}]
+               cargo = "${rust_stage0_root}/bin/cargo"
+               rustc = "${rust_stage0_root}/bin/rustc"
+               docs = $(toml_usex doc)
+               compiler-docs = $(toml_usex doc)
+               submodules = false
+               python = "${EPYTHON}"
+               locked-deps = true
+               vendor = true
+               extended = ${extended}
+               tools = [${tools}]
+               verbose = 2
+               [install]
+               prefix = "${EPREFIX}/usr"
+               libdir = "lib"
+               docdir = "share/doc/${PF}"
+               mandir = "share/man"
+               [rust]
+               optimize = true
+               debug = $(toml_usex debug)
+               debug-assertions = $(toml_usex debug)
+               default-linker = "$(tc-getCC)"
+               parallel-compiler = $(toml_usex parallel-compiler)
+               channel = "$(usex nightly nightly stable)"
+               rpath = false
+               lld = $(usex system-llvm false $(toml_usex wasm))
+               backtrace-on-ice = true
+               [dist]
+               src-tarball = false
+       EOF
+
+       for v in $(multilib_get_enabled_abi_pairs); do
+               rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
+               arch_cflags="$(get_abi_CFLAGS ${v##*.})"
+
+               cat <<- EOF >> "${S}"/config.env
+                       CFLAGS_${rust_target}=${arch_cflags}
+               EOF
+
+               cat <<- EOF >> "${S}"/config.toml
+                       [target.${rust_target}]
+                       cc = "$(tc-getBUILD_CC)"
+                       cxx = "$(tc-getBUILD_CXX)"
+                       linker = "$(tc-getCC)"
+                       ar = "$(tc-getAR)"
+               EOF
+               # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
+               if use elibc_musl; then
+                       cat <<- EOF >> "${S}"/config.toml
+                               crt-static = false
+                       EOF
+               fi
+               if use system-llvm; then
+                       cat <<- EOF >> "${S}"/config.toml
+                               llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
+                       EOF
+               fi
+       done
+
+       if use wasm; then
+               cat <<- EOF >> "${S}"/config.toml
+                       [target.wasm32-unknown-unknown]
+                       linker = "$(usex system-llvm lld rust-lld)"
+               EOF
+       fi
+}
+
+src_compile() {
+       env $(cat "${S}"/config.env)\
+               "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
+}
+
+src_install() {
+       env $(cat "${S}"/config.env) DESTDIR="${D}" \
+               "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml || die
+
+       # bug #689562, #689160
+       rm "${D}/etc/bash_completion.d/cargo" || die
+       rmdir "${D}"/etc{/bash_completion.d,} || die
+       dobashcomp build/tmp/dist/cargo-image/etc/bash_completion.d/cargo
+
+       mv "${ED}/usr/bin/rustc" "${ED}/usr/bin/rustc-${PV}" || die
+       mv "${ED}/usr/bin/rustdoc" "${ED}/usr/bin/rustdoc-${PV}" || die
+       mv "${ED}/usr/bin/rust-gdb" "${ED}/usr/bin/rust-gdb-${PV}" || die
+       mv "${ED}/usr/bin/rust-gdbgui" "${ED}/usr/bin/rust-gdbgui-${PV}" || die
+       mv "${ED}/usr/bin/rust-lldb" "${ED}/usr/bin/rust-lldb-${PV}" || die
+       mv "${ED}/usr/bin/cargo" "${ED}/usr/bin/cargo-${PV}" || die
+       if use clippy; then
+               mv "${ED}/usr/bin/clippy-driver" "${ED}/usr/bin/clippy-driver-${PV}" || die
+               mv "${ED}/usr/bin/cargo-clippy" "${ED}/usr/bin/cargo-clippy-${PV}" || die
+       fi
+       if use miri; then
+               mv "${ED}/usr/bin/miri" "${ED}/usr/bin/miri-${PV}" || die
+               mv "${ED}/usr/bin/cargo-miri" "${ED}/usr/bin/cargo-miri-${PV}" || die
+       fi
+       if use rls; then
+               mv "${ED}/usr/bin/rls" "${ED}/usr/bin/rls-${PV}" || die
+       fi
+       if use rustfmt; then
+               mv "${ED}/usr/bin/rustfmt" "${ED}/usr/bin/rustfmt-${PV}" || die
+               mv "${ED}/usr/bin/cargo-fmt" "${ED}/usr/bin/cargo-fmt-${PV}" || die
+       fi
+
+       # Move public shared libs to abi specific libdir
+       # Private and target specific libs MUST stay in /usr/lib/rustlib/${rust_target}/lib
+       if [[ $(get_libdir) != lib ]]; then
+               dodir /usr/$(get_libdir)
+               mv "${ED}/usr/lib"/*.so "${ED}/usr/$(get_libdir)/" || die
+       fi
+
+       dodoc COPYRIGHT
+
+       # note: eselect-rust adds EROOT to all paths below
+       cat <<-EOF > "${T}/provider-${P}"
+               /usr/bin/rustdoc
+               /usr/bin/rust-gdb
+               /usr/bin/rust-gdbgui
+               /usr/bin/rust-lldb
+       EOF
+       echo /usr/bin/cargo >> "${T}/provider-${P}"
+       if use clippy; then
+               echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
+               echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
+       fi
+       if use miri; then
+               echo /usr/bin/miri >> "${T}/provider-${P}"
+               echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
+       fi
+       if use rls; then
+               echo /usr/bin/rls >> "${T}/provider-${P}"
+       fi
+       if use rustfmt; then
+               echo /usr/bin/rustfmt >> "${T}/provider-${P}"
+               echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
+       fi
+
+       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}."
+
+       ewarn "cargo is now installed from dev-lang/rust{,-bin} instead of dev-util/cargo."
+       ewarn "This might have resulted in a dangling symlink for /usr/bin/cargo on some"
+       ewarn "systems. This can be resolved by calling 'sudo eselect rust set ${P}'."
+
+       if has_version app-editors/emacs; 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 use elibc_musl; then
+               ewarn "${PN} on *-musl targets is configured with crt-static"
+               ewarn ""
+               ewarn "you will need to set RUSTFLAGS=\"-C target-feature=-crt-static\" in make.conf"
+               ewarn "to use it with portage, otherwise you may see failures like"
+               ewarn "error: cannot produce proc-macro for serde_derive v1.0.98 as the target "
+               ewarn "x86_64-unknown-linux-musl does not support these crate types"
+       fi
+}
+
+pkg_postrm() {
+       eselect rust cleanup
+}