nixpkgs/pkgs/development/libraries/flint/3.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
1.7 KiB
Nix
Raw Normal View History

2024-01-02 03:10:33 +00:00
{ lib
, stdenv
2024-03-24 00:14:05 +00:00
, fetchpatch
2024-01-02 03:10:33 +00:00
, fetchurl
, gmp
, mpfr
, ntl
, autoconf
, automake
, gettext
, libtool
, openblas ? null, blas, lapack
, withBlas ? true
, withNtl ? true
}:
assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
stdenv.mkDerivation rec {
pname = "flint3";
version = "3.0.1";
src = fetchurl {
url = "https://www.flintlib.org/flint-${version}.tar.gz";
sha256 = "sha256-ezEaAFA6hjiB64F32+uEMi8pOZ89fXLzsaTJuh1XlLQ=";
};
2024-03-24 00:14:05 +00:00
patches = [
(fetchpatch {
url = "https://github.com/flintlib/flint/commit/e7d005c369754243cba32bd782ea2a5fc874fde5.diff";
hash = "sha256-IqEtYEpNVXfoTeerh/0ig+eDqUpAlGdBB3uO8ShYh3o=";
})
];
2024-03-06 12:09:58 +00:00
nativeBuildInputs = [
2024-01-02 03:10:33 +00:00
autoconf
automake
gettext
libtool
];
2024-03-06 12:09:58 +00:00
propagatedBuildInputs = [
mpfr
];
2024-01-02 03:10:33 +00:00
buildInputs = [
gmp
] ++ lib.optionals withBlas [
openblas
] ++ lib.optionals withNtl [
ntl
];
# We're not using autoreconfHook because flint's bootstrap
# script calls autoreconf, among other things.
preConfigurePhase = ''
echo "Executing bootstrap.sh"
./bootstrap.sh
'';
configureFlags = [
"--with-gmp=${gmp}"
"--with-mpfr=${mpfr}"
] ++ lib.optionals withBlas [
"--with-blas=${openblas}"
] ++ lib.optionals withNtl [
"--with-ntl=${ntl}"
];
enableParallelBuilding = true;
doCheck = true;
meta = with lib; {
description = "Fast Library for Number Theory";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ smasher164 ] ++ teams.sage.members;
2024-01-02 03:10:33 +00:00
platforms = platforms.unix;
homepage = "https://www.flintlib.org/";
downloadPage = "https://www.flintlib.org/downloads.html";
};
}