pkgname=cargo-c pkgver=0.10.7 pkgrel=1 pkgdesc="A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries" arch=('x86_64') url="https://github.com/lu-zero/cargo-c/" license=('MIT') depends=('curl' 'gcc-libs' 'glibc' 'libssh2' 'openssl' 'sqlite' 'zlib') makedepends=('rustc') options=('!lto') source=(https://github.com/lu-zero/cargo-c/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz) sha256sums=() prepare() { cd ${pkgname}-${pkgver} curl -LO https://github.com/lu-zero/cargo-c/releases/download/v${pkgver}/Cargo.lock } build() { cd ${pkgname}-${pkgver} export CFLAGS+=' -ffat-lto-objects' [ ! -e /usr/include/libssh2.h ] || export LIBSSH2_SYS_USE_PKG_CONFIG=1 [ ! -e /usr/include/sqlite3.h ] || export LIBSQLITE3_SYS_USE_PKG_CONFIG=1 cargo build --release } package() { cd ${pkgname}-${pkgver} install -vDm755 target/release/cargo-{capi,cbuild,cinstall,ctest} -t ${pkgdir}/usr/bin/ }