about summary refs log tree commit diff
path: root/pkgs/applications/misc/bitcoin/dogecoin.nix
blob: 21da32104d34c91e848f8de69cac45cf6465e95f (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ fetchurl, stdenv, pkgconfig
, openssl, boost, zlib, miniupnpc, qt4, qrencode, glib, protobuf
, utillinux, autogen, autoconf, autobuild, automake, db }:

with stdenv.lib;

let

  mkAutotoolCoin =
  { name, version, withGui, src, meta }:

  stdenv.mkDerivation {
    inherit src meta;

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

    buildInputs = [ autogen autoconf automake pkgconfig openssl
                    boost zlib miniupnpc db utillinux protobuf ]
                  ++ optionals withGui [ qt4 qrencode ];

    patchPhase = ''
      sed -i \
        -e 's,BDB_CPPFLAGS=$,BDB_CPPFLAGS="-I${db}/include",g' \
        -e 's,BDB_LIBS=$,BDB_LIBS="-L${db}/lib",g' \
        -e 's,bdbdirlist=$,bdbdirlist="${db}/include",g' \
        src/m4/dogecoin_find_bdb51.m4
    '';

    configurePhase = ''
      ./autogen.sh \
      && ./configure --prefix=$out \
                     --with-incompatible-bdb \
                     ${ if withGui then "--with-gui" else "" }
    '';

    installPhase = ''
      install -D "src/dogecoin-cli" "$out/bin/dogecoin-cli"
      install -D "src/dogecoind" "$out/bin/dogecoind"
      ${ if withGui then "install -D src/qt/dogecoin-qt $out/bin/dogecoin-qt" else "" }
    '';

  };

  mkDogeCoin = { withGui }:

  mkAutotoolCoin rec {
    name = "dogecoin";
    version = "1.8.0";
    inherit withGui;

    src = fetchurl {
      url = "https://github.com/dogecoin/dogecoin/archive/v${version}.tar.gz";
      sha256 = "8a33958c04213cd621aa3c86910477813af22512f03b47c98995d20d31f3f935";
    };

    meta = {
      description = "Wow, such coin, much shiba, very rich";
      longDescription = "wow";
      homepage = http://www.dogecoin.com/;
      license = licenses.mit;
      maintainers = with maintainers; [ edwtjo offline ];
    };
  };

in {

  dogecoin = mkDogeCoin { withGui = true; };
  dogecoind = mkDogeCoin { withGui = false; };

}