# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Ike Devolder <ike.devolder@gmail.com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>

pkgname=taglib
pkgver=2.2.1
pkgrel=1
pkgdesc='A Library for reading and editing the meta-data of several popular audio formats'
arch=(x86_64 aarch64)
url='https://taglib.github.io/'
license=(LGPL-2.1-only
         MPL-1.1)
depends=(glibc
         libgcc
         libstdc++
         sh
         zlib)
makedepends=(cmake
             git
             utf8cpp)
checkdepends=(cppunit)
source=(git+https://github.com/taglib/taglib#tag=v$pkgver)
sha256sums=('ce64ef47fc4f4c9e89b0e51329ab29abdf49cd80148149a3dcbae920e05b3ae3')

build() {
  cmake -B build -S $pkgname \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON
  cmake --build build
}

check() {
  cmake --build build --target test
}

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