diff options
author | Yiyang Wu <xgreenlandforwyy@gmail.com> | 2021-03-23 11:47:27 +0800 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2021-04-03 15:10:15 -0700 |
commit | c8de8474d60db06f2cb98b4a06b32d09a526fb44 (patch) | |
tree | f330a6f208ddccde1707b7f782d15448b28bdb4f /dev-lang | |
parent | dev-lang/rust-bin: bump to 1.51.0 (diff) | |
download | gentoo-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')
-rw-r--r-- | dev-lang/rust-bin/rust-bin-1.46.0.ebuild | 25 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-1.47.0-r1.ebuild | 25 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-1.48.0.ebuild | 25 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-1.49.0.ebuild | 25 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-1.50.0.ebuild | 25 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-1.51.0.ebuild | 25 |
6 files changed, 138 insertions, 12 deletions
diff --git a/dev-lang/rust-bin/rust-bin-1.46.0.ebuild b/dev-lang/rust-bin/rust-bin-1.46.0.ebuild index afa746bd1cb9..cafc3fe08287 100644 --- a/dev-lang/rust-bin/rust-bin-1.46.0.ebuild +++ b/dev-lang/rust-bin/rust-bin-1.46.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 )" @@ -40,6 +41,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 @@ -61,6 +72,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 rustc=rustc-bin-${PV} local rustdoc=rustdoc-bin-${PV} local rustgdb=rust-gdb-bin-${PV} diff --git a/dev-lang/rust-bin/rust-bin-1.47.0-r1.ebuild b/dev-lang/rust-bin/rust-bin-1.47.0-r1.ebuild index f8a6a6b2ddbf..a700c7022ffe 100644 --- a/dev-lang/rust-bin/rust-bin-1.47.0-r1.ebuild +++ b/dev-lang/rust-bin/rust-bin-1.47.0-r1.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 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 diff --git a/dev-lang/rust-bin/rust-bin-1.49.0.ebuild b/dev-lang/rust-bin/rust-bin-1.49.0.ebuild index df9fff31cfd2..79ddf1a8db57 100644 --- a/dev-lang/rust-bin/rust-bin-1.49.0.ebuild +++ b/dev-lang/rust-bin/rust-bin-1.49.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 diff --git a/dev-lang/rust-bin/rust-bin-1.50.0.ebuild b/dev-lang/rust-bin/rust-bin-1.50.0.ebuild index 403dbcaf3fc6..137bfca5f950 100644 --- a/dev-lang/rust-bin/rust-bin-1.50.0.ebuild +++ b/dev-lang/rust-bin/rust-bin-1.50.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 )" @@ -40,6 +41,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 @@ -61,6 +72,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 diff --git a/dev-lang/rust-bin/rust-bin-1.51.0.ebuild b/dev-lang/rust-bin/rust-bin-1.51.0.ebuild index 403dbcaf3fc6..137bfca5f950 100644 --- a/dev-lang/rust-bin/rust-bin-1.51.0.ebuild +++ b/dev-lang/rust-bin/rust-bin-1.51.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 )" @@ -40,6 +41,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 @@ -61,6 +72,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 |