#!/bin/sh

#shellcheck disable=SC2034
#shellcheck disable=SC2154
#shellcheck disable=SC2086

#ebs.formulae
ebsver=1

pkgname=gmp
pkgver=6.3.0
pkgsrc=https://ftp.gnu.org/gnu/gmp/gmp-$pkgver.tar.xz
pkgchecksum=sha256:a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898
pkgdesc="gnu multiple precision arithmetic library"
pkgmaintainer="juanvel400 <me@juanvel400.com>"
pkglicense="GPL-3.0-or-later"
pkghomepage="https://gmplib.org/"
pkgcheck=true
pkgdeps="musl"
pkgprovides="libgmp"

build() {
    ./configure ${CONFIGUREFLAGS:-} --prefix=/usr
    make
}

check() {
    make check
}

package() {
    "${1:-fakeroot}" make install DESTDIR="$pkgdir"
}

install_to_toolchain() {
    make install DESTDIR="${TOOLCHAIN_DIR}"
}
