From 24a48769f03b243065aec42c384c39a2d2306964 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 28 Feb 2023 10:03:38 +0000 Subject: gentoo auto-resync : 28:02:2023 - 10:03:37 --- dev-lang/Manifest.gz | Bin 19685 -> 19681 bytes dev-lang/rust-bin/Manifest | 6 +- dev-lang/rust-bin/rust-bin-1.65.0-r1.ebuild | 228 ++++++++++++++++++++++++++++ dev-lang/rust-bin/rust-bin-1.65.0.ebuild | 224 --------------------------- dev-lang/rust-bin/rust-bin-1.66.1-r1.ebuild | 228 ++++++++++++++++++++++++++++ dev-lang/rust-bin/rust-bin-1.66.1.ebuild | 224 --------------------------- dev-lang/rust-bin/rust-bin-1.67.1-r1.ebuild | 228 ++++++++++++++++++++++++++++ dev-lang/rust-bin/rust-bin-1.67.1.ebuild | 224 --------------------------- 8 files changed, 687 insertions(+), 675 deletions(-) create mode 100644 dev-lang/rust-bin/rust-bin-1.65.0-r1.ebuild delete mode 100644 dev-lang/rust-bin/rust-bin-1.65.0.ebuild create mode 100644 dev-lang/rust-bin/rust-bin-1.66.1-r1.ebuild delete mode 100644 dev-lang/rust-bin/rust-bin-1.66.1.ebuild create mode 100644 dev-lang/rust-bin/rust-bin-1.67.1-r1.ebuild delete mode 100644 dev-lang/rust-bin/rust-bin-1.67.1.ebuild (limited to 'dev-lang') diff --git a/dev-lang/Manifest.gz b/dev-lang/Manifest.gz index 8d6b6ac31740..de7a19e6c05f 100644 Binary files a/dev-lang/Manifest.gz and b/dev-lang/Manifest.gz differ diff --git a/dev-lang/rust-bin/Manifest b/dev-lang/rust-bin/Manifest index 97fe48a5643a..9994a99c70e3 100644 --- a/dev-lang/rust-bin/Manifest +++ b/dev-lang/rust-bin/Manifest @@ -99,7 +99,7 @@ DIST rust-1.67.1-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B b12d0ce1136e35 DIST rust-src-1.65.0.tar.xz 2488012 BLAKE2B d48f5591e72e14084f2fb0d66c1365f1648060d514af23c0498e02adfd7223b1a79bd1f512859b058f9cabc4b88b9230d15960df7c30762a5263d1785b877a68 SHA512 247f822a9c2f16d1de29d1cf6fa7ff393b7c7fe01da66a7c0b4add6259d72403922b8b1bd1b511ed8a9cc0b2c12ff574945aa7fc76c731fba620b466bcdc2eac DIST rust-src-1.66.1.tar.xz 2512096 BLAKE2B 514b8f9170d8a0e9b9deeeda27c5b83c18b7f038cb27a867fc4df1a0375b5c492793e67d0f0a2c26354ed1b58c699e1ff3e19f536dec10fc8b8211325dd4999a SHA512 3b77e29bf0803278d46aa5a484a2d74f242bf7f1ce6f5a6d1e84107630aa238620c91459f385f1b9f1bfb67c593ea5a274950a4db2975307cabc3a009b89f157 DIST rust-src-1.67.1.tar.xz 2522656 BLAKE2B 28f67cbac3d09af16f572c102890b49ffb4c610ebf379cf48ff4d0107afbb39587d2bcb7c5a4f811542f84dc3157557c762b006a6e89c54cd121d22bb677a770 SHA512 839266d2046b12954fd46f258a975a37c81cb61b6d2d9a5905fd6c83961d97c197f1b467c881d5078f3725293eb73ca402b002af3f47b6f7d431828f01d49a15 -EBUILD rust-bin-1.65.0.ebuild 6730 BLAKE2B 0f0bf58c8401dbcc858d22585a57e96988e3ee5d9dab120b4e9f955c630aa61d12e15b9deba0f4edf62a1e6c4dc869980081fa21537b014fb9cc897c3881858b SHA512 ec04fa1da0481714bf7b9d43f175f456d01eae4d70f0d914f6911bb7b809c3c133df0b614243a0f1bb0c0c2fa8345b0b6d19e269b5017cbd36252c85fdb4a176 -EBUILD rust-bin-1.66.1.ebuild 6735 BLAKE2B 05f220f65c38359a10a293a267222cd81fa6a6677b8ede598f6bd20b3b6dbdf20df73f4ca7565e5c1d83a69344b9c8e3c1ec90f755237515debfdf353e5fbfa7 SHA512 43c3fa2a22790d61d4d127e3cda68af8f78826d8e55eb84deee5becd7326835bf0a82488f68fc83a6ca8fb15b2108bd63511cd935196c9d6325db722c3e40d0a -EBUILD rust-bin-1.67.1.ebuild 6735 BLAKE2B 0f6223077f8e202f465e22b73dab3c40c73d8f57586001b639a12e597736bf15e401168b164aa946435c4229a4df24033316f7081778fa07ca3f875958784d57 SHA512 b247941e0a9697aa57c397d3af19c8ff59e4fcaece90f4772f0bb87b17d0a5b55c0eadeadf4799a60363e035aee9ca3b74e3ae78f7c7f609964d295e909b5e8d +EBUILD rust-bin-1.65.0-r1.ebuild 6793 BLAKE2B d0a58b6ef31ddb223cccdc65998038e9ff0cb4455614619de7adecc0907cca47fe4fb7d7db9d315fec00b0779530a60ad03935fca88df7c840b409c0c37e480b SHA512 7e6908661f31c2a1ea77ad3f1cc1fd729a9ebf4093296e69f39184ed95b3ee4b715de00899736d409f0aa7362b9c5b904d150e47e255cf32244fdfea28e69edf +EBUILD rust-bin-1.66.1-r1.ebuild 6798 BLAKE2B 6c814eb21abe2a4f3e3511d609e7ccc9196f49dd2d3ac060e3c8727c84258206f80173cbe6ca544f27b4fd1a32346cf6c9ba308f4d3e2abaabbdefe3051169e7 SHA512 71c77d41dd56c309b7e9103a0cd87ff54b5a9fb7ec51ea62d871041a0cb18bcc44cd98d431507339d03bcedcadc1804bb2c86637e4e5c6ba707f95b0d3b98a35 +EBUILD rust-bin-1.67.1-r1.ebuild 6798 BLAKE2B c06b46edea07c26f176fa6786e776f07732cd57f67ae8aed65c97141d146b42d4c8c1ef054c3f5f4f749f0b4bac32ce3d00910168ec927816a2e9d9d6b49aeb5 SHA512 a0c2acb403feeff3e1b543cbeb220f5bfea0339c257f200532fa5ee9cbaab15e69478c9445b8625a9169ace0fc659abd4c42cd5a72df3a0fccdbb35c47231390 MISC metadata.xml 602 BLAKE2B 8e74f441d22eeb8b276d77ed0a9c5bde01540a3f34d6053185b2be77dd9188b80c01c536f8bb18c4c60214bd0bf366a504c1f3627110a213332120b533f7ddd2 SHA512 5f120deec600c7453d503b6acb9460d1c765a567954c79749654365721b1b6fa2dd48d60d5f3fc86191e79d5f7f78d7aa1e9634e6127f333f81e546f9b0f74ac diff --git a/dev-lang/rust-bin/rust-bin-1.65.0-r1.ebuild b/dev-lang/rust-bin/rust-bin-1.65.0-r1.ebuild new file mode 100644 index 000000000000..217681fdca9e --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.65.0-r1.ebuild @@ -0,0 +1,228 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal + +MY_P="rust-${PV}" +# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src" +MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2022-11-03/rust-src-${PV}.tar.xz" +GENTOO_BIN_BASEURI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}" # omit leading slash + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" +SRC_URI="$(rust_all_arch_uris ${MY_P}) + rust-src? ( ${MY_SRC_URI} ) +" +# Keep this separate to allow easy commenting out if not yet built +SRC_URI+=" sparc? ( ${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar.xz ) " + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="stable" +KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 ~riscv ~s390 sparc x86" +IUSE="clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt" + +DEPEND="" + +RDEPEND=" + >=app-eselect/eselect-rust-20190311 + || ( + dev-libs/openssl-compat:1.1.1 + /dev/null || die + local analysis std + analysis="$(grep 'analysis' ./components)" + std="$(grep 'std' ./components)" + local components="rustc,cargo,${std}" + use doc && components="${components},rust-docs" + use clippy && components="${components},clippy-preview" + use rustfmt && components="${components},rustfmt-preview" + use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}" + # Rust component 'rust-src' is extracted from separate archive + if use rust-src; then + einfo "Combining rust and rust-src installers" + mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die + echo rust-src >> ./components || die + components="${components},rust-src" + fi + ./install.sh \ + --components="${components}" \ + --disable-verify \ + --prefix="${ED}/opt/${P}" \ + --mandir="${ED}/opt/${P}/man" \ + --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 + rustdoc + rust-gdb + rust-gdbgui + rust-lldb + ) + + use clippy && symlinks+=( clippy-driver cargo-clippy ) + use rustfmt && symlinks+=( rustfmt cargo-fmt ) + use rust-analyzer && symlinks+=( rust-analyzer ) + + einfo "installing eselect-rust symlinks and paths" + local i + for i in "${symlinks[@]}"; do + # we need realpath on /usr/bin/* symlink return version-appended binary path. + # so /usr/bin/rustc should point to /opt/rust-bin-/bin/rustc- + local ver_i="${i}-bin-${PV}" + ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}" || die + dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}" + done + + # symlinks to switch components to active rust in eselect + dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}" + dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}" + dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}" + dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}" + + # make all capital underscored variable + local CARGO_TRIPLET="$(rust_abi)" + CARGO_TRIPLET="${CARGO_TRIPLET//-/_}" + CARGO_TRIPLET="${CARGO_TRIPLET^^}" + cat <<-_EOF_ > "${T}/50${P}" + LDPATH="${EPREFIX}/usr/lib/rust/lib" + MANPATH="${EPREFIX}/usr/lib/rust/man" + $(usev elibc_musl "CARGO_TARGET_${CARGO_TRIPLET}_RUSTFLAGS=\"-C target-feature=-crt-static\"") + _EOF_ + doenvd "${T}/50${P}" + + # note: eselect-rust adds EROOT to all paths below + cat <<-_EOF_ > "${T}/provider-${P}" + /usr/bin/cargo + /usr/bin/rustdoc + /usr/bin/rust-gdb + /usr/bin/rust-gdbgui + /usr/bin/rust-lldb + /usr/lib/rustlib + /usr/lib/rust/lib + /usr/lib/rust/man + /usr/share/doc/rust + _EOF_ + + if use clippy; then + echo /usr/bin/clippy-driver >> "${T}/provider-${P}" + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" + fi + if use rustfmt; then + echo /usr/bin/rustfmt >> "${T}/provider-${P}" + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" + fi + if use rust-analyzer; then + echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" + fi + + insinto /etc/env.d/rust + doins "${T}/provider-${P}" + popd >/dev/null || die + #end native abi install + + else + local rust_target + rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))" + dodir "/opt/${P}/lib/rustlib" + cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\ + "${ED}/opt/${P}/lib/rustlib" || die + fi + + # BUG: installs x86_64 binary on other arches + rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die +} + +pkg_postinst() { + eselect rust update + + elog "Rust installs a helper script for calling GDB now," + elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}." + + if has_version app-editors/emacs; then + elog "install app-emacs/rust-mode to get emacs support for rust." + fi + + if has_version app-editors/gvim || has_version app-editors/vim; then + elog "install app-vim/rust-vim to get vim support for rust." + fi +} + +pkg_postrm() { + eselect rust cleanup +} diff --git a/dev-lang/rust-bin/rust-bin-1.65.0.ebuild b/dev-lang/rust-bin/rust-bin-1.65.0.ebuild deleted file mode 100644 index a6d5802e3a9c..000000000000 --- a/dev-lang/rust-bin/rust-bin-1.65.0.ebuild +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal - -MY_P="rust-${PV}" -# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src" -MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2022-11-03/rust-src-${PV}.tar.xz" -GENTOO_BIN_BASEURI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}" # omit leading slash - -DESCRIPTION="Systems programming language from Mozilla" -HOMEPAGE="https://www.rust-lang.org/" -SRC_URI="$(rust_all_arch_uris ${MY_P}) - rust-src? ( ${MY_SRC_URI} ) -" -# Keep this separate to allow easy commenting out if not yet built -SRC_URI+=" sparc? ( ${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar.xz ) " - -LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" -SLOT="stable" -KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 ~riscv ~s390 sparc x86" -IUSE="clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt" - -DEPEND="" - -RDEPEND=" - >=app-eselect/eselect-rust-20190311 - sys-apps/lsb-release -" - -BDEPEND=" - prefix? ( dev-util/patchelf ) - verify-sig? ( sec-keys/openpgp-keys-rust ) -" - -REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )" - -QA_PREBUILT=" - opt/${P}/bin/.* - opt/${P}/lib/.*.so - opt/${P}/libexec/.* - opt/${P}/lib/rustlib/.*/bin/.* - opt/${P}/lib/rustlib/.*/lib/.* -" - -# An rmeta file is custom binary format that contains the metadata for the crate. -# rmeta files do not support linking, since they do not contain compiled object files. -# so we can safely silence the warning for this QA check. -QA_EXECSTACK="opt/${P}/lib/rustlib/*/lib*.rlib:lib.rmeta" - -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/rust.asc" - -pkg_pretend() { - if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then - die "${CHOST} is not supported by upstream Rust. You must use a hard float version." - fi -} - -src_unpack() { - # sadly rust-src tarball does not have corresponding .asc file - # so do partial verification - if use verify-sig; then - for f in ${A}; do - if [[ -f ${DISTDIR}/${f}.asc ]]; then - verify-sig_verify_detached "${DISTDIR}/${f}" "${DISTDIR}/${f}.asc" - fi - done - fi - - default_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 - - # start native abi install - pushd "${S}" >/dev/null || die - local analysis std - analysis="$(grep 'analysis' ./components)" - std="$(grep 'std' ./components)" - local components="rustc,cargo,${std}" - use doc && components="${components},rust-docs" - use clippy && components="${components},clippy-preview" - use rustfmt && components="${components},rustfmt-preview" - use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}" - # Rust component 'rust-src' is extracted from separate archive - if use rust-src; then - einfo "Combining rust and rust-src installers" - mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die - echo rust-src >> ./components || die - components="${components},rust-src" - fi - ./install.sh \ - --components="${components}" \ - --disable-verify \ - --prefix="${ED}/opt/${P}" \ - --mandir="${ED}/opt/${P}/man" \ - --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 - rustdoc - rust-gdb - rust-gdbgui - rust-lldb - ) - - use clippy && symlinks+=( clippy-driver cargo-clippy ) - use rustfmt && symlinks+=( rustfmt cargo-fmt ) - use rust-analyzer && symlinks+=( rust-analyzer ) - - einfo "installing eselect-rust symlinks and paths" - local i - for i in "${symlinks[@]}"; do - # we need realpath on /usr/bin/* symlink return version-appended binary path. - # so /usr/bin/rustc should point to /opt/rust-bin-/bin/rustc- - local ver_i="${i}-bin-${PV}" - ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}" || die - dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}" - done - - # symlinks to switch components to active rust in eselect - dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}" - dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}" - dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}" - dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}" - - # make all capital underscored variable - local CARGO_TRIPLET="$(rust_abi)" - CARGO_TRIPLET="${CARGO_TRIPLET//-/_}" - CARGO_TRIPLET="${CARGO_TRIPLET^^}" - cat <<-_EOF_ > "${T}/50${P}" - LDPATH="${EPREFIX}/usr/lib/rust/lib" - MANPATH="${EPREFIX}/usr/lib/rust/man" - $(usev elibc_musl "CARGO_TARGET_${CARGO_TRIPLET}_RUSTFLAGS=\"-C target-feature=-crt-static\"") - _EOF_ - doenvd "${T}/50${P}" - - # note: eselect-rust adds EROOT to all paths below - cat <<-_EOF_ > "${T}/provider-${P}" - /usr/bin/cargo - /usr/bin/rustdoc - /usr/bin/rust-gdb - /usr/bin/rust-gdbgui - /usr/bin/rust-lldb - /usr/lib/rustlib - /usr/lib/rust/lib - /usr/lib/rust/man - /usr/share/doc/rust - _EOF_ - - if use clippy; then - echo /usr/bin/clippy-driver >> "${T}/provider-${P}" - echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" - fi - if use rustfmt; then - echo /usr/bin/rustfmt >> "${T}/provider-${P}" - echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" - fi - if use rust-analyzer; then - echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" - fi - - insinto /etc/env.d/rust - doins "${T}/provider-${P}" - popd >/dev/null || die - #end native abi install - - else - local rust_target - rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))" - dodir "/opt/${P}/lib/rustlib" - cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\ - "${ED}/opt/${P}/lib/rustlib" || die - fi - - # BUG: installs x86_64 binary on other arches - rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die -} - -pkg_postinst() { - eselect rust update - - elog "Rust installs a helper script for calling GDB now," - elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}." - - if has_version app-editors/emacs; then - elog "install app-emacs/rust-mode to get emacs support for rust." - fi - - if has_version app-editors/gvim || has_version app-editors/vim; then - elog "install app-vim/rust-vim to get vim support for rust." - fi -} - -pkg_postrm() { - eselect rust cleanup -} diff --git a/dev-lang/rust-bin/rust-bin-1.66.1-r1.ebuild b/dev-lang/rust-bin/rust-bin-1.66.1-r1.ebuild new file mode 100644 index 000000000000..4c965e1f5dd4 --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.66.1-r1.ebuild @@ -0,0 +1,228 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal + +MY_P="rust-${PV}" +# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src" +MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2023-01-10/rust-src-${PV}.tar.xz" +GENTOO_BIN_BASEURI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}" # omit leading slash + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" +SRC_URI="$(rust_all_arch_uris ${MY_P}) + rust-src? ( ${MY_SRC_URI} ) +" +# Keep this separate to allow easy commenting out if not yet built +SRC_URI+=" sparc? ( ${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar.xz ) " + +LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="stable" +KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86" +IUSE="clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt" + +DEPEND="" + +RDEPEND=" + >=app-eselect/eselect-rust-20190311 + || ( + dev-libs/openssl-compat:1.1.1 + /dev/null || die + local analysis std + analysis="$(grep 'analysis' ./components)" + std="$(grep 'std' ./components)" + local components="rustc,cargo,${std}" + use doc && components="${components},rust-docs" + use clippy && components="${components},clippy-preview" + use rustfmt && components="${components},rustfmt-preview" + use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}" + # Rust component 'rust-src' is extracted from separate archive + if use rust-src; then + einfo "Combining rust and rust-src installers" + mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die + echo rust-src >> ./components || die + components="${components},rust-src" + fi + ./install.sh \ + --components="${components}" \ + --disable-verify \ + --prefix="${ED}/opt/${P}" \ + --mandir="${ED}/opt/${P}/man" \ + --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 + rustdoc + rust-gdb + rust-gdbgui + rust-lldb + ) + + use clippy && symlinks+=( clippy-driver cargo-clippy ) + use rustfmt && symlinks+=( rustfmt cargo-fmt ) + use rust-analyzer && symlinks+=( rust-analyzer ) + + einfo "installing eselect-rust symlinks and paths" + local i + for i in "${symlinks[@]}"; do + # we need realpath on /usr/bin/* symlink return version-appended binary path. + # so /usr/bin/rustc should point to /opt/rust-bin-/bin/rustc- + local ver_i="${i}-bin-${PV}" + ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}" || die + dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}" + done + + # symlinks to switch components to active rust in eselect + dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}" + dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}" + dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}" + dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}" + + # make all capital underscored variable + local CARGO_TRIPLET="$(rust_abi)" + CARGO_TRIPLET="${CARGO_TRIPLET//-/_}" + CARGO_TRIPLET="${CARGO_TRIPLET^^}" + cat <<-_EOF_ > "${T}/50${P}" + LDPATH="${EPREFIX}/usr/lib/rust/lib" + MANPATH="${EPREFIX}/usr/lib/rust/man" + $(usev elibc_musl "CARGO_TARGET_${CARGO_TRIPLET}_RUSTFLAGS=\"-C target-feature=-crt-static\"") + _EOF_ + doenvd "${T}/50${P}" + + # note: eselect-rust adds EROOT to all paths below + cat <<-_EOF_ > "${T}/provider-${P}" + /usr/bin/cargo + /usr/bin/rustdoc + /usr/bin/rust-gdb + /usr/bin/rust-gdbgui + /usr/bin/rust-lldb + /usr/lib/rustlib + /usr/lib/rust/lib + /usr/lib/rust/man + /usr/share/doc/rust + _EOF_ + + if use clippy; then + echo /usr/bin/clippy-driver >> "${T}/provider-${P}" + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" + fi + if use rustfmt; then + echo /usr/bin/rustfmt >> "${T}/provider-${P}" + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" + fi + if use rust-analyzer; then + echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" + fi + + insinto /etc/env.d/rust + doins "${T}/provider-${P}" + popd >/dev/null || die + #end native abi install + + else + local rust_target + rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))" + dodir "/opt/${P}/lib/rustlib" + cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\ + "${ED}/opt/${P}/lib/rustlib" || die + fi + + # BUG: installs x86_64 binary on other arches + rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die +} + +pkg_postinst() { + eselect rust update + + elog "Rust installs a helper script for calling GDB now," + elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}." + + if has_version app-editors/emacs; then + elog "install app-emacs/rust-mode to get emacs support for rust." + fi + + if has_version app-editors/gvim || has_version app-editors/vim; then + elog "install app-vim/rust-vim to get vim support for rust." + fi +} + +pkg_postrm() { + eselect rust cleanup +} diff --git a/dev-lang/rust-bin/rust-bin-1.66.1.ebuild b/dev-lang/rust-bin/rust-bin-1.66.1.ebuild deleted file mode 100644 index 42f1cf8bc4a3..000000000000 --- a/dev-lang/rust-bin/rust-bin-1.66.1.ebuild +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal - -MY_P="rust-${PV}" -# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src" -MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2023-01-10/rust-src-${PV}.tar.xz" -GENTOO_BIN_BASEURI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}" # omit leading slash - -DESCRIPTION="Systems programming language from Mozilla" -HOMEPAGE="https://www.rust-lang.org/" -SRC_URI="$(rust_all_arch_uris ${MY_P}) - rust-src? ( ${MY_SRC_URI} ) -" -# Keep this separate to allow easy commenting out if not yet built -SRC_URI+=" sparc? ( ${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar.xz ) " - -LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA" -SLOT="stable" -KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86" -IUSE="clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt" - -DEPEND="" - -RDEPEND=" - >=app-eselect/eselect-rust-20190311 - sys-apps/lsb-release -" - -BDEPEND=" - prefix? ( dev-util/patchelf ) - verify-sig? ( sec-keys/openpgp-keys-rust ) -" - -REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )" - -QA_PREBUILT=" - opt/${P}/bin/.* - opt/${P}/lib/.*.so - opt/${P}/libexec/.* - opt/${P}/lib/rustlib/.*/bin/.* - opt/${P}/lib/rustlib/.*/lib/.* -" - -# An rmeta file is custom binary format that contains the metadata for the crate. -# rmeta files do not support linking, since they do not contain compiled object files. -# so we can safely silence the warning for this QA check. -QA_EXECSTACK="opt/${P}/lib/rustlib/*/lib*.rlib:lib.rmeta" - -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/rust.asc" - -pkg_pretend() { - if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then - die "${CHOST} is not supported by upstream Rust. You must use a hard float version." - fi -} - -src_unpack() { - # sadly rust-src tarball does not have corresponding .asc file - # so do partial verification - if use verify-sig; then - for f in ${A}; do - if [[ -f ${DISTDIR}/${f}.asc ]]; then - verify-sig_verify_detached "${DISTDIR}/${f}" "${DISTDIR}/${f}.asc" - fi - done - fi - - default_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 - - # start native abi install - pushd "${S}" >/dev/null || die - local analysis std - analysis="$(grep 'analysis' ./components)" - std="$(grep 'std' ./components)" - local components="rustc,cargo,${std}" - use doc && components="${components},rust-docs" - use clippy && components="${components},clippy-preview" - use rustfmt && components="${components},rustfmt-preview" - use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}" - # Rust component 'rust-src' is extracted from separate archive - if use rust-src; then - einfo "Combining rust and rust-src installers" - mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die - echo rust-src >> ./components || die - components="${components},rust-src" - fi - ./install.sh \ - --components="${components}" \ - --disable-verify \ - --prefix="${ED}/opt/${P}" \ - --mandir="${ED}/opt/${P}/man" \ - --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 - rustdoc - rust-gdb - rust-gdbgui - rust-lldb - ) - - use clippy && symlinks+=( clippy-driver cargo-clippy ) - use rustfmt && symlinks+=( rustfmt cargo-fmt ) - use rust-analyzer && symlinks+=( rust-analyzer ) - - einfo "installing eselect-rust symlinks and paths" - local i - for i in "${symlinks[@]}"; do - # we need realpath on /usr/bin/* symlink return version-appended binary path. - # so /usr/bin/rustc should point to /opt/rust-bin-/bin/rustc- - local ver_i="${i}-bin-${PV}" - ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}" || die - dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}" - done - - # symlinks to switch components to active rust in eselect - dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}" - dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}" - dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}" - dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}" - - # make all capital underscored variable - local CARGO_TRIPLET="$(rust_abi)" - CARGO_TRIPLET="${CARGO_TRIPLET//-/_}" - CARGO_TRIPLET="${CARGO_TRIPLET^^}" - cat <<-_EOF_ > "${T}/50${P}" - LDPATH="${EPREFIX}/usr/lib/rust/lib" - MANPATH="${EPREFIX}/usr/lib/rust/man" - $(usev elibc_musl "CARGO_TARGET_${CARGO_TRIPLET}_RUSTFLAGS=\"-C target-feature=-crt-static\"") - _EOF_ - doenvd "${T}/50${P}" - - # note: eselect-rust adds EROOT to all paths below - cat <<-_EOF_ > "${T}/provider-${P}" - /usr/bin/cargo - /usr/bin/rustdoc - /usr/bin/rust-gdb - /usr/bin/rust-gdbgui - /usr/bin/rust-lldb - /usr/lib/rustlib - /usr/lib/rust/lib - /usr/lib/rust/man - /usr/share/doc/rust - _EOF_ - - if use clippy; then - echo /usr/bin/clippy-driver >> "${T}/provider-${P}" - echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" - fi - if use rustfmt; then - echo /usr/bin/rustfmt >> "${T}/provider-${P}" - echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" - fi - if use rust-analyzer; then - echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" - fi - - insinto /etc/env.d/rust - doins "${T}/provider-${P}" - popd >/dev/null || die - #end native abi install - - else - local rust_target - rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))" - dodir "/opt/${P}/lib/rustlib" - cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\ - "${ED}/opt/${P}/lib/rustlib" || die - fi - - # BUG: installs x86_64 binary on other arches - rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die -} - -pkg_postinst() { - eselect rust update - - elog "Rust installs a helper script for calling GDB now," - elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}." - - if has_version app-editors/emacs; then - elog "install app-emacs/rust-mode to get emacs support for rust." - fi - - if has_version app-editors/gvim || has_version app-editors/vim; then - elog "install app-vim/rust-vim to get vim support for rust." - fi -} - -pkg_postrm() { - eselect rust cleanup -} diff --git a/dev-lang/rust-bin/rust-bin-1.67.1-r1.ebuild b/dev-lang/rust-bin/rust-bin-1.67.1-r1.ebuild new file mode 100644 index 000000000000..ad7fd7020f34 --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.67.1-r1.ebuild @@ -0,0 +1,228 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal + +MY_P="rust-${PV}" +# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src" +MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2023-02-09/rust-src-${PV}.tar.xz" +GENTOO_BIN_BASEURI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}" # omit leading slash + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" +SRC_URI="$(rust_all_arch_uris ${MY_P}) + rust-src? ( ${MY_SRC_URI} ) +" +# Keep this separate to allow easy commenting out if not yet built +#SRC_URI+=" sparc? ( ${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar.xz ) " + +LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="stable" +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~x86" +IUSE="clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt" + +DEPEND="" + +RDEPEND=" + >=app-eselect/eselect-rust-20190311 + || ( + dev-libs/openssl-compat:1.1.1 + /dev/null || die + local analysis std + analysis="$(grep 'analysis' ./components)" + std="$(grep 'std' ./components)" + local components="rustc,cargo,${std}" + use doc && components="${components},rust-docs" + use clippy && components="${components},clippy-preview" + use rustfmt && components="${components},rustfmt-preview" + use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}" + # Rust component 'rust-src' is extracted from separate archive + if use rust-src; then + einfo "Combining rust and rust-src installers" + mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die + echo rust-src >> ./components || die + components="${components},rust-src" + fi + ./install.sh \ + --components="${components}" \ + --disable-verify \ + --prefix="${ED}/opt/${P}" \ + --mandir="${ED}/opt/${P}/man" \ + --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 + rustdoc + rust-gdb + rust-gdbgui + rust-lldb + ) + + use clippy && symlinks+=( clippy-driver cargo-clippy ) + use rustfmt && symlinks+=( rustfmt cargo-fmt ) + use rust-analyzer && symlinks+=( rust-analyzer ) + + einfo "installing eselect-rust symlinks and paths" + local i + for i in "${symlinks[@]}"; do + # we need realpath on /usr/bin/* symlink return version-appended binary path. + # so /usr/bin/rustc should point to /opt/rust-bin-/bin/rustc- + local ver_i="${i}-bin-${PV}" + ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}" || die + dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}" + done + + # symlinks to switch components to active rust in eselect + dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}" + dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}" + dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}" + dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}" + + # make all capital underscored variable + local CARGO_TRIPLET="$(rust_abi)" + CARGO_TRIPLET="${CARGO_TRIPLET//-/_}" + CARGO_TRIPLET="${CARGO_TRIPLET^^}" + cat <<-_EOF_ > "${T}/50${P}" + LDPATH="${EPREFIX}/usr/lib/rust/lib" + MANPATH="${EPREFIX}/usr/lib/rust/man" + $(usev elibc_musl "CARGO_TARGET_${CARGO_TRIPLET}_RUSTFLAGS=\"-C target-feature=-crt-static\"") + _EOF_ + doenvd "${T}/50${P}" + + # note: eselect-rust adds EROOT to all paths below + cat <<-_EOF_ > "${T}/provider-${P}" + /usr/bin/cargo + /usr/bin/rustdoc + /usr/bin/rust-gdb + /usr/bin/rust-gdbgui + /usr/bin/rust-lldb + /usr/lib/rustlib + /usr/lib/rust/lib + /usr/lib/rust/man + /usr/share/doc/rust + _EOF_ + + if use clippy; then + echo /usr/bin/clippy-driver >> "${T}/provider-${P}" + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" + fi + if use rustfmt; then + echo /usr/bin/rustfmt >> "${T}/provider-${P}" + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" + fi + if use rust-analyzer; then + echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" + fi + + insinto /etc/env.d/rust + doins "${T}/provider-${P}" + popd >/dev/null || die + #end native abi install + + else + local rust_target + rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))" + dodir "/opt/${P}/lib/rustlib" + cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\ + "${ED}/opt/${P}/lib/rustlib" || die + fi + + # BUG: installs x86_64 binary on other arches + rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die +} + +pkg_postinst() { + eselect rust update + + elog "Rust installs a helper script for calling GDB now," + elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}." + + if has_version app-editors/emacs; then + elog "install app-emacs/rust-mode to get emacs support for rust." + fi + + if has_version app-editors/gvim || has_version app-editors/vim; then + elog "install app-vim/rust-vim to get vim support for rust." + fi +} + +pkg_postrm() { + eselect rust cleanup +} diff --git a/dev-lang/rust-bin/rust-bin-1.67.1.ebuild b/dev-lang/rust-bin/rust-bin-1.67.1.ebuild deleted file mode 100644 index d9998776c583..000000000000 --- a/dev-lang/rust-bin/rust-bin-1.67.1.ebuild +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal - -MY_P="rust-${PV}" -# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src" -MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2023-02-09/rust-src-${PV}.tar.xz" -GENTOO_BIN_BASEURI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}" # omit leading slash - -DESCRIPTION="Systems programming language from Mozilla" -HOMEPAGE="https://www.rust-lang.org/" -SRC_URI="$(rust_all_arch_uris ${MY_P}) - rust-src? ( ${MY_SRC_URI} ) -" -# Keep this separate to allow easy commenting out if not yet built -#SRC_URI+=" sparc? ( ${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar.xz ) " - -LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA" -SLOT="stable" -KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~x86" -IUSE="clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt" - -DEPEND="" - -RDEPEND=" - >=app-eselect/eselect-rust-20190311 - sys-apps/lsb-release -" - -BDEPEND=" - prefix? ( dev-util/patchelf ) - verify-sig? ( sec-keys/openpgp-keys-rust ) -" - -REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )" - -QA_PREBUILT=" - opt/${P}/bin/.* - opt/${P}/lib/.*.so - opt/${P}/libexec/.* - opt/${P}/lib/rustlib/.*/bin/.* - opt/${P}/lib/rustlib/.*/lib/.* -" - -# An rmeta file is custom binary format that contains the metadata for the crate. -# rmeta files do not support linking, since they do not contain compiled object files. -# so we can safely silence the warning for this QA check. -QA_EXECSTACK="opt/${P}/lib/rustlib/*/lib*.rlib:lib.rmeta" - -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/rust.asc" - -pkg_pretend() { - if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then - die "${CHOST} is not supported by upstream Rust. You must use a hard float version." - fi -} - -src_unpack() { - # sadly rust-src tarball does not have corresponding .asc file - # so do partial verification - if use verify-sig; then - for f in ${A}; do - if [[ -f ${DISTDIR}/${f}.asc ]]; then - verify-sig_verify_detached "${DISTDIR}/${f}" "${DISTDIR}/${f}.asc" - fi - done - fi - - default_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 - - # start native abi install - pushd "${S}" >/dev/null || die - local analysis std - analysis="$(grep 'analysis' ./components)" - std="$(grep 'std' ./components)" - local components="rustc,cargo,${std}" - use doc && components="${components},rust-docs" - use clippy && components="${components},clippy-preview" - use rustfmt && components="${components},rustfmt-preview" - use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}" - # Rust component 'rust-src' is extracted from separate archive - if use rust-src; then - einfo "Combining rust and rust-src installers" - mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die - echo rust-src >> ./components || die - components="${components},rust-src" - fi - ./install.sh \ - --components="${components}" \ - --disable-verify \ - --prefix="${ED}/opt/${P}" \ - --mandir="${ED}/opt/${P}/man" \ - --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 - rustdoc - rust-gdb - rust-gdbgui - rust-lldb - ) - - use clippy && symlinks+=( clippy-driver cargo-clippy ) - use rustfmt && symlinks+=( rustfmt cargo-fmt ) - use rust-analyzer && symlinks+=( rust-analyzer ) - - einfo "installing eselect-rust symlinks and paths" - local i - for i in "${symlinks[@]}"; do - # we need realpath on /usr/bin/* symlink return version-appended binary path. - # so /usr/bin/rustc should point to /opt/rust-bin-/bin/rustc- - local ver_i="${i}-bin-${PV}" - ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}" || die - dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}" - done - - # symlinks to switch components to active rust in eselect - dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}" - dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}" - dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}" - dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}" - - # make all capital underscored variable - local CARGO_TRIPLET="$(rust_abi)" - CARGO_TRIPLET="${CARGO_TRIPLET//-/_}" - CARGO_TRIPLET="${CARGO_TRIPLET^^}" - cat <<-_EOF_ > "${T}/50${P}" - LDPATH="${EPREFIX}/usr/lib/rust/lib" - MANPATH="${EPREFIX}/usr/lib/rust/man" - $(usev elibc_musl "CARGO_TARGET_${CARGO_TRIPLET}_RUSTFLAGS=\"-C target-feature=-crt-static\"") - _EOF_ - doenvd "${T}/50${P}" - - # note: eselect-rust adds EROOT to all paths below - cat <<-_EOF_ > "${T}/provider-${P}" - /usr/bin/cargo - /usr/bin/rustdoc - /usr/bin/rust-gdb - /usr/bin/rust-gdbgui - /usr/bin/rust-lldb - /usr/lib/rustlib - /usr/lib/rust/lib - /usr/lib/rust/man - /usr/share/doc/rust - _EOF_ - - if use clippy; then - echo /usr/bin/clippy-driver >> "${T}/provider-${P}" - echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" - fi - if use rustfmt; then - echo /usr/bin/rustfmt >> "${T}/provider-${P}" - echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" - fi - if use rust-analyzer; then - echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" - fi - - insinto /etc/env.d/rust - doins "${T}/provider-${P}" - popd >/dev/null || die - #end native abi install - - else - local rust_target - rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))" - dodir "/opt/${P}/lib/rustlib" - cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\ - "${ED}/opt/${P}/lib/rustlib" || die - fi - - # BUG: installs x86_64 binary on other arches - rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die -} - -pkg_postinst() { - eselect rust update - - elog "Rust installs a helper script for calling GDB now," - elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}." - - if has_version app-editors/emacs; then - elog "install app-emacs/rust-mode to get emacs support for rust." - fi - - if has_version app-editors/gvim || has_version app-editors/vim; then - elog "install app-vim/rust-vim to get vim support for rust." - fi -} - -pkg_postrm() { - eselect rust cleanup -} -- cgit v1.2.3