From f219bba765191277cc9c52a9fb695445c806d3ab Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Wed, 27 Sep 2023 09:45:55 +0100 Subject: [PATCH] feat: add arm support for prysm feat: add arm support for prysm --- packages/clients/consensus/prysm/default.nix | 2 +- packages/clients/execution/geth/default.nix | 2 +- packages/libs/bls/default.nix | 12 ++++++++++-- packages/libs/blst/default.nix | 2 +- packages/libs/crytic-compile/default.nix | 2 +- packages/libs/evmc/default.nix | 2 +- packages/libs/mcl/default.nix | 12 +++++++++++- 7 files changed, 26 insertions(+), 8 deletions(-) diff --git a/packages/clients/consensus/prysm/default.nix b/packages/clients/consensus/prysm/default.nix index 4b24a1af..948a7a34 100644 --- a/packages/clients/consensus/prysm/default.nix +++ b/packages/clients/consensus/prysm/default.nix @@ -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"]; }; } diff --git a/packages/clients/execution/geth/default.nix b/packages/clients/execution/geth/default.nix index e22f532e..fc0e4770 100644 --- a/packages/clients/execution/geth/default.nix +++ b/packages/clients/execution/geth/default.nix @@ -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"]; }; } diff --git a/packages/libs/bls/default.nix b/packages/libs/bls/default.nix index b365eae3..44ad3786 100644 --- a/packages/libs/bls/default.nix +++ b/packages/libs/bls/default.nix @@ -3,6 +3,9 @@ fetchFromGitHub, gmp, stdenv, + clang, + system, + lib, }: stdenv.mkDerivation rec { pname = "bls"; @@ -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 @@ -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"]; }; } diff --git a/packages/libs/blst/default.nix b/packages/libs/blst/default.nix index 633ebd78..0a364d19 100644 --- a/packages/libs/blst/default.nix +++ b/packages/libs/blst/default.nix @@ -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"]; }; } diff --git a/packages/libs/crytic-compile/default.nix b/packages/libs/crytic-compile/default.nix index c1dca737..39958bbe 100644 --- a/packages/libs/crytic-compile/default.nix +++ b/packages/libs/crytic-compile/default.nix @@ -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"]; }; } diff --git a/packages/libs/evmc/default.nix b/packages/libs/evmc/default.nix index 953f1320..354d177f 100644 --- a/packages/libs/evmc/default.nix +++ b/packages/libs/evmc/default.nix @@ -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"]; }; } diff --git a/packages/libs/mcl/default.nix b/packages/libs/mcl/default.nix index 3db92b78..cda12f2a 100644 --- a/packages/libs/mcl/default.nix +++ b/packages/libs/mcl/default.nix @@ -2,6 +2,10 @@ fetchFromGitHub, gmpxx, stdenv, + clang, + cmake, + system, + lib, }: stdenv.mkDerivation rec { pname = "mcl"; @@ -14,8 +18,14 @@ 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 ''; @@ -23,6 +33,6 @@ stdenv.mkDerivation rec { 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"]; }; }