From feee5f16e189d99784f0c36b76199e3eee8194ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edward=20Tj=C3=B6rnhammar?= Date: Fri, 29 Aug 2014 22:43:03 +0200 Subject: [PATCH] dogecoin: autotools build factored out --- pkgs/applications/misc/bitcoin/altcoins.nix | 47 -------------- pkgs/applications/misc/bitcoin/dogecoin.nix | 71 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 +- 3 files changed, 74 insertions(+), 49 deletions(-) create mode 100644 pkgs/applications/misc/bitcoin/dogecoin.nix diff --git a/pkgs/applications/misc/bitcoin/altcoins.nix b/pkgs/applications/misc/bitcoin/altcoins.nix index 796cedc1ee2c..2643094e2f16 100644 --- a/pkgs/applications/misc/bitcoin/altcoins.nix +++ b/pkgs/applications/misc/bitcoin/altcoins.nix @@ -80,51 +80,4 @@ in rec { }; }; - dogecoin = (buildAltcoin rec { - walletName = "dogecoin"; - version = "1.8.0"; - - src = fetchurl { - url = "https://github.com/dogecoin/dogecoin/archive/v${version}.tar.gz"; - sha256 = "8a33958c04213cd621aa3c86910477813af22512f03b47c98995d20d31f3f935"; - }; - - extraBuildInputs = [ autogen autoconf automake pkgconfig db utillinux protobuf ]; - - meta = { - description = "Wow, such coin, much shiba, very rich"; - longDescription = "wow"; - homepage = http://www.dogecoin.com/; - maintainers = [ maintainers.offline maintainers.edwtjo ]; - }; - }).override rec { - 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 - ''; - dogeConfigure = '' - ./autogen.sh \ - && ./configure --prefix=$out \ - --with-incompatible-bdb \ - --with-boost-libdir=${boost}/lib \ - ''; - dogeInstall = '' - install -D "src/dogecoin-cli" "$out/bin/dogecoin-cli" - install -D "src/dogecoind" "$out/bin/dogecoind" - ''; - configurePhase = dogeConfigure + "--with-gui"; - installPhase = dogeInstall + "install -D src/qt/dogecoin-qt $out/bin/dogecoin-qt"; - }; - - dogecoind = dogecoin.override rec { - gui = false; - makefile = "Makefile"; - preBuild = ""; - configurePhase = dogecoin.dogeConfigure + "--without-gui"; - installPhase = dogecoin.dogeInstall; - }; - } diff --git a/pkgs/applications/misc/bitcoin/dogecoin.nix b/pkgs/applications/misc/bitcoin/dogecoin.nix new file mode 100644 index 000000000000..7ace3c161c7b --- /dev/null +++ b/pkgs/applications/misc/bitcoin/dogecoin.nix @@ -0,0 +1,71 @@ +{ 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 \ + --with-boost-libdir=${boost}/lib \ + ${ 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; }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d1f9487ab4aa..ceebde40e8a1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8285,7 +8285,8 @@ let bitcoind = callPackage ../applications/misc/bitcoin { gui = false; }; altcoins = recurseIntoAttrs ( - callPackage ../applications/misc/bitcoin/altcoins.nix {} + (callPackage ../applications/misc/bitcoin/altcoins.nix {}) // + (callPackage ../applications/misc/bitcoin/dogecoin.nix {}) ); bitlbee = callPackage ../applications/networking/instant-messengers/bitlbee { @@ -9211,7 +9212,7 @@ let lynx = callPackage ../applications/networking/browsers/lynx { }; lyx = callPackage ../applications/misc/lyx { }; - + makeself = callPackage ../applications/misc/makeself { }; matchbox = callPackage ../applications/window-managers/matchbox { };