# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Tarn Burton <twburton at gmail dot com>

pkgname=normaliz
pkgver=3.8.0
pkgrel=1
pkgdesc="A tool for computations in affine monoids, vector configurations, lattice polytopes, and rational cones."
arch=(x86_64)
url="https://www.normaliz.uni-osnabrueck.de/"
license=(GPL)
depends=(e-antic)
makedepends=(boost)
source=("https://github.com/Normaliz/Normaliz/releases/download/v$pkgver/Normaliz-$pkgver.tar.gz")
sha256sums=('01c110c7addfea7201f7372d266772525784d61e13417ed0f85fbbf5cee6144e')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  #https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  install -Dm644 source/libnormaliz/output.h -t "$pkgdir"/usr/include/libnormaliz # https://github.com/Normaliz/Normaliz/issues/262
}
