summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiyang Wu <xgreenlandforwyy@gmail.com>2021-03-23 11:47:27 +0800
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2021-04-03 15:10:15 -0700
commitc8de8474d60db06f2cb98b4a06b32d09a526fb44 (patch)
treef330a6f208ddccde1707b7f782d15448b28bdb4f /dev-lang/rust-bin/rust-bin-1.48.0.ebuild
parentdev-lang/rust-bin: bump to 1.51.0 (diff)
downloadgentoo-c8de8474d60db06f2cb98b4a06b32d09a526fb44.tar.gz
gentoo-c8de8474d60db06f2cb98b4a06b32d09a526fb44.tar.bz2
gentoo-c8de8474d60db06f2cb98b4a06b32d09a526fb44.zip
dev-lang/rust-bin: change interpreter for RAP (Gentoo prefix)
Use patchelf to change interpreter to the ld.so inside prefix This fixes "GLIBC_*.*" not found bug when building with rust Package-Manager: Portage-3.0.17, Repoman-3.0.2 Closes: https://bugs.gentoo.org/739574 Closes: https://github.com/gentoo/gentoo/pull/20073 Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'dev-lang/rust-bin/rust-bin-1.48.0.ebuild')
-rw-r--r--dev-lang/rust-bin/rust-bin-1.48.0.ebuild25
1 files changed, 23 insertions, 2 deletions
diff --git a/dev-lang/rust-bin/rust-bin-1.48.0.ebuild b/dev-lang/rust-bin/rust-bin-1.48.0.ebuild
index df9fff31cfd2..79ddf1a8db57 100644
--- a/dev-lang/rust-bin/rust-bin-1.48.0.ebuild
+++ b/dev-lang/rust-bin/rust-bin-1.48.0.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-inherit bash-completion-r1 rust-toolchain toolchain-funcs multilib-minimal
+inherit bash-completion-r1 prefix rust-toolchain toolchain-funcs multilib-minimal
MY_P="rust-${PV}"
@@ -14,10 +14,11 @@ SRC_URI="$(rust_all_arch_uris ${MY_P})"
LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
SLOT="stable"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
-IUSE="clippy cpu_flags_x86_sse2 doc rls rustfmt"
+IUSE="clippy cpu_flags_x86_sse2 doc prefix rls rustfmt"
DEPEND=""
RDEPEND=">=app-eselect/eselect-rust-20190311"
+BDEPEND="prefix? ( dev-util/patchelf )"
REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
@@ -39,6 +40,16 @@ src_unpack() {
mv "${WORKDIR}/${MY_P}-$(rust_abi)" "${S}" || die
}
+patchelf_for_bin() {
+ local filetype=$(file -b ${1})
+ if [[ ${filetype} == *ELF*interpreter* ]]; then
+ einfo "${1}'s interpreter changed"
+ patchelf ${1} --set-interpreter ${2} || die
+ elif [[ ${filetype} == *script* ]]; then
+ hprefixify ${1}
+ fi
+}
+
multilib_src_install() {
if multilib_is_native_abi; then
@@ -60,6 +71,16 @@ multilib_src_install() {
--disable-ldconfig \
|| die
+ if use prefix; then
+ local interpreter=$(patchelf --print-interpreter ${EPREFIX}/bin/bash)
+ ebegin "Changing interpreter to ${interpreter} for Gentoo prefix at ${ED}/opt/${P}/bin"
+ find "${ED}/opt/${P}/bin" -type f -print0 | \
+ while IFS= read -r -d '' filename; do
+ patchelf_for_bin ${filename} ${interpreter} \; || die
+ done
+ eend $?
+ fi
+
local symlinks=(
cargo
rustc