summary refs log tree commit diff
path: root/pkgs/applications/blockchains/polkadot/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/blockchains/polkadot/default.nix')
-rw-r--r--pkgs/applications/blockchains/polkadot/default.nix45
1 files changed, 25 insertions, 20 deletions
diff --git a/pkgs/applications/blockchains/polkadot/default.nix b/pkgs/applications/blockchains/polkadot/default.nix
index a919a305419..a1f0b17b202 100644
--- a/pkgs/applications/blockchains/polkadot/default.nix
+++ b/pkgs/applications/blockchains/polkadot/default.nix
@@ -1,37 +1,42 @@
-{ stdenv
+{ clang
 , fetchFromGitHub
+, lib
+, llvmPackages
+, protobuf
 , rustPlatform
-, pkgconfig
-, openssl
 }:
-
 rustPlatform.buildRustPackage rec {
   pname = "polkadot";
-  version = "0.2.17";
+  version = "0.9.8";
 
   src = fetchFromGitHub {
     owner = "paritytech";
-    # N.B. In 2018, the thing that was "polkadot" was split off into its own
-    # repo, so if this package is ever updated it should be changed to
-    # paritytech/polkadot, as per comment here:
-    # https://github.com/paritytech/polkadot#note
-    repo = "substrate";
-    rev = "19f4f4d4df3bb266086b4e488739f73d3d5e588c";
-    sha256 = "0v7g03rbml2afw0splmyjh9nqpjg0ldjw09hyc0jqd3qlhgxiiyj";
+    repo = "polkadot";
+    rev = "v${version}";
+    sha256 = "sha256-5PNogoahAZUjIlQsVXwm7j5OmP3/uEEdV0vrIDXXBx8=";
   };
 
-  cargoSha256 = "1h5v7c7xi2r2wzh1pj6xidrg7dx23w3rjm88mggpq7574arijk4i";
+  cargoSha256 = "0iikys90flzmnnb6l2wzag8mp91p6z9y7rjzym2sd6m7xhgbc1x6";
+
+  nativeBuildInputs = [ clang ];
+
+  LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
+  PROTOC = "${protobuf}/bin/protoc";
+
+  # NOTE: We don't build the WASM runtimes since this would require a more
+  # complicated rust environment setup and this is only needed for developer
+  # environments. The resulting binary is useful for end-users of live networks
+  # since those just use the WASM blob from the network chainspec.
+  SKIP_WASM_BUILD = 1;
 
-  buildInputs = [ pkgconfig openssl openssl.dev ];
+  # We can't run the test suite since we didn't compile the WASM runtimes.
+  doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Polkadot Node Implementation";
     homepage = "https://polkadot.network";
-    license = licenses.gpl3;
-    maintainers = [ maintainers.akru ];
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ akru andresilva asymmetric FlorianFranzen RaghavSood ];
     platforms = platforms.linux;
-    # Last attempt at building this was on v0.7.22
-    # https://github.com/paritytech/polkadot/releases
-    broken = true;
   };
 }