1 { lib, stdenv, fetchFromGitHub, cmake, pkg-config, openssl, boost, gmp, procps }:
3 stdenv.mkDerivation rec {
5 version = "unstable-2018-01-15";
7 nativeBuildInputs = [ cmake pkg-config ];
8 buildInputs = [ openssl boost gmp ] ++ lib.optional stdenv.hostPlatform.isLinux procps;
10 cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "-DWITH_PROCPS=OFF" ]
11 ++ lib.optionals (stdenv.hostPlatform.isDarwin || !stdenv.hostPlatform.isx86) [ "-DWITH_SUPERCOP=OFF" ]
12 ++ lib.optionals (!stdenv.hostPlatform.isx86) [ "-DCURVE=ALT_BN128" ];
14 src = fetchFromGitHub {
15 rev = "9e6b19ff15bc19fba5da1707ba18e7f160e5ed07";
18 sha256 = "13f02qp2fmfhvxlp4xi69m0l8r5nq913l2f0zwdk7hl46lprfdca";
19 fetchSubmodules = true;
23 description = "C++ library for zkSNARKs";
24 homepage = "https://github.com/scipr-lab/libsnark";
25 license = licenses.mit;
26 platforms = lib.platforms.linux ++ lib.platforms.darwin;