* [gentoo-commits] repo/gentoo:master commit in: dev-util/rustup/files/, dev-util/rustup/
@ 2020-09-09 22:13 Georgy Yakovlev
0 siblings, 0 replies; 2+ messages in thread
From: Georgy Yakovlev @ 2020-09-09 22:13 UTC (permalink / raw
To: gentoo-commits
commit: 6456b69dbade96dc014e4eb4d7000e8012e75e6f
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 9 18:59:47 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Wed Sep 9 22:13:07 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6456b69d
dev-util/rustup: revbump, remove libressl, update helper script
Closes: https://bugs.gentoo.org/741450
Package-Manager: Portage-3.0.6, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
dev-util/rustup/files/symlink_rustup.sh | 26 ++++++++++++++--------
...ustup-1.22.1.ebuild => rustup-1.22.1-r1.ebuild} | 10 ++++-----
2 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/dev-util/rustup/files/symlink_rustup.sh b/dev-util/rustup/files/symlink_rustup.sh
index 529a71a1322..87365028843 100644
--- a/dev-util/rustup/files/symlink_rustup.sh
+++ b/dev-util/rustup/files/symlink_rustup.sh
@@ -1,9 +1,9 @@
-#!/bin/bash
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
set -euo pipefail
IFS=$'\n\t'
-SYMLINK_RUSTUP_VERSION="0.0.1"
+SYMLINK_RUSTUP_VERSION="0.0.2"
: "${CARGO_HOME:=${HOME}/.cargo}"
: "${RUSTUP_HOME:=${HOME}/.rustup}"
@@ -37,6 +37,7 @@ help() {
echo " ${CARGO_HOME}"
echo
echo "Options:"
+ echo " -a, --apply Apply changes (required)"
echo " -C, --nocolor Disable colored output"
echo " -d, --debug Debug mode (sets -x shell option)"
echo " -V, --version Print version number"
@@ -52,7 +53,7 @@ symlink_rustup() {
rust{c,doc,fmt,-gdb,-lldb,up}
)
- binpath="${EPREFIX:-}/usr/bin/rustup-init"
+ binpath="@GENTOO_PORTAGE_EPREFIX@/usr/bin/rustup-init"
gentoo_rust="$(eselect --brief rust show 2>/dev/null)"
mkdir -p "${CARGO_HOME}/bin" || die
@@ -62,15 +63,15 @@ symlink_rustup() {
if [[ -e "${symlink_path}" ]]; then
die "${symlink_path} ${__err_exists}"
else
- ln -sv "${binpath}" "${symlink_path}" || die
+ ln -s ${QUIET--v} "${binpath}" "${symlink_path}" || die
fi
done
good "Setting gentoo ${gentoo_rust// /} as default toolchain"
- "${CARGO_HOME}/bin/rustup" -v toolchain link gentoo "${EPREFIX:-}/usr" || die
- "${CARGO_HOME}/bin/rustup" -v default gentoo || die
- "${CARGO_HOME}/bin/rustup" -V || die
- "${CARGO_HOME}/bin/rustup" show || die
+ [[ ${QUIET+set} != set ]] && "${CARGO_HOME}/bin/rustup" -V
+ "${CARGO_HOME}/bin/rustup" ${QUIET--v} toolchain link gentoo "/usr"
+ "${CARGO_HOME}/bin/rustup" ${QUIET--v} default gentoo
+ [[ ${QUIET+set} != set ]] && "${CARGO_HOME}/bin/rustup" show
good "Prepend ${CARGO_HOME}/bin to your PATH to use rustup"
good "rustup selfupdate is disabled, it will be updated by portage"
@@ -82,6 +83,9 @@ main(){
me="$(basename "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")"
while [[ ${#} -gt 0 ]]; do
case ${1} in
+ -a|--apply)
+ APPLY=true
+ ;;
-h|--help)
help
exit 0
@@ -106,7 +110,11 @@ main(){
esac
shift
done
- symlink_rustup
+ if [[ ${APPLY:-false} == true ]]; then
+ symlink_rustup
+ else
+ help
+ fi
} # main()
diff --git a/dev-util/rustup/rustup-1.22.1.ebuild b/dev-util/rustup/rustup-1.22.1-r1.ebuild
similarity index 96%
rename from dev-util/rustup/rustup-1.22.1.ebuild
rename to dev-util/rustup/rustup-1.22.1-r1.ebuild
index 6b91f916003..fa40b7f0082 100644
--- a/dev-util/rustup/rustup-1.22.1.ebuild
+++ b/dev-util/rustup/rustup-1.22.1-r1.ebuild
@@ -239,7 +239,7 @@ zeroize-1.1.0
zeroize_derive-1.0.0
"
-inherit bash-completion-r1 cargo
+inherit bash-completion-r1 cargo prefix
HOME_CRATE_COMMIT="a243ee2fbee6022c57d56f5aa79aefe194eabe53"
@@ -252,13 +252,13 @@ SRC_URI="https://github.com/rust-lang/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 CC0-1.0 MIT Unlicense ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~ppc64"
-IUSE="libressl"
+IUSE=""
+# requires old libressl-2.5, so openssl only for now.
DEPEND="
app-arch/xz-utils
net-misc/curl:=[http2,ssl]
- !libressl? ( dev-libs/openssl:0= )
- libressl? ( dev-libs/libressl:0= )
+ dev-libs/openssl:0=
"
RDEPEND="${DEPEND}"
BDEPEND="virtual/rust"
@@ -283,7 +283,7 @@ src_install() {
cargo_src_install --features no-self-update
einstalldocs
exeinto /usr/share/rustup
- newexe "${FILESDIR}/symlink_rustup.sh" symlink_rustup
+ newexe "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" symlink_rustup
ln -s "${ED}/usr/bin/rustup-init" rustup || die
./rustup completions bash rustup > "${T}/rustup" || die
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rustup/files/, dev-util/rustup/
@ 2022-09-24 4:13 Georgy Yakovlev
0 siblings, 0 replies; 2+ messages in thread
From: Georgy Yakovlev @ 2022-09-24 4:13 UTC (permalink / raw
To: gentoo-commits
commit: d83b20802b8b432ee79c666c772c60f07ae2424c
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 24 03:03:59 2022 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sat Sep 24 04:13:19 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d83b2080
dev-util/rustup: revbump, add rust-analyzer, add unsymlink support
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
dev-util/rustup/files/symlink_rustup.sh | 63 +++++++++++++++++-----
...ustup-1.25.1.ebuild => rustup-1.25.1-r1.ebuild} | 0
2 files changed, 51 insertions(+), 12 deletions(-)
diff --git a/dev-util/rustup/files/symlink_rustup.sh b/dev-util/rustup/files/symlink_rustup.sh
index 743072b8f96c..8ab6608686fc 100644
--- a/dev-util/rustup/files/symlink_rustup.sh
+++ b/dev-util/rustup/files/symlink_rustup.sh
@@ -3,13 +3,13 @@
set -euo pipefail
IFS=$'\n\t'
-SYMLINK_RUSTUP_VERSION="0.0.3"
-
+SYMLINK_RUSTUP_VERSION="0.0.4"
+binpath="@GENTOO_PORTAGE_EPREFIX@/usr/bin/rustup-init"
: "${CARGO_HOME:=${HOME}/.cargo}"
: "${RUSTUP_HOME:=${HOME}/.rustup}"
-__err_exists="already exists, remove and re-run the script"
+__err_exists="already exists, try using -u|--unsymlink option first"
# dies with optional message
die() {
@@ -38,23 +38,43 @@ help() {
echo " ${CARGO_HOME}"
echo
echo "Options:"
- echo " -a, --apply Apply changes (required)"
+ echo " -s, --symlink Setup rustup symlinks in ${CARGO_HOME}/bin"
echo " -C, --nocolor Disable colored output"
echo " -d, --debug Debug mode (sets -x shell option)"
echo " -V, --version Print version number"
+ echo " -u, --unsymlink Remove rustup symlinks from ${CARGO_HOME}/bin"
echo " -q, --quiet Quiet mode"
} # help()
symlink_rustup() {
- local binpath gentoo_rust tool tools=(
- cargo{,-clippy,-fmt,-miri}
- clippy-driver
+ local gentoo_rust tool
+ # rustup calls those proxies
+ # src/lib.rs TOOLS
+ local tools=(
+ rustc
+ rustdoc
+ cargo
+ rust-lldb
+ rust-gdb
+ rust-gdbgui
rls
- rust{c,doc,fmt,-gdb,-lldb,up}
+ cargo-clippy
+ clippy-driver
+ cargo-miri
)
- binpath="@GENTOO_PORTAGE_EPREFIX@/usr/bin/rustup-init"
+ # src/lib.rs DUP_TOOLS
+ # those can be installed via cargo and not with rust itself
+ local dup_tools=(
+ rust-analyzer
+ rustfmt
+ cargo-fmt
+ )
+
+ # we need rustup symlink too, so add it to final list
+ tools+=( "${dup_tools[@]}" rustup )
+
gentoo_rust="$(eselect --brief rust show 2>/dev/null)"
mkdir -p "${CARGO_HOME}/bin" || die
@@ -78,15 +98,32 @@ symlink_rustup() {
good "rustup selfupdate is disabled, it will be updated by portage"
} # symlink_rustup()
+unsymlink_rustup() {
+ local symlinks
+ IFS= mapfile -d '' symlinks < <(find -L "${CARGO_HOME}/bin" \
+ -samefile "${binpath}" -print0 )
+ if [[ "${symlinks-}" ]]; then
+ rm -v "${symlinks[@]}" || die
+ else
+ die "already clean"
+ fi
+}
main(){
[[ "$EUID" -eq 0 ]] && die "Running as root is not supported"
local me
me="$(basename "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")"
+
+ local symlink=no
+ local unsymlink=no
+
while [[ ${#} -gt 0 ]]; do
case ${1} in
- -a|--apply)
- APPLY=true
+ -s|--symlink)
+ symlink=yes
+ ;;
+ -u|--unsymlink)
+ unsymlink=yes
;;
-h|--help)
help
@@ -112,8 +149,10 @@ main(){
esac
shift
done
- if [[ ${APPLY:-false} == true ]]; then
+ if [[ ${symlink} == yes ]]; then
symlink_rustup
+ elif [[ ${unsymlink} == yes ]]; then
+ unsymlink_rustup
else
help
fi
diff --git a/dev-util/rustup/rustup-1.25.1.ebuild b/dev-util/rustup/rustup-1.25.1-r1.ebuild
similarity index 100%
rename from dev-util/rustup/rustup-1.25.1.ebuild
rename to dev-util/rustup/rustup-1.25.1-r1.ebuild
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-24 4:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-24 4:13 [gentoo-commits] repo/gentoo:master commit in: dev-util/rustup/files/, dev-util/rustup/ Georgy Yakovlev
-- strict thread matches above, loose matches on Subject: below --
2020-09-09 22:13 Georgy Yakovlev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox