Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / r0 / r0vm / package.nix
blob5cdc11b87b4d74f67514f81e6bc84c64634e3257
1 { rustPlatform
2 , stdenv
3 , fetchFromGitHub
4 , fetchurl
5 , pkg-config
6 , perl
7 , openssl
8 , lib
9 , darwin
11 rustPlatform.buildRustPackage rec {
12   pname = "r0vm";
13   version = "1.0.3";
14   src = fetchFromGitHub {
15     owner = "risc0";
16     repo = "risc0";
17     rev = "v${version}";
18     sha256 = "sha256-shlu6X2JzFU8xCo6yXSHZUxe+XAvzfwuQrWv/ck1a3E=";
19   };
21   buildAndTestSubdir = "risc0/r0vm";
23   nativeBuildInputs = [
24     pkg-config
25     perl
26   ];
28   buildInputs = [
29     openssl.dev
30   ] ++ lib.optionals stdenv.isDarwin [
31     darwin.apple_sdk.frameworks.SystemConfiguration
32   ];
34   doCheck = false;
36   cargoHash = "sha256-xFiCNskX2zsAmqM604rg5oko4owWZYMY6jNNrJH5kJ8=";
38   postPatch =
39     let
40       # see https://github.com/risc0/risc0/blob/v1.0.3/risc0/circuit/recursion/build.rs
41       sha256Hash = "4e8496469e1efa00efb3630d261abf345e6b2905fb64b4f3a297be88ebdf83d2";
42       recursionZkr = fetchurl {
43         name = "recursion_zkr.zip";
44         url = "https://risc0-artifacts.s3.us-west-2.amazonaws.com/zkr/${sha256Hash}.zip";
45         sha256 = "sha256-ToSWRp4e+gDvs2MNJhq/NF5rKQX7ZLTzope+iOvfg9I=";
46       };
47     in
48     ''
49       ln -sf ${recursionZkr} ./risc0/circuit/recursion/src/recursion_zkr.zip
50     '';
52   meta = with lib; {
53     description = "RISC Zero zero-knowledge VM";
54     homepage = "https://github.com/risc0/risc0";
55     changelog = "https://github.com/risc0/risc0/blob/${src.rev}/CHANGELOG.md";
56     license = licenses.asl20;
57     maintainers = with maintainers; [ marijanp ];
58     mainProgram = "r0vm";
59   };