1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 CARGO_SNAPSHOT_DATE="2016-09-01"
38 libressl-pnacl-sys-2.1.6
58 openssl-sys-extras-0.7.14
60 pnacl-build-helper-1.4.10
64 rustc-serialize-0.3.19
74 unicode-normalization-0.1.2
83 inherit cargo bash-completion-r1
85 DESCRIPTION="The Rust's package manager"
86 HOMEPAGE="http://crates.io"
87 SRC_URI="https://github.com/rust-lang/cargo/archive/${PV}.tar.gz -> ${P}.tar.gz
88 $(cargo_crate_uris ${CRATES})
90 https://static.rust-lang.org/cargo-dist/${CARGO_SNAPSHOT_DATE}/cargo-nightly-i686-unknown-linux-gnu.tar.gz ->
91 cargo-snapshot-x86-${CARGO_SNAPSHOT_DATE}.tar.gz
94 https://static.rust-lang.org/cargo-dist/${CARGO_SNAPSHOT_DATE}/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz ->
95 cargo-snapshot-amd64-${CARGO_SNAPSHOT_DATE}.tar.gz
99 LICENSE="|| ( MIT Apache-2.0 )"
101 KEYWORDS="~amd64 ~x86"
105 COMMON_DEPEND="sys-libs/zlib
106 !libressl? ( dev-libs/openssl:0= )
107 libressl? ( dev-libs/libressl:0= )
109 net-libs/http-parser"
110 RDEPEND="${COMMON_DEPEND}
113 DEPEND="${COMMON_DEPEND}
114 >=dev-lang/rust-1.9.0:stable
122 # Cargo only supports these GNU triples:
123 # - Linux: <arch>-unknown-linux-gnu
124 # - MacOS: <arch>-apple-darwin
125 # - Windows: <arch>-pc-windows-gnu
126 # where <arch> could be 'x86_64' (amd64) or 'i686' (x86)
127 use amd64 && CTARGET="x86_64-unknown-linux-gnu"
128 use x86 && CTARGET="i686-unknown-linux-gnu"
130 # NOTE: 'disable-nightly' is used by crates (such as 'matches') to entirely
131 # skip their internal libraries that make use of unstable rustc features.
132 # Don't use 'enable-nightly' with a stable release of rustc as DEPEND,
133 # otherwise you could get compilation issues.
134 # see: github.com/gentoo/gentoo-rust/issues/13
141 --disable-verify-install
143 --disable-cross-tests
145 econf "${myeconfargs[@]}"
150 export CARGO_HOME="${ECARGO_HOME}"
151 emake VERBOSE=1 PKG_CONFIG_PATH=""
153 # Building HTML documentation
158 emake prepare-image-${CTARGET} IMGDIR_${CTARGET}="${ED}/usr"
160 # Install HTML documentation
161 use doc && HTML_DOCS=("target/doc")
164 dobashcomp "${ED}"/usr/etc/bash_completion.d/cargo
165 rm -rf "${ED}"/usr/etc || die
170 # NOTE: by default 'make test' uses the copy of cargo (v0.0.1-pre-nighyly)
171 # from the installer snapshot instead of the version just built, so the
172 # ebuild needs to override the value of CFG_LOCAL_CARGO to avoid false
173 # positives from unit tests.
175 CFG_ENABLE_OPTIMIZE=1 \
177 CFG_LOCAL_CARGO="${WORKDIR}"/${P}/target/${CTARGET}/release/cargo