about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/flint
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/flint')
-rw-r--r--nixpkgs/pkgs/development/libraries/flint/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/flint/default.nix b/nixpkgs/pkgs/development/libraries/flint/default.nix
new file mode 100644
index 000000000000..6873508eb7dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flint/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, stdenv
+, fetchurl
+, gmp
+, mpir
+, mpfr
+, ntl
+, openblas ? null, blas, lapack
+, withBlas ? true
+}:
+
+assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
+
+stdenv.mkDerivation rec {
+  pname = "flint";
+  version = "2.8.4";
+
+  src = fetchurl {
+    url = "https://www.flintlib.org/flint-${version}.tar.gz";
+    sha256 = "sha256-Yd+S6oyOncaS1Gxx1/UKqgmjPUugjQKheEcwpEXl5L4=";
+  };
+
+  buildInputs = [
+    gmp
+    mpir
+    mpfr
+    ntl
+  ] ++ lib.optionals withBlas [
+    openblas
+  ];
+
+  propagatedBuildInputs = [
+    mpfr # flint.h includes mpfr.h
+  ];
+
+  configureFlags = [
+    "--with-gmp=${gmp}"
+    "--with-mpir=${mpir}"
+    "--with-mpfr=${mpfr}"
+    "--with-ntl=${ntl}"
+  ] ++ lib.optionals withBlas [
+    "--with-blas=${openblas}"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Fast Library for Number Theory";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+    homepage = "https://www.flintlib.org/";
+    downloadPage = "https://www.flintlib.org/downloads.html";
+  };
+}