nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, curl
6, jansson
7, perl
8, autoreconfHook
9}:
10
11stdenv.mkDerivation rec {
12 pname = "cpuminer";
13 version = "2.5.1";
14
15 src = fetchFromGitHub {
16 owner = "pooler";
17 repo = pname;
18 rev = "v${version}";
19 sha256 = "0f44i0z8rid20c2hiyp92xq0q0mjj537r05sa6vdbc0nl0a5q40i";
20 };
21
22 patches = [
23 (fetchpatch {
24 name = "fix-build-on-aarch64.patch";
25 url = "https://github.com/pooler/cpuminer/commit/5f02105940edb61144c09a7eb960bba04a10d5b7.patch";
26 hash = "sha256-lGAcwDcXgcJBFhasSEdQIEIY7pp6x/PEXHBsVwAOqhc=";
27 })
28 ];
29
30 postPatch = if stdenv.cc.isClang then "${perl}/bin/perl ./nomacro.pl" else null;
31
32 nativeBuildInputs = [ autoreconfHook ];
33 buildInputs = [ curl jansson ];
34
35 configureFlags = [ "CFLAGS=-O3" ];
36
37 meta = with lib; {
38 homepage = "https://github.com/pooler/cpuminer";
39 description = "CPU miner for Litecoin and Bitcoin";
40 license = licenses.gpl2;
41 platforms = platforms.all;
42 maintainers = with maintainers; [ pSub ];
43 };
44}