diff options
author | André Silva <andrerfosilva@gmail.com> | 2020-09-26 00:41:01 +0100 |
---|---|---|
committer | André Silva <andrerfosilva@gmail.com> | 2020-09-27 12:32:54 +0100 |
commit | 5bafcbf7c184e93b6898c5faf5b2f8bde8455027 (patch) | |
tree | f7a919c06ae7ad4b69bc315f04af5d769e57c141 /pkgs/applications/blockchains/polkadot | |
parent | 899a563bbec30c4a86e555205e52198c684b3bad (diff) |
polkadot: 0.2.17 -> 0.8.24
Diffstat (limited to 'pkgs/applications/blockchains/polkadot')
-rw-r--r-- | pkgs/applications/blockchains/polkadot/default.nix | 44 | ||||
-rw-r--r-- | pkgs/applications/blockchains/polkadot/substrate-wasm-builder-runner.patch | 25 |
2 files changed, 50 insertions, 19 deletions
diff --git a/pkgs/applications/blockchains/polkadot/default.nix b/pkgs/applications/blockchains/polkadot/default.nix index a919a3054196..c55d78b0176b 100644 --- a/pkgs/applications/blockchains/polkadot/default.nix +++ b/pkgs/applications/blockchains/polkadot/default.nix @@ -1,37 +1,43 @@ -{ stdenv +{ clang , fetchFromGitHub +, lib +, llvmPackages +, protobuf , rustPlatform -, pkgconfig -, openssl }: - rustPlatform.buildRustPackage rec { pname = "polkadot"; - version = "0.2.17"; + version = "0.8.24"; 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 = "15q5scajxrf82k8nxysah8cs3yl2p09xzzwlkxvjkcn08r3zhig6"; }; - cargoSha256 = "1h5v7c7xi2r2wzh1pj6xidrg7dx23w3rjm88mggpq7574arijk4i"; + cargoSha256 = "0qp20g5c15qzp2n1nzwqbnn2wx6c905vh652nvkm7sb1d901iiqi"; + + cargoPatches = [ ./substrate-wasm-builder-runner.patch ]; + + nativeBuildInputs = [ clang ]; + + LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + PROTOC = "${protobuf}/bin/protoc"; + + # NOTE: We don't build the WASM runtimes since this would require a more + # complicated rust environment setup. The resulting binary is still useful for + # live networks since those just use the WASM blob from the network chainspec. + BUILD_DUMMY_WASM_BINARY = 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 ]; + maintainers = with maintainers; [ akru andresilva ]; platforms = platforms.linux; - # Last attempt at building this was on v0.7.22 - # https://github.com/paritytech/polkadot/releases - broken = true; }; } diff --git a/pkgs/applications/blockchains/polkadot/substrate-wasm-builder-runner.patch b/pkgs/applications/blockchains/polkadot/substrate-wasm-builder-runner.patch new file mode 100644 index 000000000000..7d84965dcea2 --- /dev/null +++ b/pkgs/applications/blockchains/polkadot/substrate-wasm-builder-runner.patch @@ -0,0 +1,25 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 5e7c4a14..bb67aada 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -8642,8 +8642,7 @@ dependencies = [ + [[package]] + name = "substrate-wasm-builder-runner" + version = "1.0.6" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d2a965994514ab35d3893e9260245f2947fd1981cdd4fffd2c6e6d1a9ce02e6a" ++source = "git+https://github.com/paritytech/substrate#647ad15565d7c35ecf00b73b12cccad9858780b9" + + [[package]] + name = "subtle" +diff --git a/Cargo.toml b/Cargo.toml +index 78047a1a..2d571f8e 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -112,3 +112,6 @@ polkadot = { path = "/usr/bin/polkadot" } + + [package.metadata.rpm.files] + "../scripts/packaging/polkadot.service" = { path = "/usr/lib/systemd/system/polkadot.service", mode = "644" } ++ ++[patch.crates-io] ++substrate-wasm-builder-runner = { git = "https://github.com/paritytech/substrate", branch = "master" } |