Skip to content

Commit

Permalink
feat: add arm support for prysm
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Oct 3, 2023
1 parent cb325d7 commit a030517
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
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"];
};
}
10 changes: 10 additions & 0 deletions 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,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
'';
Expand Down

0 comments on commit a030517

Please sign in to comment.