From ab3dec4efda1008c8a09e264d0fcd949aa245b04 Mon Sep 17 00:00:00 2001 From: Aleksi Hannula Date: Thu, 9 Apr 2026 11:58:46 +0300 Subject: [PATCH] minimal-bootstrap.libmpfr: init at 4.2.2 --- .../linux/minimal-bootstrap/default.nix | 6 ++ .../linux/minimal-bootstrap/gcc/mpfr.nix | 71 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 pkgs/os-specific/linux/minimal-bootstrap/gcc/mpfr.nix diff --git a/pkgs/os-specific/linux/minimal-bootstrap/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/default.nix index 6e0ff3eb8551..7f11a5add96f 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/default.nix @@ -281,6 +281,12 @@ lib.makeScope gnutar = gnutar-latest; }; + libmpfr = callPackage ./gcc/mpfr.nix { + gcc = gcc-latest; + gnumake = gnumake-musl; + gnutar = gnutar-latest; + }; + linux-headers = callPackage ./linux-headers { gcc = gcc-latest; gnumake = gnumake-musl; diff --git a/pkgs/os-specific/linux/minimal-bootstrap/gcc/mpfr.nix b/pkgs/os-specific/linux/minimal-bootstrap/gcc/mpfr.nix new file mode 100644 index 000000000000..11807a44350f --- /dev/null +++ b/pkgs/os-specific/linux/minimal-bootstrap/gcc/mpfr.nix @@ -0,0 +1,71 @@ +{ + 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 + ''