summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
authorKJ Ørbekk <kj@orbekk.com>2017-05-27 00:16:01 -0400
committerKJ Ørbekk <kj@orbekk.com>2017-05-27 00:16:01 -0400
commit0648077a15a6a9cda1cccfff972f5a535b6b2dc9 (patch)
tree36513e01387dd3070678ef79ec3e948f201b7947 /pkgs
parent7b73155fb7947b5b71f12fdbd5e965d839e08a09 (diff)
nheqminer: Add nix package
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/
+ '';
+}