From ae008ddb0330612c2236703aeabb22033a0378fb Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Tue, 7 Apr 2015 11:01:01 -0300 Subject: [PATCH] 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.. --- pkgs/applications/altcoins/default.nix | 4 ++ pkgs/applications/altcoins/primecoin.nix | 52 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 pkgs/applications/altcoins/primecoin.nix diff --git a/pkgs/applications/altcoins/default.nix b/pkgs/applications/altcoins/default.nix index 1196e6d5ebd0..a49e4dc9f909 100644 --- a/pkgs/applications/altcoins/default.nix +++ b/pkgs/applications/altcoins/default.nix @@ -19,4 +19,8 @@ rec { namecoin = callPackage ./namecoin.nix { inherit namecoind; }; namecoind = callPackage ./namecoind.nix { }; + + primecoin = callPackage ./primecoin.nix { withGui = true; }; + primecoind = callPackage ./primecoin.nix { withGui = false; }; + } diff --git a/pkgs/applications/altcoins/primecoin.nix b/pkgs/applications/altcoins/primecoin.nix new file mode 100644 index 000000000000..11ec35a71bda --- /dev/null +++ b/pkgs/applications/altcoins/primecoin.nix @@ -0,0 +1,52 @@ +{ stdenv, fetchurl, pkgconfig, openssl, db48, boost +, zlib, miniupnpc, qt4, 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 qrencode ]; + + configureFlags = [ "--with-boost-libdir=${boost.lib}/lib" ] + ++ optionals withGui [ "--with-gui=qt4" ]; + + configurePhase = optional withGui "qmake"; + + 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; + }; +}