Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / blockchains / cgminer / default.nix
blob7d2dbe9208582f9ec302e53543dd875c7adbcdd8
1 { lib, stdenv
2 , fetchFromGitHub
3 , pkg-config
4 , libtool
5 , autoconf
6 , automake
7 , curl
8 , ncurses
9 , ocl-icd
10 , opencl-headers
11 , libusb1
12 , xorg
13 , jansson }:
15 stdenv.mkDerivation rec {
16   pname = "cgminer";
17   version = "4.11.1";
19   src = fetchFromGitHub {
20     owner = "ckolivas";
21     repo = "cgminer";
22     rev = "v${version}";
23     sha256 = "0l1ms3nxnjzh4mpiadikvngcr9k3jnjqy3yna207za0va0c28dj5";
24   };
26   nativeBuildInputs = [ pkg-config autoconf automake ];
27   buildInputs = [ libtool curl ncurses ocl-icd opencl-headers
28     xorg.libX11 xorg.libXext xorg.libXinerama jansson libusb1 ];
30   configureScript = "./autogen.sh";
31   configureFlags = [ "--enable-scrypt"
32                      "--enable-opencl"
33                      "--enable-bitforce"
34                      "--enable-icarus"
35                      "--enable-modminer"
36                      "--enable-ztex"
37                      "--enable-avalon"
38                      "--enable-klondike"
39                      "--enable-keccak"
40                      "--enable-bflsc"];
42   # Workaround build failure on -fno-common toolchains like upstream
43   # gcc-10. Otherwise build fails as:
44   #   ld: cgminer-driver-modminer.o:/build/source/miner.h:285:
45   #     multiple definition of `bitforce_drv'; cgminer-cgminer.o:/build/source/miner.h:285:
46   #     first defined here
47   env.NIX_CFLAGS_COMPILE = "-fcommon";
49   meta = with lib; {
50     description = "CPU/GPU miner in c for bitcoin";
51     homepage = "https://github.com/ckolivas/cgminer";
52     license = licenses.gpl3;
53     maintainers = with maintainers; [ offline mmahut ];
54     platforms = platforms.linux;
55   };