1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 CARGO_SNAPSHOT_DATE="2016-03-21"
8 CARGO_INDEX_COMMIT="64a9f2f594cefc2ca652e0cecf7ce6e41c0279ee"
9 CRATES="advapi32-sys-0.1.2
33 libressl-pnacl-sys-2.1.6
47 pnacl-build-helper-1.4.10
51 rustc-serialize-0.3.18
59 unicode-normalization-0.1.2
68 inherit cargo bash-completion-r1
70 DESCRIPTION="The Rust's package manager"
71 HOMEPAGE="http://crates.io"
72 SRC_URI="https://github.com/rust-lang/cargo/archive/${PV}.tar.gz -> ${P}.tar.gz
73 https://github.com/rust-lang/crates.io-index/archive/${CARGO_INDEX_COMMIT}.tar.gz -> cargo-registry-${CARGO_INDEX_COMMIT}.tar.gz
74 $(cargo_crate_uris ${CRATES})
76 https://static.rust-lang.org/cargo-dist/${CARGO_SNAPSHOT_DATE}/cargo-nightly-i686-unknown-linux-gnu.tar.gz ->
77 cargo-snapshot-x86-${CARGO_SNAPSHOT_DATE}.tar.gz
80 https://static.rust-lang.org/cargo-dist/${CARGO_SNAPSHOT_DATE}/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz ->
81 cargo-snapshot-amd64-${CARGO_SNAPSHOT_DATE}.tar.gz
85 LICENSE="|| ( MIT Apache-2.0 )"
87 KEYWORDS="~amd64 ~x86"
91 COMMON_DEPEND="sys-libs/zlib
95 RDEPEND="${COMMON_DEPEND}
98 DEPEND="${COMMON_DEPEND}
99 >=dev-lang/rust-1.1.0:stable
107 # Cargo only supports these GNU triples:
108 # - Linux: <arch>-unknown-linux-gnu
109 # - MacOS: <arch>-apple-darwin
110 # - Windows: <arch>-pc-windows-gnu
111 # where <arch> could be 'x86_64' (amd64) or 'i686' (x86)
112 use amd64 && CTARGET="x86_64-unknown-linux-gnu"
113 use x86 && CTARGET="i686-unknown-linux-gnu"
115 # NOTE: 'disable-nightly' is used by crates (such as 'matches') to entirely
116 # skip their internal libraries that make use of unstable rustc features.
117 # Don't use 'enable-nightly' with a stable release of rustc as DEPEND,
118 # otherwise you could get compilation issues.
119 # see: github.com/gentoo/gentoo-rust/issues/13
126 --disable-verify-install
128 --disable-cross-tests
130 econf "${myeconfargs[@]}"
135 export CARGO_HOME="${ECARGO_HOME}"
136 emake VERBOSE=1 PKG_CONFIG_PATH=""
138 # Building HTML documentation
143 emake prepare-image-${CTARGET} IMGDIR_${CTARGET}="${ED}/usr"
145 # Install HTML documentation
146 use doc && HTML_DOCS=("target/doc")
149 dobashcomp "${ED}"/usr/etc/bash_completion.d/cargo
150 rm -rf "${ED}"/usr/etc || die
155 # NOTE: by default 'make test' uses the copy of cargo (v0.0.1-pre-nighyly)
156 # from the installer snapshot instead of the version just built, so the
157 # ebuild needs to override the value of CFG_LOCAL_CARGO to avoid false
158 # positives from unit tests.
160 CFG_ENABLE_OPTIMIZE=1 \
162 CFG_LOCAL_CARGO="${WORKDIR}"/${P}/target/${CTARGET}/release/cargo