# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=coin-or-osi
pkgver=0.108.11
pkgrel=1
pkgdesc='COIN-OR Open Solver Interface'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://github.com/coin-or/Osi'
license=(EPL-2.0)
groups=(coin-or)
depends=(coin-or-coinutils
         gcc-libs
         glibc)
makedepends=(gcc-fortran
             git)
source=(git+https://github.com/coin-or/Osi#tag=releases/$pkgver)
sha256sums=('596856f51b4dc5296e40703e04f62fd64e088445866148fd24c3875a894b49b7')

build() {
  cd Osi
  ./configure --prefix=/usr --enable-dependency-linking \
              --with-coinutils-lib="$(pkg-config --libs coinutils)" \
              --with-coinutils-incdir="/usr/include/coin/"
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool # Fix overlinking
  make
}

package() {
  cd Osi
  make DESTDIR="$pkgdir" install
}
