@@ -0,0 +1,50 @@
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 = "memorycoin" + (toString (optional (!withGui) "d")) + "-" + version;
9+ version = "0.8.5";
10+
11+ src = fetchurl {
12+ url = "https://github.com/memorycoin/memorycoin/archive/v${version}.tar.gz";
13+ sha256 = "1iyh6dqrg0mirwci5br5n5qw3ghp2cs23wd8ygr56bh9ml4dr1m8";
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/memorycoin-qt"
30+ else "install -D bitcoind $out/bin/memorycoind";
31+
32+ meta = {
33+ description = "Peer-to-peer, CPU-based electronic cash system";
34+ longDescription= ''
35+ Memorycoin is a cryptocurrency that aims to empower the
36+ economically and financially marginalized. It allows individuals
37+ to participate in the internet economy even when they live in
38+ countries where credit card companies and PayPal(R) refuse to
39+ operate. Individuals can store and transfer wealth with just a
40+ memorized pass phrase.
41+
42+ Memorycoin is based on the Bitcoin code, but with some key
43+ differences.
44+ '';
45+ homepage = "http://www.bitcoin.org/";
46+ maintainers = with maintainers; [ AndersonTorres ];
47+ license = licenses.mit;
48+ platforms = platforms.unix;
49+ };
50+}