Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, fetchFromGitHub 4, cmake 5, gmp 6, flint 7, mpfr 8, libmpc 9, withShared ? true 10}: 11 12stdenv.mkDerivation rec { 13 pname = "symengine"; 14 version = "0.10.1"; 15 16 src = fetchFromGitHub { 17 owner = "symengine"; 18 repo = "symengine"; 19 rev = "v${version}"; 20 hash = "sha256-qTu0vS9K6rrr/0SXKpGC9P1QSN/AN7hyO/4DrGvhxWM="; 21 }; 22 23 nativeBuildInputs = [ cmake ]; 24 25 buildInputs = [ gmp flint mpfr libmpc ]; 26 27 cmakeFlags = [ 28 "-DWITH_FLINT=ON" 29 "-DINTEGER_CLASS=flint" 30 "-DWITH_SYMENGINE_THREAD_SAFE=yes" 31 "-DWITH_MPC=yes" 32 "-DBUILD_FOR_DISTRIBUTION=yes" 33 ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ 34 # error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not? 35 "-DBUILD_TESTS=OFF" 36 ] ++ lib.optionals withShared [ 37 "-DBUILD_SHARED_LIBS=ON" 38 ]; 39 40 doCheck = true; 41 42 meta = with lib; { 43 description = "A fast symbolic manipulation library"; 44 homepage = "https://github.com/symengine/symengine"; 45 platforms = platforms.unix ++ platforms.windows; 46 license = licenses.bsd3; 47 maintainers = [ maintainers.costrouc ]; 48 }; 49 50}