--- original/rust-1.42.0.ebuild 2020-03-19 21:58:58.436775758 -0700 +++ rust-1.42.0.ebuild 2020-03-19 21:58:58.438775758 -0700 @@ -18,7 +18,7 @@ SLOT="stable/${ABI_VER}" MY_P="rustc-${PV}" SRC="${MY_P}-src.tar.xz" - KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~x86" fi RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).1" @@ -322,6 +322,24 @@ dodoc COPYRIGHT + cat <<-EOF > "${T}"/50${P} + RUST_SRC_PATH="/usr/lib/rustlib/src/rust/src/" + CARGO_TARGET_DIR_PREFIX="/tmp/rust-build-artifacts/" + EOF + doenvd "${T}"/50${P} + + # We want gdb to automatically find the correct Rust sources + # (as installed by this ebuild). Note that automatical sourcing of + # this file requires a patched gdb. + # TODO: We should be able to use rust-gdb's + # GDB_PYTHON_MODULE_DIRECTORY instead! It's cleaner and does + # not rely on a patched gdb. + cat <<-EOF > "${T}/rust.gdb" + set substitute-path ${S}/src/ /usr/lib/rustlib/src/rust/src/ + EOF + insinto /usr/share/gdb/ + doins "${T}/rust.gdb" + # note: eselect-rust adds EROOT to all paths below cat <<-EOF > "${T}/provider-${P}" /usr/bin/rustdoc @@ -376,6 +394,11 @@ 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 + + elog + elog "In order for CARGO_TARGET_DIR_PREFIX to be set properly, please run" + elog "env-update && source /etc/profile" + elog } pkg_postrm() {