Files
2026-07-27 21:12:08 +03:00

72 lines
1.2 KiB
Nix

{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
gcc,
binutils,
gnumake,
gnused,
gnugrep,
gawk,
diffutils,
findutils,
gnutar,
xz,
libgmp,
}:
let
pname = "mpfr";
version = "4.2.2";
src = fetchurl {
url = "mirror://gnu/mpfr/mpfr-${version}.tar.xz";
hash = "sha256-tnugOD736KhWNzTi6InvXsPDuJigHQD6CmhprYHGzgE=";
};
in
bash.runCommand "${pname}-${version}"
{
inherit pname version;
nativeBuildInputs = [
gcc
binutils
gnumake
gnused
gnugrep
gawk
diffutils
findutils
gnutar
xz
];
meta = {
description = "The GNU Multiple Precision Floating-Point Reliable Library, version ${version}";
homepage = "https://www.mpfr.org/";
license = lib.licenses.lgpl3Plus;
teams = [ lib.teams.minimal-bootstrap ];
platforms = lib.platforms.unix;
};
}
''
# Unpack
tar xf ${src}
cd mpfr-${version}
# Configure
bash ./configure \
--prefix=$out \
--build=${buildPlatform.config} \
--host=${hostPlatform.config} \
--disable-dependency-tracking \
--with-gmp=${libgmp}
# Build
make -j $NIX_BUILD_CORES
# Install
make -j $NIX_BUILD_CORES install-strip
''