Skip to content

Commit

Permalink
feat: add arm support for prysm
Browse files Browse the repository at this point in the history
feat: add arm support for prysm
  • Loading branch information
dzmitry-lahoda committed Oct 3, 2023
1 parent 96bd37d commit f219bba
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/clients/consensus/prysm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ buildGoModule rec {
description = "Go implementation of Ethereum proof of stake";
homepage = "https://github.com/prysmaticlabs/prysm";
mainProgram = "beacon-chain";
platforms = ["x86_64-linux"];
platforms = ["x86_64-linux" "aarch64-linux"];
};
}
2 changes: 1 addition & 1 deletion packages/clients/execution/geth/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ in
homepage = "https://geth.ethereum.org/";
license = with licenses; [lgpl3Plus gpl3Plus];
mainProgram = "geth";
platforms = ["x86_64-linux"];
platforms = ["x86_64-linux" "aarch64-linux"];
};
}
12 changes: 10 additions & 2 deletions packages/libs/bls/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
fetchFromGitHub,
gmp,
stdenv,
clang,
system,
lib,
}:
stdenv.mkDerivation rec {
pname = "bls";
Expand All @@ -16,7 +19,12 @@ stdenv.mkDerivation rec {
hash = "sha256-VIJi8sjDq40ecPnEWzFPDR2t5rCOUIWxfI4QAemfPPM=";
};

nativeBuildInputs = [cmake];
nativeBuildInputs = [cmake] ++ (lib.optionals (system == "aarch64-linux") [clang]);
cmakeFlags = lib.optionals (system == "aarch64-linux") [
"-DCMAKE_CXX_COMPILER=clang++"
"-DCMAKE_CXX_COMPILER_ID=Clang"
];

buildInputs = [gmp];

# ETH2.0 spec
Expand All @@ -25,6 +33,6 @@ stdenv.mkDerivation rec {
meta = {
description = "BLS threshold signature";
homepage = "https://github.com/herumi/bls";
platforms = ["x86_64-linux" "aarch64-darwin"];
platforms = ["x86_64-linux" "aarch64-darwin" "aarch64-linux"];
};
}
2 changes: 1 addition & 1 deletion packages/libs/blst/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ stdenv.mkDerivation rec {
meta = {
description = "Multilingual BLS12-381 signature library";
homepage = "https://github.com/supranational/blst";
platforms = ["x86_64-linux"];
platforms = ["x86_64-linux" "aarch64-linux"];
};
}
2 changes: 1 addition & 1 deletion packages/libs/crytic-compile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ python3.pkgs.buildPythonPackage rec {
description = "Abstraction layer for smart contract build systems";
homepage = "https://github.com/crytic/crytic-compile";
license = licenses.agpl3Plus;
platforms = ["x86_64-linux"];
platforms = ["x86_64-linux" "aarch64-linux"];
};
}
2 changes: 1 addition & 1 deletion packages/libs/evmc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ stdenv.mkDerivation rec {
meta = {
description = "EVMC – Ethereum Client-VM Connector API";
homepage = "https://github.com/ethereum/evmc";
platforms = ["x86_64-linux"];
platforms = ["x86_64-linux" "aarch64-linux"];
};
}
12 changes: 11 additions & 1 deletion packages/libs/mcl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
fetchFromGitHub,
gmpxx,
stdenv,
clang,
cmake,
system,
lib,
}:
stdenv.mkDerivation rec {
pname = "mcl";
Expand All @@ -14,15 +18,21 @@ stdenv.mkDerivation rec {
hash = "sha256-aVuBt5T+tNjrK1QahzaCxuimUDQVtoKfK/v0LTT3hy8=";
};

nativeBuildInputs = [cmake] ++ (lib.optionals (system == "aarch64-linux") [clang]);
buildInputs = [gmpxx];

cmakeFlags = lib.optionals (system == "aarch64-linux") [
"-DCMAKE_CXX_COMPILER=clang++"
"-DCMAKE_CXX_COMPILER_ID=Clang"
];

installPhase = ''
make PREFIX=$out/ install
'';

meta = {
description = "A portable and fast pairing-based cryptography library";
homepage = "https://github.com/herumi/mcl";
platforms = ["x86_64-linux" "aarch64-darwin"];
platforms = ["x86_64-linux" "aarch64-darwin" "aarch64-linux"];
};
}

0 comments on commit f219bba

Please sign in to comment.