# Maintainer: Martell Malone <martellmalone@gmail.com>

_realname=libelf
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.8.13
pkgrel=7
pkgdesc="ELF object file access library (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('LGPL')
url="http://www.mr511.de/software/english.html"
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc")
source=("https://fossies.org/linux/misc/old/${_realname}-${pkgver}.tar.gz")
sha256sums=('591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d')

build() {
  mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}

  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --enable-extended-format=yes

  make -j1 all
}

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