depot/third_party/nixpkgs/pkgs/development/libraries/libff/default.nix
Default email b6d97fd731 Project import generated by Copybara.
GitOrigin-RevId: be0b453d7c7eee2090962c9a83749b024ff9acf5
2020-12-25 14:55:36 +01:00

34 lines
1.1 KiB
Nix

{ stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config }:
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" ];
# CMake is hardcoded to always build static library which causes linker
# failure for Haskell applications depending on haskellPackages.hevm on macOS.
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace libff/CMakeLists.txt --replace "STATIC" "SHARED"
'';
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ boost gmp openssl ];
meta = with stdenv.lib; {
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 ];
};
}