# Maintainer: Hannah von Reth <vonreth@kde.org>

_realname=png2ico
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver="2002.12.08"
pkgrel=3
pkgdesc="Converts PNG files to Windows icon resource files (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
license=("GPL2")
url="https://www.winterdrache.de/freeware/png2ico/"
depends=("${MINGW_PACKAGE_PREFIX}-libpng")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
options=(!strip staticlibs !buildflags)

source=("${_realname}-${pkgver}.tar.gz"::"https://www.winterdrache.de/freeware/${_realname}/data/${_realname}-src-2002-12-08.tar.gz"
        "fix_include.diff")
sha256sums=('d6bc2b8f9dacfb8010e5f5654aaba56476df18d88e344ea1a32523bb5843b68e'
            '9a386c45bd8b3d0f48d095e9dc1de87dde61a5dad175f0547b56b8d015af5a5b')

prepare() {
  cd "${srcdir}/${_realname}"
  patch -p1 -i "${srcdir}/fix_include.diff"
}

build() {
  cd ${srcdir}/${_realname}
  make # VERBOSE=1
}

package() {
  mkdir -p ${pkgdir}${MINGW_PREFIX}/bin
  cp ${srcdir}/${_realname}/png2ico.exe ${pkgdir}${MINGW_PREFIX}/bin/png2ico.exe
}
