2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config }:
|
2020-11-28 22:14:07 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libff";
|
|
|
|
version = "1.0.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scipr-lab";
|
|
|
|
repo = "libff";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0dczi829497vqlmn6n4fgi89bc2h9f13gx30av5z2h6ikik7crgn";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DWITH_PROCPS=Off" ];
|
|
|
|
|
2020-12-05 01:13:54 +00:00
|
|
|
# CMake is hardcoded to always build static library which causes linker
|
|
|
|
# failure for Haskell applications depending on haskellPackages.hevm on macOS.
|
2021-01-21 17:00:13 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
2020-12-05 01:13:54 +00:00
|
|
|
substituteInPlace libff/CMakeLists.txt --replace "STATIC" "SHARED"
|
|
|
|
'';
|
|
|
|
|
2020-11-28 22:14:07 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
buildInputs = [ boost gmp openssl ];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-11-28 22:14:07 +00:00
|
|
|
description = "C++ library for Finite Fields and Elliptic Curves";
|
|
|
|
changelog = "https://github.com/scipr-lab/libff/blob/develop/CHANGELOG.md";
|
|
|
|
homepage = "https://github.com/scipr-lab/libff";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ arturcygan ];
|
|
|
|
};
|
|
|
|
}
|