# Description: A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries
# URL: https://github.com/lu-zero/cargo-c/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: libgit2 rust

name=cargo-c
version=0.9.23
release=1
source=(https://github.com/lu-zero/cargo-c/archive/v$version/$name-$version.tar.gz)

build() {
  prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
  [[ ! -e $PKGMK_SOURCE_DIR/rust ]] && mkdir $PKGMK_SOURCE_DIR/rust

  export CFLAGS+=' -ffat-lto-objects'
  cargo build --release --manifest-path $name-$version/Cargo.toml

  cargo install --offline --no-track --path $name-$version --root $PKG/usr
}
