From 6c30cc2d5bd48ddbdbe8d75544899cd5dbfcaba4 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 14 Jul 2018 20:18:26 +0100 Subject: gentoo resync : 14.07.2018 --- dev-lang/rust-bin/Manifest | 15 ++- dev-lang/rust-bin/metadata.xml | 4 + dev-lang/rust-bin/rust-bin-1.27.0.ebuild | 125 ++++++++++++++++++++++++ dev-lang/rust-bin/rust-bin-1.27.1-r1.ebuild | 142 ++++++++++++++++++++++++++++ dev-lang/rust-bin/rust-bin-1.27.1.ebuild | 130 +++++++++++++++++++++++++ 5 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 dev-lang/rust-bin/rust-bin-1.27.0.ebuild create mode 100644 dev-lang/rust-bin/rust-bin-1.27.1-r1.ebuild create mode 100644 dev-lang/rust-bin/rust-bin-1.27.1.ebuild (limited to 'dev-lang/rust-bin') diff --git a/dev-lang/rust-bin/Manifest b/dev-lang/rust-bin/Manifest index 8080099fdd25..fe05985b65a4 100644 --- a/dev-lang/rust-bin/Manifest +++ b/dev-lang/rust-bin/Manifest @@ -13,7 +13,20 @@ DIST rust-1.26.2-arm-unknown-linux-gnueabihf.tar.xz 98502692 BLAKE2B 124040a31e9 DIST rust-1.26.2-armv7-unknown-linux-gnueabihf.tar.xz 98828932 BLAKE2B 2f60e65128bd32d97422d82d99f5c5447d1c1e77582028089d52208e3ede4af5e72c278a3fb5001348c864087f3e85af05604a0b6078891c5ed812d745840d93 SHA512 7b8e3f39a62b7b5fdaa6d53e5638de26968799d97b5d53e09bf49456b02f968495cff4757f25d38bc3393ca33dc1b9da353ec290ba9416770e082548aa5079ac DIST rust-1.26.2-i686-unknown-linux-gnu.tar.xz 143090096 BLAKE2B 7871fa4e4d0f320ff949cd31cefa116bc7b741927626958e1d10197f05fc9a662b8d6c21ddd4d2910700e6f7273e4fc18738e6ff58cd85b9af4ed25eceea31d9 SHA512 859b5b72c78cca8cd473012599ca12539ef9a5ee38d1aaaad024019fd84220e344e1cd0efd2b027ef333555b158b23529f35ceb5d59d76c35e7946b5fe4a8a52 DIST rust-1.26.2-x86_64-unknown-linux-gnu.tar.xz 138609432 BLAKE2B 54507a8ce3ab2676e6e66852b6d3f1a47ca07ad4b56383f6247149309a0f60f67fbf0a6ba27d968c24340c07d7d5074942c6eaccbc1207c5e75fd9a6f47b2481 SHA512 29e474b0eab4dd2ffa0b964d83f52ffce530e75c4193e307410ef6d20ef9ad2b300a4f467bdf06b3311157340e9295cb9b1efdcf08dafee66979b076c2afba7e +DIST rust-1.27.0-arm-unknown-linux-gnueabi.tar.xz 101002020 BLAKE2B e725b5cd8ec5ec9c035b70c7a45f49e21332846bc4e760afce4abc5d6de3a84029d06e1df0ca430d9b9b1117d4b534146310391254ebad458552d40b152aa56a SHA512 c0924ae1296802d6bed09944cb04b98414dcd4e102387cc1c4810e26793409daf4622300d451d297c9a84890f108dff1bb4ef70381d582b6d26aae0b2c38e476 +DIST rust-1.27.0-arm-unknown-linux-gnueabihf.tar.xz 101316444 BLAKE2B f3c2e5f0cd6c75e51c3a25bd9aad34180d04bb97187f1ce240b6682e64026efee3359a71d1aadf9ea2fadf0cffa277daade02703d1e70c2fa43f68624ccf43a8 SHA512 5c374d103377dc94e5a68c46deba22080b374dd652cfc64abc69fbbe69e59b40537208534a15c860fb985abb426468eef33b7d6c9a8fee3f855a447c6c0ced4f +DIST rust-1.27.0-armv7-unknown-linux-gnueabihf.tar.xz 98186744 BLAKE2B add9b9ce125e8e0216579fc4eb9a615396bc6798bd8fe52fc5e02b4eddbca991e227fa1022d5ea86473e4a2f4738fe8e30ad01899bac78b6c2072eead9b9e69d SHA512 034288fd8767f1773b4a5232b26e68a812d0f8084e39dff776d3c8d235f2b3f51c12620a0346851fccbb0ab3cd194938682fa8e9d8641f8ee3c3d9259c96a86f +DIST rust-1.27.0-i686-unknown-linux-gnu.tar.xz 144744880 BLAKE2B ef48cd1b2601868840c59274a776be40e0ac8ce674d0a00712176e28f5e381b95b790d898fdfdae153768b754f87662c581cd5b11752d5d4401aadd9b446fc7b SHA512 66508f09e7a48d72d4a18da209dadd5e11fc1e9811726fdfa8de609359eee6bc1d8d3b578b50ab0b4dcff879e96edd6d60449508eed7d2d44f72b2c8c29e2546 +DIST rust-1.27.0-x86_64-unknown-linux-gnu.tar.xz 144343920 BLAKE2B 214530a0724f0fa6e1c4e769787a1c0d56e9a6c13a0cacdb9f639d523915fbd413fe42ccd9073308b14b551804d269061ed9bc03cc6761b817bc556e1837d005 SHA512 e57b60cafec48a396cde1ff62bd01148e0e3c803b9b97d70a7cf477a7d3a4295ca98fa99a1252004751e8529b214c2859cd2134ce722b3336b9640c2aef6f625 +DIST rust-1.27.1-arm-unknown-linux-gnueabi.tar.xz 101083416 BLAKE2B 2fd3a4b0c8a6cc1e7f7bc11300081183144639c4d02b8bb989154fbad92ad1e30ac8171993d8296ce8f0486dd018df46360693d912b50ca0c299c4c059f79d17 SHA512 7fa376f077abad6e24b81aa98ab7d953b8257388212a509c7a061ebe022cefd5bd042f24fc4444287bc4fb4cb9a6cbb651ae0d8146b5d4fe73d395ebb7192367 +DIST rust-1.27.1-arm-unknown-linux-gnueabihf.tar.xz 101382108 BLAKE2B 8743930b86b8ac1032afc5ced83f57b0606e9143a9d8e30a8b2ede70abb415fc2f1a904cb4b92adde7f71d54e83384509f02220cea9a9ab189a79815a58bd434 SHA512 be49a245163bef0345cd138fdc8d13a8403bf6b523505666650119eba87921f6a1abb04267bc698da30e5e688d8592fc20d8d3d63aff7ac1fa7397950531d329 +DIST rust-1.27.1-armv7-unknown-linux-gnueabihf.tar.xz 98288932 BLAKE2B 4794e8c54c8f733de6129829bab9e02644651fd6350db76bdb8c69f32fcff0a61e4992241431fea2b871e04a6f28607810918c5161a5a8a0b3fe756a37b619e3 SHA512 405bd579e69ec73de384487c4cd77eefcbc6c537ca3421f38ce2d35b8cd911def82fb9006b788a8aa6cdef69f620a5b1f2a2f7364bf7ddd0452d80b33315fa43 +DIST rust-1.27.1-i686-unknown-linux-gnu.tar.xz 144852524 BLAKE2B f087ad3ee7f942482c6aa02f9dcdc4adf6ede64e698024f7dcca6dccedcc5f9e9805050015d8328c5b672c94cb7f1008551a95a69b1ce8e754e048c5604dd11e SHA512 e0c7d5f64db768321bbdf229529b12f93e36507db03329b0b26094fd81cdf013804f929105ac4545903eb4494770120407c40616086b431ea66413be7e1163d3 +DIST rust-1.27.1-x86_64-unknown-linux-gnu.tar.xz 144328984 BLAKE2B 45551c2f4258c821e9b56ac09d673c46032b5f480da5fc51c0e0e33f66be7f0619aa4ad878336dbffae32e6eb43f2adfbba927ad5cfbb919b9e4395169d5c3bd SHA512 b419c19f75082a63a669ebeeefbce907ca7e7ac50a1c1355d1b10b3a4c1f8e28a76c4fd677efd8cb966a6e70a76059813e39b8dfe93de1401c7419d57ddca52a EBUILD rust-bin-1.25.0.ebuild 3456 BLAKE2B c25d70226b0ea86619e749fce47b34706b08257bb0a33f99d6ceeff477040e1dadb4daa830e9c23463f4b20283109292c499dc216753ab9070717275800a8133 SHA512 a423705eb4fc96bd0fe3efe5f79187be88f46a965c1735a65c1990b43917d8d2fb8298b536375db590edd25314c41fa0aef344f8444c9413426013885f0adcc7 EBUILD rust-bin-1.26.0.ebuild 3591 BLAKE2B 37db63381b0ece72c839661baa5102b7359b7e5ab68b36e2a6de513deff00a413c5dfe27ffcc94c45807a5f2288620b2bd10dc48da06790adb330a54d5bff47f SHA512 f297a3b61e89996fb8e4e52274571fad69602772cb3168574c724b42f59d710f571cba30bcbf32086584d8a93e87313689aeeab4c600a24355b3e82e31e297c9 EBUILD rust-bin-1.26.2.ebuild 3584 BLAKE2B 932ca808ee2ec13b9b3b400a3ba1b88eddbca83b1d80d03951692c8ec232ebe4df1e7ee9c2a80a8753a8069d4ed2db67d352ba6a89e4e2d13333c7c30494cec5 SHA512 9a4c592ffa1793574b31d73e8922257651b8336812755fa98a576d05bd346118d08e9344f0c11a21e3024e3346da115c2adba44c2393185e051e18bbc4bf0eec -MISC metadata.xml 250 BLAKE2B fe9734e0ff554c2ae0be039e12f780b2a36e30b518a00cac557fc63b2eecb4c9c61d914aae6f9a3f80efd109e596717ed3e5db4756440f923657fe41cb208e78 SHA512 659ffa5a36819a0534e5c614275998a130d02260924fa03d43b667f38672041b6740fb9c1efbc74d3f900ee4d3c14280aefa93d0c99fa27c1159683956f2c8f0 +EBUILD rust-bin-1.27.0.ebuild 3584 BLAKE2B 932ca808ee2ec13b9b3b400a3ba1b88eddbca83b1d80d03951692c8ec232ebe4df1e7ee9c2a80a8753a8069d4ed2db67d352ba6a89e4e2d13333c7c30494cec5 SHA512 9a4c592ffa1793574b31d73e8922257651b8336812755fa98a576d05bd346118d08e9344f0c11a21e3024e3346da115c2adba44c2393185e051e18bbc4bf0eec +EBUILD rust-bin-1.27.1-r1.ebuild 4276 BLAKE2B 5d333ac21078b8c31570665b882d7f21a4f10efc1b79a016bc032dc0aa7c95db8fa822d05befbe5ba5ff0ff6991478e6c197dc4c57173eb9a2a037182a282004 SHA512 5dcde407708a0f7000e8a3e5a237c8b0ba80a1d2ee7dda47adcdfa24ad25c5c7a7c37774931f93ebe79b50f71ebd1df8b05400f12cb65f5b7689f55a5c101a97 +EBUILD rust-bin-1.27.1.ebuild 3839 BLAKE2B f420bb2b4c550670872b635ebf8bc9aa19811a640f6cacf5d4a79e6bec7c7793685813fc4ec2aa5ee4eec45f2f6e06a0b54f821492ac481f86cc177ebcad37f2 SHA512 9f9a50a92b018361fb0044f97c94a11239ddd03bf3aa91521029e59d79bca15c29f66559f3bdd280acd413bf7dc8af5d5c5b6a15dcb2d66e0bc4519d2879a059 +MISC metadata.xml 379 BLAKE2B e2b131a15a86c6230ef9ff560fc522c9e37ed06d2d44eb7e63fa91a01673acbe0dbf80d6e774e68edca439521bb9d61d509ea69203f3c10f496f0c638c8c5368 SHA512 ed16a24b5d5f34471dbc5d411de5a819015cd9da81b55e593401ed52425fc5aa53c793e0e00966fc44e599a99036c5b9756a66b31a85cd80abe41dc97f9f785f diff --git a/dev-lang/rust-bin/metadata.xml b/dev-lang/rust-bin/metadata.xml index 85cf4eb92057..3407a1ae8de4 100644 --- a/dev-lang/rust-bin/metadata.xml +++ b/dev-lang/rust-bin/metadata.xml @@ -5,4 +5,8 @@ rust@gentoo.org Rust Project + + Install cargo component + Install rustfmt component + diff --git a/dev-lang/rust-bin/rust-bin-1.27.0.ebuild b/dev-lang/rust-bin/rust-bin-1.27.0.ebuild new file mode 100644 index 000000000000..0eea0a7d10c1 --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.27.0.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils bash-completion-r1 versionator toolchain-funcs + +MY_P="rust-${PV}" + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" +SRC_URI="amd64? ( https://static.rust-lang.org/dist/${MY_P}-x86_64-unknown-linux-gnu.tar.xz ) + arm? ( + https://static.rust-lang.org/dist/${MY_P}-arm-unknown-linux-gnueabi.tar.xz + https://static.rust-lang.org/dist/${MY_P}-arm-unknown-linux-gnueabihf.tar.xz + https://static.rust-lang.org/dist/${MY_P}-armv7-unknown-linux-gnueabihf.tar.xz + ) + x86? ( https://static.rust-lang.org/dist/${MY_P}-i686-unknown-linux-gnu.tar.xz )" + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="stable" +KEYWORDS="~amd64 ~x86" +IUSE="doc" + +CARGO_DEPEND_VERSION="0.$(($(get_version_component_range 2) + 1)).0" + +DEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 + !dev-lang/rust:0 +" +RDEPEND="${DEPEND}" +PDEPEND=">=dev-util/cargo-${CARGO_DEPEND_VERSION}" + +QA_PREBUILT=" + opt/${P}/bin/rustc-bin-${PV} + opt/${P}/bin/rustdoc-bin-${PV} + opt/${P}/lib/*.so + opt/${P}/lib/rustlib/*/lib/*.so + opt/${P}/lib/rustlib/*/lib/*.rlib* +" + +pkg_pretend () { + if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then + die "${CHOST} is not supported by upstream Rust. You must use a hard float version." + fi +} + +src_unpack() { + default + + local postfix + use amd64 && postfix=x86_64-unknown-linux-gnu + + if use arm && [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv6* ]]; then + postfix=arm-unknown-linux-gnueabi + elif use arm && [[ ${CHOST} == armv6*h* ]]; then + postfix=arm-unknown-linux-gnueabihf + elif use arm && [[ ${CHOST} == armv7*h* ]]; then + postfix=armv7-unknown-linux-gnueabihf + fi + + use x86 && postfix=i686-unknown-linux-gnu + mv "${WORKDIR}/${MY_P}-${postfix}" "${S}" || die +} + +src_install() { + local std=$(grep 'std' ./components) + local components="rustc,${std}" + 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}" +} + +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-vim 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-1.27.1-r1.ebuild b/dev-lang/rust-bin/rust-bin-1.27.1-r1.ebuild new file mode 100644 index 000000000000..53d2d4e87ebe --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.27.1-r1.ebuild @@ -0,0 +1,142 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils bash-completion-r1 versionator toolchain-funcs + +MY_P="rust-${PV}" + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" +SRC_URI="amd64? ( https://static.rust-lang.org/dist/${MY_P}-x86_64-unknown-linux-gnu.tar.xz ) + arm? ( + https://static.rust-lang.org/dist/${MY_P}-arm-unknown-linux-gnueabi.tar.xz + https://static.rust-lang.org/dist/${MY_P}-arm-unknown-linux-gnueabihf.tar.xz + https://static.rust-lang.org/dist/${MY_P}-armv7-unknown-linux-gnueabihf.tar.xz + ) + x86? ( https://static.rust-lang.org/dist/${MY_P}-i686-unknown-linux-gnu.tar.xz )" + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="stable" +KEYWORDS="~amd64 ~x86" +IUSE="cargo doc rustfmt" + +CARGO_DEPEND_VERSION="0.$(($(get_version_component_range 2) + 1)).0" + +DEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 + !dev-lang/rust:0 + cargo? ( !dev-util/cargo ) + rustfmt? ( !dev-util/rustfmt ) +" +RDEPEND="${DEPEND}" +PDEPEND="!cargo? ( >=dev-util/cargo-${CARGO_DEPEND_VERSION} )" + +QA_PREBUILT=" + opt/${P}/bin/*-${PV} + opt/${P}/lib/*.so + opt/${P}/lib/rustlib/*/lib/*.so + opt/${P}/lib/rustlib/*/lib/*.rlib* +" + +pkg_pretend () { + if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then + die "${CHOST} is not supported by upstream Rust. You must use a hard float version." + fi +} + +src_unpack() { + default + + local postfix + use amd64 && postfix=x86_64-unknown-linux-gnu + + if use arm && [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv6* ]]; then + postfix=arm-unknown-linux-gnueabi + elif use arm && [[ ${CHOST} == armv6*h* ]]; then + postfix=arm-unknown-linux-gnueabihf + elif use arm && [[ ${CHOST} == armv7*h* ]]; then + postfix=armv7-unknown-linux-gnueabihf + fi + + use x86 && postfix=i686-unknown-linux-gnu + mv "${WORKDIR}/${MY_P}-${postfix}" "${S}" || die +} + +src_install() { + local std=$(grep 'std' ./components) + local components="rustc,${std}" + use doc && components="${components},rust-docs" + use cargo && components="${components},cargo" + use rustfmt && components="${components},rustfmt-preview" + ./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}" + + if use cargo; then + local cargo=cargo-${PV} + mv "${D}/opt/${P}/bin/cargo" "${D}/opt/${P}/bin/${cargo}" || die + dosym "../../opt/${P}/bin/${cargo}" "/usr/bin/${cargo}" + fi + if use rustfmt; then + local rustfmt=rustfmt-${PV} + local cargo_fmt=cargo-fmt-${PV} + mv "${D}/opt/${P}/bin/rustfmt" "${D}/opt/${P}/bin/${rustfmt}" || die + mv "${D}/opt/${P}/bin/cargo-fmt" "${D}/opt/${P}/bin/${cargo_fmt}" || die + dosym "../../opt/${P}/bin/${rustfmt}" "/usr/bin/${rustfmt}" + dosym "../../opt/${P}/bin/${cargo_fmt}" "/usr/bin/${cargo_fmt}" + fi + + 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}" +} + +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-vim 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-1.27.1.ebuild b/dev-lang/rust-bin/rust-bin-1.27.1.ebuild new file mode 100644 index 000000000000..c1554f3d217c --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.27.1.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils bash-completion-r1 versionator toolchain-funcs + +MY_P="rust-${PV}" + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" +SRC_URI="amd64? ( https://static.rust-lang.org/dist/${MY_P}-x86_64-unknown-linux-gnu.tar.xz ) + arm? ( + https://static.rust-lang.org/dist/${MY_P}-arm-unknown-linux-gnueabi.tar.xz + https://static.rust-lang.org/dist/${MY_P}-arm-unknown-linux-gnueabihf.tar.xz + https://static.rust-lang.org/dist/${MY_P}-armv7-unknown-linux-gnueabihf.tar.xz + ) + x86? ( https://static.rust-lang.org/dist/${MY_P}-i686-unknown-linux-gnu.tar.xz )" + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="stable" +KEYWORDS="~amd64 ~x86" +IUSE="cargo doc" + +CARGO_DEPEND_VERSION="0.$(($(get_version_component_range 2) + 1)).0" + +DEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 + !dev-lang/rust:0 + cargo? ( !dev-util/cargo ) +" +RDEPEND="${DEPEND}" +PDEPEND=">=dev-util/cargo-${CARGO_DEPEND_VERSION}" + +QA_PREBUILT=" + opt/${P}/bin/rustc-bin-${PV} + opt/${P}/bin/rustdoc-bin-${PV} + opt/${P}/lib/*.so + opt/${P}/lib/rustlib/*/lib/*.so + opt/${P}/lib/rustlib/*/lib/*.rlib* +" + +pkg_pretend () { + if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then + die "${CHOST} is not supported by upstream Rust. You must use a hard float version." + fi +} + +src_unpack() { + default + + local postfix + use amd64 && postfix=x86_64-unknown-linux-gnu + + if use arm && [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv6* ]]; then + postfix=arm-unknown-linux-gnueabi + elif use arm && [[ ${CHOST} == armv6*h* ]]; then + postfix=arm-unknown-linux-gnueabihf + elif use arm && [[ ${CHOST} == armv7*h* ]]; then + postfix=armv7-unknown-linux-gnueabihf + fi + + use x86 && postfix=i686-unknown-linux-gnu + mv "${WORKDIR}/${MY_P}-${postfix}" "${S}" || die +} + +src_install() { + local std=$(grep 'std' ./components) + local components="rustc,${std}" + use doc && components="${components},rust-docs" + use cargo && components="${components},cargo" + ./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} + local cargo=cargo-${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 + use cargo && mv "${D}/opt/${P}/bin/cargo" "${D}/opt/${P}/bin/${cargo}" || 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}" + use cargo && dosym "../../opt/${P}/bin/${cargo}" "/usr/bin/${cargo}" + + 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}" +} + +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-vim 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 +} -- cgit v1.2.3