2018-03-08 00:05:52 +01:00
|
|
|
{ stdenv, fetchFromGitHub, automake, autoconf, libtool, autoreconfHook, gmpxx
|
|
|
|
, optimize ? false # impure
|
|
|
|
}:
|
2016-10-10 16:31:38 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
pname = "givaro";
|
2018-03-08 00:05:52 +01:00
|
|
|
version = "4.0.4";
|
2016-10-10 16:31:38 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linbox-team";
|
|
|
|
repo = "${pname}";
|
|
|
|
rev = "v${version}";
|
2018-03-08 00:05:52 +01:00
|
|
|
sha256 = "199p8wyj5i63jbnk7j8qbdbfp5rm2lpmcxyk3mdjy9bz7ygx3hhy";
|
2016-10-10 16:31:38 +02:00
|
|
|
};
|
2018-08-14 02:13:40 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
buildInputs = [autoconf automake libtool gmpxx];
|
2018-08-14 02:13:40 +02:00
|
|
|
|
2018-03-08 00:05:52 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-optimization"
|
|
|
|
] ++ stdenv.lib.optionals (!optimize) [
|
|
|
|
# disable SIMD instructions (which are enabled *when available* by default)
|
|
|
|
"--disable-sse"
|
|
|
|
"--disable-sse2"
|
|
|
|
"--disable-sse3"
|
|
|
|
"--disable-ssse3"
|
|
|
|
"--disable-sse41"
|
|
|
|
"--disable-sse42"
|
|
|
|
"--disable-avx"
|
|
|
|
"--disable-avx2"
|
|
|
|
"--disable-fma"
|
|
|
|
"--disable-fma4"
|
|
|
|
];
|
2018-08-14 02:13:40 +02:00
|
|
|
|
|
|
|
# On darwin, tests are linked to dylib in the nix store, so we need to make
|
|
|
|
# sure tests run after installPhase.
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "check";
|
|
|
|
doCheck = false;
|
|
|
|
|
2016-10-10 16:31:38 +02:00
|
|
|
meta = {
|
|
|
|
inherit version;
|
|
|
|
description = ''A C++ library for arithmetic and algebraic computations'';
|
|
|
|
license = stdenv.lib.licenses.cecill-b;
|
|
|
|
maintainers = [stdenv.lib.maintainers.raskin];
|
2018-08-14 02:13:40 +02:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2016-10-10 16:31:38 +02:00
|
|
|
};
|
|
|
|
}
|