# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
pkgname=libimagequant
pkgver=4.3.1
pkgrel=1
pkgdesc="Library for high-quality conversion of RGBA images to 8-bit indexed-color (palette) images"
arch=('x86_64' 'armv7h')
url="https://pngquant.org/lib/"
license=('BSD')
depends=('gcc-libs')
makedepends=('cargo' 'cargo-c')
source=("https://github.com/ImageOptim/libimagequant/archive/$pkgver/libimagequant-$pkgver.tar.gz")
sha256sums=('75020204491f14a8cdf4b857f6c5bab08b6b5f1736345412b296a253bc632bf6')
build() {
cd "$srcdir/$pkgname-$pkgver/imagequant-sys"
cargo cbuild --release --prefix=/usr
}
#check() {
# cd "$srcdir/$pkgname-$pkgver/imagequant-sys"
# cargo ctest --release
#}
package() {
cd "$srcdir/$pkgname-$pkgver/imagequant-sys"
cargo cinstall --destdir="$pkgdir" --prefix=/usr --release
install -Dm644 COPYRIGHT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}