# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: josephgbr <rafael.f.f1@gmail.com>

pkgname=lib32-soundtouch
pkgver=2.3.0
pkgrel=1
pkgdesc='An audio processing library'
arch=(x86_64)
url='https://www.surina.net/soundtouch/'
license=(LGPL)
depends=(
  lib32-gcc-libs
  soundtouch
)
makedepends=(git)
_tag=c65afe49f697fcea87d9a134870c8d115d7700cc
source=(git+https://gitlab.com/soundtouch/soundtouch.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd soundtouch

  git describe --tags
}

prepare() {
  cd soundtouch

  ./bootstrap
}

build() {
  cd soundtouch

  export CC='gcc -m32'
  export CXX='g++ -m32'
  export PKG_CONFIG_PATH=/usr/lib32/pkgconfig

  ./configure \
    --prefix=/usr \
    --libdir=/usr/lib32 \
    --enable-shared
  make
}

package() {
  make DESTDIR="${pkgdir}" -C soundtouch install
  rm -rf "${pkgdir}"/usr/{bin,doc,include,share}
}

# vim: ts=2 sw=2 et:
