# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Lex Black <autumn-wind@web.de>
# Contributor: Arthur Zamarin <arthurzam@gmail.com>

pkgname=openlibm
pkgver=0.8.3
pkgrel=1
pkgdesc='Standalone implementation of C mathematical functions'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://openlibm.org/'
license=(MIT)
depends=(glibc)
makedepends=(git)
source=(git+https://github.com/JuliaLang/$pkgname#tag=v$pkgver)
sha256sums=('f7c5ce8166b53ec31f6169ae9ae11d033ff0b05b9a05e53591b430a34bca9845')

prepare() {
  cd $pkgname
  sed -e 's|/usr/local|/usr|' -i Make.inc
}

build() {
  cd $pkgname
  make prefix=/usr
}

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

  install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname/
}
