# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=chromaprint
pkgver=1.5.1
pkgrel=7
pkgdesc="C library for generating audio fingerprints used by AcoustID"
url="https://acoustid.org/chromaprint"
arch="all"
license="MIT"
makedepends="cmake fftw-dev ffmpeg-dev samurai"
options="!check"
subpackages="$pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/acoustid/chromaprint/archive/v$pkgver.tar.gz
	new-ffmpeg-compat-1.patch
	new-ffmpeg-compat-2.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DBUILD_TOOLS=ON .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ea16e4d2b879c15b1d9b9ec93878da8b893f1834c70942663e1d2d106c2e0a661094fe2dd3bae7a6c2a1f9d5d8fab5e0b0ba493561090cf57b2228606fad1e66  chromaprint-1.5.1.tar.gz
e7804f59dafbc3c4b2cb9b87deaf9b46660e902eb55addf7a51b24b60a7221a7e2400cfb69b3944626e1ee04ed93b834bc8dc60b70c06cbd21e045eca313ac81  new-ffmpeg-compat-1.patch
402abb9c65e6d691f248b13fce3f126b3f3f308dffc49b224af3a98c2e4392eb326e7e8e902973fad8e15e6c4af053f4dbdae5d088980778d32f50fd8390dc45  new-ffmpeg-compat-2.patch
"
