# Maintainer: Alexandros Theodotou <alex at zrythm dot org>

_realname=lsp-dsp-lib
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0.29
pkgrel=1
pkgdesc='SIMD-optimized library for digital signal processing (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
             "${MINGW_PACKAGE_PREFIX}-make")
license=('spdx:LGPL-3.0 OR GPL-3.0-or-later')
url="https://github.com/lsp-plugins/lsp-dsp-lib"
source=("https://github.com/lsp-plugins/$_realname/releases/download/$pkgver/$_realname-src-$pkgver.tar.gz")
sha256sums=('7da14562c773ba5e167114c91dc847bb4b4cf2ad75e0000312db69dfcd3ec35d')

build() {
  cd "${srcdir}/${_realname}"

  make config PREFIX=${MINGW_PREFIX} ARCHITECTURE=${CARCH}
  make
}

package() {
  cd "${srcdir}/${_realname}"

  make DESTDIR="${pkgdir}" install
  mkdir -p "${pkgdir}${MINGW_PREFIX}/bin"
  mv "${pkgdir}${MINGW_PREFIX}/lib/"*.dll "${pkgdir}${MINGW_PREFIX}/bin"

  for file in COPYING COPYING.LESSER; do
    install -Dm644 $file "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/$file"
  done
}
