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";