summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/nheqminer/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/nheqminer/default.nix b/pkgs/nheqminer/default.nix
new file mode 100644
index 0000000..0022a3e
--- /dev/null
+++ b/pkgs/nheqminer/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub, patchelf, cmake, boost }:
+let
+ boostStatic = boost.override { enableStatic = true; };
+in
+stdenv.mkDerivation rec {
+ version = "master";
+ name = "nheqminer-${version}";
+
+ src = fetchFromGitHub {
+ owner = "nicehash";
+ repo = "nheqminer";
+ rev = "b9900ff8e3c6f8e5a46af18db454f2a2082d9f46";
+ sha256 = "06alzgpbwhhavqgin7ds8aza7skhnh8pcz6hqwsj5db6160c6hr5";
+ };
+
+ NIX_LDFLAGS="-lpthread";
+ cmakeFlags = [
+ "-DBOOST_LIBRARYDIR=${boostStatic.out}/lib"
+ "-DUSE_CUDA_DJEZO=OFF"
+ ];
+ buildInputs = [ cmake boost ];
+
+ preConfigure = ''
+ pushd cpu_xenoncat/asm_linux
+ chmod +x fasm
+ bash assemble.sh
+ popd
+
+ # the installer looks for this relative path
+ mkdir -p nheqminer/cpu_xenoncat/asm_linux
+ ln -sf $(pwd)/cpu_xenoncat/asm_linux/equihash_avx1.o nheqminer/cpu_xenoncat/asm_linux/equihash_avx1.o
+ ln -sf $(pwd)/cpu_xenoncat/asm_linux/equihash_avx2.o nheqminer/cpu_xenoncat/asm_linux/equihash_avx2.o
+ '';
+
+ installPhase = ''
+ mkdir -p $out/bin
+ pwd
+ cp nheqminer $out/bin/
+ '';
+}