2024-05-23 09:03:07 +00:00
|
|
|
{ rustPlatform
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, perl
|
|
|
|
, openssl
|
|
|
|
, lib
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "r0vm";
|
2024-08-03 22:35:00 +00:00
|
|
|
version = "1.0.5";
|
2024-05-23 09:03:07 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "risc0";
|
|
|
|
repo = "risc0";
|
|
|
|
rev = "v${version}";
|
2024-09-14 21:47:11 +00:00
|
|
|
hash = "sha256-jtROtI5/4W2pNvn1ZYR/wQAZmECTr7YxuZGu2Ns9paw=";
|
2024-05-23 09:03:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildAndTestSubdir = "risc0/r0vm";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
perl
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl.dev
|
2024-09-24 15:50:49 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-05-23 09:03:07 +00:00
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-08-03 22:35:00 +00:00
|
|
|
cargoHash = "sha256-WLd/cUiaIR04CIOaf9JwFmAY4fU9yH2QHDuT3Q54Gvg=";
|
2024-05-23 09:03:07 +00:00
|
|
|
|
|
|
|
postPatch =
|
|
|
|
let
|
2024-08-03 22:35:00 +00:00
|
|
|
# see https://github.com/risc0/risc0/blob/v1.0.5/risc0/circuit/recursion/build.rs
|
2024-06-14 13:05:57 +00:00
|
|
|
sha256Hash = "4e8496469e1efa00efb3630d261abf345e6b2905fb64b4f3a297be88ebdf83d2";
|
2024-05-23 09:03:07 +00:00
|
|
|
recursionZkr = fetchurl {
|
|
|
|
name = "recursion_zkr.zip";
|
|
|
|
url = "https://risc0-artifacts.s3.us-west-2.amazonaws.com/zkr/${sha256Hash}.zip";
|
2024-09-14 21:47:11 +00:00
|
|
|
hash = "sha256-ToSWRp4e+gDvs2MNJhq/NF5rKQX7ZLTzope+iOvfg9I=";
|
2024-05-23 09:03:07 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
''
|
|
|
|
ln -sf ${recursionZkr} ./risc0/circuit/recursion/src/recursion_zkr.zip
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "RISC Zero zero-knowledge VM";
|
|
|
|
homepage = "https://github.com/risc0/risc0";
|
2024-06-16 20:48:03 +00:00
|
|
|
changelog = "https://github.com/risc0/risc0/blob/${src.rev}/CHANGELOG.md";
|
2024-05-23 09:03:07 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ marijanp ];
|
|
|
|
mainProgram = "r0vm";
|
|
|
|
};
|
|
|
|
}
|