1 |
commit: dbc7ce142d85a62851ae1cf14daf003ed3fb4baf |
2 |
Author: Doug Goldstein <cardoe <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 30 15:31:29 2016 +0000 |
4 |
Commit: Doug Goldstein <cardoe <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 30 15:32:07 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbc7ce14 |
7 |
|
8 |
dev-lang/rust: add packages for >=sys-devel/llvm-3.7.0 |
9 |
|
10 |
Because of changes Gentoo has made with how sys-devel/llvm is built |
11 |
the way we have to depend on it has changed. LLVM 3.6.0 is only |
12 |
a build time DEPEND. While LLVM 3.7.0 and newer is a run-time |
13 |
RDEPEND and DEPEND. Since no EAPI provides a dynamic way for |
14 |
packages to update RDEPEND we need to provide two different |
15 |
packages so that people can build against LLVM 3.6.0 and LLVM |
16 |
3.7.0 and newer. |
17 |
|
18 |
Package-Manager: portage-2.2.26 |
19 |
Signed-off-by: Doug Goldstein <cardoe <AT> gentoo.org> |
20 |
|
21 |
dev-lang/rust/rust-1.7.0-r100.ebuild | 158 ++++++++++++++++++++++ |
22 |
dev-lang/rust/rust-1.8.0_beta20160323-r100.ebuild | 158 ++++++++++++++++++++++ |
23 |
2 files changed, 316 insertions(+) |
24 |
|
25 |
diff --git a/dev-lang/rust/rust-1.7.0-r100.ebuild b/dev-lang/rust/rust-1.7.0-r100.ebuild |
26 |
new file mode 100644 |
27 |
index 0000000..1c94d49 |
28 |
--- /dev/null |
29 |
+++ b/dev-lang/rust/rust-1.7.0-r100.ebuild |
30 |
@@ -0,0 +1,158 @@ |
31 |
+# Copyright 1999-2016 Gentoo Foundation |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+# $Id$ |
34 |
+ |
35 |
+EAPI=6 |
36 |
+ |
37 |
+PYTHON_COMPAT=( python2_7 ) |
38 |
+ |
39 |
+inherit python-any-r1 versionator toolchain-funcs |
40 |
+ |
41 |
+if [[ ${PV} = *beta* ]]; then |
42 |
+ betaver=${PV//*beta} |
43 |
+ BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" |
44 |
+ MY_P="rustc-beta" |
45 |
+ SLOT="beta/${PV}" |
46 |
+ SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.gz" |
47 |
+ KEYWORDS="" |
48 |
+else |
49 |
+ ABI_VER="$(get_version_component_range 1-2)" |
50 |
+ SLOT="stable/${ABI_VER}" |
51 |
+ MY_P="rustc-${PV}" |
52 |
+ SRC="${MY_P}-src.tar.gz" |
53 |
+ KEYWORDS="~amd64 ~x86" |
54 |
+fi |
55 |
+ |
56 |
+# from src/snapshots.txt |
57 |
+RUST_SNAPSHOT_DATE="2016-02-17" |
58 |
+RUST_SNAPSHOT_SRCHASH="4d3eebf" |
59 |
+RUST_SNAPSHOT_HASH_amd64="d29b7607d13d64078b6324aec82926fb493f59ba" |
60 |
+RUST_SNAPSHOT_HASH_x86="5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7" |
61 |
+RUST_STAGE0="rust-stage0-${RUST_SNAPSHOT_DATE}-${RUST_SNAPSHOT_SRCHASH}" |
62 |
+RUST_STAGE0_amd64="${RUST_STAGE0}-linux-x86_64-${RUST_SNAPSHOT_HASH_amd64}" |
63 |
+RUST_STAGE0_x86="${RUST_STAGE0}-linux-i386-${RUST_SNAPSHOT_HASH_x86}" |
64 |
+ |
65 |
+DESCRIPTION="Systems programming language from Mozilla" |
66 |
+HOMEPAGE="http://www.rust-lang.org/" |
67 |
+ |
68 |
+SRC_URI="http://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.gz |
69 |
+ amd64? ( http://static.rust-lang.org/stage0-snapshots/${RUST_STAGE0_amd64}.tar.bz2 ) |
70 |
+ x86? ( http://static.rust-lang.org/stage0-snapshots/${RUST_STAGE0_x86}.tar.bz2 ) |
71 |
+" |
72 |
+ |
73 |
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" |
74 |
+ |
75 |
+IUSE="clang debug doc libcxx +system-llvm" |
76 |
+REQUIRED_USE="libcxx? ( clang )" |
77 |
+ |
78 |
+RDEPEND="libcxx? ( sys-libs/libcxx ) |
79 |
+ system-llvm? ( >=sys-devel/llvm-3.7.0[multitarget] |
80 |
+ <sys-devel/llvm-3.8.0[multitarget] ) |
81 |
+" |
82 |
+ |
83 |
+DEPEND="${RDEPEND} |
84 |
+ ${PYTHON_DEPS} |
85 |
+ >=dev-lang/perl-5.0 |
86 |
+ clang? ( sys-devel/clang ) |
87 |
+" |
88 |
+ |
89 |
+PDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425" |
90 |
+ |
91 |
+S="${WORKDIR}/${MY_P}" |
92 |
+ |
93 |
+src_unpack() { |
94 |
+ unpack "rustc-${PV}-src.tar.gz" || die |
95 |
+ mkdir "${MY_P}/dl" || die |
96 |
+ local stagename="RUST_STAGE0_${ARCH}" |
97 |
+ local stage0="${!stagename}" |
98 |
+ cp "${DISTDIR}/${stage0}.tar.bz2" "${MY_P}/dl/" || die "cp stage0" |
99 |
+} |
100 |
+ |
101 |
+src_prepare() { |
102 |
+ find mk -name '*.mk' -exec \ |
103 |
+ sed -i -e "s/-Werror / /g" {} \; || die |
104 |
+ |
105 |
+ eapply_user |
106 |
+} |
107 |
+ |
108 |
+src_configure() { |
109 |
+ export CFG_DISABLE_LDCONFIG="notempty" |
110 |
+ |
111 |
+ "${ECONF_SOURCE:-.}"/configure \ |
112 |
+ --prefix="${EPREFIX}/usr" \ |
113 |
+ --libdir="${EPREFIX}/usr/$(get_libdir)/${P}" \ |
114 |
+ --mandir="${EPREFIX}/usr/share/${P}/man" \ |
115 |
+ --release-channel=${SLOT%%/*} \ |
116 |
+ --disable-manage-submodules \ |
117 |
+ --default-linker=$(tc-getBUILD_CC) \ |
118 |
+ --default-ar=$(tc-getBUILD_AR) \ |
119 |
+ --python=${EPYTHON} \ |
120 |
+ $(use_enable clang) \ |
121 |
+ $(use_enable debug) \ |
122 |
+ $(use_enable debug llvm-assertions) \ |
123 |
+ $(use_enable !debug optimize) \ |
124 |
+ $(use_enable !debug optimize-cxx) \ |
125 |
+ $(use_enable !debug optimize-llvm) \ |
126 |
+ $(use_enable !debug optimize-tests) \ |
127 |
+ $(use_enable doc docs) \ |
128 |
+ $(use_enable libcxx libcpp) \ |
129 |
+ $(usex system-llvm "--llvm-root=${EPREFIX}/usr" " ") \ |
130 |
+ || die |
131 |
+} |
132 |
+ |
133 |
+src_compile() { |
134 |
+ emake VERBOSE=1 |
135 |
+} |
136 |
+ |
137 |
+src_install() { |
138 |
+ unset SUDO_USER |
139 |
+ |
140 |
+ default |
141 |
+ |
142 |
+ mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die |
143 |
+ mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die |
144 |
+ mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die |
145 |
+ |
146 |
+ dodoc COPYRIGHT |
147 |
+ |
148 |
+ dodir "/usr/share/doc/rust-${PV}/" |
149 |
+ mv "${D}/usr/share/doc/rust"/* "${D}/usr/share/doc/rust-${PV}/" || die |
150 |
+ rmdir "${D}/usr/share/doc/rust/" || die |
151 |
+ |
152 |
+ cat <<-EOF > "${T}"/50${P} |
153 |
+ LDPATH="/usr/$(get_libdir)/${P}" |
154 |
+ MANPATH="/usr/share/${P}/man" |
155 |
+ EOF |
156 |
+ doenvd "${T}"/50${P} |
157 |
+ |
158 |
+ cat <<-EOF > "${T}/provider-${P}" |
159 |
+ /usr/bin/rustdoc |
160 |
+ /usr/bin/rust-gdb |
161 |
+ EOF |
162 |
+ dodir /etc/env.d/rust |
163 |
+ insinto /etc/env.d/rust |
164 |
+ doins "${T}/provider-${P}" |
165 |
+} |
166 |
+ |
167 |
+pkg_postinst() { |
168 |
+ eselect rust update --if-unset |
169 |
+ |
170 |
+ elog "Rust installs a helper script for calling GDB now," |
171 |
+ elog "for your convenience it is installed under /usr/bin/rust-gdb-${PV}." |
172 |
+ |
173 |
+ if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then |
174 |
+ elog "install app-emacs/rust-mode to get emacs support for rust." |
175 |
+ fi |
176 |
+ |
177 |
+ if has_version app-editors/gvim || has_version app-editors/vim; then |
178 |
+ elog "install app-vim/rust-mode to get vim support for rust." |
179 |
+ fi |
180 |
+ |
181 |
+ if has_version 'app-shells/zsh'; then |
182 |
+ elog "install app-shells/rust-zshcomp to get zsh completion for rust." |
183 |
+ fi |
184 |
+} |
185 |
+ |
186 |
+pkg_postrm() { |
187 |
+ eselect rust unset --if-invalid |
188 |
+} |
189 |
|
190 |
diff --git a/dev-lang/rust/rust-1.8.0_beta20160323-r100.ebuild b/dev-lang/rust/rust-1.8.0_beta20160323-r100.ebuild |
191 |
new file mode 100644 |
192 |
index 0000000..eb4b27d |
193 |
--- /dev/null |
194 |
+++ b/dev-lang/rust/rust-1.8.0_beta20160323-r100.ebuild |
195 |
@@ -0,0 +1,158 @@ |
196 |
+# Copyright 1999-2016 Gentoo Foundation |
197 |
+# Distributed under the terms of the GNU General Public License v2 |
198 |
+# $Id$ |
199 |
+ |
200 |
+EAPI=6 |
201 |
+ |
202 |
+PYTHON_COMPAT=( python2_7 ) |
203 |
+ |
204 |
+inherit python-any-r1 versionator toolchain-funcs |
205 |
+ |
206 |
+if [[ ${PV} = *beta* ]]; then |
207 |
+ betaver=${PV//*beta} |
208 |
+ BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" |
209 |
+ MY_P="rustc-beta" |
210 |
+ SLOT="beta/${PV}" |
211 |
+ SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.gz" |
212 |
+ KEYWORDS="" |
213 |
+else |
214 |
+ ABI_VER="$(get_version_component_range 1-2)" |
215 |
+ SLOT="stable/${ABI_VER}" |
216 |
+ MY_P="rustc-${PV}" |
217 |
+ SRC="${MY_P}-src.tar.gz" |
218 |
+ KEYWORDS="~amd64 ~x86" |
219 |
+fi |
220 |
+ |
221 |
+# from src/snapshots.txt |
222 |
+RUST_SNAPSHOT_DATE="2016-02-17" |
223 |
+RUST_SNAPSHOT_SRCHASH="4d3eebf" |
224 |
+RUST_SNAPSHOT_HASH_amd64="d29b7607d13d64078b6324aec82926fb493f59ba" |
225 |
+RUST_SNAPSHOT_HASH_x86="5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7" |
226 |
+RUST_STAGE0="rust-stage0-${RUST_SNAPSHOT_DATE}-${RUST_SNAPSHOT_SRCHASH}" |
227 |
+RUST_STAGE0_amd64="${RUST_STAGE0}-linux-x86_64-${RUST_SNAPSHOT_HASH_amd64}" |
228 |
+RUST_STAGE0_x86="${RUST_STAGE0}-linux-i386-${RUST_SNAPSHOT_HASH_x86}" |
229 |
+ |
230 |
+DESCRIPTION="Systems programming language from Mozilla" |
231 |
+HOMEPAGE="http://www.rust-lang.org/" |
232 |
+ |
233 |
+SRC_URI="http://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.gz |
234 |
+ amd64? ( http://static.rust-lang.org/stage0-snapshots/${RUST_STAGE0_amd64}.tar.bz2 ) |
235 |
+ x86? ( http://static.rust-lang.org/stage0-snapshots/${RUST_STAGE0_x86}.tar.bz2 ) |
236 |
+" |
237 |
+ |
238 |
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" |
239 |
+ |
240 |
+IUSE="clang debug doc libcxx +system-llvm" |
241 |
+REQUIRED_USE="libcxx? ( clang )" |
242 |
+ |
243 |
+RDEPEND="libcxx? ( sys-libs/libcxx ) |
244 |
+ system-llvm? ( >=sys-devel/llvm-3.7.0[multitarget] |
245 |
+ <sys-devel/llvm-3.9.0[multitarget] ) |
246 |
+" |
247 |
+ |
248 |
+DEPEND="${RDEPEND} |
249 |
+ ${PYTHON_DEPS} |
250 |
+ >=dev-lang/perl-5.0 |
251 |
+ clang? ( sys-devel/clang ) |
252 |
+" |
253 |
+ |
254 |
+PDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425" |
255 |
+ |
256 |
+S="${WORKDIR}/${MY_P}" |
257 |
+ |
258 |
+src_unpack() { |
259 |
+ unpack "rustc-${PV}-src.tar.gz" || die |
260 |
+ mkdir "${MY_P}/dl" || die |
261 |
+ local stagename="RUST_STAGE0_${ARCH}" |
262 |
+ local stage0="${!stagename}" |
263 |
+ cp "${DISTDIR}/${stage0}.tar.bz2" "${MY_P}/dl/" || die "cp stage0" |
264 |
+} |
265 |
+ |
266 |
+src_prepare() { |
267 |
+ find mk -name '*.mk' -exec \ |
268 |
+ sed -i -e "s/-Werror / /g" {} \; || die |
269 |
+ |
270 |
+ eapply_user |
271 |
+} |
272 |
+ |
273 |
+src_configure() { |
274 |
+ export CFG_DISABLE_LDCONFIG="notempty" |
275 |
+ |
276 |
+ "${ECONF_SOURCE:-.}"/configure \ |
277 |
+ --prefix="${EPREFIX}/usr" \ |
278 |
+ --libdir="${EPREFIX}/usr/$(get_libdir)/${P}" \ |
279 |
+ --mandir="${EPREFIX}/usr/share/${P}/man" \ |
280 |
+ --release-channel=${SLOT%%/*} \ |
281 |
+ --disable-manage-submodules \ |
282 |
+ --default-linker=$(tc-getBUILD_CC) \ |
283 |
+ --default-ar=$(tc-getBUILD_AR) \ |
284 |
+ --python=${EPYTHON} \ |
285 |
+ $(use_enable clang) \ |
286 |
+ $(use_enable debug) \ |
287 |
+ $(use_enable debug llvm-assertions) \ |
288 |
+ $(use_enable !debug optimize) \ |
289 |
+ $(use_enable !debug optimize-cxx) \ |
290 |
+ $(use_enable !debug optimize-llvm) \ |
291 |
+ $(use_enable !debug optimize-tests) \ |
292 |
+ $(use_enable doc docs) \ |
293 |
+ $(use_enable libcxx libcpp) \ |
294 |
+ $(usex system-llvm "--llvm-root=${EPREFIX}/usr" " ") \ |
295 |
+ || die |
296 |
+} |
297 |
+ |
298 |
+src_compile() { |
299 |
+ emake VERBOSE=1 |
300 |
+} |
301 |
+ |
302 |
+src_install() { |
303 |
+ unset SUDO_USER |
304 |
+ |
305 |
+ default |
306 |
+ |
307 |
+ mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die |
308 |
+ mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die |
309 |
+ mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die |
310 |
+ |
311 |
+ dodoc COPYRIGHT |
312 |
+ |
313 |
+ dodir "/usr/share/doc/rust-${PV}/" |
314 |
+ mv "${D}/usr/share/doc/rust"/* "${D}/usr/share/doc/rust-${PV}/" || die |
315 |
+ rmdir "${D}/usr/share/doc/rust/" || die |
316 |
+ |
317 |
+ cat <<-EOF > "${T}"/50${P} |
318 |
+ LDPATH="/usr/$(get_libdir)/${P}" |
319 |
+ MANPATH="/usr/share/${P}/man" |
320 |
+ EOF |
321 |
+ doenvd "${T}"/50${P} |
322 |
+ |
323 |
+ cat <<-EOF > "${T}/provider-${P}" |
324 |
+ /usr/bin/rustdoc |
325 |
+ /usr/bin/rust-gdb |
326 |
+ EOF |
327 |
+ dodir /etc/env.d/rust |
328 |
+ insinto /etc/env.d/rust |
329 |
+ doins "${T}/provider-${P}" |
330 |
+} |
331 |
+ |
332 |
+pkg_postinst() { |
333 |
+ eselect rust update --if-unset |
334 |
+ |
335 |
+ elog "Rust installs a helper script for calling GDB now," |
336 |
+ elog "for your convenience it is installed under /usr/bin/rust-gdb-${PV}." |
337 |
+ |
338 |
+ if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then |
339 |
+ elog "install app-emacs/rust-mode to get emacs support for rust." |
340 |
+ fi |
341 |
+ |
342 |
+ if has_version app-editors/gvim || has_version app-editors/vim; then |
343 |
+ elog "install app-vim/rust-mode to get vim support for rust." |
344 |
+ fi |
345 |
+ |
346 |
+ if has_version 'app-shells/zsh'; then |
347 |
+ elog "install app-shells/rust-zshcomp to get zsh completion for rust." |
348 |
+ fi |
349 |
+} |
350 |
+ |
351 |
+pkg_postrm() { |
352 |
+ eselect rust unset --if-invalid |
353 |
+} |