2018-03-30 13:40:52 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, gmp
|
|
|
|
, mpir
|
|
|
|
, mpfr
|
|
|
|
, ntl
|
|
|
|
, openblas ? null
|
|
|
|
, withBlas ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert withBlas -> openblas != null;
|
|
|
|
|
2016-10-10 18:31:19 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "flint-${version}";
|
2018-03-30 13:40:52 +01:00
|
|
|
version = "2.5.2"; # remove libflint.so.MAJOR patch when updating
|
2016-10-10 18:31:19 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.flintlib.org/flint-${version}.tar.gz";
|
|
|
|
sha256 = "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb";
|
|
|
|
};
|
2018-03-30 13:40:52 +01:00
|
|
|
buildInputs = [
|
|
|
|
gmp
|
|
|
|
mpir
|
|
|
|
mpfr
|
|
|
|
ntl
|
|
|
|
] ++ stdenv.lib.optionals withBlas [
|
|
|
|
openblas
|
|
|
|
];
|
2018-04-11 12:52:10 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
mpfr # flint.h includes mpfr.h
|
|
|
|
];
|
2018-03-30 13:40:52 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-gmp=${gmp}"
|
|
|
|
"--with-mpir=${mpir}"
|
|
|
|
"--with-mpfr=${mpfr}"
|
|
|
|
"--with-ntl=${ntl}"
|
|
|
|
] ++ stdenv.lib.optionals withBlas [
|
|
|
|
"--with-blas=${openblas}"
|
|
|
|
];
|
2018-07-08 22:07:41 +01:00
|
|
|
|
|
|
|
# issues with ntl -- https://github.com/wbhart/flint2/issues/487
|
2018-08-14 03:47:57 +01:00
|
|
|
NIX_CXXSTDLIB_COMPILE = [ "-std=c++11" ];
|
2018-07-08 22:07:41 +01:00
|
|
|
|
2018-03-30 13:40:52 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Always produce libflint.so.MAJOR; will be included in the next flint version
|
|
|
|
# See https://github.com/wbhart/flint2/pull/347
|
|
|
|
url = "https://github.com/wbhart/flint2/commit/49fbcd8f736f847d3f9667f9f7d5567ef4550ecb.patch";
|
|
|
|
sha256 = "09w09bpq85kjf752bd3y3i5lvy59b8xjiy7qmrcxzibx2a21pj73";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
doCheck = true;
|
2016-10-10 18:31:19 +01:00
|
|
|
meta = {
|
|
|
|
inherit version;
|
|
|
|
description = ''Fast Library for Number Theory'';
|
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
|
|
|
maintainers = [stdenv.lib.maintainers.raskin];
|
2018-08-14 03:47:57 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.flintlib.org/;
|
2016-10-10 18:31:19 +01:00
|
|
|
downloadPage = "http://www.flintlib.org/downloads.html";
|
|
|
|
updateWalker = true;
|
|
|
|
};
|
|
|
|
}
|