From 7a05dabd70a3aed5040c9a95a44c698631c55c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 17 Apr 2022 11:10:44 +0100 Subject: [PATCH] nearcore: init at 1.25.0 (#168635) --- .../blockchains/nearcore/default.nix | 42 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/applications/blockchains/nearcore/default.nix diff --git a/pkgs/applications/blockchains/nearcore/default.nix b/pkgs/applications/blockchains/nearcore/default.nix new file mode 100644 index 000000000000..f9f0bd0c69bf --- /dev/null +++ b/pkgs/applications/blockchains/nearcore/default.nix @@ -0,0 +1,42 @@ +{ rustPlatform, lib, fetchFromGitHub +, zlib, elfutils, openssl +, cmake, python3, pkg-config, protobuf, perl, llvmPackages +}: +rustPlatform.buildRustPackage rec { + #https://github.com/near/nearcore + pname = "nearcore"; + version = "1.25.0"; + src = fetchFromGitHub { + owner = "near"; + repo = "nearcore"; + # there is also a branch for this version number, so we need to be explicit + rev = "refs/tags/${version}"; + sha256 = "sha256-7hiBqJLGIf+kNKJvMQ7KtGZm/SWLY3pT7YDlwbm3HDM="; + }; + + cargoSha256 = "sha256-EGv4CibSHL9oTAdWK7d/SOzZWPcEB16hTWlWHjKU4wc="; + + # don't build SDK samples that require wasm-enabled rust + cargoBuildFlags = [ "-p" "neard" ]; + doCheck = false; # needs network + + buildInputs = [ zlib elfutils openssl ]; + nativeBuildInputs = [ + cmake + python3 + pkg-config + protobuf + perl + ]; + + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; + BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include"; + + meta = with lib; { + description = "Reference client for NEAR Protocol"; + homepage = "https://github.com/near/nearcore"; + license = licenses.mit; + maintainers = with maintainers; [ mic92 ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f00ee1c353ff..2cb33763c823 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8162,6 +8162,8 @@ with pkgs; ndppd = callPackage ../applications/networking/ndppd { }; + nearcore = callPackage ../applications/blockchains/nearcore { }; + nebula = callPackage ../tools/networking/nebula { }; nemiver = callPackage ../development/tools/nemiver { };