Skip to content

Commit c5fcc86

Browse files
authored
libsnark: refactor, unstable-2018-01-15 -> 20140603-unstable-2024-02-23, fix build (NixOS#353177)
2 parents 89eec0c + e79ff6a commit c5fcc86

File tree

3 files changed

+50
-30
lines changed

3 files changed

+50
-30
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchFromGitHub,
5+
cmake,
6+
pkg-config,
7+
openssl,
8+
boost,
9+
gmp,
10+
withProcps ? false,
11+
procps,
12+
}:
13+
14+
stdenv.mkDerivation {
15+
pname = "libsnark";
16+
version = "20140603-unstable-2024-02-23";
17+
18+
nativeBuildInputs = [
19+
cmake
20+
pkg-config
21+
];
22+
buildInputs = [
23+
openssl
24+
boost
25+
gmp
26+
] ++ lib.optional withProcps procps;
27+
28+
cmakeFlags =
29+
lib.optionals (!withProcps) [ "-DWITH_PROCPS=OFF" ]
30+
++ lib.optionals (stdenv.hostPlatform.isDarwin || !stdenv.hostPlatform.isx86) [
31+
"-DWITH_SUPERCOP=OFF"
32+
]
33+
++ lib.optionals (!stdenv.hostPlatform.isx86) [ "-DCURVE=ALT_BN128" ];
34+
35+
src = fetchFromGitHub {
36+
owner = "scipr-lab";
37+
repo = "libsnark";
38+
rev = "6c705e3135f585c222813654caedc86520fda1f6";
39+
hash = "sha256-5Gk24fwVaXBWEFmhTsN9Qm8x/Qpr1KjavI3staJidxQ=";
40+
fetchSubmodules = true;
41+
};
42+
43+
meta = {
44+
broken = withProcps; # Despite procps having a valid pkg-config file, CMake doesn't seem to be able to find it.
45+
description = "C++ library for zkSNARKs";
46+
homepage = "https://github.com/scipr-lab/libsnark";
47+
license = lib.licenses.mit;
48+
platforms = lib.platforms.all;
49+
};
50+
}

pkgs/development/libraries/libsnark/default.nix

Lines changed: 0 additions & 28 deletions
This file was deleted.

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21359,8 +21359,6 @@ with pkgs;
2135921359
inherit (darwin.apple_sdk.frameworks) Carbon AudioToolbox;
2136021360
};
2136121361

21362-
libsnark = callPackage ../development/libraries/libsnark { };
21363-
2136421362
libsodium = callPackage ../development/libraries/libsodium { };
2136521363

2136621364
libsoup = callPackage ../development/libraries/libsoup { };

0 commit comments

Comments
 (0)