1 |
commit: 8bbc138c88743356486ac68aa630305c7bc43d24 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 13 06:05:09 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 13 06:06:17 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bbc138c |
7 |
|
8 |
dev-util/rustup: revbump, minor improvements |
9 |
|
10 |
install helper script as /usr/bin/rustup-init-gentoo |
11 |
|
12 |
Package-Manager: Portage-3.0.8, Repoman-3.0.1 |
13 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
14 |
|
15 |
dev-util/rustup/files/symlink_rustup.sh | 4 ++- |
16 |
...up-1.22.1-r1.ebuild => rustup-1.22.1-r2.ebuild} | 39 +++++++++++++++------- |
17 |
dev-util/rustup/rustup-9999.ebuild | 16 +++++---- |
18 |
3 files changed, 39 insertions(+), 20 deletions(-) |
19 |
|
20 |
diff --git a/dev-util/rustup/files/symlink_rustup.sh b/dev-util/rustup/files/symlink_rustup.sh |
21 |
index 87365028843..743072b8f96 100644 |
22 |
--- a/dev-util/rustup/files/symlink_rustup.sh |
23 |
+++ b/dev-util/rustup/files/symlink_rustup.sh |
24 |
@@ -3,7 +3,8 @@ |
25 |
set -euo pipefail |
26 |
IFS=$'\n\t' |
27 |
|
28 |
-SYMLINK_RUSTUP_VERSION="0.0.2" |
29 |
+SYMLINK_RUSTUP_VERSION="0.0.3" |
30 |
+ |
31 |
|
32 |
: "${CARGO_HOME:=${HOME}/.cargo}" |
33 |
: "${RUSTUP_HOME:=${HOME}/.rustup}" |
34 |
@@ -79,6 +80,7 @@ symlink_rustup() { |
35 |
|
36 |
|
37 |
main(){ |
38 |
+ [[ "$EUID" -eq 0 ]] && die "Running as root is not supported" |
39 |
local me |
40 |
me="$(basename "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")" |
41 |
while [[ ${#} -gt 0 ]]; do |
42 |
|
43 |
diff --git a/dev-util/rustup/rustup-1.22.1-r1.ebuild b/dev-util/rustup/rustup-1.22.1-r2.ebuild |
44 |
similarity index 85% |
45 |
rename from dev-util/rustup/rustup-1.22.1-r1.ebuild |
46 |
rename to dev-util/rustup/rustup-1.22.1-r2.ebuild |
47 |
index 9f951ef8aa7..cb13c09bcf5 100644 |
48 |
--- a/dev-util/rustup/rustup-1.22.1-r1.ebuild |
49 |
+++ b/dev-util/rustup/rustup-1.22.1-r2.ebuild |
50 |
@@ -239,19 +239,25 @@ zeroize-1.1.0 |
51 |
zeroize_derive-1.0.0 |
52 |
" |
53 |
|
54 |
-inherit bash-completion-r1 cargo prefix |
55 |
- |
56 |
HOME_CRATE_COMMIT="a243ee2fbee6022c57d56f5aa79aefe194eabe53" |
57 |
|
58 |
+inherit bash-completion-r1 cargo prefix |
59 |
+ |
60 |
DESCRIPTION="Rust toolchain installer" |
61 |
HOMEPAGE="https://rust-lang.github.io/rustup/" |
62 |
-SRC_URI="https://github.com/rust-lang/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz |
63 |
- https://github.com/rbtcollins/home/archive/${HOME_CRATE_COMMIT}.tar.gz -> ${P}_home_crate.tar.gz |
64 |
- $(cargo_crate_uris ${CRATES})" |
65 |
+ |
66 |
+if [[ ${PV} == "9999" ]] ; then |
67 |
+ inherit git-r3 |
68 |
+ EGIT_REPO_URI="https://github.com/rust-lang/${PN}.git" |
69 |
+else |
70 |
+ SRC_URI="https://github.com/rust-lang/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz |
71 |
+ https://github.com/rbtcollins/home/archive/${HOME_CRATE_COMMIT}.tar.gz -> ${P}_home_crate.tar.gz |
72 |
+ $(cargo_crate_uris ${CRATES})" |
73 |
+ KEYWORDS="~amd64 ~arm64 ~ppc64" |
74 |
+fi |
75 |
|
76 |
LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 CC0-1.0 MIT Unlicense ZLIB" |
77 |
SLOT="0" |
78 |
-KEYWORDS="~amd64 ~arm64 ~ppc64" |
79 |
IUSE="" |
80 |
|
81 |
# requires old libressl-2.5, so openssl only for now. |
82 |
@@ -274,6 +280,15 @@ src_prepare() { |
83 |
sed -i "/^home =/s:.*:home = { path = \"../home-${HOME_CRATE_COMMIT}\" }:" Cargo.toml || die |
84 |
} |
85 |
|
86 |
+src_unpack() { |
87 |
+ if [[ "${PV}" == *9999* ]]; then |
88 |
+ git-r3_src_unpack |
89 |
+ cargo_live_src_unpack |
90 |
+ else |
91 |
+ cargo_src_unpack |
92 |
+ fi |
93 |
+} |
94 |
+ |
95 |
src_configure() { |
96 |
local myfeatures=( no-self-update ) |
97 |
cargo_src_configure |
98 |
@@ -287,8 +302,7 @@ src_compile() { |
99 |
src_install() { |
100 |
cargo_src_install |
101 |
einstalldocs |
102 |
- exeinto /usr/share/rustup |
103 |
- newexe "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" symlink_rustup |
104 |
+ newbin "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" rustup-init-gentoo |
105 |
|
106 |
ln -s "${ED}/usr/bin/rustup-init" rustup || die |
107 |
./rustup completions bash rustup > "${T}/rustup" || die |
108 |
@@ -302,9 +316,10 @@ src_install() { |
109 |
|
110 |
pkg_postinst() { |
111 |
einfo "No rustup toolchains installed by default" |
112 |
- einfo "system rust toolchain can be added to rustup by running" |
113 |
- einfo "helper script installed to ${EPREFIX}/usr/share/rustup/symlink_rustup" |
114 |
- einfo "it will create proper symlinks in user home directory" |
115 |
+ einfo "eselect activated system rust toolchain can be added to rustup by running" |
116 |
+ einfo "helper script installed as ${EPREFIX}/usr/bin/rustup-init-gentoo" |
117 |
+ einfo "it will create symlinks to system-installed rustup in home directory" |
118 |
einfo "and rustup updates will be managed by portage" |
119 |
- einfo "please delete current rustup installation (if any) before running the script" |
120 |
+ einfo "please delete current rustup binaries from ~/.cargo/bin/ (if any)" |
121 |
+ einfo "before running rustup-init-gentoo" |
122 |
} |
123 |
|
124 |
diff --git a/dev-util/rustup/rustup-9999.ebuild b/dev-util/rustup/rustup-9999.ebuild |
125 |
index 5db8a446ae6..ccdc91c9c6b 100644 |
126 |
--- a/dev-util/rustup/rustup-9999.ebuild |
127 |
+++ b/dev-util/rustup/rustup-9999.ebuild |
128 |
@@ -3,7 +3,8 @@ |
129 |
|
130 |
EAPI=7 |
131 |
|
132 |
-CRATES="" |
133 |
+CRATES=" |
134 |
+" |
135 |
|
136 |
inherit bash-completion-r1 cargo prefix |
137 |
|
138 |
@@ -23,6 +24,7 @@ LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 CC0-1.0 MIT Un |
139 |
SLOT="0" |
140 |
IUSE="" |
141 |
|
142 |
+# requires old libressl-2.5, so openssl only for now. |
143 |
DEPEND=" |
144 |
app-arch/xz-utils |
145 |
net-misc/curl:=[http2,ssl] |
146 |
@@ -58,8 +60,7 @@ src_compile() { |
147 |
src_install() { |
148 |
cargo_src_install |
149 |
einstalldocs |
150 |
- exeinto /usr/share/rustup |
151 |
- newexe "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" symlink_rustup |
152 |
+ newbin "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)" rustup-init-gentoo |
153 |
|
154 |
ln -s "${ED}/usr/bin/rustup-init" rustup || die |
155 |
./rustup completions bash rustup > "${T}/rustup" || die |
156 |
@@ -73,9 +74,10 @@ src_install() { |
157 |
|
158 |
pkg_postinst() { |
159 |
einfo "No rustup toolchains installed by default" |
160 |
- einfo "system rust toolchain can be added to rustup by running" |
161 |
- einfo "helper script installed to ${EPREFIX}/usr/share/rustup/symlink_rustup" |
162 |
- einfo "it will create proper symlinks in user home directory" |
163 |
+ einfo "eselect activated system rust toolchain can be added to rustup by running" |
164 |
+ einfo "helper script installed as ${EPREFIX}/usr/bin/rustup-init-gentoo" |
165 |
+ einfo "it will create symlinks to system-installed rustup in home directory" |
166 |
einfo "and rustup updates will be managed by portage" |
167 |
- einfo "please delete current rustup installation (if any) before running the script" |
168 |
+ einfo "please delete current rustup binaries from ~/.cargo/bin/ (if any)" |
169 |
+ einfo "before running rustup-init-gentoo" |
170 |
} |