From 72c16839ea42806f2b2e0df7b2865b5e362ce77d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 17 Nov 2022 21:17:09 +0000 Subject: [PATCH] mpfr: 4.1.0 -> 4.1.1 Changes: https://www.mpfr.org/mpfr-4.1.0/#fixed While at it added trivial updater script. --- pkgs/development/libraries/mpfr/default.nix | 27 ++++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix index bf1625cf2f9f..76d2c9e0ece9 100644 --- a/pkgs/development/libraries/mpfr/default.nix +++ b/pkgs/development/libraries/mpfr/default.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchurl, gmp }: +{ lib +, stdenv +, fetchurl +, gmp +, writeScript +}: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -6,15 +11,15 @@ # files. stdenv.mkDerivation rec { - version = "4.1.0"; + version = "4.1.1"; pname = "mpfr"; src = fetchurl { urls = [ - #"https://www.mpfr.org/${name}/${name}.tar.xz" + "https://www.mpfr.org/${pname}-${version}/${pname}-${version}.tar.xz" "mirror://gnu/mpfr/${pname}-${version}.tar.xz" ]; - sha256 = "0zwaanakrqjf84lfr5hfsdr7hncwv9wj0mchlr7cmxigfgqs760c"; + hash = "sha256-/9GVvVZ9uv/DuYsj/QCq0FN2gMmJYXHkT+P/eeKKwz0="; }; outputs = [ "out" "dev" "doc" "info" ]; @@ -31,6 +36,20 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + passthru = { + updateScript = writeScript "update-mpfr" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl pcre common-updater-scripts + + set -eu -o pipefail + + # Expect the text in format of 'GNU MPFR version 4.1.1' + new_version="$(curl -s https://www.mpfr.org/mpfr-current/ | + pcregrep -o1 'GNU MPFR version ([0-9.]+)')" + update-source-version ${pname} "$new_version" + ''; + }; + meta = { homepage = "https://www.mpfr.org/"; description = "Library for multiple-precision floating-point arithmetic";