nixpkgs/pkgs/development/libraries/libff/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
1.0 KiB
Nix
Raw Normal View History

2022-09-11 14:40:41 +00:00
{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config
, enableStatic ? stdenv.hostPlatform.isStatic }:
2020-11-28 22:14:07 +00:00
stdenv.mkDerivation rec {
pname = "libff";
2021-12-15 14:21:35 +00:00
version = "0.2.1";
2020-11-28 22:14:07 +00:00
src = fetchFromGitHub {
owner = "scipr-lab";
repo = "libff";
rev = "v${version}";
sha256 = "0dczi829497vqlmn6n4fgi89bc2h9f13gx30av5z2h6ikik7crgn";
fetchSubmodules = true;
};
2021-12-15 14:21:35 +00:00
cmakeFlags = [ "-DWITH_PROCPS=Off" ]
++ lib.optionals stdenv.isAarch64 [ "-DCURVE=ALT_BN128" "-DUSE_ASM=OFF" ];
2020-11-28 22:14:07 +00:00
2022-09-11 14:40:41 +00:00
postPatch = lib.optionalString (!enableStatic) ''
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 ];
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 ];
};
}