at 18.03-beta 32 lines 1.0 kB view raw
1{ stdenv, fetchFromGitHub, cmake, pkgconfig, openssl, boost, gmp, procps, fetchpatch, patchutils }: 2 3let 4 rev = "9e6b19ff15bc19fba5da1707ba18e7f160e5ed07"; 5 inherit (stdenv) lib; 6in stdenv.mkDerivation rec { 7 name = "libsnark-pre${version}"; 8 version = stdenv.lib.substring 0 8 rev; 9 10 buildInputs = [ cmake pkgconfig openssl boost gmp ] ++ lib.optional stdenv.hostPlatform.isLinux procps; 11 12 cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "-DWITH_PROCPS=OFF" "-DWITH_SUPERCOP=OFF" ]; 13 14 src = fetchFromGitHub { 15 inherit rev; 16 owner = "scipr-lab"; 17 repo = "libsnark"; 18 sha256 = "13f02qp2fmfhvxlp4xi69m0l8r5nq913l2f0zwdk7hl46lprfdca"; 19 fetchSubmodules = true; 20 }; 21 22 patches = [ ./darwin-fix-clock-gettime.patch ]; 23 24 enableParallelBuilding = true; 25 26 meta = with stdenv.lib; { 27 description = "C++ library for zkSNARKs"; 28 homepage = https://github.com/scipr-lab/libsnark; 29 license = licenses.mit; 30 platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; 31 }; 32}