2020-09-25 23:41:01 +00:00
|
|
|
{ clang
|
2018-12-05 14:10:31 +00:00
|
|
|
, fetchFromGitHub
|
2020-09-25 23:41:01 +00:00
|
|
|
, lib
|
|
|
|
, llvmPackages
|
|
|
|
, protobuf
|
2018-12-05 14:10:31 +00:00
|
|
|
, rustPlatform
|
|
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 11:41:23 +00:00
|
|
|
pname = "polkadot";
|
2021-11-03 20:49:25 +00:00
|
|
|
version = "0.9.12-1";
|
2018-12-05 14:10:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "paritytech";
|
2020-09-25 23:41:01 +00:00
|
|
|
repo = "polkadot";
|
|
|
|
rev = "v${version}";
|
2021-11-03 20:49:25 +00:00
|
|
|
sha256 = "sha256-+HATcxdIDQGDIQBF08yy/eKBcS10Hp7C0nZFVsYFNwQ=";
|
2020-03-09 04:02:24 +00:00
|
|
|
};
|
2020-02-14 02:00:26 +00:00
|
|
|
|
2021-11-03 20:49:25 +00:00
|
|
|
cargoSha256 = "sha256-1qg4ZnSORRVI7eCVMrR7lY3tzo7KJt+dC2RBXqbKrig=";
|
2020-09-25 23:41:01 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ clang ];
|
|
|
|
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 08:23:57 +00:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
2020-09-25 23:41:01 +00:00
|
|
|
PROTOC = "${protobuf}/bin/protoc";
|
|
|
|
|
|
|
|
# NOTE: We don't build the WASM runtimes since this would require a more
|
2021-01-22 17:16:14 +00:00
|
|
|
# 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;
|
2018-12-05 14:10:31 +00:00
|
|
|
|
2020-09-25 23:41:01 +00:00
|
|
|
# We can't run the test suite since we didn't compile the WASM runtimes.
|
|
|
|
doCheck = false;
|
2018-12-05 14:10:31 +00:00
|
|
|
|
2020-09-25 23:41:01 +00:00
|
|
|
meta = with lib; {
|
2018-12-05 14:10:31 +00:00
|
|
|
description = "Polkadot Node Implementation";
|
2020-03-09 04:02:24 +00:00
|
|
|
homepage = "https://polkadot.network";
|
2021-03-06 02:30:43 +00:00
|
|
|
license = licenses.gpl3Only;
|
2021-05-05 21:50:59 +00:00
|
|
|
maintainers = with maintainers; [ akru andresilva asymmetric FlorianFranzen RaghavSood ];
|
2018-12-05 14:10:31 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|