# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=mpdecimal
pkgver=4.0.0
pkgrel=2.1
pkgdesc="Package for correctly-rounded arbitrary precision decimal floating point arithmetic"
url="https://www.bytereef.org/mpdecimal/index.html"
license=('BSD')
ncxfat_makedepends=(binutils glibc gcc-libs)
ncxfab_makedepends=(base-devel sh crosspacman coreutils make)
source=("https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-$pkgver.tar.gz")
sha512sums=('7610ac53ac79f7a8a33fa7a3e61515810444ec73ebca859df7a9ddc18e96b990c99323172810c9cc7f6d6e1502c0be308cd443d6c2d5d0c871648e4842e05d59')

build() {
  cd mpdecimal-$pkgver

  ./configure --prefix=$MPKG_USRPATH --host=$MPKG_TARGETMACHINE
  LDXXFLAGS="$LDFLAGS" make
}

package() {
  ncxfat_depends=('glibc' 'gcc-libs')
  cd mpdecimal-$pkgver
  make DESTDIR="$pkgdir" install

  install -Dm644 COPYRIGHT.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}
