nixpkgs/pkgs/development/libraries/mpfi/default.nix
Yueh-Shun Li 91b3db1309 treewide: fix sourceRoot for fetchgit-based src
According to Nixpkgs manual[1] and NixOS 23.11 Release Note[2], the
`sourceRoot` attribute passed to `stdenv.mkDerivation` should be
specified as `"${src.name}"` or `"${src.name}/subdir"` when `src` is
produced using `fetchgit`-based fetchers.

`sourceRoot = "source"` or `sourceRoot = "source/subdir"` is based on
the assumption that the `name` attribute of these pre-unpacked fetchers
are always `"source"`, which is not the case. Expecting constant `name`
also makes the source FODs prone to irrelevent hashes during version
bumps.

[1]: https://nixos.org/manual/nixpkgs/unstable/#var-stdenv-sourceRoot
[2]: https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11
2024-03-09 07:53:25 +08:00

34 lines
1 KiB
Nix

{lib, stdenv, fetchFromGitLab, autoreconfHook, texinfo, mpfr}:
stdenv.mkDerivation rec {
pname = "mpfi";
version = "1.5.4";
src = fetchFromGitLab {
domain = "gitlab.inria.fr";
owner = "mpfi";
repo = "mpfi";
# Apparently there is an upstream off-by-one-commit error in tagging
# Conditional to allow auto-updaters to try new releases
# TODO: remove the conditional after an upstream update
# rev = version;
rev = if version == "1.5.4" then
"feab26bc54529417af983950ddbffb3a4c334d4f"
else version;
sha256 = "sha256-aj/QmJ38ifsW36JFQcbp55aIQRvOpiqLHwEh/aFXsgo=";
};
sourceRoot = "${src.name}/mpfi";
nativeBuildInputs = [ autoreconfHook texinfo ];
buildInputs = [ mpfr ];
meta = {
description = "A multiple precision interval arithmetic library based on MPFR";
homepage = "http://perso.ens-lyon.fr/nathalie.revol/software.html";
license = lib.licenses.lgpl21Plus;
maintainers = [lib.maintainers.raskin];
platforms = lib.platforms.unix;
};
}