about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/flint
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-01-07 14:58:29 +0100
committerAlyssa Ross <hi@alyssa.is>2024-01-07 14:58:29 +0100
commitad899504860973e98351c922ecb934595f2c0f19 (patch)
treeb1260cc90947e834af941c6cb6aed51dc68f50b5 /nixpkgs/pkgs/development/libraries/flint
parentf34a1b70eb86e4a63cfb88ea460345bb1aed88e3 (diff)
parentdc676e1b5014069a2b06e236242e2f0990384934 (diff)
downloadnixlib-ad899504860973e98351c922ecb934595f2c0f19.tar
nixlib-ad899504860973e98351c922ecb934595f2c0f19.tar.gz
nixlib-ad899504860973e98351c922ecb934595f2c0f19.tar.bz2
nixlib-ad899504860973e98351c922ecb934595f2c0f19.tar.lz
nixlib-ad899504860973e98351c922ecb934595f2c0f19.tar.xz
nixlib-ad899504860973e98351c922ecb934595f2c0f19.tar.zst
nixlib-ad899504860973e98351c922ecb934595f2c0f19.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/flint')
-rw-r--r--nixpkgs/pkgs/development/libraries/flint/3.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/flint/3.nix b/nixpkgs/pkgs/development/libraries/flint/3.nix
new file mode 100644
index 000000000000..3be7fdc63904
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flint/3.nix
@@ -0,0 +1,71 @@
+{ lib
+, stdenv
+, 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=";
+  };
+
+  propagatedBuildInputs = [
+    autoconf
+    automake
+    gettext
+    libtool
+  ];
+
+  buildInputs = [
+    gmp
+    mpfr
+  ] ++ 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;
+    platforms = platforms.unix;
+    homepage = "https://www.flintlib.org/";
+    downloadPage = "https://www.flintlib.org/downloads.html";
+  };
+}