From 0648077a15a6a9cda1cccfff972f5a535b6b2dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KJ=20=C3=98rbekk?= Date: Sat, 27 May 2017 00:16:01 -0400 Subject: nheqminer: Add nix package --- pkgs/nheqminer/default.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pkgs/nheqminer/default.nix (limited to 'pkgs/nheqminer') 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/ + ''; +} -- cgit v1.2.3