From a338dcf27226df147015997288efa5b61ce3fdc7 Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Tue, 23 Mar 2021 23:49:45 +0100 Subject: [PATCH] also build iele --- flake.nix | 5 +++-- nix/pkgs/iele.nix | 25 +++++++++++++++++++++++++ nix/pkgs/mantis/wrapped.nix | 5 +++-- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 nix/pkgs/iele.nix diff --git a/flake.nix b/flake.nix index 45423efbdc..a3321938e3 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,8 @@ kevm = final.callPackage ./nix/pkgs/kevm.nix { }; + iele = final.callPackage ./nix/pkgs/iele.nix { }; + mantis-entrypoint = final.callPackage ./nix/entrypoint.nix { }; }; @@ -75,7 +77,6 @@ defaultApp = apps.mantis; }) // (collectHydraSets [ (mkHydraSet [ "mantis" ] [ "x86_64-linux" "x86_64-darwin" ]) - (mkHydraSet [ "kevm" ] [ "x86_64-linux" ]) - (mkHydraSet [ "mantis-entrypoint" ] [ "x86_64-linux" ]) + (mkHydraSet [ "kevm" "iele" "mantis-entrypoint" ] [ "x86_64-linux" ]) ]); } diff --git a/nix/pkgs/iele.nix b/nix/pkgs/iele.nix new file mode 100644 index 0000000000..e31f6b887a --- /dev/null +++ b/nix/pkgs/iele.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, dockerTools, secp256k1, gmp5, mpfr, zlib }: +let libPath = lib.makeLibraryPath [ secp256k1 gmp5 mpfr zlib ]; +in stdenv.mkDerivation { + name = "iele"; + + src = dockerTools.pullImage { + imageName = "inputoutput/mantis"; + imageDigest = + "sha256:594ed009f1bc1f12b86e11136441602107c3d580476002d9bae58b258a74ac1b"; + sha256 = "sha256-JT+FarGQlgYoO392Ne1ofdqmishZLfH+OwV2CXTYwdA="; + }; + + installPhase = '' + mkdir -p tmp $out/bin + tar --delay-directory-restore -C tmp -xf layer.tar || true + + cp tmp/bin/iele-vm $out/bin + chmod 0755 $out/bin/iele-vm + + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${libPath}" \ + "$out/bin/iele-vm" + ''; +} diff --git a/nix/pkgs/mantis/wrapped.nix b/nix/pkgs/mantis/wrapped.nix index a80c63e0c6..edc7e3fe88 100644 --- a/nix/pkgs/mantis/wrapped.nix +++ b/nix/pkgs/mantis/wrapped.nix @@ -1,9 +1,9 @@ -{ lib, stdenv, mantis, makeWrapper, jre, gawk, gnused, kevm, coreutils }: +{ lib, stdenv, mantis, makeWrapper, jre, gawk, gnused, kevm, iele, coreutils }: let inherit (stdenv.lib) optionalString makeLibraryPath; inherit (stdenv) cc isDarwin; LD_LIBRARY_PATH = makeLibraryPath [ cc.cc.lib ]; - PATH = lib.makeBinPath [ jre gawk gnused kevm coreutils ]; + PATH = lib.makeBinPath [ jre gawk gnused kevm iele coreutils ]; in stdenv.mkDerivation { pname = "mantis"; version = let @@ -31,5 +31,6 @@ in stdenv.mkDerivation { done ln -s ${kevm}/bin/kevm-vm $out/bin + ln -s ${iele}/bin/iele-vm $out/bin ''; }