# Maintainer: umarcor <unai.martinezcorral@ehu.eus>

_realname=serial-studio
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0.20
pkgrel=1
pkgdesc="Serial Studio: Multi-purpose serial data visualization & processing program (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="https://github.com/Serial-Studio/Serial-Studio"
license=('MIT')
groups=("${MINGW_PACKAGE_PREFIX}-eda")
depends=("${MINGW_PACKAGE_PREFIX}-qt5")
makedepends=(
  'git'
  "${MINGW_PACKAGE_PREFIX}-gcc"
  "${MINGW_PACKAGE_PREFIX}-cmake"
)

source=("${_realname}::git+https://github.com/${_realname}/${_realname}#commit=v${pkgver}")
sha256sums=('SKIP')

build() {
  cd "${srcdir}/${_realname}"
  git submodule update --init --recursive
  mkdir build
  cd build
  MSYS2_ARG_CONV_EXCL="PREFIX=" \
  qmake PREFIX="${MINGW_PREFIX}" ..
  make
}

check() {
  "${srcdir}/${_realname}"/build/release/Serial-Studio.exe --help
}

package() {
  cd "${srcdir}/${_realname}"/build
  make INSTALL_ROOT="${pkgdir}" install
}
