Primecoin (0.8.6): New Package

Primecoin is an altcoin which uses prime-searching as its proof-of-work.
It is the first energy-multiuse altcoin - normally, the proof-of-work algorithms
in altcoins are useful only for the coin itself, but the Primecoin algorithm
is very useful to mathematical research..

+56
+4
pkgs/applications/altcoins/default.nix
··· 19 20 namecoin = callPackage ./namecoin.nix { inherit namecoind; }; 21 namecoind = callPackage ./namecoind.nix { }; 22 }
··· 19 20 namecoin = callPackage ./namecoin.nix { inherit namecoind; }; 21 namecoind = callPackage ./namecoind.nix { }; 22 + 23 + primecoin = callPackage ./primecoin.nix { withGui = true; }; 24 + primecoind = callPackage ./primecoin.nix { withGui = false; }; 25 + 26 }
+52
pkgs/applications/altcoins/primecoin.nix
···
··· 1 + { stdenv, fetchurl, pkgconfig, openssl, db48, boost 2 + , zlib, miniupnpc, qt4, utillinux, protobuf, qrencode 3 + , withGui }: 4 + 5 + with stdenv.lib; 6 + stdenv.mkDerivation rec{ 7 + 8 + name = "primecoin" + (toString (optional (!withGui) "d")) + "-" + version; 9 + version = "0.8.6"; 10 + 11 + src = fetchurl { 12 + url = "https://github.com/primecoin/primecoin/archive/v${version}.tar.gz"; 13 + sha256 = "0cixnkici74204s9d5iqj5sccib5a8dig2p2fp1axdjifpg787i3"; 14 + }; 15 + 16 + buildInputs = [ pkgconfig openssl db48 boost zlib 17 + miniupnpc utillinux protobuf ] 18 + ++ optionals withGui [ qt4 qrencode ]; 19 + 20 + configureFlags = [ "--with-boost-libdir=${boost.lib}/lib" ] 21 + ++ optionals withGui [ "--with-gui=qt4" ]; 22 + 23 + configurePhase = optional withGui "qmake"; 24 + 25 + preBuild = optional (!withGui) "cd src; cp makefile.unix Makefile"; 26 + 27 + installPhase = 28 + if withGui 29 + then "install -D bitcoin-qt $out/bin/primecoin-qt" 30 + else "install -D bitcoind $out/bin/primecoind"; 31 + 32 + meta = { 33 + description = "A new type cryptocurrency which is proof-of-work based on searching for prime numbers."; 34 + longDescription= '' 35 + Primecoin is an innovative cryptocurrency, a form of digital 36 + currency secured by cryptography and issued through a 37 + decentralized mining market. Derived from Satoshi Nakamoto's 38 + Bitcoin, Primecoin introduces an unique form of proof-of-work 39 + based on prime numbers. 40 + 41 + The innovative prime proof-of-work in Primecoin not only 42 + provides security and minting to the network, but also generates 43 + a special form of prime number chains of interest to mathematical 44 + research. Thus primecoin network is energy-multiuse, compared to 45 + bitcoin. 46 + ''; 47 + homepage = http://primecoin.io/; 48 + maintainers = with maintainers; [ AndersonTorres ]; 49 + license = licenses.mit; 50 + platforms = platforms.unix; 51 + }; 52 + }