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

pkgname=corrosion
pkgver=0.4.5
pkgrel=1
pkgdesc='Tool for integrating Rust into an existing CMake project'
arch=(x86_64 aarch64)
url='https://github.com/corrosion-rs/corrosion'
license=(MIT)
depends=(cmake
         rust)
source=(https://github.com/corrosion-rs/corrosion/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('32e91eb2eac16f1c48c88f2c918ccf82a2c4fc787f872654e658825a0ba48a29')

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

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