From 0a72cc83f76b544aced605fba8bbd3fdef753b9a Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 25 Mar 2025 09:46:01 +0000 Subject: [PATCH] nix: add solc source build derivation --- nix/solc.nix | 32 ++++++++++++++++++++++++++++++++ nix/user-packages.nix | 1 + 2 files changed, 33 insertions(+) create mode 100644 nix/solc.nix diff --git a/nix/solc.nix b/nix/solc.nix new file mode 100644 index 00000000..e82564a9 --- /dev/null +++ b/nix/solc.nix @@ -0,0 +1,32 @@ +{ pkgs, fetchzip, fetchurl }: + +pkgs.stdenv.mkDerivation rec { + pname = "solc"; + version = "0.8.26"; + src = fetchzip { + url = "https://github.com/ethereum/solidity/releases/download/v0.8.26/solidity_0.8.26.tar.gz"; + sha256 = "sha256-4lrxwjEg1/TPWt2WB/kQNYvdOEt5aEbnGaEcNMz9pv4="; + }; + range_pkg = fetchurl { + url = "https://github.com/ericniebler/range-v3/archive/0.12.0.tar.gz"; + sha256 = "sha256-AVrbIwCpjt/OrwclvuwzN/VCr0kVzsTQuJ+giG9Lqcs="; + }; + fmtlib_pkg = fetchurl { + url = "https://github.com/fmtlib/fmt/archive/9.1.0.tar.gz"; + sha256 = "sha256-XepI0fzdw+xXHOIFjhORCg1Ka6tMwJqAnYsd0ciK5vI="; + }; + json_pkg = fetchurl { + url = "https://github.com/nlohmann/json/releases/download/v3.11.3/json.hpp"; + sha256 = "sha256-m+pMgGbvShwgayvlo2MC+JJvf9xgh69dILQX0M8QPqY="; + }; + nativeBuildInputs = [ pkgs.cmake ]; + buildInputs = [ pkgs.boost ]; + cmakeFlags = [ "-DBoost_USE_STATIC_LIBS=OFF" ]; + patchPhase = '' + mkdir -p deps/downloads + mkdir -p deps/nlohmann/nlohmann + cp ${range_pkg} deps/downloads/range-v3-0.12.0.tar.gz + cp ${fmtlib_pkg} deps/downloads/fmt-9.1.0.tar.gz + cp ${json_pkg} deps/nlohmann/nlohmann/json.hpp + ''; +} diff --git a/nix/user-packages.nix b/nix/user-packages.nix index 0a08ba23..8bf0faa4 100644 --- a/nix/user-packages.nix +++ b/nix/user-packages.nix @@ -22,6 +22,7 @@ rec { # tag_version = "v1.13.15"; # vendor_hash = "sha256-LWNFuF66KudxrpWBBXjMbrWP5CwEuPE2h3kGfILIII0"; # }; + # solc = callPackage (bdir + /solc.nix) {}; # Solidity compiler # litecoin = callPackage (bdir + /litecoin.nix) {}; # Litecoin daemon # bitcoin-cash = callPackage (bdir + /bitcoin-cash-node.nix) {}; # Bitcoin Cash Node daemon # zcash-mini = callPackage (bdir + /zcash-mini.nix) {}; # ZEC (test suite)