diff options
| author | Matt Jolly <kangie@gentoo.org> | 2025-06-04 10:23:59 +1000 |
|---|---|---|
| committer | Matt Jolly <kangie@gentoo.org> | 2025-06-04 20:13:11 +1000 |
| commit | a6799411f8d70811eb2cead969fedc95bf1d6178 (patch) | |
| tree | ef74af41fccacdb7a23e7447b343a7feba40e56d /dev-lang/rust/rust-1.86.0-r2.ebuild | |
| parent | 66031fd62c87a7e8b379ff9f0202e58815f50d7e (diff) | |
| download | gentoo-a6799411f8d70811eb2cead969fedc95bf1d6178.tar.gz gentoo-a6799411f8d70811eb2cead969fedc95bf1d6178.tar.bz2 gentoo-a6799411f8d70811eb2cead969fedc95bf1d6178.zip | |
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@gentoo.org>
Diffstat (limited to 'dev-lang/rust/rust-1.86.0-r2.ebuild')
| -rw-r--r-- | dev-lang/rust/rust-1.86.0-r2.ebuild | 92 |
1 files changed, 46 insertions, 46 deletions
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 |
