1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 CARGO_SNAPSHOT_DATE="2016-09-01"
60 rustc-serialize-0.3.21
71 unicode-normalization-0.1.2
80 inherit cargo bash-completion-r1
82 DESCRIPTION="The Rust's package manager"
83 HOMEPAGE="http://crates.io"
84 SRC_URI="https://github.com/rust-lang/cargo/archive/${PV}.tar.gz -> ${P}.tar.gz
85 $(cargo_crate_uris ${CRATES})
87 https://static.rust-lang.org/cargo-dist/${CARGO_SNAPSHOT_DATE}/cargo-nightly-i686-unknown-linux-gnu.tar.gz ->
88 cargo-snapshot-x86-${CARGO_SNAPSHOT_DATE}.tar.gz
91 https://static.rust-lang.org/cargo-dist/${CARGO_SNAPSHOT_DATE}/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz ->
92 cargo-snapshot-amd64-${CARGO_SNAPSHOT_DATE}.tar.gz
96 LICENSE="|| ( MIT Apache-2.0 )"
98 KEYWORDS="~amd64 ~x86"
102 COMMON_DEPEND="sys-libs/zlib
103 !libressl? ( dev-libs/openssl:0= )
104 libressl? ( dev-libs/libressl:0= )
106 net-libs/http-parser"
107 RDEPEND="${COMMON_DEPEND}
110 DEPEND="${COMMON_DEPEND}
111 >=dev-lang/rust-1.9.0:stable
119 # Cargo only supports these GNU triples:
120 # - Linux: <arch>-unknown-linux-gnu
121 # - MacOS: <arch>-apple-darwin
122 # - Windows: <arch>-pc-windows-gnu
123 # where <arch> could be 'x86_64' (amd64) or 'i686' (x86)
124 use amd64 && CTARGET="x86_64-unknown-linux-gnu"
125 use x86 && CTARGET="i686-unknown-linux-gnu"
127 # NOTE: 'disable-nightly' is used by crates (such as 'matches') to entirely
128 # skip their internal libraries that make use of unstable rustc features.
129 # Don't use 'enable-nightly' with a stable release of rustc as DEPEND,
130 # otherwise you could get compilation issues.
131 # see: github.com/gentoo/gentoo-rust/issues/13
136 --cargo="${WORKDIR}"/${P}/target/snapshot/bin/cargo
138 # --release-channel stable
139 --disable-verify-install
141 --disable-cross-tests
143 econf "${myeconfargs[@]}"
148 export CARGO_HOME="${ECARGO_HOME}"
149 emake VERBOSE=1 PKG_CONFIG_PATH=""
151 # Building HTML documentation
156 emake prepare-image-${CTARGET} IMGDIR_${CTARGET}="${ED}/usr"
158 # Install HTML documentation
159 use doc && HTML_DOCS=("target/doc")
162 dobashcomp "${ED}"/usr/etc/bash_completion.d/cargo
163 rm -rf "${ED}"/usr/etc || die
168 # NOTE: by default 'make test' uses the copy of cargo (v0.0.1-pre-nighyly)
169 # from the installer snapshot instead of the version just built, so the
170 # ebuild needs to override the value of CFG_LOCAL_CARGO to avoid false
171 # positives from unit tests.
173 CFG_ENABLE_OPTIMIZE=1 \
175 CFG_LOCAL_CARGO="${WORKDIR}"/${P}/target/${CTARGET}/release/cargo