commit:     a6799411f8d70811eb2cead969fedc95bf1d6178
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 00:23:59 2025 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Wed Jun  4 10:13:11 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6799411

dev-lang/rust: move src_unpack for consistency

When adding / updating `src_unpack` to handle verify-sig and (our) patch
tarballs, it was placed in its correct "position" in most ebuilds, however
these ebuilds were not updated at the time.

Ensure that all rust ebuilds have `src_unpack` immediately before `src_prepare`.

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 dev-lang/rust/rust-1.85.0-r2.ebuild | 92 ++++++++++++++++++-------------------
 dev-lang/rust/rust-1.85.1-r1.ebuild | 92 ++++++++++++++++++-------------------
 dev-lang/rust/rust-1.86.0-r2.ebuild | 92 ++++++++++++++++++-------------------
 dev-lang/rust/rust-1.87.0-r1.ebuild | 92 ++++++++++++++++++-------------------
 4 files changed, 184 insertions(+), 184 deletions(-)

diff --git a/dev-lang/rust/rust-1.85.0-r2.ebuild 
b/dev-lang/rust/rust-1.85.0-r2.ebuild
index 1b324dac1ca9..08f658a882e7 100644
--- a/dev-lang/rust/rust-1.85.0-r2.ebuild
+++ b/dev-lang/rust/rust-1.85.0-r2.ebuild
@@ -182,52 +182,6 @@ toml_usex() {
        usex "${1}" true false
 }
 
-src_unpack() {
-       if [[ ${PV} = *9999* ]]; then
-               git-r3_src_unpack
-               mkdir "${S}/.cargo" || die # The vendor script has a check for 
.cargo/config{,.toml}
-               touch "${S}/.cargo/config.toml" || die
-               local rust_stage0_root="$(${RUSTC} --print sysroot || die 
"Can't determine rust's sysroot")"
-               local rust_build=""
-               local rust_host=""
-               # Configure vendor to use the portage-provided toolchain. This 
prevents it from
-               # attempting to fetch a `beta` toolchain from the internet.
-               cat <<- _EOF_ > "${T}/vendor-config.toml"
-                       [build]
-                       build = "$(rust_abi "${CBUILD}")"
-                       host = ["$(rust_abi "${CHOST}")"]
-                       target = ["$(rust_abi "${CHOST}")"]
-                       cargo = "${rust_stage0_root}/bin/cargo"
-                       rustc = "${rust_stage0_root}/bin/rustc"
-                       rustfmt = "${rust_stage0_root}/bin/rustfmt"
-               _EOF_
-               # We're using git sources so we need to run the Vendor script
-               # to ensure that all dependencies are present and up-to-date
-               mkdir "${S}/vendor" || die
-               # This also compiles the 'build helper', there's no way to 
avoid this.
-               ${EPYTHON} "${S}"/x.py vendor -v 
--config="${T}"/vendor-config.toml -j$(makeopts_jobs) ||
-                       die "Failed to vendor dependencies"
-               # TODO: This has to be generated somehow, this is from a 1.84.x 
tarball I had lying around.
-               cat <<- _EOF_ > "${S}/.cargo/config.toml"
-                       [source.crates-io]
-                       replace-with = "vendored-sources"
-
-                       [source."git+https://github.com/rust-lang/team";]
-                       git = "https://github.com/rust-lang/team";
-                       replace-with = "vendored-sources"
-
-                       [source.vendored-sources]
-                       directory = "vendor"
-               _EOF_
-       elif use verify-sig ; then
-               # Patch tarballs are not signed (but we trust Gentoo infra)
-               verify-sig_verify_detached 
"${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc}
-               default
-       else
-               default
-       fi
-}
-
 pre_build_checks() {
        local M=9216
        # multiply requirements by 1.3 if we are doing x86-multilib
@@ -300,6 +254,52 @@ pkg_setup() {
        fi
 }
 
+src_unpack() {
+       if [[ ${PV} = *9999* ]]; then
+               git-r3_src_unpack
+               mkdir "${S}/.cargo" || die # The vendor script has a check for 
.cargo/config{,.toml}
+               touch "${S}/.cargo/config.toml" || die
+               local rust_stage0_root="$(${RUSTC} --print sysroot || die 
"Can't determine rust's sysroot")"
+               local rust_build=""
+               local rust_host=""
+               # Configure vendor to use the portage-provided toolchain. This 
prevents it from
+               # attempting to fetch a `beta` toolchain from the internet.
+               cat <<- _EOF_ > "${T}/vendor-config.toml"
+                       [build]
+                       build = "$(rust_abi "${CBUILD}")"
+                       host = ["$(rust_abi "${CHOST}")"]
+                       target = ["$(rust_abi "${CHOST}")"]
+                       cargo = "${rust_stage0_root}/bin/cargo"
+                       rustc = "${rust_stage0_root}/bin/rustc"
+                       rustfmt = "${rust_stage0_root}/bin/rustfmt"
+               _EOF_
+               # We're using git sources so we need to run the Vendor script
+               # to ensure that all dependencies are present and up-to-date
+               mkdir "${S}/vendor" || die
+               # This also compiles the 'build helper', there's no way to 
avoid this.
+               ${EPYTHON} "${S}"/x.py vendor -v 
--config="${T}"/vendor-config.toml -j$(makeopts_jobs) ||
+                       die "Failed to vendor dependencies"
+               # TODO: This has to be generated somehow, this is from a 1.84.x 
tarball I had lying around.
+               cat <<- _EOF_ > "${S}/.cargo/config.toml"
+                       [source.crates-io]
+                       replace-with = "vendored-sources"
+
+                       [source."git+https://github.com/rust-lang/team";]
+                       git = "https://github.com/rust-lang/team";
+                       replace-with = "vendored-sources"
+
+                       [source.vendored-sources]
+                       directory = "vendor"
+               _EOF_
+       elif use verify-sig ; then
+               # Patch tarballs are not signed (but we trust Gentoo infra)
+               verify-sig_verify_detached 
"${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc}
+               default
+       else
+               default
+       fi
+}
+
 src_prepare() {
        if [[ ${PV} = *9999* ]]; then
                # We need to update / generate lockfiles for the workspace

diff --git a/dev-lang/rust/rust-1.85.1-r1.ebuild 
b/dev-lang/rust/rust-1.85.1-r1.ebuild
index b4b88abc8398..229c825cfa66 100644
--- a/dev-lang/rust/rust-1.85.1-r1.ebuild
+++ b/dev-lang/rust/rust-1.85.1-r1.ebuild
@@ -182,52 +182,6 @@ toml_usex() {
        usex "${1}" true false
 }
 
-src_unpack() {
-       if [[ ${PV} = *9999* ]]; then
-               git-r3_src_unpack
-               mkdir "${S}/.cargo" || die # The vendor script has a check for 
.cargo/config{,.toml}
-               touch "${S}/.cargo/config.toml" || die
-               local rust_stage0_root="$(${RUSTC} --print sysroot || die 
"Can't determine rust's sysroot")"
-               local rust_build=""
-               local rust_host=""
-               # Configure vendor to use the portage-provided toolchain. This 
prevents it from
-               # attempting to fetch a `beta` toolchain from the internet.
-               cat <<- _EOF_ > "${T}/vendor-config.toml"
-                       [build]
-                       build = "$(rust_abi "${CBUILD}")"
-                       host = ["$(rust_abi "${CHOST}")"]
-                       target = ["$(rust_abi "${CHOST}")"]
-                       cargo = "${rust_stage0_root}/bin/cargo"
-                       rustc = "${rust_stage0_root}/bin/rustc"
-                       rustfmt = "${rust_stage0_root}/bin/rustfmt"
-               _EOF_
-               # We're using git sources so we need to run the Vendor script
-               # to ensure that all dependencies are present and up-to-date
-               mkdir "${S}/vendor" || die
-               # This also compiles the 'build helper', there's no way to 
avoid this.
-               ${EPYTHON} "${S}"/x.py vendor -v 
--config="${T}"/vendor-config.toml -j$(makeopts_jobs) ||
-                       die "Failed to vendor dependencies"
-               # TODO: This has to be generated somehow, this is from a 1.84.x 
tarball I had lying around.
-               cat <<- _EOF_ > "${S}/.cargo/config.toml"
-                       [source.crates-io]
-                       replace-with = "vendored-sources"
-
-                       [source."git+https://github.com/rust-lang/team";]
-                       git = "https://github.com/rust-lang/team";
-                       replace-with = "vendored-sources"
-
-                       [source.vendored-sources]
-                       directory = "vendor"
-               _EOF_
-       elif use verify-sig ; then
-               # Patch tarballs are not signed (but we trust Gentoo infra)
-               verify-sig_verify_detached 
"${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc}
-               default
-       else
-               default
-       fi
-}
-
 pre_build_checks() {
        local M=9216
        # multiply requirements by 1.3 if we are doing x86-multilib
@@ -300,6 +254,52 @@ pkg_setup() {
        fi
 }
 
+src_unpack() {
+       if [[ ${PV} = *9999* ]]; then
+               git-r3_src_unpack
+               mkdir "${S}/.cargo" || die # The vendor script has a check for 
.cargo/config{,.toml}
+               touch "${S}/.cargo/config.toml" || die
+               local rust_stage0_root="$(${RUSTC} --print sysroot || die 
"Can't determine rust's sysroot")"
+               local rust_build=""
+               local rust_host=""
+               # Configure vendor to use the portage-provided toolchain. This 
prevents it from
+               # attempting to fetch a `beta` toolchain from the internet.
+               cat <<- _EOF_ > "${T}/vendor-config.toml"
+                       [build]
+                       build = "$(rust_abi "${CBUILD}")"
+                       host = ["$(rust_abi "${CHOST}")"]
+                       target = ["$(rust_abi "${CHOST}")"]
+                       cargo = "${rust_stage0_root}/bin/cargo"
+                       rustc = "${rust_stage0_root}/bin/rustc"
+                       rustfmt = "${rust_stage0_root}/bin/rustfmt"
+               _EOF_
+               # We're using git sources so we need to run the Vendor script
+               # to ensure that all dependencies are present and up-to-date
+               mkdir "${S}/vendor" || die
+               # This also compiles the 'build helper', there's no way to 
avoid this.
+               ${EPYTHON} "${S}"/x.py vendor -v 
--config="${T}"/vendor-config.toml -j$(makeopts_jobs) ||
+                       die "Failed to vendor dependencies"
+               # TODO: This has to be generated somehow, this is from a 1.84.x 
tarball I had lying around.
+               cat <<- _EOF_ > "${S}/.cargo/config.toml"
+                       [source.crates-io]
+                       replace-with = "vendored-sources"
+
+                       [source."git+https://github.com/rust-lang/team";]
+                       git = "https://github.com/rust-lang/team";
+                       replace-with = "vendored-sources"
+
+                       [source.vendored-sources]
+                       directory = "vendor"
+               _EOF_
+       elif use verify-sig ; then
+               # Patch tarballs are not signed (but we trust Gentoo infra)
+               verify-sig_verify_detached 
"${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc}
+               default
+       else
+               default
+       fi
+}
+
 src_prepare() {
        if [[ ${PV} = *9999* ]]; then
                # We need to update / generate lockfiles for the workspace

diff --git a/dev-lang/rust/rust-1.86.0-r2.ebuild 
b/dev-lang/rust/rust-1.86.0-r2.ebuild
index 47274a631639..4ea28cc34213 100644
--- a/dev-lang/rust/rust-1.86.0-r2.ebuild
+++ b/dev-lang/rust/rust-1.86.0-r2.ebuild
@@ -183,52 +183,6 @@ toml_usex() {
        usex "${1}" true false
 }
 
-src_unpack() {
-       if [[ ${PV} = *9999* ]]; then
-               git-r3_src_unpack
-               mkdir "${S}/.cargo" || die # The vendor script has a check for 
.cargo/config{,.toml}
-               touch "${S}/.cargo/config.toml" || die
-               local rust_stage0_root="$(${RUSTC} --print sysroot || die 
"Can't determine rust's sysroot")"
-               local rust_build=""
-               local rust_host=""
-               # Configure vendor to use the portage-provided toolchain. This 
prevents it from
-               # attempting to fetch a `beta` toolchain from the internet.
-               cat <<- _EOF_ > "${T}/vendor-config.toml"
-                       [build]
-                       build = "$(rust_abi "${CBUILD}")"
-                       host = ["$(rust_abi "${CHOST}")"]
-                       target = ["$(rust_abi "${CHOST}")"]
-                       cargo = "${rust_stage0_root}/bin/cargo"
-                       rustc = "${rust_stage0_root}/bin/rustc"
-                       rustfmt = "${rust_stage0_root}/bin/rustfmt"
-               _EOF_
-               # We're using git sources so we need to run the Vendor script
-               # to ensure that all dependencies are present and up-to-date
-               mkdir "${S}/vendor" || die
-               # This also compiles the 'build helper', there's no way to 
avoid this.
-               ${EPYTHON} "${S}"/x.py vendor -v 
--config="${T}"/vendor-config.toml -j$(makeopts_jobs) ||
-                       die "Failed to vendor dependencies"
-               # TODO: This has to be generated somehow, this is from a 1.84.x 
tarball I had lying around.
-               cat <<- _EOF_ > "${S}/.cargo/config.toml"
-                       [source.crates-io]
-                       replace-with = "vendored-sources"
-
-                       [source."git+https://github.com/rust-lang/team";]
-                       git = "https://github.com/rust-lang/team";
-                       replace-with = "vendored-sources"
-
-                       [source.vendored-sources]
-                       directory = "vendor"
-               _EOF_
-       elif use verify-sig ; then
-               # Patch tarballs are not signed (but we trust Gentoo infra)
-               verify-sig_verify_detached 
"${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc}
-               default
-       else
-               default
-       fi
-}
-
 pre_build_checks() {
        local M=9216
        # multiply requirements by 1.3 if we are doing x86-multilib
@@ -301,6 +255,52 @@ pkg_setup() {
        fi
 }
 
+src_unpack() {
+       if [[ ${PV} = *9999* ]]; then
+               git-r3_src_unpack
+               mkdir "${S}/.cargo" || die # The vendor script has a check for 
.cargo/config{,.toml}
+               touch "${S}/.cargo/config.toml" || die
+               local rust_stage0_root="$(${RUSTC} --print sysroot || die 
"Can't determine rust's sysroot")"
+               local rust_build=""
+               local rust_host=""
+               # Configure vendor to use the portage-provided toolchain. This 
prevents it from
+               # attempting to fetch a `beta` toolchain from the internet.
+               cat <<- _EOF_ > "${T}/vendor-config.toml"
+                       [build]
+                       build = "$(rust_abi "${CBUILD}")"
+                       host = ["$(rust_abi "${CHOST}")"]
+                       target = ["$(rust_abi "${CHOST}")"]
+                       cargo = "${rust_stage0_root}/bin/cargo"
+                       rustc = "${rust_stage0_root}/bin/rustc"
+                       rustfmt = "${rust_stage0_root}/bin/rustfmt"
+               _EOF_
+               # We're using git sources so we need to run the Vendor script
+               # to ensure that all dependencies are present and up-to-date
+               mkdir "${S}/vendor" || die
+               # This also compiles the 'build helper', there's no way to 
avoid this.
+               ${EPYTHON} "${S}"/x.py vendor -v 
--config="${T}"/vendor-config.toml -j$(makeopts_jobs) ||
+                       die "Failed to vendor dependencies"
+               # TODO: This has to be generated somehow, this is from a 1.84.x 
tarball I had lying around.
+               cat <<- _EOF_ > "${S}/.cargo/config.toml"
+                       [source.crates-io]
+                       replace-with = "vendored-sources"
+
+                       [source."git+https://github.com/rust-lang/team";]
+                       git = "https://github.com/rust-lang/team";
+                       replace-with = "vendored-sources"
+
+                       [source.vendored-sources]
+                       directory = "vendor"
+               _EOF_
+       elif use verify-sig ; then
+               # Patch tarballs are not signed (but we trust Gentoo infra)
+               verify-sig_verify_detached 
"${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc}
+               default
+       else
+               default
+       fi
+}
+
 src_prepare() {
        if [[ ${PV} = *9999* ]]; then
                # We need to update / generate lockfiles for the workspace

diff --git a/dev-lang/rust/rust-1.87.0-r1.ebuild 
b/dev-lang/rust/rust-1.87.0-r1.ebuild
index b1d86a75ce62..fdd3861b1382 100644
--- a/dev-lang/rust/rust-1.87.0-r1.ebuild
+++ b/dev-lang/rust/rust-1.87.0-r1.ebuild
@@ -184,52 +184,6 @@ toml_usex() {
        usex "${1}" true false
 }
 
-src_unpack() {
-       if [[ ${PV} = *9999* ]]; then
-               git-r3_src_unpack
-               mkdir "${S}/.cargo" || die # The vendor script has a check for 
.cargo/config{,.toml}
-               touch "${S}/.cargo/config.toml" || die
-               local rust_stage0_root="$(${RUSTC} --print sysroot || die 
"Can't determine rust's sysroot")"
-               local rust_build=""
-               local rust_host=""
-               # Configure vendor to use the portage-provided toolchain. This 
prevents it from
-               # attempting to fetch a `beta` toolchain from the internet.
-               cat <<- _EOF_ > "${T}/vendor-config.toml"
-                       [build]
-                       build = "$(rust_abi "${CBUILD}")"
-                       host = ["$(rust_abi "${CHOST}")"]
-                       target = ["$(rust_abi "${CHOST}")"]
-                       cargo = "${rust_stage0_root}/bin/cargo"
-                       rustc = "${rust_stage0_root}/bin/rustc"
-                       rustfmt = "${rust_stage0_root}/bin/rustfmt"
-               _EOF_
-               # We're using git sources so we need to run the Vendor script
-               # to ensure that all dependencies are present and up-to-date
-               mkdir "${S}/vendor" || die
-               # This also compiles the 'build helper', there's no way to 
avoid this.
-               ${EPYTHON} "${S}"/x.py vendor -v 
--config="${T}"/vendor-config.toml -j$(makeopts_jobs) ||
-                       die "Failed to vendor dependencies"
-               # TODO: This has to be generated somehow, this is from a 1.84.x 
tarball I had lying around.
-               cat <<- _EOF_ > "${S}/.cargo/config.toml"
-                       [source.crates-io]
-                       replace-with = "vendored-sources"
-
-                       [source."git+https://github.com/rust-lang/team";]
-                       git = "https://github.com/rust-lang/team";
-                       replace-with = "vendored-sources"
-
-                       [source.vendored-sources]
-                       directory = "vendor"
-               _EOF_
-       elif use verify-sig ; then
-               # Patch tarballs are not signed (but we trust Gentoo infra)
-               verify-sig_verify_detached 
"${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc}
-               default
-       else
-               default
-       fi
-}
-
 pre_build_checks() {
        local M=9216
        # multiply requirements by 1.3 if we are doing x86-multilib
@@ -302,6 +256,52 @@ pkg_setup() {
        fi
 }
 
+src_unpack() {
+       if [[ ${PV} = *9999* ]]; then
+               git-r3_src_unpack
+               mkdir "${S}/.cargo" || die # The vendor script has a check for 
.cargo/config{,.toml}
+               touch "${S}/.cargo/config.toml" || die
+               local rust_stage0_root="$(${RUSTC} --print sysroot || die 
"Can't determine rust's sysroot")"
+               local rust_build=""
+               local rust_host=""
+               # Configure vendor to use the portage-provided toolchain. This 
prevents it from
+               # attempting to fetch a `beta` toolchain from the internet.
+               cat <<- _EOF_ > "${T}/vendor-config.toml"
+                       [build]
+                       build = "$(rust_abi "${CBUILD}")"
+                       host = ["$(rust_abi "${CHOST}")"]
+                       target = ["$(rust_abi "${CHOST}")"]
+                       cargo = "${rust_stage0_root}/bin/cargo"
+                       rustc = "${rust_stage0_root}/bin/rustc"
+                       rustfmt = "${rust_stage0_root}/bin/rustfmt"
+               _EOF_
+               # We're using git sources so we need to run the Vendor script
+               # to ensure that all dependencies are present and up-to-date
+               mkdir "${S}/vendor" || die
+               # This also compiles the 'build helper', there's no way to 
avoid this.
+               ${EPYTHON} "${S}"/x.py vendor -v 
--config="${T}"/vendor-config.toml -j$(makeopts_jobs) ||
+                       die "Failed to vendor dependencies"
+               # TODO: This has to be generated somehow, this is from a 1.84.x 
tarball I had lying around.
+               cat <<- _EOF_ > "${S}/.cargo/config.toml"
+                       [source.crates-io]
+                       replace-with = "vendored-sources"
+
+                       [source."git+https://github.com/rust-lang/team";]
+                       git = "https://github.com/rust-lang/team";
+                       replace-with = "vendored-sources"
+
+                       [source.vendored-sources]
+                       directory = "vendor"
+               _EOF_
+       elif use verify-sig ; then
+               # Patch tarballs are not signed (but we trust Gentoo infra)
+               verify-sig_verify_detached 
"${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc}
+               default
+       else
+               default
+       fi
+}
+
 src_prepare() {
        if [[ ${PV} = *9999* ]]; then
                # We need to update / generate lockfiles for the workspace

Reply via email to