|
1 | 1 | { |
| 2 | + applyPatches, |
2 | 3 | fetchFromGitHub, |
3 | | - lib, |
4 | | - stdenv, |
5 | | - lsb-release, |
6 | | - which, |
7 | | - cmake, |
8 | 4 | pkgs, |
9 | | - writeShellScriptBin, |
10 | | - buildFlags ? ["nimbus_beacon_node" "nimbus_validator_client"], |
| 5 | + targets ? ["nimbus_beacon_node" "nimbus_validator_client"], |
11 | 6 | }: let |
12 | | - nim1 = pkgs.nim-unwrapped-1.overrideAttrs rec { |
13 | | - version = "1.6.18"; |
14 | | - src = pkgs.fetchurl { |
15 | | - url = "https://nim-lang.org/download/nim-${version}.tar.xz"; |
16 | | - hash = "sha256-UCQaxyIpG6ljdT8EWqo1h7c8GqKK4pxXPBWluKYCoss="; |
17 | | - }; |
18 | | - }; |
19 | | -in |
20 | | - stdenv.mkDerivation rec { |
21 | | - pname = "nimbus-eth2"; |
22 | | - version = "24.6.0"; |
23 | | - |
| 7 | + version = "24.12.0"; |
| 8 | + src = applyPatches { |
24 | 9 | src = fetchFromGitHub { |
25 | 10 | owner = "status-im"; |
26 | | - repo = pname; |
| 11 | + repo = "nimbus-eth2"; |
27 | 12 | rev = "v${version}"; |
28 | | - hash = "sha256-cSQfuwMz0JDALJKeYpq25vvqq4SnAKkqW6kRNWGG788="; |
| 13 | + hash = "sha256-DBvsnGr91a69eCj1hAeoVOpxas5rfaT36rIxWEmvIVg="; |
29 | 14 | fetchSubmodules = true; |
30 | 15 | }; |
31 | | - |
32 | | - fakeGit = writeShellScriptBin "git" "echo ${version}"; |
33 | | - |
34 | | - # Dunno why we need `lsb-release`, looks like for nim itself |
35 | | - # without `which` it can't find gcc |
36 | | - nativeBuildInputs = [fakeGit lsb-release nim1 which cmake]; |
37 | | - enableParallelBuilding = true; |
38 | | - |
39 | | - NIMFLAGS = "-d:disableMarchNative -d:release"; |
40 | | - |
41 | | - makeFlags = ["USE_SYSTEM_NIM=1"]; |
42 | | - inherit buildFlags; |
43 | | - dontConfigure = true; |
44 | | - |
45 | | - preBuild = '' |
46 | | - patchShebangs scripts vendor/nimbus-build-system/scripts |
47 | | - make nimbus-build-system-paths |
48 | | - ''; |
49 | | - |
50 | | - installPhase = '' |
51 | | - mkdir -p $out/bin |
52 | | - rm -f build/generate_makefile |
53 | | - cp build/* $out/bin |
54 | | - ''; |
55 | | - |
56 | | - meta = { |
57 | | - description = "Nim implementation of the Ethereum Beacon Chain"; |
58 | | - homepage = "https://github.com/status-im/nimbus-eth2"; |
59 | | - license = lib.licenses.asl20; |
60 | | - mainProgram = "nimbus_beacon_node"; |
61 | | - platforms = ["x86_64-linux"]; |
62 | | - }; |
63 | | - } |
| 16 | + patches = [./fix-hash.patch]; |
| 17 | + }; |
| 18 | +in |
| 19 | + import "${src}/nix" {inherit pkgs targets;} |
0 commit comments