From 1ed80ee338b1a315a8f31dca05b004d39cf2fb10 Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 17 Dec 2025 17:15:19 +0000 Subject: [PATCH] dev-lang/rust: fix handling of _p* PV Closes: https://bugs.gentoo.org/967528 Signed-off-by: Sam James --- ...2.0_p1.ebuild => rust-1.92.0_p1-r1.ebuild} | 24 ++++++++--------- dev-lang/rust/rust-9999.ebuild | 26 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) rename dev-lang/rust/{rust-1.92.0_p1.ebuild => rust-1.92.0_p1-r1.ebuild} (98%) diff --git a/dev-lang/rust/rust-1.92.0_p1.ebuild b/dev-lang/rust/rust-1.92.0_p1-r1.ebuild similarity index 98% rename from dev-lang/rust/rust-1.92.0_p1.ebuild rename to dev-lang/rust/rust-1.92.0_p1-r1.ebuild index 4cabbbd188c87..2c871a58fd3dd 100644 --- a/dev-lang/rust/rust-1.92.0_p1.ebuild +++ b/dev-lang/rust/rust-1.92.0_p1-r1.ebuild @@ -19,6 +19,7 @@ PYTHON_COMPAT=( python3_{11..14} ) RUST_MAX_VER=${PV%%_*} RUST_PV=${PV%%_p*} +RUST_P=${PN}-${RUST_PV} [[ -z ${RUST_PATCH_VER} ]] && RUST_PATCH_VER=${PV} if [[ ${PV} == *9999* ]]; then @@ -781,7 +782,7 @@ src_install() { # we need realpath on /usr/bin/* symlink return version-appended binary path. # so /usr/bin/rustc should point to /usr/lib/rust//bin/rustc- # need to fix eselect-rust to remove this hack. - local ver_i="${i}-${PV%%_*}" + local ver_i="${i}-${RUST_PV}" if [[ -f "${ED}/usr/lib/${PN}/${SLOT}/bin/${i}" ]]; then einfo "Installing ${i} symlink" ln -v "${ED}/usr/lib/${PN}/${SLOT}/bin/${i}" "${ED}/usr/lib/${PN}/${SLOT}/bin/${ver_i}" || die @@ -797,9 +798,9 @@ src_install() { use rust-analyzer && dosym "${SLOT}/libexec" "/usr/lib/${PN}/libexec-${SLOT}" dosym "${SLOT}/share/man" "/usr/lib/${PN}/man-${SLOT}" dosym "rust/${SLOT}/lib/rustlib" "/usr/lib/rustlib-${SLOT}" - dosym "../../lib/${PN}/${SLOT}/share/doc/rust" "/usr/share/doc/${P}" + dosym "../../lib/${PN}/${SLOT}/share/doc/rust" "/usr/share/doc/${RUST_P}" - newenvd - "50${P}" <<-_EOF_ + newenvd - "50${RUST_P}" <<-_EOF_ MANPATH="${EPREFIX}/usr/lib/rust/man-${SLOT}" _EOF_ @@ -821,20 +822,20 @@ src_install() { _EOF_ if use clippy; then - echo /usr/bin/clippy-driver >> "${T}/provider-${P}" - echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" + echo /usr/bin/clippy-driver >> "${T}/provider-${RUST_P}" + echo /usr/bin/cargo-clippy >> "${T}/provider-${RUST_P}" fi if [[ ${SLOT} == *9999* ]] && use miri; then - echo /usr/bin/miri >> "${T}/provider-${P}" - echo /usr/bin/cargo-miri >> "${T}/provider-${P}" + echo /usr/bin/miri >> "${T}/provider-${RUST_P}" + echo /usr/bin/cargo-miri >> "${T}/provider-${RUST_P}" fi if use rustfmt; then - echo /usr/bin/rustfmt >> "${T}/provider-${P}" - echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" + echo /usr/bin/rustfmt >> "${T}/provider-${RUST_P}" + echo /usr/bin/cargo-fmt >> "${T}/provider-${RUST_P}" fi if use rust-analyzer; then - echo /usr/lib/rust/libexec >> "${T}/provider-${P}" - echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" + echo /usr/lib/rust/libexec >> "${T}/provider-${RUST_P}" + echo /usr/bin/rust-analyzer >> "${T}/provider-${RUST_P}" fi insinto /etc/env.d/rust @@ -848,7 +849,6 @@ src_install() { } pkg_postinst() { - eselect rust update if has_version dev-debug/gdb || has_version llvm-core/lldb; then diff --git a/dev-lang/rust/rust-9999.ebuild b/dev-lang/rust/rust-9999.ebuild index c0e13b75ef382..2c871a58fd3dd 100644 --- a/dev-lang/rust/rust-9999.ebuild +++ b/dev-lang/rust/rust-9999.ebuild @@ -19,11 +19,12 @@ PYTHON_COMPAT=( python3_{11..14} ) RUST_MAX_VER=${PV%%_*} RUST_PV=${PV%%_p*} +RUST_P=${PN}-${RUST_PV} [[ -z ${RUST_PATCH_VER} ]] && RUST_PATCH_VER=${PV} if [[ ${PV} == *9999* ]]; then # Update this as new `beta` releases come out. - RUST_MIN_VER="1.91.0" + RUST_MIN_VER="1.88.0" elif [[ ${PV} == *beta* ]]; then RUST_MAX_VER="$(ver_cut 1).$(ver_cut 2).0" RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0" @@ -781,7 +782,7 @@ src_install() { # we need realpath on /usr/bin/* symlink return version-appended binary path. # so /usr/bin/rustc should point to /usr/lib/rust//bin/rustc- # need to fix eselect-rust to remove this hack. - local ver_i="${i}-${PV%%_*}" + local ver_i="${i}-${RUST_PV}" if [[ -f "${ED}/usr/lib/${PN}/${SLOT}/bin/${i}" ]]; then einfo "Installing ${i} symlink" ln -v "${ED}/usr/lib/${PN}/${SLOT}/bin/${i}" "${ED}/usr/lib/${PN}/${SLOT}/bin/${ver_i}" || die @@ -797,9 +798,9 @@ src_install() { use rust-analyzer && dosym "${SLOT}/libexec" "/usr/lib/${PN}/libexec-${SLOT}" dosym "${SLOT}/share/man" "/usr/lib/${PN}/man-${SLOT}" dosym "rust/${SLOT}/lib/rustlib" "/usr/lib/rustlib-${SLOT}" - dosym "../../lib/${PN}/${SLOT}/share/doc/rust" "/usr/share/doc/${P}" + dosym "../../lib/${PN}/${SLOT}/share/doc/rust" "/usr/share/doc/${RUST_P}" - newenvd - "50${P}" <<-_EOF_ + newenvd - "50${RUST_P}" <<-_EOF_ MANPATH="${EPREFIX}/usr/lib/rust/man-${SLOT}" _EOF_ @@ -821,20 +822,20 @@ src_install() { _EOF_ if use clippy; then - echo /usr/bin/clippy-driver >> "${T}/provider-${P}" - echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" + echo /usr/bin/clippy-driver >> "${T}/provider-${RUST_P}" + echo /usr/bin/cargo-clippy >> "${T}/provider-${RUST_P}" fi if [[ ${SLOT} == *9999* ]] && use miri; then - echo /usr/bin/miri >> "${T}/provider-${P}" - echo /usr/bin/cargo-miri >> "${T}/provider-${P}" + echo /usr/bin/miri >> "${T}/provider-${RUST_P}" + echo /usr/bin/cargo-miri >> "${T}/provider-${RUST_P}" fi if use rustfmt; then - echo /usr/bin/rustfmt >> "${T}/provider-${P}" - echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" + echo /usr/bin/rustfmt >> "${T}/provider-${RUST_P}" + echo /usr/bin/cargo-fmt >> "${T}/provider-${RUST_P}" fi if use rust-analyzer; then - echo /usr/lib/rust/libexec >> "${T}/provider-${P}" - echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" + echo /usr/lib/rust/libexec >> "${T}/provider-${RUST_P}" + echo /usr/bin/rust-analyzer >> "${T}/provider-${RUST_P}" fi insinto /etc/env.d/rust @@ -848,7 +849,6 @@ src_install() { } pkg_postinst() { - eselect rust update if has_version dev-debug/gdb || has_version llvm-core/lldb; then