name=mpfr
version=4.2.1
revision=1
tarball_url="https://ftp.gnu.org/gnu/mpfr/mpfr-${version}.tar.xz"
tarball_blake2b="ad69f53bc910294647523e7613b18a683f1d0f3dd994168ab2a46b66d0371ffa9b8e7cb59495f898470aea69d343e83fc722f11babe4af7b3a12665a1e65860c"
source_hostdeps="automake autoconf autoconf-archive libtool pkg-config"
imagedeps="gcc"
hostdeps="gcc autoconf autoconf-archive automake libtool pkg-config"
deps="core-libs gmp"

regenerate() {
    autoreconf -fvi
}

build() {
    cp -rp "${source_dir}"/. ./

        configure_script_path=./configure \
    autotools_configure \
        --enable-static=no \
        --enable-shared=yes \
        --enable-thread-safe \
        --with-pic

    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

    post_package_strip
}
