aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/misc/cgminer/default.nix
blob: 09236565d5984055dd94bbbee49b308a1426769f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ fetchgit, stdenv, pkgconfig, libtool, autoconf, automake
, curl, ncurses, ocl-icd, opencl-headers, xorg, jansson }:

stdenv.mkDerivation {
  version = "3.7.2";
  pname = "cgminer";

  src = fetchgit {
    url = "https://github.com/ckolivas/cgminer.git";
    rev = "refs/tags/v3.7.2";
    sha256  = "1xfzx91dpwjj1vmhas3v9ybs0p2i74lrhinijmpav15acfggm9fq";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [
    autoconf automake libtool curl ncurses ocl-icd opencl-headers
    xorg.libX11 xorg.libXext xorg.libXinerama jansson
  ];
  configureScript = "./autogen.sh";
  configureFlags = [ "--enable-scrypt" "--enable-opencl" ];
  NIX_LDFLAGS = "-lgcc_s -lX11 -lXext -lXinerama";

  postBuild = ''
    gcc api-example.c -o cgminer-api
  '';

  postInstall = ''
    cp cgminer-api $out/bin/
    chmod 444 $out/bin/*.cl
  '';

  meta = with stdenv.lib; {
    description = "CPU/GPU miner in c for bitcoin";
    longDescription= ''
      This is a multi-threaded multi-pool GPU, FPGA and ASIC miner with ATI GPU
      monitoring, (over)clocking and fanspeed support for bitcoin and derivative
      coins. Do not use on multiple block chains at the same time!
    '';
    homepage = "https://github.com/ckolivas/cgminer";
    license = licenses.gpl3;
    maintainers = [ maintainers.offline ];
    platforms = stdenv.lib.platforms.linux;
    hydraPlatforms = [];
  };
}