# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Andrew Sun  <adsun701 at gmail dot com>
# Contributor: Kritias     <theodoridisgr at gmail dot com>
# Contributor: sudokode    <sudokode at gmail dot com>
# Contributor: Allan McRae <allan at archlinux dot org>

pkgbase=libisl
pkgname=libisl
pkgver=0.26
pkgrel=1.1
pkgdesc='Library for manipulating sets and relations of integer points bounded by linear constraints'
url='https://libisl.sourceforge.io'
license=('MIT')
ncxfat_makedepends=('binutils' 'gmp' 'gcc' 'glibc')
ncxfab_makedepends=('base-devel' 'sh' 'make' 'coreutils' 'crosspacman')
options=(staticlibs)
source=("https://libisl.sourceforge.io/isl-${pkgver}.tar.xz")
b2sums=('2cfe2e0774a991d2385e66f58490c5454382cabc82d74eb4bbe5a603293b7bdc34ca3b087f0884f9da319c447747edc76275ecaf2f171237939f9c7d3c52ced7')

prepare() {
  cd "${srcdir}"/isl-${pkgver}
  autoreconf -fiv
}

build() {
  cd "${srcdir}"/isl-${pkgver}
  ./configure --prefix=$MPKG_USRPATH --host=$MPKG_TARGETMACHINE
  make
}

package() {
  ncxfat_depends=('gmp')
  provides=('isl' 'libisl.so')
  replaces=('isl')
  cd "${srcdir}"/isl-${pkgver}

  make DESTDIR="${pkgdir}" install

  install -dm755 "${pkgdir}"$MPKG_USRPATH/share/gdb/auto-load/usr/lib/
  # FIXME: Our link archive (.la) has no lib names, so this is not produced
  #mv "${pkgdir}"/usr/lib/libisl.so.*-gdb.py "${pkgdir}"/usr/share/gdb/auto-load/usr/lib/

  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
