summary refs log tree commit diff
path: root/pkgs/development/libraries/libsnark/default.nix
blob: c3e6d0e049e42e3ab5b074ab1173c43f9175bae9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, openssl, boost, gmp, procps }:

let
  rev = "9e6b19ff15bc19fba5da1707ba18e7f160e5ed07";
in stdenv.mkDerivation rec {
  name = "libsnark-pre${version}";
  version = lib.substring 0 8 rev;

  nativeBuildInputs = [ cmake pkg-config ];
  buildInputs = [ openssl boost gmp ] ++ lib.optional stdenv.hostPlatform.isLinux procps;

  cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "-DWITH_PROCPS=OFF" "-DWITH_SUPERCOP=OFF" ];

  src = fetchFromGitHub {
    inherit rev;
    owner           = "scipr-lab";
    repo            = "libsnark";
    sha256          = "13f02qp2fmfhvxlp4xi69m0l8r5nq913l2f0zwdk7hl46lprfdca";
    fetchSubmodules = true;
  };

  meta = with lib; {
    description = "C++ library for zkSNARKs";
    homepage = "https://github.com/scipr-lab/libsnark";
    license = licenses.mit;
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
  };
}