# Maintainer: David Macek <david.macek.0@gmail.com>

_realname="msys2-launcher"
pkgname=("${_realname}")
pkgver=1.5
pkgrel=4
pkgdesc="Helper for launching MSYS2 shells"
arch=('x86_64' 'i686')
license=('spdx:MIT')
backup=({mingw32,mingw64,msys2,ucrt64,clang64,clangarm64}.ini)
conflicts=("${_realname}-git")
replaces=("${_realname}-git")
depends=("mintty>=1~2.2.1")
if [[ "${CARCH}" == 'i686' ]]; then
  makedepends+=('mingw-w64-cross-mingw32-gcc')
else
  makedepends+=('mingw-w64-cross-mingw64-gcc')
fi
source=("https://git.befatorinc.de/Befator-Inc-Firmen-Netzwerk/msys2-launcher/archive/3def1d0618fc1134d9e172016adedf4f0f4dcf50.zip")
sha256sums=('6113d0ea41c257c055922e9f531f8c55ad7f557bddf5197d35206885445ab2d1')
msys2_references=(
  'internal'
)

build() {
  cd "msys2-launcher"
  make PREFIX=/opt/bin/${CARCH}-w64-mingw32-
}

package() {
  cd "msys2-launcher"
  cp {mingw32,mingw64,msys2,ucrt64,clang64,clangarm64}.{exe,ini} "${pkgdir}"
}
