biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / blockchains / nearcore / default.nix
blob46fbc289bde35ec10daa6cb79a0017411e7aaa82
1 { rustPlatform, lib, fetchFromGitHub
2 , zlib, openssl
3 , pkg-config, protobuf
4 }:
5 rustPlatform.buildRustPackage rec {
6   pname = "nearcore";
7   version = "1.30.1";
9   # https://github.com/near/nearcore/tags
10   src = fetchFromGitHub {
11     owner = "near";
12     repo = "nearcore";
13     # there is also a branch for this version number, so we need to be explicit
14     rev = "refs/tags/${version}";
16     sha256 = "sha256-VjvHCiWjsx5Y7xxqck/O9gSNrL8mxCTosLwLqC85ywY=";
17   };
19   cargoHash = "sha256-5Gs1sAzjuUO3IkwMX1NeA/Sbax0qtwvulyT66AQaNjs=";
20   cargoPatches = [ ./0001-make-near-test-contracts-optional.patch ];
22   postPatch = ''
23     substituteInPlace neard/build.rs \
24       --replace 'get_git_version()?' '"nix:${version}"'
25   '';
27   CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
28   CARGO_PROFILE_RELEASE_LTO = "fat";
29   NEAR_RELEASE_BUILD = "release";
31   OPENSSL_NO_VENDOR = 1; # we want to link to OpenSSL provided by Nix
33   # don't build SDK samples that require wasm-enabled rust
34   buildAndTestSubdir = "neard";
35   doCheck = false; # needs network
37   buildInputs = [
38     zlib
39     openssl
40   ];
42   nativeBuildInputs = [
43     pkg-config
44     protobuf
45     rustPlatform.bindgenHook
46   ];
48   # fat LTO requires ~3.4GB RAM
49   requiredSystemFeatures = [ "big-parallel" ];
51   meta = with lib; {
52     description = "Reference client for NEAR Protocol";
53     homepage = "https://github.com/near/nearcore";
54     license = licenses.gpl3;
55     maintainers = with maintainers; [ mikroskeem ];
56     # only x86_64 is supported in nearcore because of sse4+ support, macOS might
57     # be also possible
58     platforms = [ "x86_64-linux" ];
59   };