#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer		: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=mpfr
_pkgver=4.1.0
_patchver=13
pkgrel=03
pkgver=${_pkgver}.p${_patchver}
pkgdesc='Multiple-precision floating-point library'
arch=(x86_64)
url='https://www.mpfr.org/'
depends=('glibc' 'gmp')
makedepends=('autoconf-archive' 'automake')
source=("https://ftp.gnu.org/gnu/mpfr/mpfr-${_pkgver}.tar.xz"{,.sig}
         patches.diff) # wget https://www.mpfr.org/mpfr-4.1.0/allpatches -O patches.diff

prepare() {
  cd $pkgname-${_pkgver}

  patch -p1 < "$srcdir"/patches.diff
  autoreconf -fiv
}

build() {
  cd $pkgname-${_pkgver}
  ./configure --prefix=/usr \
    --enable-thread-safe \
    --enable-shared
  make
}

check() {
  cd $pkgname-${_pkgver}
  make check
  make check-exported-symbols
}

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

#---- license gpg-key sha256sums ----

license=('GPL3' 'LGPL3')

# NOTE: key holder contacted about unsafe key (2021-05-03)
validpgpkeys=('07F3DBBECC1A39605078094D980C197698C3739D') # Vincent Lefevre <vincent@vinc17.net>

sha256sums=(0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f #  mpfr-4.1.0.tar.xz
	681220885640e2918a52a6d8ac1e3fd9dc2a7f6f62d5aae0d99665b981d84cff #  mpfr-4.1.0.tar.xz.sig
	75af77904037442fcd3061a4fee2394194716c542e96989dcfac2445c842daf1) # patches.diff

