# Maintainer: Peter Budai <peterbudai at hotmail dot com>

_realname=osm-gps-map
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.1.0
pkgrel=3
pkgdesc="A Gtk+ Widget for Displaying OpenStreetMap tiles. (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="https://nzjrs.github.io/osm-gps-map/"
license=("GPLv2+")
depends=(
    "${MINGW_PACKAGE_PREFIX}-libsoup"
    "${MINGW_PACKAGE_PREFIX}-gtk3"
    "${MINGW_PACKAGE_PREFIX}-gobject-introspection"
)
makedepends=(
    "${MINGW_PACKAGE_PREFIX}-gcc"
    "${MINGW_PACKAGE_PREFIX}-libtool"
    "${MINGW_PACKAGE_PREFIX}-gnome-common"
)

source=( https://github.com/nzjrs/osm-gps-map/releases/download/${pkgver}/${_realname}-${pkgver}.tar.gz) 
sha256sums=('8F2FF865ED9ED9786CC5373C37B341B876958416139D0065EBB785CF88D33586')

prepare() {
    cd "${srcdir}/${_realname}-${pkgver}"
}

build() {
    [[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST}
    mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}

    CFLAGS+=" -DG_DISABLE_ASSERT"
    ../${_realname}-${pkgver}/configure \
        --prefix="${MINGW_PREFIX}"      \
        --build=${MINGW_CHOST}          \
        --host=${MINGW_CHOST}           \
        --enable-gtk-doc=no

  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR=${pkgdir} install
}
