Unverified Commit cd9938d1 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #132215 from ilyakooo0/iko/chia-plotter

parents d0e0c93c a6581d35
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4541,6 +4541,12 @@
    githubId = 592849;
    name = "Ilya Kolpakov";
  };
  ilyakooo0 = {
    name = "Ilya Kostyuchenko";
    email = "ilyakooo0@gmail.com";
    github = "ilyakooo0";
    githubId = 6209627;
  };
  imalison = {
    email = "IvanMalison@gmail.com";
    github = "IvanMalison";
+65 −0
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, stdenv
, libsodium
, cmake
, substituteAll
, pythonPackages
}:

stdenv.mkDerivation {
  pname = "chia-plotter";
  version = "unstable-2021-07-12";

  src = fetchFromGitHub {
    owner = "madMAx43v3r";
    repo = "chia-plotter";
    rev = "974d6e5f1440f68c48492122ca33828a98864dfc";
    sha256 = "0dliswvqmi3wq9w8jp0sb0z74n5k37608sig6r60z206g2bwhjja";
    fetchSubmodules = true;
  };

  patches = [
    # prevent CMake from trying to get libraries on the Internet
    (substituteAll {
      src = ./dont_fetch_dependencies.patch;
      pybind11_src = pythonPackages.pybind11.src;
      relic_src = fetchFromGitHub {
        owner = "relic-toolkit";
        repo = "relic";
        rev = "1885ae3b681c423c72b65ce1fe70910142cf941c";
        hash = "sha256-tsSZTcssl8t7Nqdex4BesgQ+ACPgTdtHnJFvS9josN0=";
      };
    })
  ];

  nativeBuildInputs = [ cmake ];

  buildInputs = [ libsodium ];

  # These flags come from the upstream build script:
  # https://github.com/madMAx43v3r/chia-plotter/blob/974d6e5f1440f68c48492122ca33828a98864dfc/make_devel.sh#L7
  CXXFLAGS = "-O3 -fmax-errors=1";
  cmakeFlags = [
    "-DARITH=easy"
    "-DBUILD_BLS_PYTHON_BINDINGS=false"
    "-DBUILD_BLS_TESTS=false"
    "-DBUILD_BLS_BENCHMARKS=false"
  ];

  installPhase = ''
    runHook preInstall

    install -D -m 755 chia_plot $out/bin/chia_plot

    runHook postInstall
  '';

  meta = with lib; {
    homepage = "https://github.com/madMAx43v3r/chia-plotter";
    description = "New implementation of a chia plotter which is designed as a processing pipeline";
    license = licenses.gpl3Only;
    platforms = platforms.linux;
    maintainers = with maintainers; [ ilyakooo0 ];
  };
}
+50 −0
Original line number Diff line number Diff line
diff --git a/lib/bls-signatures/python-bindings/CMakeLists.txt b/lib/bls-signatures/python-bindings/CMakeLists.txt
index 255e3bb..5f99c3a 100644
--- a/lib/bls-signatures/python-bindings/CMakeLists.txt
+++ b/lib/bls-signatures/python-bindings/CMakeLists.txt
@@ -6,8 +6,7 @@ include(FetchContent)
 
 FetchContent_Declare(
   pybind11
-  GIT_REPOSITORY https://github.com/pybind/pybind11.git
-  GIT_TAG        v2.6.2
+  SOURCE_DIR @pybind11_src@
 )
 FetchContent_MakeAvailable(pybind11 relic)
 
diff --git a/lib/bls-signatures/src/CMakeLists.txt b/lib/bls-signatures/src/CMakeLists.txt
index b762b5d..e06073b 100644
--- a/lib/bls-signatures/src/CMakeLists.txt
+++ b/lib/bls-signatures/src/CMakeLists.txt
@@ -4,18 +4,11 @@ set (CMAKE_CXX_STANDARD 17)
 # CMake 3.14+
 include(FetchContent)
 
-if (DEFINED ENV{RELIC_MAIN})
-  set(RELIC_GIT_TAG "origin/main")
-else ()
-  set(RELIC_GIT_TAG "1885ae3b681c423c72b65ce1fe70910142cf941c")
-endif ()
-
 message(STATUS "Relic will be built from: ${RELIC_GIT_TAG}")
 
 FetchContent_Declare(
   relic
-  GIT_REPOSITORY https://github.com/relic-toolkit/relic.git
-  GIT_TAG        ${RELIC_GIT_TAG}
+  SOURCE_DIR @relic_src@
 )
 FetchContent_MakeAvailable(relic)
 
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 970ec74..948441a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,7 @@ include_directories(
 	${BLAKE3_PATH}
 	${CMAKE_BINARY_DIR}/_deps/relic-src/include
 	${CMAKE_BINARY_DIR}/_deps/relic-build/include
+     @relic_src@/include
 )
 
 IF (WIN32)
+2 −0
Original line number Diff line number Diff line
@@ -28649,6 +28649,8 @@ in
  chia = callPackage ../applications/blockchains/chia { };
  chia-plotter = callPackage ../applications/blockchains/chia-plotter { };
  clightning = callPackage ../applications/blockchains/clightning { };
  bitcoin-abc  = libsForQt5.callPackage ../applications/blockchains/bitcoin-abc {