forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / flint / 3.nix
blob60321984d316571582193cebca055a426d4292b1
1 { lib
2 , stdenv
3 , fetchpatch
4 , fetchurl
5 , gmp
6 , mpfr
7 , ntl
8 , autoconf
9 , automake
10 , gettext
11 , libtool
12 , openblas ? null, blas, lapack
13 , withBlas ? true
14 , withNtl ? true
17 assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
19 stdenv.mkDerivation rec {
20   pname = "flint3";
21   version = "3.0.1";
23   src = fetchurl {
24     url = "https://www.flintlib.org/flint-${version}.tar.gz";
25     sha256 = "sha256-ezEaAFA6hjiB64F32+uEMi8pOZ89fXLzsaTJuh1XlLQ=";
26   };
28   patches = [
29     (fetchpatch {
30       url = "https://github.com/flintlib/flint/commit/e7d005c369754243cba32bd782ea2a5fc874fde5.diff";
31       hash = "sha256-IqEtYEpNVXfoTeerh/0ig+eDqUpAlGdBB3uO8ShYh3o=";
32     })
33   ];
35   nativeBuildInputs = [
36     autoconf
37     automake
38     gettext
39     libtool
40   ];
42   propagatedBuildInputs = [
43     mpfr
44   ];
46   buildInputs = [
47     gmp
48   ] ++ lib.optionals withBlas [
49     openblas
50   ] ++ lib.optionals withNtl [
51     ntl
52   ];
54   # We're not using autoreconfHook because flint's bootstrap
55   # script calls autoreconf, among other things.
56   preConfigurePhase = ''
57     echo "Executing bootstrap.sh"
58     ./bootstrap.sh
59   '';
61   configureFlags = [
62     "--with-gmp=${gmp}"
63     "--with-mpfr=${mpfr}"
64   ] ++ lib.optionals withBlas [
65     "--with-blas=${openblas}"
66   ] ++ lib.optionals withNtl [
67     "--with-ntl=${ntl}"
68   ];
70   enableParallelBuilding = true;
72   doCheck = true;
74   meta = with lib; {
75     description = "Fast Library for Number Theory";
76     license = licenses.gpl2Plus;
77     maintainers = with maintainers; [ smasher164 ] ++ teams.sage.members;
78     platforms = platforms.unix;
79     homepage = "https://www.flintlib.org/";
80     downloadPage = "https://www.flintlib.org/downloads.html";
81   };