archrelease: copy trunk to community-any
[ArchLinux/community.git] / pngquant / trunk / PKGBUILD
blobef9346ff7b7d201eb585c6af954e6b4e9127db69
1 # Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
2 # Contributor: Hannes Graeuler <hgraeule @ uos dot de>
4 # this is needed only for building the imagequant-sys crate
5 _libver=4.1.1
7 pkgname=pngquant
8 pkgver=3.0.1
9 pkgrel=3
10 pkgdesc="Command-line utility to quantize PNGs down to 8-bit paletted PNGs"
11 arch=('x86_64')
12 url="https://pngquant.org/"
13 license=('BSD')
14 depends=('libpng' 'lcms2' 'libimagequant')
15 makedepends=('cargo')
16 source=("https://github.com/kornelski/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz"
17         "https://github.com/ImageOptim/libimagequant/archive/$_libver/libimagequant-$_libver.tar.gz")
18 sha256sums=('488e4587c27c7515427b231530cc070a6b123727137b32c501658cff3f8a3451'
19             '726ce0bf2a8175a32d1ef303c3e8971a1fda354e760f1327c08656268bb019c2')
21 prepare() {
22     cd "$srcdir/$pkgname-$pkgver"
23     rm -rf lib
24     ln -s ../libimagequant-$_libver lib
25     cargo fetch --target "$CARCH-unknown-linux-gnu"
28 build() {
29     cd "$srcdir/$pkgname-$pkgver"
30     export RUSTUP_TOOLCHAIN=stable
31     export CARGO_TARGET_DIR=target
32     cargo build --release
35 check() {
36     cd "$srcdir/$pkgname-$pkgver"
37     export RUSTUP_TOOLCHAIN=stable
38     cargo test
41 package() {
42     cd "$srcdir/$pkgname-$pkgver"
43     install -Dm755 target/release/pngquant "$pkgdir/usr/bin/pngquant"
44     install -Dm644 pngquant.1 "$pkgdir/usr/share/man/man1/pngquant.1"
45     install -Dm644 COPYRIGHT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"