summary refs log tree commit diff
path: root/pkgs/applications/altcoins/primecoin.nix
blob: 360a39a4fd81bd4a0b407669192b7015b0e503b0 (plain) (blame)
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
46
47
48
49
50
{ stdenv, fetchurl, pkgconfig, openssl, db48, boost
, zlib, miniupnpc, qt4, qmake4Hook, utillinux, protobuf, qrencode
, withGui }:

with stdenv.lib;
stdenv.mkDerivation rec{

  name = "primecoin" + (toString (optional (!withGui) "d")) + "-" + version;
  version = "0.8.6";

  src = fetchurl {
    url =  "https://github.com/primecoin/primecoin/archive/v${version}.tar.gz";
    sha256 = "0cixnkici74204s9d5iqj5sccib5a8dig2p2fp1axdjifpg787i3";
  };

  buildInputs = [ pkgconfig openssl db48 boost zlib
                  miniupnpc utillinux protobuf ]
                  ++ optionals withGui [ qt4 qmake4Hook qrencode ];

  configureFlags = [ "--with-boost-libdir=${boost.lib}/lib" ]
                     ++ optionals withGui [ "--with-gui=qt4" ];

  preBuild = optional (!withGui) "cd src; cp makefile.unix Makefile";

  installPhase =
    if withGui
    then "install -D bitcoin-qt $out/bin/primecoin-qt"
    else "install -D bitcoind $out/bin/primecoind";

  meta = {
    description = "A new type cryptocurrency which is proof-of-work based on searching for prime numbers";
    longDescription= ''
      Primecoin is an innovative cryptocurrency, a form of digital
      currency secured by cryptography and issued through a
      decentralized mining market. Derived from Satoshi Nakamoto's
      Bitcoin, Primecoin introduces an unique form of proof-of-work
      based on prime numbers.

      The innovative prime proof-of-work in Primecoin not only
      provides security and minting to the network, but also generates
      a special form of prime number chains of interest to mathematical
      research. Thus primecoin network is energy-multiuse, compared to
      bitcoin.
    '';
    homepage = http://primecoin.io/;
    maintainers = with maintainers; [ AndersonTorres ];
    license = licenses.mit;
    platforms = platforms.unix;
  };
}