1 # Maintainer: Daniel Bermond <dbermond@archlinux.org>
6 pkgdesc='A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries'
8 url='https://github.com/lu-zero/cargo-c/'
10 depends=('curl' 'openssl' 'zlib')
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')
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"
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"
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"
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}"