diff options
author | Georgy Yakovlev <gyakovlev@gentoo.org> | 2020-10-12 23:05:09 -0700 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2020-10-12 23:06:17 -0700 |
commit | 8bbc138c88743356486ac68aa630305c7bc43d24 (patch) | |
tree | cd1d082efae94db4f59089d90516c44a2df5071b /dev-util | |
parent | dev-libs/gost-engine: strip -Werror (diff) | |
download | gentoo-8bbc138c88743356486ac68aa630305c7bc43d24.tar.gz gentoo-8bbc138c88743356486ac68aa630305c7bc43d24.tar.bz2 gentoo-8bbc138c88743356486ac68aa630305c7bc43d24.zip |
dev-util/rustup: revbump, minor improvements
install helper script as /usr/bin/rustup-init-gentoo
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'dev-util')
-rw-r--r-- | dev-util/rustup/files/symlink_rustup.sh | 4 | ||||
-rw-r--r-- | dev-util/rustup/rustup-1.22.1-r2.ebuild (renamed from dev-util/rustup/rustup-1.22.1-r1.ebuild) | 39 | ||||
-rw-r--r-- | dev-util/rustup/rustup-9999.ebuild | 16 |
3 files changed, 39 insertions, 20 deletions
diff --git a/dev-util/rustup/files/symlink_rustup.sh b/dev-util/rustup/files/symlink_rustup.sh index 87365028843a..743072b8f96c 100644 --- a/dev-util/rustup/files/symlink_rustup.sh +++ b/dev-util/rustup/files/symlink_rustup.sh @@ -3,7 +3,8 @@ set -euo pipefail IFS=$'\n\t' -SYMLINK_RUSTUP_VERSION="0.0.2" +SYMLINK_RUSTUP_VERSION="0.0.3" + : "${CARGO_HOME:=${HOME}/.cargo}" : "${RUSTUP_HOME:=${HOME}/.rustup}" @@ -79,6 +80,7 @@ symlink_rustup() { main(){ + [[ "$EUID" -eq 0 ]] && die "Running as root is not supported" local me me="$(basename "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")" while [[ ${#} -gt 0 ]]; do diff --git a/dev-util/rustup/rustup-1.22.1-r1.ebuild b/dev-util/rustup/rustup-1.22.1-r2.ebuild index 9f951ef8aa7d..cb13c09bcf50 100644 --- a/dev-util/rustup/rustup-1.22.1-r1.ebuild +++ b/dev-util/rustup/rustup-1.22.1-r2.ebuild @@ -239,19 +239,25 @@ zeroize-1.1.0 zeroize_derive-1.0.0 " -inherit bash-completion-r1 cargo prefix - HOME_CRATE_COMMIT="a243ee2fbee6022c57d56f5aa79aefe194eabe53" +inherit bash-completion-r1 cargo prefix + DESCRIPTION="Rust toolchain installer" HOMEPAGE="https://rust-lang.github.io/rustup/" -SRC_URI="https://github.com/rust-lang/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz - https://github.com/rbtcollins/home/archive/${HOME_CRATE_COMMIT}.tar.gz -> ${P}_home_crate.tar.gz - $(cargo_crate_uris ${CRATES})" + +if [[ ${PV} == "9999" ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/rust-lang/${PN}.git" +else + SRC_URI="https://github.com/rust-lang/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz + https://github.com/rbtcollins/home/archive/${HOME_CRATE_COMMIT}.tar.gz -> ${P}_home_crate.tar.gz + $(cargo_crate_uris ${CRATES})" + KEYWORDS="~amd64 ~arm64 ~ppc64" +fi LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 CC0-1.0 MIT Unlicense ZLIB" SLOT="0" -KEYWORDS="~amd64 ~arm64 ~ppc64" IUSE="" # requires old libressl-2.5, so openssl only for now. @@ -274,6 +280,15 @@ src_prepare() { sed -i "/^home =/s:.*:home = { path = \"../home-${HOME_CRATE_COMMIT}\" }:" Cargo.toml || die } +src_unpack() { + if [[ "${PV}" == *9999* ]]; then + git-r3_src_unpack + cargo_live_src_unpack + else + cargo_src_unpack + fi +} + src_configure() { local myfeatures=( no-self-update ) cargo_src_configure @@ -287,8 +302,7 @@ src_compile() { src_install() { cargo_src_install einstalldocs - exeinto /usr/share/rustup - newexe "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" symlink_rustup + newbin "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" rustup-init-gentoo ln -s "${ED}/usr/bin/rustup-init" rustup || die ./rustup completions bash rustup > "${T}/rustup" || die @@ -302,9 +316,10 @@ src_install() { pkg_postinst() { einfo "No rustup toolchains installed by default" - einfo "system rust toolchain can be added to rustup by running" - einfo "helper script installed to ${EPREFIX}/usr/share/rustup/symlink_rustup" - einfo "it will create proper symlinks in user home directory" + einfo "eselect activated system rust toolchain can be added to rustup by running" + einfo "helper script installed as ${EPREFIX}/usr/bin/rustup-init-gentoo" + einfo "it will create symlinks to system-installed rustup in home directory" einfo "and rustup updates will be managed by portage" - einfo "please delete current rustup installation (if any) before running the script" + einfo "please delete current rustup binaries from ~/.cargo/bin/ (if any)" + einfo "before running rustup-init-gentoo" } diff --git a/dev-util/rustup/rustup-9999.ebuild b/dev-util/rustup/rustup-9999.ebuild index 5db8a446ae65..ccdc91c9c6bc 100644 --- a/dev-util/rustup/rustup-9999.ebuild +++ b/dev-util/rustup/rustup-9999.ebuild @@ -3,7 +3,8 @@ EAPI=7 -CRATES="" +CRATES=" +" inherit bash-completion-r1 cargo prefix @@ -23,6 +24,7 @@ LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 CC0-1.0 MIT Un SLOT="0" IUSE="" +# requires old libressl-2.5, so openssl only for now. DEPEND=" app-arch/xz-utils net-misc/curl:=[http2,ssl] @@ -58,8 +60,7 @@ src_compile() { src_install() { cargo_src_install einstalldocs - exeinto /usr/share/rustup - newexe "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" symlink_rustup + newbin "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" rustup-init-gentoo ln -s "${ED}/usr/bin/rustup-init" rustup || die ./rustup completions bash rustup > "${T}/rustup" || die @@ -73,9 +74,10 @@ src_install() { pkg_postinst() { einfo "No rustup toolchains installed by default" - einfo "system rust toolchain can be added to rustup by running" - einfo "helper script installed to ${EPREFIX}/usr/share/rustup/symlink_rustup" - einfo "it will create proper symlinks in user home directory" + einfo "eselect activated system rust toolchain can be added to rustup by running" + einfo "helper script installed as ${EPREFIX}/usr/bin/rustup-init-gentoo" + einfo "it will create symlinks to system-installed rustup in home directory" einfo "and rustup updates will be managed by portage" - einfo "please delete current rustup installation (if any) before running the script" + einfo "please delete current rustup binaries from ~/.cargo/bin/ (if any)" + einfo "before running rustup-init-gentoo" } |