blob: f461b332a89042095c9e8a32e1c9325818a5cbfa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=cargo
pkgver=0.22.0
pkgrel=0
pkgdesc="The Rust package manager"
url="https://crates.io"
arch="x86_64" # limited by rust pkg
license="MIT ASL-2.0"
depends="rust"
# Note: Cargo is self-hosted, so you need cargo to build cargo (ugh).
# The last revision of this abuild that does not depend on itself (uses
# prebuilt cargo) is 2282bb03f12bd9c0175feb9972cab2292df46f1e.
makedepends="cargo cmake curl-dev libgit2-dev libssh2-dev libressl-dev
python2 zlib-dev"
subpackages="$pkgname-doc
$pkgname-bash-completion:bashcomp:noarch
$pkgname-zsh-completion:zshcomp:noarch"
# XXX: Cargo depends on many crates (Rust packages) and currently downloads
# them itself in the build phase. This quite violates our policy. However,
# unlike some other package managers, Cargo does not download arbitrary
# packages from the Internet without any verification. The source tarball
# includes file Cargo.lock that contains complete dependency tree with exact
# version and checksum for each crate . With --locked we force cargo to
# adhere to this file and verify checksums. So it provides the same
# guarantees as abuild. That said, for now it's exception only for cargo
# package and should not be applied to other rust packages!
source="$pkgname-$pkgver.tar.gz::https://github.com/rust-lang/$pkgname/archive/$pkgver.tar.gz
tests-fix-build-auth-http_auth_offered.patch
tests-ignore-ssh_something_happens.patch"
builddir="$srcdir/$pkgname-$pkgver"
export CARGO_HOME="$srcdir/.cargo"
_cargo_opts="--release --locked --verbose ${JOBS:+--jobs $JOBS}"
build() {
cd "$builddir"
# Convince libgit2-sys to use the distro libgit2.
export LIBGIT2_SYS_USE_PKG_CONFIG=1
cargo build $_cargo_opts
cargo test $_cargo_opts --no-run
}
check() {
cd "$builddir"
./target/release/cargo --version
CFG_DISABLE_CROSS_TESTS=1 RUST_BACKTRACE=1 \
cargo test $_cargo_opts --no-fail-fast
}
package() {
cd "$builddir"
install -D -m 755 target/release/cargo "$pkgdir"/usr/bin/cargo
mkdir -p "$pkgdir"/usr/share/man/man1
install -m 644 -t "$pkgdir"/usr/share/man/man1/ src/etc/man/*.1
mkdir -p "$pkgdir"/usr/share/licenses/$pkgname
install -m 644 -t "$pkgdir"/usr/share/licenses/$pkgname/ LICENSE*
}
bashcomp() {
pkgdesc="Bash completions for $pkgname"
depends=""
install_if="$pkgname=$pkgver-r$pkgrel bash"
cd "$builddir"
install -D -m 644 -D src/etc/cargo.bashcomp.sh \
"$subpkgdir"/usr/share/bash-completion/completions/cargo
}
zshcomp() {
pkgdesc="ZSH completions for $pkgname"
depends=""
install_if="$pkgname=$pkgver-r$pkgrel zsh"
cd "$builddir"
install -D -m 644 src/etc/_cargo \
"$subpkgdir"/usr/share/zsh/site-functions/_cargo
}
sha512sums="31764df0462fcd0e7ddd29aee63ed0916b0d05e44d72aa815b3b823256e90f85e582c468a517d048e4451dfc1a3b22434abf25d825d3d926ab7a95f7bb44ad40 cargo-0.22.0.tar.gz
4e9a0d409951a72b5c1d3578cb310c0efc5d98a5b963432ec4f485f1d58d2354f0050c31574d6bd9090b7247468ef1a13b04b133deabe6daed91032764468f97 tests-fix-build-auth-http_auth_offered.patch
17c669a71443e21cc5e5cc6eb99933c20562b7df9d859c493ff25252167eb1aea6dd7322a06207776eab1c769464f95a432d1520a949512a52592b1eb115a4be tests-ignore-ssh_something_happens.patch"
|