pkgname=libsndfile
pkgver=1.2.2
pkgdesc="C library for reading and writing files containing sampled sound"
homepage="https://libsndfile.github.io/libsndfile/"
licenses=("LGPL-2.1")
sources=("${pkgname}-${pkgver}.tar.xz")
urls=("https://github.com/libsndfile/libsndfile/releases/download/${pkgver}/${sources[0]}")
sha512sums=("a6e3ea3ac5d91befaa99f6a31a3fac44e7b7c11f1de4698167317a461d5a19a2651d47486a920b34400f18367b4f6173bf0c1c9ba80eb682cece1b5beee352a0")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  CFLAGS+=" -std=gnu17"
  local conf_args=(
    --prefix=/usr
    --docdir=/usr/share/doc/${pkgname}-${pkgver}
    --disable-octave
    --disable-static
    --disable-werror
    --enable-external-libs
    --disable-mpeg
    --enable-full-suite
    --disable-alsa
    --disable-sqlite
  )
  ./configure "${conf_args[@]}"
  make
}

src_check() {
  make check
}

src_install() {
  make DESTDIR="$pkgdir" install
}

# vim:ft=sh syn=sh et sw=2:
