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

pkgname=libblastrampoline
pkgver=5.10.0
pkgrel=1
pkgdesc='Using PLT trampolines to provide a BLAS and LAPACK demuxing library'
arch=(x86_64 powerpc64le riscv64)
url='https://github.com/JuliaLinearAlgebra/libblastrampoline'
license=(MIT)
depends=(glibc)
makedepends=(git)
source=(git+https://github.com/JuliaLinearAlgebra/libblastrampoline#tag=v$pkgver)
sha256sums=('81fc4d666654685e7a867cb82008647b7053ff348ad0fbd7b9e7a9213a938d75')
options=(!lto)

build() {
  cd $pkgname/src
  make\
    COMPLEX_RETSTYLE_AUTODETECTION=0 \
    F2C_AUTODETECTION=0 \
    LBT_CFLAGS="$CFLAGS -fPIC -D_GNU_SOURCE" \
    LBT_LDFLAGS="-shared $LDFLAGS"
}

package() {
  cd $pkgname/src
  make F2C_AUTODETECTION=0 COMPLEX_RETSTYLE_AUTODETECTION=0 prefix="$pkgdir"/usr install
  install -Dm644 ../LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
