diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/flint')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/flint/3.nix | 74 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/flint/default.nix | 57 |
2 files changed, 131 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..b8b8c2d8ec7d --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/flint/3.nix @@ -0,0 +1,74 @@ +{ 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="; + }; + + nativeBuildInputs = [ + autoconf + automake + gettext + libtool + ]; + + propagatedBuildInputs = [ + mpfr + ]; + + 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; + platforms = platforms.unix; + homepage = "https://www.flintlib.org/"; + downloadPage = "https://www.flintlib.org/downloads.html"; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/flint/default.nix b/nixpkgs/pkgs/development/libraries/flint/default.nix new file mode 100644 index 000000000000..eeb2cf1127e4 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/flint/default.nix @@ -0,0 +1,57 @@ +{ 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.9.0"; + + src = fetchurl { + url = "https://www.flintlib.org/flint-${version}.tar.gz"; + sha256 = "sha256-L8CQ1RAzyTII5sENQGOXpTyYOuU0O5WOsl9ypXpM52o="; + }; + + 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}" + ]; + + enableParallelBuilding = true; + + 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"; + }; +} |