1 # Template file for 'cargo'
7 hostmakedepends="cargo-bootstrap rust python3 curl pkg-config zlib-devel"
8 makedepends="rust libcurl-devel openssl-devel"
10 short_desc="Rust package manager"
11 maintainer="Enno Boland <gottox@voidlinux.org>"
12 license="Apache-2.0 OR MIT"
13 homepage="https://crates.io/"
14 distfiles="https://github.com/rust-lang/cargo/archive/refs/tags/${_cargo_revision}.tar.gz"
15 checksum=53fbf5eb9d0c42ce184bd1b170606db7c878e7ef07ed3b513a67e62e14ca4661
16 replaces="cargo-tree>=0"
18 build_options="static bindist"
19 desc_option_bindist="Generate a tarball for bootstrap"
21 if [ -n "$build_option_static" -o -n "$build_option_bindist" ]; then
25 if [ -z "$_build_static" ]; then
26 makedepends+=" libgit2-1.8-devel"
32 # breaks requested building sqlite in bundled mode
33 unset LIBSQLITE3_SYS_USE_PKG_CONFIG
35 if [ -n "$_build_static" ]; then
36 unset LIBSSH2_SYS_USE_PKG_CONFIG
37 export OPENSSL_STATIC=1
38 # rust-openssl can not be linked static if pkg-config is used
39 export OPENSSL_NO_PKG_CONFIG
40 export OPENSSL_DIR="${XBPS_CROSS_BASE}/usr"
43 if [ -n "$_build_static" ]; then
44 cargs+=" --features=all-static"
47 cargo build --release ${cargs}
51 local cbin="target/release/cargo"
52 if [ "$CROSS_BUILD" ]; then
53 cbin="target/${RUST_TARGET}/release/cargo"
56 if [ "$build_option_bindist" ]; then
57 local dest="cargo-${version}-${RUST_TARGET}"
58 mkdir -p ${XBPS_SRCDISTDIR}/distfiles ${dest}/cargo/bin
59 install -m 0755 ${cbin} ${dest}/cargo/bin
60 install -m 0644 LICENSE-APACHE LICENSE-MIT LICENSE-THIRD-PARTY ${dest}
61 bsdtar cvJf ${dest}.tar.xz ${dest}
62 install -m 0644 ${dest}.tar.xz ${XBPS_SRCDISTDIR}/distfiles
67 for f in src/etc/man/*.?; do
70 vinstall src/etc/cargo.bashcomp.sh 0644 \
71 usr/share/bash-completion/completions cargo
72 vinstall src/etc/_cargo 0644 usr/share/zsh/site-functions
74 vlicense LICENSE-APACHE
76 vlicense LICENSE-THIRD-PARTY