# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: spider-mario <spidermario@free.fr>
# Contributor: Daniel Ehlers <danielehlers@mindeye.net>

pkgname=coin-or-clp
pkgver=1.17.10
pkgrel=1
pkgdesc='COIN-OR linear programming solver'
arch=(x86_64 aarch64)
url='https://github.com/coin-or/Clp'
license=(EPL-2.0)
groups=(coin-or)
depends=(coin-or-asl
         coin-or-coinutils
         coin-or-osi
         gcc-libs
         glibc
         suitesparse)
makedepends=(git)
source=(git+https://github.com/coin-or/Clp#tag=releases/$pkgver)
sha256sums=('675f2ba993bd78084a5dfcf61cd38798a9597ebf1d2321677c6f9483ce1a26da')

build() {
  cd Clp
  CFLAGS+=" -Wno-implicit-function-declaration" \
  ./configure --prefix=/usr \
              --with-cholmod-lib='-lcholmod' \
              --with-cholmod-incdir=/usr/include/suitesparse \
              --with-amd-lib='-lamd' \
              --with-amd-incdir=/usr/include/suitesparse
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool # Fix overlinking
  make
}

check() {
  cd Clp
  make test
}

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