diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-09 19:55:08 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-12 14:20:02 +0200 |
commit | 9bbbb65173b57fc96c1cb9a456570c41907c2835 (patch) | |
tree | dbb00596e3db1155b2fb88c171095ca4cb6c9edd /testing/cargo/APKBUILD | |
parent | 3dbe27e7f2807ef9aa9249736e35b8f71beed090 (diff) | |
download | aports-9bbbb65173b57fc96c1cb9a456570c41907c2835.tar.bz2 aports-9bbbb65173b57fc96c1cb9a456570c41907c2835.tar.xz |
testing/cargo: improve abuild
Diffstat (limited to 'testing/cargo/APKBUILD')
-rw-r--r-- | testing/cargo/APKBUILD | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/testing/cargo/APKBUILD b/testing/cargo/APKBUILD index 48e27d9332..e7047ff384 100644 --- a/testing/cargo/APKBUILD +++ b/testing/cargo/APKBUILD @@ -2,37 +2,38 @@ # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=cargo pkgver=0.14.0 -pkgrel=1 +# Git revision of prebuilt Cargo to use for bootstrapping. +_bootstrap_gitrev=333a79884d2463b11f279d815284b6406656c949 +pkgrel=0 pkgdesc="The Rust package manager" url="https://crates.io" -arch="x86_64" +arch="x86_64" # limited by rust pkg license="MIT ASL-2.0" depends="rust" makedepends="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" - # NOTE: Cargo is self-hosted, so you need cargo to build cargo (ugh). # TODO: Implement some support for verifying crates fetched by cargo! +_ctarget="$CARCH-unknown-linux-musl" source="$pkgname-$pkgver.tar.gz::https://github.com/rust-lang/$pkgname/archive/$pkgver.tar.gz - https://s3.amazonaws.com/rust-lang-ci/cargo-builds/333a79884d2463b11f279d815284b6406656c949/cargo-nightly-x86_64-unknown-linux-musl.tar.gz + cargo-$_bootstrap_gitrev-$_ctarget.tar.gz::https://s3.amazonaws.com/rust-lang-ci/cargo-builds/$_bootstrap_gitrev/cargo-nightly-$_ctarget.tar.gz fix-release-num.patch" builddir="$srcdir/$pkgname-$pkgver" -_ctarget="$CARCH-unknown-linux-musl" - build() { - export CARGO_HOME="$builddir/.cargo" - # Convince libgit2-sys to use the distro libgit2. - export LIBGIT2_SYS_USE_PKG_CONFIG=1 - cd "$builddir" + ./configure \ --prefix=/usr \ - --local-cargo="$srcdir/cargo-nightly-$_ctarget/cargo/bin/cargo" \ - || return 1 - make CARGOFLAGS="--locked" VERBOSE=1 + --local-cargo="$srcdir/cargo-nightly-$_ctarget/cargo/bin/cargo" + + # LIBGIT2... Convince libgit2-sys to use the distro libgit2. + make CARGOFLAGS="--locked" \ + CARGO_HOME="$srcdir/.cargo" \ + LIBGIT2_SYS_USE_PKG_CONFIG=1 \ + VERBOSE=1 } package() { @@ -47,10 +48,10 @@ bashcomp() { install_if="$pkgname=$pkgver-r$pkgrel bash" _mv "$pkgdir"/usr/etc/bash_completion.d/* \ - "$subpkgdir"/usr/share/bash-completion/completions/ || return 1 + "$subpkgdir"/usr/share/bash-completion/completions/ # Clean directories which are supposed to be empty. - rmdir "$pkgdir"/usr/etc/bash_completion.d && rmdir "$pkgdir"/usr/etc + rmdir -p "$pkgdir"/usr/etc/bash_completion.d 2>/dev/null || true } zshcomp() { @@ -58,7 +59,7 @@ zshcomp() { depends="" install_if="$pkgname=$pkgver-r$pkgrel zsh" - _mv "$pkgdir"/usr/share/zsh "$subpkgdir"/usr/share/ || return 1 + _mv "$pkgdir"/usr/share/zsh "$subpkgdir"/usr/share/ rmdir "$pkgdir"/usr/share } @@ -68,12 +69,6 @@ _mv() { mv $@ } -md5sums="d789a7785e37a1f299b24bc4b57f98ff cargo-0.14.0.tar.gz -27e5c82f233e2207cca1c1db9218a362 cargo-nightly-x86_64-unknown-linux-musl.tar.gz -fe8c3891c23626882b2380e32450413d fix-release-num.patch" -sha256sums="90ec0e644586959f62e6e34e649ba57db6f74aa37b89e90972f817c49b187531 cargo-0.14.0.tar.gz -928bd9e4966f67fe020d703a549fa04fc18d98227ec2c57f479625cbb58576c2 cargo-nightly-x86_64-unknown-linux-musl.tar.gz -3fa15aa38a1d6c0a8f1b9a1361197faa6c7de79d9e38097b38017cb352098339 fix-release-num.patch" sha512sums="dcd6857f256f1b4cd4d0dfedbb7fceedadcf3ecbe92014f58ff3e668870624d5a1cddda1c4b2653b6ec713c6aef4810760e112e589b6eba81bba9692356acb4f cargo-0.14.0.tar.gz -d55792c55730689b5b7a95db0d57a5c991dd2ee565685bf43e50652597c399569759363acb18d726a2ece5ba5dbdeb396158dfb1aa68a36ca4e3f9ba92e81da3 cargo-nightly-x86_64-unknown-linux-musl.tar.gz +d55792c55730689b5b7a95db0d57a5c991dd2ee565685bf43e50652597c399569759363acb18d726a2ece5ba5dbdeb396158dfb1aa68a36ca4e3f9ba92e81da3 cargo-333a79884d2463b11f279d815284b6406656c949-x86_64-unknown-linux-musl.tar.gz 2db1c0870d20a6cfdff863a17180d960e2891e3cfd0ff565d1d1494eaeacfb553e2d1374cdc626f4ce5bc7c2a1c11ab99ae5462d8c3b44716a0f50f7b2b355fd fix-release-num.patch" |