polkadot: 0.9.17 -> 0.9.18
This commit is contained in:
parent
03891bb4bb
commit
214be243c9
@ -8,15 +8,21 @@
|
|||||||
}:
|
}:
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "polkadot";
|
pname = "polkadot";
|
||||||
version = "0.9.17";
|
version = "0.9.18";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "paritytech";
|
owner = "paritytech";
|
||||||
repo = "polkadot";
|
repo = "polkadot";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-m47Y4IXGc43XLs5d6ehlD0A53BWC5kO3K2BS/xbYgl8=";
|
sha256 = "sha256-pjHSiVspBV15jKUFv+Uf2l3tah40l55Pv8vwDuwgwjc=";
|
||||||
|
|
||||||
# see the comment below on fakeGit for how this is used
|
# the build process of polkadot requires a .git folder in order to determine
|
||||||
|
# the git commit hash that is being built and add it to the version string.
|
||||||
|
# since having a .git folder introduces reproducibility issues to the nix
|
||||||
|
# build, we check the git commit hash after fetching the source and save it
|
||||||
|
# into a .git_commit file, and then delete the .git folder. we can then use
|
||||||
|
# this file to populate an environment variable with the commit hash, which
|
||||||
|
# is picked up by polkadot's build process.
|
||||||
leaveDotGit = true;
|
leaveDotGit = true;
|
||||||
postFetch = ''
|
postFetch = ''
|
||||||
( cd $out; git rev-parse --short HEAD > .git_commit )
|
( cd $out; git rev-parse --short HEAD > .git_commit )
|
||||||
@ -24,28 +30,14 @@ rustPlatform.buildRustPackage rec {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoSha256 = "sha256-JBacioy2woAfKQuK6tXU9as4DNc+3uY3F3GWksCf6WU=";
|
cargoSha256 = "sha256-Gc5WbayQUlsl7Fk8NyLPh2Zg2yrLl3WJqKorNZMLi94=";
|
||||||
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs = [ clang ];
|
||||||
let
|
|
||||||
# the build process of polkadot requires a .git folder in order to determine
|
preBuild = ''
|
||||||
# the git commit hash that is being built and add it to the version string.
|
export SUBSTRATE_CLI_GIT_COMMIT_HASH=$(cat .git_commit)
|
||||||
# since having a .git folder introduces reproducibility issues to the nix
|
rm .git_commit
|
||||||
# build, we check the git commit hash after fetching the source and save it
|
|
||||||
# into a .git_commit file, and then delete the .git folder. then we create a
|
|
||||||
# fake git command that will just return the contents of this file, which will
|
|
||||||
# be used when the polkadot build calls `git rev-parse` to fetch the commit
|
|
||||||
# hash.
|
|
||||||
fakeGit = writeShellScriptBin "git" ''
|
|
||||||
if [[ $@ = "rev-parse --short HEAD" ]]; then
|
|
||||||
cat /build/source/.git_commit
|
|
||||||
else
|
|
||||||
>&2 echo "Unknown command: $@"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
in
|
|
||||||
[ clang fakeGit ];
|
|
||||||
|
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
||||||
PROTOC = "${protobuf}/bin/protoc";
|
PROTOC = "${protobuf}/bin/protoc";
|
||||||
|
Loading…
Reference in New Issue
Block a user