# Description: Time-stretching and pitch-shifting audio library and utility.
# URL: https://www.breakfastquay.com/rubberband/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: fftw libsamplerate vamp-plugin-sdk
# Optional: ladspa libogg libvorbis openjdk17-jdk opus

name=rubberband
version=3.3.0
release=1
source=(https://github.com/breakfastquay/rubberband/archive/v$version/$name-v$version.tar.gz)

build() {
  if prt-get isinst openjdk17-jdk; then
    export PKGMK_RUBBERBAND+=" -D extra_include_dirs=/usr/lib/java/openjdk17-jdk/include,/usr/lib/java/openjdk17-jdk/include/linux"
    export JAVA_HOME=/usr/lib/java/openjdk17-jdk
    export PATH+=":$JAVA_HOME/bin"
  fi

  meson setup build $name-$version $PKGMK_RUBBERBAND \
    --prefix=/usr \
    --buildtype=plain \
    -D fft=fftw \
    -D resampler=libsamplerate

  meson compile -C build -j ${JOBS:-1}
  DESTDIR=$PKG meson install -C build
}
