# Maintainer: Diego Sogari <diego.sogari@gmail.com>

_realname=lmdbxx
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.9.14.0
pkgrel=2
pkgdesc="C++11 wrapper for LMDB (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://lmdbxx.sourceforge.io/"
msys2_repository_url="https://github.com/bendiken/lmdbxx"
license=('spdx:Unlicense')
depends=("${MINGW_PACKAGE_PREFIX}-lmdb")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
source=("https://github.com/bendiken/lmdbxx/archive/${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('99ae16599829c7c9dfb396382bb8e774031ca7e839c38e0c5fef124f409f19a2')
noextract=("${_realname}-${pkgver}.tar.gz")

prepare() {
  tar xf "${_realname}-${pkgver}.tar.gz" --exclude=README
  cd "${srcdir}/${_realname}-${pkgver}"
  sed -e "s|/usr/local|${MINGW_PREFIX}|g" -i Makefile
}

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