unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Theodoros Foradis <theodoros@foradis.org>
To: 28401@debbugs.gnu.org
Subject: [bug#28401] [PATCH 1/2] gnu: Add monero.
Date: Sat,  9 Sep 2017 20:47:34 +0300	[thread overview]
Message-ID: <20170909174735.7562-1-theodoros@foradis.org> (raw)
In-Reply-To: <87o9qjesvl.fsf@foradis.org>

* gnu/packages/finance.scm (monero): New variable.
---
 gnu/packages/finance.scm | 108 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 108 insertions(+)

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 6d6844fa7..6f589a76c 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
+;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,11 +30,16 @@
  #:use-module (guix build-system python)
  #:use-module (gnu packages base)
  #:use-module (gnu packages boost)
+ #:use-module (gnu packages check)
  #:use-module (gnu packages databases)
+ #:use-module (gnu packages documentation)
+ #:use-module (gnu packages dns)
  #:use-module (gnu packages emacs)
+ #:use-module (gnu packages graphviz)
  #:use-module (gnu packages groff)
  #:use-module (gnu packages libedit)
  #:use-module (gnu packages libevent)
+ #:use-module (gnu packages libunwind)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages pkg-config)
@@ -44,6 +50,8 @@
  #:use-module (gnu packages textutils)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages upnp)
+ #:use-module (gnu packages web)
+ #:use-module (gnu packages xml)
  #:use-module (gnu packages gnuzilla))
 
 (define-public bitcoin-core
@@ -292,3 +300,103 @@ protocol.  It supports Simple Payment Verification (SPV) and deterministic key
 generation from a seed.  Your secret keys are encrypted and are never sent to
 other machines/servers.  Electrum does not download the Bitcoin blockchain.")
     (license license:expat)))
+
+(define-public monero
+  ;; This package bundles easylogging++ and lmdb.
+  ;; The bundled easylogging++ is modified, and the changes will not be upstreamed.
+  ;; The devs deem the lmdb driver too critical a consenus component, to use
+  ;; the system's dynamically linked library.
+  (package
+    (name "monero")
+    (version "0.11.0.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/monero-project/monero/archive/v"
+                           version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Delete bundled dependencies.
+           (for-each
+            delete-file-recursively
+            '("external/miniupnpc" "external/rapidjson"
+              "external/unbound"))
+           #t))
+       (sha256
+        (base32
+         "083w40a553c0r3i18020jcrv5s0b64vx3d8xrn9nwkb2237ighlk"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("googletest" ,googletest)
+       ("graphviz" ,graphviz)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("bind" ,isc-bind)
+       ("boost" ,boost)
+       ("expat" ,expat)
+       ("libunwind" ,libunwind)
+       ("lmdb" ,lmdb)
+       ("miniupnpc" ,miniupnpc)
+       ("openssl" ,openssl)
+       ("rapidjson" ,rapidjson)
+       ("unbound" ,unbound)))
+    (arguments
+     `(#:out-of-source? #t
+       #:configure-flags '("-DBUILD_TESTS=ON"
+                           "-DBUILD_GUI_DEPS=ON")
+       #:phases
+       (modify-phases %standard-phases
+         ;; tests/core_tests need a valid HOME
+         (add-before 'configure 'set-home
+           (lambda _
+             (setenv "HOME" (getcwd))
+             #t))
+         (add-after 'set-home 'fix-wallet-path-for-unit-tests
+           (lambda _
+             (substitute* "tests/unit_tests/serialization.cpp"
+               (("\\.\\./\\.\\./\\.\\./\\.\\./") "../../"))
+             #t))
+         (add-after 'fix-wallet-path-for-unit-tests 'change-log-path
+           (lambda _
+             (substitute* "contrib/epee/src/mlog.cpp"
+               (("epee::string_tools::get_current_module_folder\\(\\)")
+                "\".bitmonero\""))
+             (substitute* "contrib/epee/src/mlog.cpp"
+               (("return \\(") "return ((std::string(getenv(\"HOME\"))) / "))
+             #t))
+         (replace 'check
+           (lambda _
+             (zero?
+              (system* "make" "ARGS=-E 'unit_tests|libwallet_api_tests'"
+                       "test"))))
+         ;; The excluded unit tests need network access
+         (add-after 'check 'unit-tests
+           (lambda _
+             (let ((excluded-unit-tests
+                    (string-join
+                     '("AddressFromURL.Success"
+                       "AddressFromURL.Failure"
+                       "DNSResolver.IPv4Success"
+                       "DNSResolver.DNSSECSuccess"
+                       "DNSResolver.DNSSECFailure"
+                       "DNSResolver.GetTXTRecord")
+                     ":")))
+               (zero?
+                (system* "tests/unit_tests/unit_tests"
+                         (string-append "--gtest_filter=-"
+                                        excluded-unit-tests))))))
+         (add-after 'install 'install-blockchain-import-export
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (install-file "bin/monero-blockchain-import" bin)
+               (install-file "bin/monero-blockchain-export" bin)))))))
+    (home-page "https://getmonero.org/")
+    (synopsis "Monero command line client")
+    (description
+     "Monero is a secure, private, untraceable currency.  This package provides the
+Monero command line client and daemon.")
+    (license license:bsd-3)))
-- 
2.13.4

  reply	other threads:[~2017-09-09 17:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-09 16:35 [bug#28401] [PATCH 0/2] gnu: Add monero Theodoros Foradis
2017-09-09 17:47 ` Theodoros Foradis [this message]
2017-09-09 17:47   ` [bug#28401] [PATCH 2/2] gnu: Add monero-core Theodoros Foradis
2017-09-11  8:21     ` bug#28401: " Ludovic Courtès
2017-09-11  8:17   ` [bug#28401] [PATCH 1/2] gnu: Add monero Ludovic Courtès
2017-09-11  8:39 ` [bug#28401] [PATCH 0/2] " Ludovic Courtès
2017-09-11  8:56   ` Theodoros Foradis
2017-09-11 11:36     ` Ludovic Courtès
2017-09-11 13:51       ` Efraim Flashner
2017-09-11 14:42         ` Theodoros Foradis
2017-09-11 14:44           ` Efraim Flashner
2017-09-11 16:14             ` Theodoros Foradis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170909174735.7562-1-theodoros@foradis.org \
    --to=theodoros@foradis.org \
    --cc=28401@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).