diff options
author | Jauhien Piatlicki <jauhien@gentoo.org> | 2015-06-06 13:53:37 +0200 |
---|---|---|
committer | Jauhien Piatlicki <jauhien@gentoo.org> | 2015-06-06 13:53:37 +0200 |
commit | 8cc4a1d012107de90a7f3dee2972ccadeb704b9a (patch) | |
tree | 29fcafc076ae032bf7218b8aa13bb25f2fb5618f | |
parent | Merge pull request #132 from jauhien/rust-bin (diff) | |
download | rust-8cc4a1d012107de90a7f3dee2972ccadeb704b9a.tar.gz rust-8cc4a1d012107de90a7f3dee2972ccadeb704b9a.tar.bz2 rust-8cc4a1d012107de90a7f3dee2972ccadeb704b9a.zip |
[dev-lang/rust*] move to the new SLOT schema (issue #115)
SLOTs for both dev-lang/rust and dev-lang/rust-bin correspond to the
upstream release channels now
-rw-r--r-- | README.md | 17 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-1.0.0.ebuild | 9 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-99.ebuild | 110 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-999.ebuild | 5 | ||||
-rw-r--r-- | dev-lang/rust/Manifest | 3 | ||||
-rw-r--r-- | dev-lang/rust/rust-1.0.0.ebuild | 15 | ||||
-rw-r--r-- | dev-lang/rust/rust-99.ebuild | 138 | ||||
-rw-r--r-- | dev-lang/rust/rust-999.ebuild | 4 |
8 files changed, 269 insertions, 32 deletions
@@ -83,12 +83,11 @@ Exceptions are trivial changes and urgent changes (that fix something completely Currently we have these slots for `dev-lang/rust`: -* `1.0` -- 1.0 release +* `stable` -- stable release +* `beta` -- beta version * `nightly` -- nightly version * `git` -- upstream git version -This will probably change to some other schema that corresponds to current release channels (a subject to discussion). - Note, that source packages use a custom postfix for Rust libraries. This is important, as otherwise simultaneously installed different Rust versions will fail to work. An example of `src_prepare` that sets appropriate postfixes: @@ -100,13 +99,15 @@ src_prepare() { } ``` -For `dev-lang/rust-bin` have two slots now: +For `dev-lang/rust-bin` slots are: -* `1.0` -- 1.0 release +* `stable` -- stable release +* `beta` -- beta version * `nightly` -- nightly version -Note, that `cargo` USE is available only for `nightly` `dev-lang/rust-bin` -and `cargo` binary is not under the eselect control. +Note, that `cargo-bundled` USE is available only for `nightly` and `beta` `dev-lang/rust-bin` +and `cargo` binary is not under the eselect control, so `nightly` and `beta` cannot have `cargo-bundled` +USE enabled at the same time. ## Eselect-rust @@ -148,4 +149,4 @@ At the moment these packages are: * app-shells/rust-zshcomp * app-vim/rust-mode * dev-lang/rust -* dev-lang/rust-binary +* dev-lang/rust-bin diff --git a/dev-lang/rust-bin/rust-bin-1.0.0.ebuild b/dev-lang/rust-bin/rust-bin-1.0.0.ebuild index 7226cc0..977c854 100644 --- a/dev-lang/rust-bin/rust-bin-1.0.0.ebuild +++ b/dev-lang/rust-bin/rust-bin-1.0.0.ebuild @@ -6,18 +6,15 @@ EAPI=5 inherit eutils bash-completion-r1 -BETA_NUM="${PV##*beta}" -MY_PV="${PV/_/-}" -# beta => beta BUT beta2 => beta.2 -[ -n "${BETA_NUM}" ] && MY_PV="${MY_PV/beta/beta.}" -MY_P="rustc-${MY_PV}" +MY_P="rustc-${PV}" + DESCRIPTION="Systems programming language from Mozilla" HOMEPAGE="http://www.rust-lang.org/" SRC_URI="amd64? ( http://static.rust-lang.org/dist/${MY_P}-x86_64-unknown-linux-gnu.tar.gz ) x86? ( http://static.rust-lang.org/dist/${MY_P}-i686-unknown-linux-gnu.tar.gz )" LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" -SLOT="1.0" +SLOT="stable" KEYWORDS="~amd64 ~x86" IUSE="" diff --git a/dev-lang/rust-bin/rust-bin-99.ebuild b/dev-lang/rust-bin/rust-bin-99.ebuild new file mode 100644 index 0000000..72db39b --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-99.ebuild @@ -0,0 +1,110 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit eutils bash-completion-r1 + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="http://www.rust-lang.org/" +MY_SRC_URI="http://static.rust-lang.org/dist/rust-beta" + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="beta" +KEYWORDS="" + +IUSE="cargo-bundled doc" + +CDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 + !dev-lang/rust:0 + cargo-bundled? ( + !dev-rust/cargo + !dev-lang/rust-bin:nightly[cargo-bundled] + ) +" +DEPEND="${CDEPEND} + net-misc/wget +" +RDEPEND="${CDEPEND} +" + +src_unpack() { + local postfix + use amd64 && postfix=x86_64-unknown-linux-gnu + use x86 && postfix=i686-unknown-linux-gnu + + wget "${MY_SRC_URI}-${postfix}.tar.gz" || die + unpack ./"rust-beta-${postfix}.tar.gz" + + mv "${WORKDIR}/rust-beta-${postfix}" "${S}" || die +} + +src_install() { + local components=rustc + use cargo-bundled && components="${components},cargo" + use doc && components="${components},rust-docs" + ./install.sh \ + --components="${components}" \ + --disable-verify \ + --prefix="${D}/opt/${P}" \ + --mandir="${D}/usr/share/${P}/man" \ + --disable-ldconfig \ + || die + + local rustc=rustc-bin-${PV} + local rustdoc=rustdoc-bin-${PV} + local rustgdb=rust-gdb-bin-${PV} + + mv "${D}/opt/${P}/bin/rustc" "${D}/opt/${P}/bin/${rustc}" || die + mv "${D}/opt/${P}/bin/rustdoc" "${D}/opt/${P}/bin/${rustdoc}" || die + mv "${D}/opt/${P}/bin/rust-gdb" "${D}/opt/${P}/bin/${rustgdb}" || die + + dosym "/opt/${P}/bin/${rustc}" "/usr/bin/${rustc}" + dosym "/opt/${P}/bin/${rustdoc}" "/usr/bin/${rustdoc}" + dosym "/opt/${P}/bin/${rustgdb}" "/usr/bin/${rustgdb}" + + cat <<-EOF > "${T}"/50${P} + LDPATH="/opt/${P}/lib" + MANPATH="/usr/share/${P}/man" + EOF + doenvd "${T}"/50${P} + + cat <<-EOF > "${T}/provider-${P}" + /usr/bin/rustdoc + /usr/bin/rust-gdb + EOF + dodir /etc/env.d/rust + insinto /etc/env.d/rust + doins "${T}/provider-${P}" + + if use cargo-bundled ; then + dosym "/opt/${P}/bin/cargo" /usr/bin/cargo + dosym "/opt/${P}/share/zsh/site-functions/_cargo" /usr/share/zsh/site-functions/_cargo + newbashcomp "${D}/opt/${P}/etc/bash_completion.d/cargo" cargo + rm -rf "${D}/opt/${P}/etc" + fi +} + +pkg_postinst() { + eselect rust update --if-unset + + 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 || has_version app-editors/emacs-vcs; 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-mode to get vim support for rust." + fi + + if has_version 'app-shells/zsh'; then + elog "install app-shells/rust-zshcomp to get zsh completion for rust." + fi +} + +pkg_postrm() { + eselect rust unset --if-invalid +} diff --git a/dev-lang/rust-bin/rust-bin-999.ebuild b/dev-lang/rust-bin/rust-bin-999.ebuild index e774855..0020e9b 100644 --- a/dev-lang/rust-bin/rust-bin-999.ebuild +++ b/dev-lang/rust-bin/rust-bin-999.ebuild @@ -18,7 +18,10 @@ IUSE="cargo-bundled doc" CDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 !dev-lang/rust:0 - cargo-bundled? ( !dev-rust/cargo ) + cargo-bundled? ( + !dev-rust/cargo + !dev-lang/rust-bin:beta[cargo-bundled] + ) " DEPEND="${CDEPEND} net-misc/wget diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest index 45aaf41..3d5c408 100644 --- a/dev-lang/rust/Manifest +++ b/dev-lang/rust/Manifest @@ -1,6 +1,3 @@ DIST rust-stage0-2015-03-27-5520801-linux-i386-1ef82402ed16f5a6d2f87a9a62eaa83170e249ec.tar.bz2 18104375 SHA256 f948477a43dc14436b218a24a81097d0460ca2e2177bebabba24fae89fc62b4b SHA512 86b28b03e8ef730620e593d00786b14736e05fdf5f312ab194175340fad1f24e169f69e381e73c1eb102f059f47a926dabd93bfaad46c50caa3717ee10412a5c WHIRLPOOL 086875d15228ebc68334eb4d663207917e1876044e12296426a00a0fec88a1325fe6a5e620e51b58eb08a58c27896df5fbb6d6ca992e0d754a98697f1bc9ed17 DIST rust-stage0-2015-03-27-5520801-linux-x86_64-ef2154372e97a3cb687897d027fd51c8f2c5f349.tar.bz2 17935368 SHA256 b62eed6bdb3cb356c90d587e9d9ee7fb5aedad917ff872c04e67e20b4c8f1c91 SHA512 0a978be4865f9e77c5ab552d423e21f1edefc767bc8a8d2936b45b0a9194648c5fb3c32cec0eaea438ad1339802faa1504b511956c2d71f73f2eb0439a4d7b99 WHIRLPOOL 89b0b8c51fd072c33afe8e98bc9aaea301ffa810a166b612d10dd89bbc491c3350f591f57bc3494066d71402910519b07cffa95d2802bdd6334aaad0c2f79334 -DIST rustc-1.0.0-beta.2-src.tar.gz 22115249 SHA256 969f20bfec588456af8ab81c9b00ef46df075bf9ac9955e42a87b1f39cb99771 SHA512 d692284d25ff93aa7f7a444fc0c0f09128d0836ff61396054d1ab0931206abcfa8b8adeef209d8c51f824257691babee85bec68bd716a28722ec93aa322ad64b WHIRLPOOL df88151b87fb97a78840b4f71c1e625b4b68c06ac0a7a7614583b12b914c6ffae470bd552a7d8a1a01c360ba15c4d3fc522ffbcd7d35043b88e12fb26266e93d -DIST rustc-1.0.0-beta.3-src.tar.gz 22086520 SHA256 e751bc8a8ad236c8865697f866b2863e224af56b0194ddf9f3edd71f9ff6545f SHA512 4a7b8044fa9efb27ef987d7395c1df4e2a5f6f718c3cf8a6fa0e2c85a9d025ed31b287b40983f66c4c087f585acbdcacad4d707800b49d31b5b7e5b65b9f7a77 WHIRLPOOL 03480dea33bcaa4523ba82dbe71cb7089692e2bf42e79f850c3dded5dd2e5fbe4aeac76c81807fca65bd479aa29a159071ae1d1334e544eb2ebdc8e928b452ab -DIST rustc-1.0.0-beta.4-src.tar.gz 22077195 SHA256 54e5868dd55a5c171327c72d662b5931a962b0cf160022d11c189ea232e0bd91 SHA512 500fee0b746e86fea03a2d4b818bff8f567adcbf2539eb3c698597d8f74af50a528f9e669f583f582b1409dfc3a5e6816389dc3e5edcaab64a9ef09852960f7d WHIRLPOOL 46b59b809877a7697b47c1b449dc1dc369fe685070b2be515c2164139fa68610f5ec8e4d67de9d9c6419385e8b3af993e0ce57d117d415e6fc249c4643579ae8 DIST rustc-1.0.0-src.tar.gz 22121878 SHA256 c304cbd4f7b25d116b73c249f66bdb5c9da8645855ce195a41bda5077b995eba SHA512 dd34857b3c484d869eb6ab1a1e11e62647ac3e124858a4e39e10d749a6e43ce02e77a386d71fe9c97dce80e464cc115d5364892391c2ebc8ed4501b2206474a8 WHIRLPOOL ce74cbd03f1a806e09f6847ce6fffa30cc0c35361e10e3bafbda5409e63a051f88a08c6abd8e722cabf14799975dc3ee7f69886f14c551630e604af27e4daede diff --git a/dev-lang/rust/rust-1.0.0.ebuild b/dev-lang/rust/rust-1.0.0.ebuild index ec67ea0..f852688 100644 --- a/dev-lang/rust/rust-1.0.0.ebuild +++ b/dev-lang/rust/rust-1.0.0.ebuild @@ -8,13 +8,7 @@ PYTHON_COMPAT=( python2_7 ) inherit eutils python-any-r1 -RUST_CHANNEL="stable" - -BETA_NUM="${PV##*beta}" -MY_PV="${PV/_/-}" -# beta => beta BUT beta2 => beta.2 -[ -n "${BETA_NUM}" ] && MY_PV="${MY_PV/beta/beta.}" -MY_P="rustc-${MY_PV}" +MY_P="rustc-${PV}" DESCRIPTION="Systems programming language from Mozilla" HOMEPAGE="http://www.rust-lang.org/" @@ -24,7 +18,7 @@ SRC_URI="http://static.rust-lang.org/dist/${MY_P}-src.tar.gz amd64? ( http://static.rust-lang.org/stage0-snapshots/rust-stage0-2015-03-27-5520801-linux-x86_64-ef2154372e97a3cb687897d027fd51c8f2c5f349.tar.bz2 )" LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" -SLOT="1.0" +SLOT="stable" KEYWORDS="~amd64 ~x86" IUSE="clang debug doc libcxx +system-llvm" @@ -40,8 +34,7 @@ DEPEND="${CDEPEND} clang? ( sys-devel/clang ) system-llvm? ( >=sys-devel/llvm-3.6.0[multitarget(-)] ) " -RDEPEND="${CDEPEND} -" +RDEPEND="${CDEPEND}" S=${WORKDIR}/${MY_P} @@ -63,7 +56,7 @@ src_configure() { --prefix="${EPREFIX}/usr" \ --libdir="${EPREFIX}/usr/lib/${P}" \ --mandir="${EPREFIX}/usr/share/${P}/man" \ - --release-channel=${RUST_CHANNEL} \ + --release-channel=${SLOT} \ --disable-manage-submodules \ $(use_enable clang) \ $(use_enable debug) \ diff --git a/dev-lang/rust/rust-99.ebuild b/dev-lang/rust/rust-99.ebuild new file mode 100644 index 0000000..e00deb3 --- /dev/null +++ b/dev-lang/rust/rust-99.ebuild @@ -0,0 +1,138 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) + +inherit eutils python-any-r1 + +MY_P=rustc-beta + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="http://www.rust-lang.org/" +MY_SRC_URI="http://static.rust-lang.org/dist/${MY_P}-src.tar.gz" + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="beta" +KEYWORDS="" + +IUSE="clang debug doc libcxx +system-llvm" +REQUIRED_USE="libcxx? ( clang )" + +CDEPEND="libcxx? ( sys-libs/libcxx ) + >=app-eselect/eselect-rust-0.3_pre20150425 + !dev-lang/rust:0 +" +DEPEND="${CDEPEND} + ${PYTHON_DEPS} + >=dev-lang/perl-5.0 + net-misc/wget + clang? ( sys-devel/clang ) + system-llvm? ( >=sys-devel/llvm-3.6.0[multitarget(-)] ) +" +RDEPEND="${CDEPEND} +" + +S="${WORKDIR}/${MY_P}" + +src_unpack() { + wget "${MY_SRC_URI}" || die + unpack ./"${MY_P}-src.tar.gz" + + use amd64 && BUILD_TRIPLE=x86_64-unknown-linux-gnu + use x86 && BUILD_TRIPLE=i686-unknown-linux-gnu + export CFG_SRC_DIR="${S}" && \ + cd ${S} && \ + mkdir -p "${S}/dl" && \ + mkdir -p "${S}/${BUILD_TRIPLE}/stage0/bin" && \ + python2 "${S}/src/etc/get-snapshot.py" ${BUILD_TRIPLE} || die +} + +src_prepare() { + local postfix="gentoo-${SLOT}" + sed -i -e "s/CFG_FILENAME_EXTRA=.*/CFG_FILENAME_EXTRA=${postfix}/" mk/main.mk || die +} + +src_configure() { + export CFG_DISABLE_LDCONFIG="notempty" + "${ECONF_SOURCE:-.}"/configure \ + --prefix="${EPREFIX}/usr" \ + --libdir="${EPREFIX}/usr/lib/${P}" \ + --mandir="${EPREFIX}/usr/share/${P}/man" \ + --release-channel=${SLOT} \ + --disable-manage-submodules \ + $(use_enable clang) \ + $(use_enable debug) \ + $(use_enable debug llvm-assertions) \ + $(use_enable !debug optimize) \ + $(use_enable !debug optimize-cxx) \ + $(use_enable !debug optimize-llvm) \ + $(use_enable !debug optimize-tests) \ + $(use_enable doc docs) \ + $(use_enable libcxx libcpp) \ + $(usex system-llvm "--llvm-root=${EPREFIX}/usr" " ") \ + || die +} + +src_compile() { + emake VERBOSE=1 +} + +src_install() { + default + + mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die + mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die + mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die + + dodoc COPYRIGHT LICENSE-APACHE LICENSE-MIT + + # le kludge that fixes https://github.com/Heather/gentoo-rust/issues/41 + mv "${D}/usr/lib/rust-${PV}/rust-${PV}/rustlib"/* "${D}/usr/lib/rust-${PV}/rustlib/" || die + rmdir "${D}/usr/lib/rust-${PV}/rust-${PV}/rustlib" || die + mv "${D}/usr/lib/rust-${PV}/rust-${PV}/"/* "${D}/usr/lib/rust-${PV}/" || die + rmdir "${D}/usr/lib/rust-${PV}/rust-${PV}/" || die + + dodir "/usr/share/doc/rust-${PV}/" + mv "${D}/usr/share/doc/rust"/* "${D}/usr/share/doc/rust-${PV}/" || die + rmdir "${D}/usr/share/doc/rust/" || die + + cat <<-EOF > "${T}"/50${P} + LDPATH="/usr/lib/${P}" + MANPATH="/usr/share/${P}/man" + EOF + doenvd "${T}"/50${P} + + cat <<-EOF > "${T}/provider-${P}" + /usr/bin/rustdoc + /usr/bin/rust-gdb + EOF + dodir /etc/env.d/rust + insinto /etc/env.d/rust + doins "${T}/provider-${P}" +} + +pkg_postinst() { + eselect rust update --if-unset + + elog "Rust installs a helper script for calling GDB now," + elog "for your convenience it is installed under /usr/bin/rust-gdb-${PV}." + + if has_version app-editors/emacs || has_version app-editors/emacs-vcs; 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-mode to get vim support for rust." + fi + + if has_version 'app-shells/zsh'; then + elog "install app-shells/rust-zshcomp to get zsh completion for rust." + fi +} + +pkg_postrm() { + eselect rust unset --if-invalid +} diff --git a/dev-lang/rust/rust-999.ebuild b/dev-lang/rust/rust-999.ebuild index c264c10..a04d46f 100644 --- a/dev-lang/rust/rust-999.ebuild +++ b/dev-lang/rust/rust-999.ebuild @@ -8,8 +8,6 @@ PYTHON_COMPAT=( python2_7 ) inherit eutils python-any-r1 -RUST_CHANNEL="nightly" - MY_P=rustc-nightly DESCRIPTION="Systems programming language from Mozilla" @@ -63,7 +61,7 @@ src_configure() { --prefix="${EPREFIX}/usr" \ --libdir="${EPREFIX}/usr/lib/${P}" \ --mandir="${EPREFIX}/usr/share/${P}/man" \ - --release-channel=${RUST_CHANNEL} \ + --release-channel=${SLOT} \ --disable-manage-submodules \ $(use_enable clang) \ $(use_enable debug) \ |