# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Vaporeon <vaporeon@vaporeon.io>

pkgname=corrosion
pkgver=0.5.2
pkgrel=1
pkgdesc='Tool for integrating Rust into an existing CMake project'
arch=(any)
url='https://github.com/corrosion-rs/corrosion'
license=(MIT)
depends=(cmake
         rust)
makedepends=(git)
source=(git+https://github.com/corrosion-rs/corrosion#tag=v$pkgver)
sha256sums=('ff6ed913b26218fdf7f394b3793e08ed9f7b42fe57a2be0e18b7338f2429f13a')

build() {
  cmake -B build -S $pkgname \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DCORROSION_BUILD_TESTS=OFF
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 $pkgname/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
