2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, gmp
|
|
|
|
, flint
|
|
|
|
, mpfr
|
|
|
|
, libmpc
|
2023-07-15 17:15:38 +00:00
|
|
|
, withShared ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "symengine";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.11.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "symengine";
|
|
|
|
repo = "symengine";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-TB6wZnPZ16k8N8r0F6x+363zlTCJbM4HsKLvMZy1uYA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = [ gmp flint mpfr libmpc ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DWITH_FLINT=ON"
|
|
|
|
"-DINTEGER_CLASS=flint"
|
|
|
|
"-DWITH_SYMENGINE_THREAD_SAFE=yes"
|
|
|
|
"-DWITH_MPC=yes"
|
|
|
|
"-DBUILD_FOR_DISTRIBUTION=yes"
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
|
|
|
# error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not?
|
|
|
|
"-DBUILD_TESTS=OFF"
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ lib.optionals withShared [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "A fast symbolic manipulation library";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/symengine/symengine";
|
|
|
|
platforms = platforms.unix ++ platforms.windows;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|