archrelease: copy trunk to community-any
[ArchLinux/community.git] / cargo-c / repos / community-x86_64 / PKGBUILD
blob995fb5937d17cc883da9dbe8d12553d77b933523
1 # Maintainer: Daniel Bermond <dbermond@archlinux.org>
3 pkgname=cargo-c
4 pkgver=0.9.19
5 pkgrel=1
6 pkgdesc='A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries'
7 arch=('x86_64')
8 url='https://github.com/lu-zero/cargo-c/'
9 license=('MIT')
10 depends=('curl' 'openssl' 'zlib')
11 makedepends=('cargo')
12 source=("https://github.com/lu-zero/cargo-c/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
13         "${pkgname}-${pkgver}.Cargo.lock"::"https://github.com/lu-zero/cargo-c/releases/download/v${pkgver}/Cargo.lock")
14 sha256sums=('c2633ff22e52da9985394f30c8ef5e9abbac4d14c9b79e3690c8e95cf500ab97'
15             '7dc8d68efcda151e0b284654c9ca0a17af4cc8bbf4db88342297b016361ef0d3')
17 prepare() {
18     ln -sf "../${pkgname}-${pkgver}.Cargo.lock" "${pkgname}-${pkgver}/Cargo.lock"
19     cargo fetch --locked --target "${CARCH}-unknown-linux-gnu" --manifest-path="${pkgname}-${pkgver}/Cargo.toml"
22 build() {
23     export CFLAGS+=' -ffat-lto-objects'
24     export RUSTUP_TOOLCHAIN='stable'
25     export CARGO_TARGET_DIR="${pkgname}-${pkgver}/target"
26     cargo build --release --frozen --manifest-path="${pkgname}-${pkgver}/Cargo.toml"
29 check() {
30     export CFLAGS+=' -ffat-lto-objects'
31     export RUSTUP_TOOLCHAIN='stable'
32     export CARGO_TARGET_DIR="${pkgname}-${pkgver}/target"
33     cargo test --frozen --manifest-path="${pkgname}-${pkgver}/Cargo.toml"
36 package() {
37     find "${pkgname}-${pkgver}/target/release" -maxdepth 1 -type f -executable -exec install -D -m755 -t "${pkgdir}/usr/bin" {} +
38     install -D -m644 "${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"