2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, automake
|
|
|
|
, autoconf
|
|
|
|
, libtool
|
|
|
|
, autoreconfHook
|
|
|
|
, gmpxx
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "givaro";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "4.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linbox-team";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "sha256-KR0WJc0CSvaBnPRott4hQJhWNBb/Wi6MIhcTExtVobQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
# Pull upstream fix for gcc-13:
|
|
|
|
# https://github.com/linbox-team/givaro/pull/218
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13.patch";
|
|
|
|
url = "https://github.com/linbox-team/givaro/commit/c7744bb133496cd7ac04688f345646d505e1bf52.patch";
|
|
|
|
hash = "sha256-aAA5o8Va10v0Pqgcpx7qM0TAZiNQgXoR6N9xecj7tDA=";
|
|
|
|
})
|
2024-04-21 15:54:59 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "clang-16.patch";
|
|
|
|
url = "https://github.com/linbox-team/givaro/commit/a81d44b3b57c275bcb04ab00db79be02561deaa2.patch";
|
|
|
|
hash = "sha256-sSk+VWffoEjZRTJcHRISLHPyW6yuvI1u8knBOfxNUIE=";
|
|
|
|
})
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook autoconf automake ];
|
|
|
|
buildInputs = [libtool];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ gmpxx ];
|
|
|
|
|
|
|
|
configureFlags = [
|
2024-04-21 15:54:59 +00:00
|
|
|
"--without-archnative"
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isx86_64 [
|
2020-04-24 23:36:52 +00:00
|
|
|
# disable SIMD instructions (which are enabled *when available* by default)
|
2020-09-25 04:45:31 +00:00
|
|
|
"--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3"
|
|
|
|
"--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3"
|
|
|
|
"--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
|
|
|
|
"--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
|
|
|
|
"--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx"
|
|
|
|
"--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2"
|
|
|
|
"--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma"
|
|
|
|
"--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4"
|
|
|
|
];
|
2020-04-24 23:36:52 +00: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;
|
|
|
|
|
|
|
|
meta = {
|
2021-01-17 00:15:33 +00:00
|
|
|
description = "A C++ library for arithmetic and algebraic computations";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "givaro-config";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.cecill-b;
|
|
|
|
maintainers = [lib.maintainers.raskin];
|
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|