gnu: Add ruby-commander.
[jackhill/guix/guix.git] / gnu / packages / finance.scm
CommitLineData
20c6b9da 1;;; GNU Guix --- Functional package management for GNU
fe7fa353 2;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
136ff9a2 3;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
d3699b31 4;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
cb0866c3 5;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
9475fd92 6;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
8514662b 7;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
14e09e90 8;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
8b7ac58c 9;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5424f9bc 10;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
3da86c52 11;;; Copyright © 2018 Adriano Peluso <catonano@gmail.com>
8f4d15f1 12;;; Copyright © 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
948e888d 13;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
20c6b9da
AE
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages finance)
fa4f95a7
CB
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (guix download)
730553d7 34 #:use-module (guix git-download)
fa4f95a7
CB
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system python)
5424f9bc 38 #:use-module (gnu packages)
fa4f95a7
CB
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages check)
0a551443 42 #:use-module (gnu packages crypto)
fa4f95a7
CB
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages documentation)
45 #:use-module (gnu packages dns)
46 #:use-module (gnu packages emacs)
255d1bbe 47 #:use-module (gnu packages dbm)
df724c9c 48 #:use-module (gnu packages gnupg)
fa4f95a7
CB
49 #:use-module (gnu packages graphviz)
50 #:use-module (gnu packages groff)
51 #:use-module (gnu packages libedit)
52 #:use-module (gnu packages libevent)
53 #:use-module (gnu packages libunwind)
96f5e2e9 54 #:use-module (gnu packages libusb)
fa4f95a7
CB
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages multiprecision)
0a551443 57 #:use-module (gnu packages networking)
fa4f95a7
CB
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages protobuf)
60 #:use-module (gnu packages python)
cc6f4912 61 #:use-module (gnu packages python-crypto)
589e3f4e 62 #:use-module (gnu packages python-web)
44d10b1f 63 #:use-module (gnu packages python-xyz)
fa4f95a7 64 #:use-module (gnu packages qt)
1d0865c1 65 #:use-module (gnu packages readline)
fa4f95a7
CB
66 #:use-module (gnu packages texinfo)
67 #:use-module (gnu packages textutils)
68 #:use-module (gnu packages tls)
69 #:use-module (gnu packages upnp)
70 #:use-module (gnu packages web)
71 #:use-module (gnu packages xml)
72 #:use-module (gnu packages gnuzilla))
20c6b9da
AE
73
74(define-public bitcoin-core
75 (package
76 (name "bitcoin-core")
0a59cc6e 77 (version "0.17.1")
20c6b9da
AE
78 (source (origin
79 (method url-fetch)
80 (uri
0a59cc6e 81 (string-append "https://bitcoincore.org/bin/bitcoin-core-"
14ea30e4 82 version "/bitcoin-" version ".tar.gz"))
20c6b9da
AE
83 (sha256
84 (base32
0a59cc6e 85 "0am4pnaf2cisv172jqx6jdpzx770agm8777163lkjbw3ryslymiy"))))
20c6b9da
AE
86 (build-system gnu-build-system)
87 (native-inputs
88 `(("pkg-config" ,pkg-config)
e49e74f5 89 ("python" ,python) ; for the tests
0193812a
MB
90 ("util-linux" ,util-linux) ; provides the hexdump command for tests
91 ("qttools" ,qttools)))
20c6b9da 92 (inputs
fe7fa353 93 `(("bdb" ,bdb-5.3) ; with 6.2.23, there is an error: ambiguous overload
20c6b9da 94 ("boost" ,boost)
14ea30e4 95 ("libevent" ,libevent)
20c6b9da
AE
96 ("miniupnpc" ,miniupnpc)
97 ("openssl" ,openssl)
98 ("protobuf" ,protobuf)
0193812a 99 ("qtbase" ,qtbase)))
20c6b9da
AE
100 (arguments
101 `(#:configure-flags
102 (list
103 ;; We use a bdb version newer than 4.8.
104 "--with-incompatible-bdb"
105 ;; Boost is not found unless specified manually.
106 (string-append "--with-boost="
0193812a
MB
107 (assoc-ref %build-inputs "boost"))
108 ;; XXX: The configure script looks up Qt paths by
109 ;; `pkg-config --variable=host_bins Qt5Core`, which fails to pick
110 ;; up executables residing in 'qttools', so we specify them here.
111 (string-append "ac_cv_path_LRELEASE="
112 (assoc-ref %build-inputs "qttools")
113 "/bin/lrelease")
114 (string-append "ac_cv_path_LUPDATE="
115 (assoc-ref %build-inputs "qttools")
116 "/bin/lupdate"))
20c6b9da
AE
117 #:phases
118 (modify-phases %standard-phases
99629e5a
CD
119 (add-before 'configure 'make-qt-deterministic
120 (lambda _
121 ;; Make Qt deterministic.
122 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
123 #t))
20c6b9da
AE
124 (add-before 'check 'set-home
125 (lambda _
0e9600cb
DM
126 (setenv "HOME" (getenv "TMPDIR")) ; Tests write to $HOME.
127 #t)))))
20c6b9da
AE
128 (home-page "https://bitcoin.org/en/")
129 (synopsis "Bitcoin peer-to-peer client")
130 (description
131 "Bitcoin is a digital currency that enables instant payments to anyone
132anywhere in the world. It uses peer-to-peer technology to operate without
133central authority: managing transactions and issuing money are carried out
134collectively by the network. Bitcoin Core is the reference implementation
135of the bitcoin protocol. This package provides the Bitcoin Core command
136line client and a client based on Qt.")
137 (license license:expat)))
d3699b31
AG
138
139(define-public ledger
140 (package
141 (name "ledger")
f90ed028 142 (version "3.1.2")
8b7ac58c
TGR
143 (source
144 (origin
145 (method git-fetch)
146 (uri (git-reference
147 (url "https://github.com/ledger/ledger.git")
148 (commit (string-append "v" version))))
149 (file-name (git-file-name name version))
150 (sha256
f90ed028
RW
151 (base32 "0hwnipj2m9p95hhyv6kyq54m27g14r58gnsy2my883kxhpcyb2vc"))
152 (patches (search-patches "ledger-fix-uninitialized.patch"))))
d3699b31
AG
153 (build-system cmake-build-system)
154 (arguments
f90ed028 155 `(#:configure-flags
d3699b31
AG
156 `("-DBUILD_DOCS:BOOL=ON"
157 "-DBUILD_WEB_DOCS:BOOL=ON"
d3699b31 158 "-DUSE_PYTHON:BOOL=ON"
f90ed028 159 "-DCMAKE_INSTALL_LIBDIR:PATH=lib")
d3699b31
AG
160 #:phases
161 (modify-phases %standard-phases
162 (add-before 'configure 'install-examples
163 (lambda* (#:key outputs #:allow-other-keys)
164 (let ((examples (string-append (assoc-ref outputs "out")
165 "/share/doc/ledger/examples")))
166 (install-file "test/input/sample.dat" examples)
167 (install-file "test/input/demo.ledger" examples))
168 #t))
169 (add-after 'build 'build-doc
1f3c4ba8 170 (lambda _ (invoke "make" "doc")))
d3699b31
AG
171 (add-before 'check 'check-setup
172 ;; One test fails if it can't set the timezone.
173 (lambda* (#:key inputs #:allow-other-keys)
174 (setenv "TZDIR"
175 (string-append (assoc-ref inputs "tzdata")
176 "/share/zoneinfo"))
f90ed028
RW
177 ;; Skip failing test BaselineTest_cmd-org.
178 ;; This is a known upstream issue. See
179 ;; https://github.com/ledger/ledger/issues/550
180 (setenv "ARGS" "-E BaselineTest_cmd-org")
181 #t)))))
d3699b31
AG
182 (inputs
183 `(("boost" ,boost)
184 ("gmp" ,gmp)
185 ("libedit" ,libedit)
186 ("mpfr" ,mpfr)
187 ("python" ,python-2)
188 ("tzdata" ,tzdata)
189 ("utfcpp" ,utfcpp)))
190 (native-inputs
f90ed028 191 `(("groff" ,groff)
d3699b31 192 ("texinfo" ,texinfo)))
b53a0c88 193 (home-page "https://ledger-cli.org/")
d3699b31
AG
194 (synopsis "Command-line double-entry accounting program")
195 (description
196 "Ledger is a powerful, double-entry accounting system that is
197accessed from the UNIX command-line. This may put off some users, since
198there is no flashy UI, but for those who want unparalleled reporting
199access to their data there are few alternatives.
200
201Ledger uses text files for input. It reads the files and generates
202reports; there is no other database or stored state. To use Ledger,
203you create a file of your account names and transactions, run from the
204command line with some options to specify input and requested reports, and
205get output. The output is generally plain text, though you could generate
206a graph or html instead. Ledger is simple in concept, surprisingly rich
207in ability, and easy to use.")
208 ;; There are some extra licenses in files which do not presently get
209 ;; installed when you build this package. Different versions of the GPL
210 ;; are used in the contrib and python subdirectories. The bundled version
211 ;; of utfcpp is under the Boost 1.0 license. Also the file
212 ;; `tools/update_copyright_year` has an Expat license.
213 (license (list license:bsd-3
214 license:asl2.0 ; src/strptime.cc
215 (license:non-copyleft
216 "file://src/wcwidth.cc"
f90ed028 217 "See src/wcwidth.cc in the distribution.")))))
cb0866c3 218
0df201c0
RW
219(define-public emacs-ledger-mode
220 ;; There have been no new releases since 2016.
221 (let ((commit "253a20dc62e137ed0ed8e1dd8614ecba116610ea")
222 (revision "1"))
223 (package
224 (name "emacs-ledger-mode")
225 (version (git-version "3.1.1" revision commit))
226 (source
227 (origin
228 (method git-fetch)
229 (uri (git-reference
230 (url "https://github.com/ledger/ledger-mode.git")
231 (commit commit)))
232 (file-name (git-file-name name version))
233 (sha256
234 (base32 "06wrgkqpgvk17vibrk2qikdlqn8y63jg86marp1wgmram92mb3jk"))))
235 (build-system cmake-build-system)
236 (arguments
237 `(#:modules ((guix build cmake-build-system)
238 (guix build utils)
239 (guix build emacs-utils))
240 #:imported-modules (,@%cmake-build-system-modules
241 (guix build emacs-utils))
242 #:tests? #f ; there are none
243 #:phases
244 (modify-phases %standard-phases
245 (add-after 'build 'build-doc
246 (lambda* (#:key outputs #:allow-other-keys)
247 (let ((target (string-append (assoc-ref outputs "out")
248 "/share/info")))
249 (mkdir-p target)
250 (invoke "makeinfo" "-o" target
251 "../source/doc/ledger-mode.texi"))
252 #t))
253 (add-after 'install 'relocate-elisp
254 (lambda* (#:key outputs #:allow-other-keys)
255 (let* ((site-dir (string-append (assoc-ref outputs "out")
256 "/share/emacs/site-lisp"))
257 (guix-dir (string-append site-dir "/guix.d"))
258 (orig-dir (string-append site-dir "/ledger-mode"))
259 (dest-dir (string-append guix-dir "/ledger-mode")))
260 (mkdir-p guix-dir)
261 (rename-file orig-dir dest-dir)
262 (emacs-generate-autoloads ,name dest-dir)
263 #t))))))
264 (native-inputs
265 `(("emacs-minimal" ,emacs-minimal)
266 ("texinfo" ,texinfo)))
267 (home-page "https://ledger-cli.org/")
268 (synopsis "Command-line double-entry accounting program")
269 (description
270 "Ledger is a powerful, double-entry accounting system that is
271accessed from the UNIX command-line. This may put off some users, since
272there is no flashy UI, but for those who want unparalleled reporting
273access to their data there are few alternatives.
274
275Ledger uses text files for input. It reads the files and generates
276reports; there is no other database or stored state. To use Ledger,
277you create a file of your account names and transactions, run from the
278command line with some options to specify input and requested reports, and
279get output. The output is generally plain text, though you could generate
280a graph or html instead. Ledger is simple in concept, surprisingly rich
281in ability, and easy to use.
282
283This package provides the Emacs mode.")
284 (license license:gpl2+))))
285
cb0866c3
HG
286(define-public geierlein
287 (package
288 (name "geierlein")
1c21e734 289 (version "0.9.13")
cb0866c3
HG
290 (source
291 (origin
1fd71120
TGR
292 (method git-fetch)
293 (uri (git-reference
294 (url "https://github.com/stesie/geierlein.git")
295 (commit (string-append "V" version))))
296 (file-name (git-file-name name version))
cb0866c3 297 (sha256
1fd71120 298 (base32 "00zpwr3lk2vdmd60fgdwdk0xxs52wvnm19ln2m75yfphydvkglic"))))
cb0866c3
HG
299 (build-system gnu-build-system)
300 (arguments
1fd71120 301 `(#:tests? #f ; would require npm, python and a lot more
cb0866c3
HG
302 #:phases
303 (modify-phases %standard-phases
1c21e734 304 (delete 'configure) ; no configure script
cb0866c3
HG
305 (add-after 'unpack 'override-target-directory-and-tool-paths
306 (lambda* (#:key inputs outputs #:allow-other-keys)
307 (substitute* "Makefile"
308 (("prefix := .*")
309 (string-append "prefix := " (assoc-ref outputs "out") "\n"))
310 ;; Required for tests, unused for now:
311 ;;(("PYTHON := .*")
312 ;; (string-append (which "python") "\n")))
313 (("INSTALL := .*")
314 (string-append "INSTALL := " (which "install") "\n")))
315 (substitute* "bin/xgeierlein.in"
316 ;; Use icecat as XULRUNNER
317 (("^for search ")
318 (string-append "XULRUNNER=" (which "icecat") "\n"
319 "for search ")))
320 #t)))))
321 (inputs
322 `(("icecat" ,icecat)))
1e41bb1b 323 (home-page "https://stesie.github.io/geierlein/")
cb0866c3
HG
324 (synopsis "Free Elster client, for sending Germany VAT declarations")
325 (description
326 "Geierlein is a free Elster client, i.e. an application that
327allows to send VAT declarations to Germany's fiscal authorities.
328
329Currently it is *not* possible to send returns that are due annually
330(especially the income tax return) since the fiscal authority doesn't
331allow to do that off the ERiC library (which is proprietary however).
332It's not clear at the moment whether one day it will be possible to
333do so.")
334 (license license:agpl3+)))
9475fd92
CZ
335
336(define-public electrum
337 (package
338 (name "electrum")
81d59f44 339 (version "3.3.3")
9475fd92
CZ
340 (source
341 (origin
342 (method url-fetch)
343 (uri (string-append "https://download.electrum.org/"
344 version "/Electrum-"
345 version ".tar.gz"))
346 (sha256
347 (base32
81d59f44 348 "0z2zfhyawrbzs0w1426a2w0d4wsajl34ymj77qmpm41138g2ysf2"))
9475fd92
CZ
349 (modules '((guix build utils)))
350 (snippet
351 '(begin
352 ;; Delete the bundled dependencies.
353 (delete-file-recursively "packages")
354 #t))))
355 (build-system python-build-system)
356 (inputs
47bd32d9
CZ
357 `(("python-pyaes" ,python-pyaes)
358 ("python-pysocks" ,python-pysocks)
359 ("python-sip" ,python-sip)
360 ("python-pyqt" ,python-pyqt)
361 ("python-ecdsa" ,python-ecdsa)
362 ("python-pbkdf2" ,python-pbkdf2)
363 ("python-requests" ,python-requests)
364 ("python-qrcode" ,python-qrcode)
365 ("python-protobuf" ,python-protobuf)
81d59f44
VC
366 ("python-aiohttp" ,python-aiohttp)
367 ("python-aiohttp-socks" ,python-aiohttp-socks)
368 ("python-aiorpcx" ,python-aiorpcx)
369 ("python-certifi" ,python-certifi)
47bd32d9
CZ
370 ("python-dnspython" ,python-dnspython)
371 ("python-jsonrpclib-pelix" ,python-jsonrpclib-pelix)))
9475fd92 372 (arguments
47bd32d9 373 `(#:tests? #f ;; package doesn't have any tests
9475fd92
CZ
374 #:phases
375 (modify-phases %standard-phases
376 (add-before 'build 'patch-home
377 (lambda* (#:key outputs #:allow-other-keys)
378 (substitute* "setup.py"
379 (("~/.local/share")
380 (string-append (assoc-ref outputs "out") "/local/share"))))))))
381 (home-page "https://electrum.org/")
382 (synopsis "Bitcoin wallet")
383 (description
384 "Electrum is a lightweight Bitcoin client, based on a client-server
385protocol. It supports Simple Payment Verification (SPV) and deterministic key
386generation from a seed. Your secret keys are encrypted and are never sent to
387other machines/servers. Electrum does not download the Bitcoin blockchain.")
388 (license license:expat)))
8514662b 389
a0bb0217
VC
390(define-public electron-cash
391 (package
392 (inherit electrum)
393 (name "electron-cash")
4e86e9d7 394 (version "3.3.5")
a0bb0217
VC
395 (source
396 (origin
397 (method url-fetch)
398 (uri (string-append "https://electroncash.org/downloads/"
399 version
4e86e9d7 400 "/win-linux/Electron-Cash-"
a0bb0217
VC
401 version
402 ".tar.gz"))
403 (sha256
404 (base32
4e86e9d7 405 "185z3c5j9nvl31ga80hvahx7ghvkgmqgfjrrzw1fbs6p9jxy007w"))
a0bb0217
VC
406 (modules '((guix build utils)))
407 (snippet
408 '(begin
409 ;; Delete the bundled dependencies.
410 (delete-file-recursively "packages")
411 #t))))
412 (home-page "https://electroncash.org/")
413 (synopsis "Bitcoin Cash wallet")
414 (description
415 "Electroncash is a lightweight Bitcoin Cash client, based on a client-server
416protocol. It supports Simple Payment Verification (SPV) and deterministic key
417generation from a seed. Your secret keys are encrypted and are never sent to
418other machines/servers. Electroncash does not download the Bitcoin Cash blockchain.")
419 (license license:expat)))
420
8514662b
TF
421(define-public monero
422 ;; This package bundles easylogging++ and lmdb.
423 ;; The bundled easylogging++ is modified, and the changes will not be upstreamed.
424 ;; The devs deem the lmdb driver too critical a consenus component, to use
425 ;; the system's dynamically linked library.
426 (package
427 (name "monero")
0a551443 428 (version "0.12.3.0")
8514662b
TF
429 (source
430 (origin
0a551443
TF
431 (method git-fetch)
432 (uri (git-reference
433 (url "https://github.com/monero-project/monero")
434 (commit (string-append "v" version))))
136ff9a2 435 (file-name (git-file-name name version))
0a551443 436 (patches (search-patches "monero-use-system-miniupnpc.patch"))
8514662b
TF
437 (sha256
438 (base32
0a551443 439 "14db9kgjm2ha93c2x5fjdw01xaqshn756qr3x2cnzyyjh7caz5qd"))))
8514662b
TF
440 (build-system cmake-build-system)
441 (native-inputs
442 `(("doxygen" ,doxygen)
443 ("googletest" ,googletest)
444 ("graphviz" ,graphviz)
445 ("pkg-config" ,pkg-config)))
446 (inputs
447 `(("bind" ,isc-bind)
448 ("boost" ,boost)
0a551443
TF
449 ("zeromq" ,zeromq)
450 ("cppzmq" ,cppzmq)
8514662b 451 ("expat" ,expat)
0a551443 452 ("libsodium" ,libsodium)
8514662b
TF
453 ("libunwind" ,libunwind)
454 ("lmdb" ,lmdb)
0a551443 455 ("miniupnpc" ,monero-miniupnpc)
8514662b
TF
456 ("openssl" ,openssl)
457 ("rapidjson" ,rapidjson)
458 ("unbound" ,unbound)))
459 (arguments
460 `(#:out-of-source? #t
0a551443 461 #:build-type "release"
8514662b 462 #:configure-flags '("-DBUILD_TESTS=ON"
fa7647c6
EF
463 ,@(if (string=? "aarch64-linux" (%current-system))
464 '("-DARCH=armv8-a")
465 '())
8514662b
TF
466 "-DBUILD_GUI_DEPS=ON")
467 #:phases
468 (modify-phases %standard-phases
469 ;; tests/core_tests need a valid HOME
470 (add-before 'configure 'set-home
471 (lambda _
472 (setenv "HOME" (getcwd))
473 #t))
474 (add-after 'set-home 'fix-wallet-path-for-unit-tests
475 (lambda _
476 (substitute* "tests/unit_tests/serialization.cpp"
477 (("\\.\\./\\.\\./\\.\\./\\.\\./") "../../"))
478 #t))
479 (add-after 'fix-wallet-path-for-unit-tests 'change-log-path
480 (lambda _
481 (substitute* "contrib/epee/src/mlog.cpp"
482 (("epee::string_tools::get_current_module_folder\\(\\)")
483 "\".bitmonero\""))
484 (substitute* "contrib/epee/src/mlog.cpp"
485 (("return \\(") "return ((std::string(getenv(\"HOME\"))) / "))
486 #t))
487 (replace 'check
488 (lambda _
797445be
TF
489 (invoke "make" "ARGS=-E 'unit_tests|libwallet_api_tests'"
490 "test")))
8514662b
TF
491 ;; The excluded unit tests need network access
492 (add-after 'check 'unit-tests
493 (lambda _
494 (let ((excluded-unit-tests
495 (string-join
496 '("AddressFromURL.Success"
497 "AddressFromURL.Failure"
498 "DNSResolver.IPv4Success"
499 "DNSResolver.DNSSECSuccess"
500 "DNSResolver.DNSSECFailure"
501 "DNSResolver.GetTXTRecord")
502 ":")))
797445be
TF
503 (invoke "tests/unit_tests/unit_tests"
504 (string-append "--gtest_filter=-"
505 excluded-unit-tests)))))
8514662b
TF
506 (add-after 'install 'install-blockchain-import-export
507 (lambda* (#:key outputs #:allow-other-keys)
508 (let* ((out (assoc-ref outputs "out"))
509 (bin (string-append out "/bin")))
510 (install-file "bin/monero-blockchain-import" bin)
511 (install-file "bin/monero-blockchain-export" bin)))))))
512 (home-page "https://getmonero.org/")
513 (synopsis "Command-line interface to the Monero currency")
514 (description
515 "Monero is a secure, private, untraceable currency. This package provides the
516Monero command line client and daemon.")
517 (license license:bsd-3)))
79228a52 518
f7e24839 519(define-public monero-gui
79228a52 520 (package
f7e24839 521 (name "monero-gui")
3902bc5c 522 (version "0.12.2.0")
79228a52
TF
523 (source
524 (origin
3902bc5c
TF
525 (method git-fetch)
526 (uri (git-reference
f7e24839 527 (url "https://github.com/monero-project/monero-gui")
3902bc5c 528 (commit (string-append "v" version))))
398a96a2 529 (file-name (git-file-name name version))
79228a52
TF
530 (sha256
531 (base32
3902bc5c 532 "1cnrkwh7kp64lnzz1xfmkf1mhsgm5gls292gpqai3jr8jydpkahl"))))
79228a52
TF
533 (build-system gnu-build-system)
534 (native-inputs
535 `(("doxygen" ,doxygen)
536 ("graphviz" ,graphviz)
6915d20f
EF
537 ("pkg-config" ,pkg-config)
538 ("qttools" ,qttools)))
79228a52
TF
539 (inputs
540 `(("boost" ,boost)
541 ("libunwind" ,libunwind)
542 ("openssl" ,openssl)
6915d20f
EF
543 ("qtbase" ,qtbase)
544 ("qtdeclarative" ,qtdeclarative)
545 ("qtgraphicaleffects" ,qtgraphicaleffects)
546 ("qtquickcontrols" ,qtquickcontrols)
1d0865c1 547 ("readline" ,readline)
79228a52
TF
548 ("unbound" ,unbound)))
549 (propagated-inputs
550 `(("monero" ,monero)))
551 (arguments
552 `(#:phases
553 (modify-phases %standard-phases
554 (delete 'configure)
555 (delete 'check)
556 (add-before 'build 'fix-makefile-vars
557 (lambda _
558 (substitute* "src/zxcvbn-c/makefile"
559 (("\\?=") "="))
560 #t))
561 (add-after 'fix-makefile-vars 'fix-library-paths
562 (lambda* (#:key inputs #:allow-other-keys)
563 (substitute* "monero-wallet-gui.pro"
564 (("-L/usr/local/lib") "")
565 (("-L/usr/local/opt/openssl/lib")
566 (string-append "-L"
567 (assoc-ref inputs "openssl")
568 "/lib"))
569 (("-L/usr/local/opt/boost/lib")
570 (string-append "-L"
571 (assoc-ref inputs "boost")
572 "/lib")))
573 #t))
574 (add-after 'fix-library-paths 'fix-monerod-path
575 (lambda* (#:key inputs #:allow-other-keys)
576 (substitute* "src/daemon/DaemonManager.cpp"
577 (("QApplication::applicationDirPath\\(\\) \\+ \"/monerod")
578 (string-append "\""(assoc-ref inputs "monero")
579 "/bin/monerod")))
580 #t))
6915d20f
EF
581 (add-after 'fix-monerod-path 'fix-qt-paths
582 (lambda* (#:key inputs #:allow-other-keys)
583 (let* ((qttools (assoc-ref inputs "qttools"))
584 (lrelease (string-append qttools "/bin/lrelease"))
585 (lupdate (string-append qttools "/bin/lupdate")))
586 (substitute* "monero-wallet-gui.pro"
587 (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease") lrelease)
588 (("\\$\\$\\[QT_INSTALL_BINS\\]/lupdate") lupdate))
589 #t)))
79228a52
TF
590 (replace 'build
591 (lambda _
88d5ee44 592 (invoke "./build.sh")))
79228a52
TF
593 (add-after 'build 'fix-install-path
594 (lambda* (#:key outputs #:allow-other-keys)
595 (substitute* "build/Makefile"
596 (("/opt/monero-wallet-gui")
597 (assoc-ref outputs "out")))
598 #t))
599 (add-before 'install 'change-dir
600 (lambda _
6915d20f
EF
601 (chdir "build")))
602 (add-after 'install 'wrap-executable
603 (lambda* (#:key inputs outputs #:allow-other-keys)
604 (let ((out (assoc-ref outputs "out")))
605 (wrap-program (string-append out "/bin/monero-wallet-gui")
606 `("QT_PLUGIN_PATH" ":" prefix
607 ,(map (lambda (label)
608 (string-append (assoc-ref inputs label)
609 "/lib/qt5/plugins"))
610 '("qtbase" "qtdeclarative")))
611 `("QML2_IMPORT_PATH" ":" prefix
612 ,(map (lambda (label)
613 (string-append (assoc-ref inputs label)
614 "/lib/qt5/qml"))
615 '("qtdeclarative" "qtgraphicaleffects"
616 "qtquickcontrols"))))
617 #t))))))
79228a52
TF
618 (home-page "https://getmonero.org/")
619 (synopsis "Graphical user interface for the Monero currency")
620 (description
621 "Monero is a secure, private, untraceable currency. This package provides the
622Monero GUI client.")
623 (license license:bsd-3)))
00d3f022 624
f7e24839
TF
625(define-public monero-core
626 (deprecated-package "monero-core" monero-gui))
627
00d3f022
DM
628(define-public python-trezor-agent
629 (package
630 (name "python-trezor-agent")
df724c9c 631 (version "0.13.0")
00d3f022
DM
632 (source
633 (origin
39a7b720
TGR
634 (method git-fetch)
635 (uri (git-reference
636 (url "https://github.com/romanz/trezor-agent.git")
637 (commit (string-append "v" version))))
638 (file-name (git-file-name name version))
00d3f022 639 (sha256
df724c9c 640 (base32 "0i4igkxi8fwdlbhg6nx27lhnc9v9nmrw4j5fvpnc202n6yjlc7x7"))))
00d3f022
DM
641 (build-system python-build-system)
642 (arguments
643 `(#:phases
644 (modify-phases %standard-phases
df724c9c
VC
645 (add-after 'unpack 'remove-requires-backports-shutil-which
646 ;; Remove requires on backport of shutil_which, as python 3.4+ has
647 ;; a built-in implementation supported in python-trezor-agent.
648 (lambda _
649 (substitute* "setup.py"
650 (("'backports.shutil_which>=3.5.1',") ""))
651 #t))
00d3f022
DM
652 (delete 'check)
653 (add-after 'install 'check
654 (lambda* (#:key outputs inputs #:allow-other-keys)
39a7b720 655 ;; Make installed package available for running the tests.
00d3f022
DM
656 (add-installed-pythonpath inputs outputs)
657 (invoke "py.test"))))))
658 (propagated-inputs
df724c9c
VC
659 `(("python-configargparse" ,python-configargparse)
660 ("python-daemon" ,python-daemon)
661 ("python-docutils" ,python-docutils)
662 ("python-ecdsa" ,python-ecdsa)
00d3f022 663 ("python-ed25519" ,python-ed25519)
df724c9c
VC
664 ("python-mnemonic" ,python-mnemonic)
665 ("python-pymsgbox" ,python-pymsgbox)
00d3f022 666 ("python-semver" ,python-semver)
df724c9c
VC
667 ("python-unidecode" ,python-unidecode)
668 ("python-wheel" ,python-wheel)))
00d3f022 669 (native-inputs
df724c9c
VC
670 `(("gnupg" ,gnupg)
671 ("python-mock" ,python-mock)
00d3f022
DM
672 ("python-pytest" ,python-pytest)))
673 (home-page "https://github.com/romanz/trezor-agent")
df724c9c 674 (synopsis "Use hardware wallets as SSH and GPG agent")
00d3f022
DM
675 (description
676 "@code{libagent} is a library that allows using TREZOR, Keepkey and
677Ledger Nano as a hardware SSH/GPG agent.")
678 (license license:lgpl3)))
679
680(define-public python2-trezor-agent
681 (package-with-python2 python-trezor-agent))
6e9749ef
DM
682
683(define-public python-mnemonic
684 (package
685 (name "python-mnemonic")
686 (version "0.18")
687 (source
688 (origin
689 (method url-fetch)
690 (uri (pypi-uri "mnemonic" version))
691 (sha256
692 (base32
693 "07bzfa5di6nv5xwwcwbypnflpj50wlfczhh6q6hg8w13g5m319q2"))))
694 (build-system python-build-system)
695 (propagated-inputs
696 `(("python-pbkdf2" ,python-pbkdf2)))
697 (home-page "https://github.com/trezor/python-mnemonic")
698 (synopsis "Implementation of Bitcoin BIP-0039")
699 (description "@code{mnemonic} is a library that provides an implementation
700of Bitcoin BIP-0039.")
701 (license license:expat)))
702
703(define-public python2-mnemonic
704 (package-with-python2 python-mnemonic))
96f5e2e9
DM
705
706(define-public python-ledgerblue
707 (package
708 (name "python-ledgerblue")
709 (version "0.1.16")
710 (source
711 (origin
712 (method url-fetch)
713 (uri (pypi-uri "ledgerblue" version))
714 (sha256
715 (base32
716 "010mghaqh1cmz3a0ifc3f40mmyplilwlw7kpha2mzyrrff46p9gb"))))
717 (build-system python-build-system)
718 (propagated-inputs
719 `(("python-ecpy" ,python-ecpy)
720 ("python-future" ,python-future)
721 ("python-hidapi" ,python-hidapi)
722 ("python-pillow" ,python-pillow)
723 ("python-protobuf" ,python-protobuf)
724 ("python-pycrypto" ,python-pycrypto)))
725 (home-page "https://github.com/LedgerHQ/blue-loader-python")
726 (synopsis "Python library to communicate with Ledger Blue/Nano S")
727 (description "@code{ledgerblue} is a Python library to communicate with
728Ledger Blue/Nano S.")
729 (license license:asl2.0)))
730
731(define-public python2-ledgerblue
732 (package-with-python2 python-ledgerblue))
733
1dca32e3
DM
734(define-public python-trezor
735 (package
736 (name "python-trezor")
8c16b8a4 737 (version "0.11.1")
1dca32e3
DM
738 (source
739 (origin
740 (method url-fetch)
741 (uri (pypi-uri "trezor" version))
742 (sha256
743 (base32
8c16b8a4 744 "064yds8f4px0c6grkkanpdjx022g4q87ihzhkmdv9qanv0hz6hv0"))))
1dca32e3 745 (build-system python-build-system)
b4c698c8
VC
746 (arguments
747 `(#:phases
748 (modify-phases %standard-phases
749 ;; Default tests run device-specific tests which fail, only run specific tests.
750 (replace 'check
751 (lambda* (#:key inputs outputs #:allow-other-keys)
8c16b8a4
VC
752 ;; Delete tests that require network access.
753 (delete-file "trezorlib/tests/unit_tests/test_tx_api.py")
754 (invoke "python" "-m" "pytest" "--pyarg" "trezorlib.tests.unit_tests"))))))
1dca32e3 755 (propagated-inputs
b4c698c8 756 `(("python-click" ,python-click)
8c16b8a4 757 ("python-construct" ,python-construct)
b4c698c8 758 ("python-ecdsa" ,python-ecdsa)
b4c698c8 759 ("python-libusb1" ,python-libusb1)
1dca32e3 760 ("python-mnemonic" ,python-mnemonic)
b4c698c8
VC
761 ("python-pyblake2" ,python-pyblake2)
762 ("python-requests" ,python-requests)
8c16b8a4 763 ("python-typing-extensions" ,python-typing-extensions)))
1dca32e3 764 (native-inputs
8c16b8a4
VC
765 `(("protobuf" ,protobuf) ; Tests
766 ("python-black" ,python-black) ; Tests
767 ("python-protobuf" ,python-protobuf) ; Tests
768 ("python-isort" ,python-isort) ; Tests
b4c698c8
VC
769 ("python-pyqt" ,python-pyqt) ; Tests
770 ("python-pytest" ,python-pytest))) ; Tests
1dca32e3
DM
771 (home-page "https://github.com/trezor/python-trezor")
772 (synopsis "Python library for communicating with TREZOR Hardware Wallet")
773 (description "@code{trezor} is a Python library for communicating with
774TREZOR Hardware Wallet.")
775 (license license:lgpl3)))
776
777(define-public python2-trezor
778 (package-with-python2 python-trezor))
d596fea5 779
d6ddeffc
DM
780(define-public python-keepkey
781 (package
782 (name "python-keepkey")
02d9e5d2 783 (version "6.0.2")
d6ddeffc
DM
784 (source
785 (origin
786 (method url-fetch)
787 (uri (pypi-uri "keepkey" version))
788 (sha256
789 (base32
02d9e5d2 790 "16j8hnxj9r4b2w6kfncmny09pb1al8ppmn59qxzl3qmh1xhpy45g"))))
d6ddeffc
DM
791 (build-system python-build-system)
792 (arguments
793 `(#:phases
794 (modify-phases %standard-phases
795 (delete 'check)
796 (add-after 'install 'check
797 (lambda* (#:key inputs outputs #:allow-other-keys)
798 (add-installed-pythonpath inputs outputs)
799 (apply invoke "python" (find-files "tests/unit" "\\.py$")))))))
800 (propagated-inputs
801 `(("python-ecdsa" ,python-ecdsa)
802 ("python-hidapi" ,python-hidapi)
02d9e5d2 803 ("python-libusb1" ,python-libusb1)
d6ddeffc
DM
804 ("python-mnemonic" ,python-mnemonic)
805 ("python-protobuf" ,python-protobuf)))
806 (home-page "https://github.com/keepkey/python-keepkey")
807 (synopsis "Python library for communicating with KeepKey Hardware Wallet")
808 (description "@code{keepkey} is a Python library for communicating with
809the KeepKey Hardware Wallet.")
810 (license license:lgpl3)))
811
812(define-public python2-keepkey
813 (package-with-python2 python-keepkey))
814
d596fea5
DM
815(define-public ledger-agent
816 (package
817 (name "ledger-agent")
818 (version "0.9.0")
819 (source
820 (origin
821 (method url-fetch)
822 (uri (pypi-uri "ledger_agent" version))
823 (sha256
824 (base32
825 "03zj602m2rln9yvr08dswy56vzkbldp8b074ixwzz525dafblr92"))))
826 (build-system python-build-system)
827 (inputs
828 `(("python-ledgerblue" ,python-ledgerblue)
829 ("python-trezor-agent" ,python-trezor-agent)))
830 (home-page "http://github.com/romanz/trezor-agent")
831 (synopsis "Ledger as hardware SSH/GPG agent")
832 (description "This package allows using Ledger as hardware SSH/GPG agent.
833
5859fd6c
MB
834Usage for SSH: trezor-agent foo@@example.com --connect
835Usage for GPG: Initialize using trezor-gpg init \"Foo <foo@@example.com>\"
d596fea5
DM
836Then set the environment variable GNUPGHOME to
837\"${HOME}/.gnupg/trezor\".")
838 (license license:lgpl3)))
47c8ea99
DM
839
840(define-public trezor-agent
841 (package
842 (name "trezor-agent")
7fafdadd 843 (version "0.10.0")
47c8ea99
DM
844 (source
845 (origin
846 (method url-fetch)
847 (uri (pypi-uri "trezor_agent" version))
848 (sha256
849 (base32
7fafdadd
VC
850 "144657c7bn0a667dq5fv5r6j7iilxf3h9agj29v1m2qpq40g0az8"))))
851 (arguments
852 ;; Tests fail with "AttributeError: module 'attr' has no attribute 's'".
853 `(#:phases
854 (modify-phases %standard-phases
855 (add-after 'wrap 'fixup-agent-py
856 (lambda* (#:key inputs outputs #:allow-other-keys)
857 (let* ((out (assoc-ref outputs "out")))
858 ;; overwrite the wrapper with the real thing.
859 (install-file "./trezor_agent.py"
860 (string-append out "/bin"))
861 #t))))))
47c8ea99
DM
862 (build-system python-build-system)
863 (inputs
864 `(("python-trezor" ,python-trezor)
865 ("python-trezor-agent" ,python-trezor-agent)))
7fafdadd
VC
866 (native-inputs
867 `(("python-hidapi" ,python-hidapi)))
868 (home-page "https://github.com/romanz/trezor-agent")
47c8ea99
DM
869 (synopsis "Using Trezor as hardware SSH/GPG agent")
870 (description "This package allows using Trezor as a hardware SSH/GPG
871agent.")
872 (license license:lgpl3)))
50c4d676
DM
873
874(define-public keepkey-agent
875 (package
876 (name "keepkey-agent")
877 (version "0.9.0")
878 (source
879 (origin
880 (method url-fetch)
881 (uri (pypi-uri "keepkey_agent" version))
882 (sha256
883 (base32
884 "03779gvlx70i0nnry98i4pl1d92604ix5x6jgdfkrdgzqbh5vj27"))))
885 (build-system python-build-system)
886 (inputs
887 `(("python-keepkey" ,python-keepkey)
888 ("python-trezor-agent" ,python-trezor-agent)))
889 (home-page "http://github.com/romanz/trezor-agent")
890 (synopsis "KeepKey as hardware SSH/GPG agent")
891 (description "This package allows using KeepKey as a hardware SSH/GPG
892agent.")
893 (license license:lgpl3)))
3da86c52
AP
894
895(define-public python-stdnum
896 (package
897 (name "python-stdnum")
898 (version "1.8.1")
899 (source
900 (origin
901 (method url-fetch)
902 (uri (pypi-uri "python-stdnum" version))
903 (sha256
904 (base32
905 "0hvr47q32xbyiznpmbg4r8rcvxhnf0lwf33hcpnynyik57djy5np"))))
906 (build-system python-build-system)
907 (home-page
908 "https://arthurdejong.org/python-stdnum/")
909 (synopsis
910 "Python module to handle standardized number and code formats")
911 (description
912 "This is a Python library that aims to provide functions to handle,
913parse and validate standard numbers.
914The module supports more than 100 different number formats
915amongst which a great number of VAT and other tax numbers,
916personal identity and company identification codes,
917international standard numbers (ISBN, IBAN, EAN, etc.)
918and various other formats.
919The module also inclused implementations of the Verhoeff,
920Luhn and family of ISO/IEC 7064 check digit algorithms. ")
921 (license license:lgpl2.1+)))
922
923(define-public python2-stdnum
924 (package-with-python2 python-stdnum))
730553d7 925
c7299015
NG
926(define-public python-duniterpy
927 (package
928 (name "python-duniterpy")
352033f3 929 (version "0.52.0")
c7299015
NG
930 (source
931 (origin
932 (method git-fetch)
933 ;; Pypi's default URI is missing "requirements.txt" file.
934 (uri (git-reference
7dab3e61 935 (url "https://git.duniter.org/clients/python/duniterpy.git")
c7299015
NG
936 (commit version)))
937 (file-name (git-file-name name version))
938 (sha256
939 (base32
352033f3 940 "07liba2d21hb8m3n6yccfamq9yq0ryywh18vs9g2sgywfsnv82lh"))))
c7299015 941 (build-system python-build-system)
1427d888
NG
942 (arguments
943 ;; Tests fail with "AttributeError: module 'attr' has no attribute 's'".
42a57df8
NG
944 `(#:tests? #f
945 #:phases
946 (modify-phases %standard-phases
947 (add-after 'build 'build-documentation
948 (lambda _
949 (invoke "make" "docs")))
950 (add-after 'build-documentation 'install-documentation
951 (lambda* (#:key inputs outputs #:allow-other-keys)
952 (let* ((out (assoc-ref outputs "out"))
953 (doc (string-append out "/share/doc/" ,name)))
954 (mkdir-p doc)
955 (copy-recursively "docs/_build/html" doc))
956 #t)))))
957 (native-inputs
352033f3
NG
958 `(("sphinx" ,python-sphinx)
959 ("sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
c7299015 960 (propagated-inputs
352033f3
NG
961 `(("aiohttp" ,python-aiohttp)
962 ("attr" ,python-attr)
963 ("base58" ,python-base58)
964 ("jsonschema" ,python-jsonschema)
965 ("libnacl" ,python-libnacl)
966 ("pyaes" ,python-pyaes)
967 ("pylibscrypt" ,python-pylibscrypt)
968 ("pypeg2" ,python-pypeg2)))
9f1a2be2 969 (home-page "https://git.duniter.org/clients/python/duniterpy")
c7299015
NG
970 (synopsis "Python implementation of Duniter API")
971 (description "@code{duniterpy} is an implementation of
207a79b2 972@uref{https://github.com/duniter/duniter/, duniter} API. Its
c7299015
NG
973main features are:
974@itemize
207a79b2
NG
975@item Support Duniter's Basic Merkle API and protocol
976@item Asynchronous/synchronous without threads
977@item Support HTTP, HTTPS and Web Socket transport for Basic Merkle API
978@item Support Elasticsearch Duniter4j API
c7299015 979@item Duniter signing key
207a79b2 980@item Sign/verify and encrypt/decrypt messages with the Duniter credentials
c7299015
NG
981@end itemize")
982 (license license:gpl3+)))
983
730553d7
NG
984(define-public silkaj
985 (package
986 (name "silkaj")
c14b3a8d 987 (version "0.6.5")
730553d7
NG
988 (source
989 (origin
990 (method git-fetch)
991 (uri (git-reference
992 (url "https://git.duniter.org/clients/python/silkaj.git")
993 (commit (string-append "v" version))))
994 (file-name (git-file-name name version))
995 (sha256
996 (base32
c14b3a8d 997 "1fy509vsmz7rs9m3vah0ky0jvq9mxmfga6b18rkrkl2lbjk872q2"))))
730553d7
NG
998 (build-system python-build-system)
999 (arguments
e627052f 1000 `(#:tests? #f)) ;no test
730553d7 1001 (inputs
c14b3a8d
NG
1002 `(("click" ,python-click)
1003 ("duniterpy" ,python-duniterpy)
1004 ("ipaddress" ,python-ipaddress)
1005 ("pynacl" ,python-pynacl)
1006 ("tabulate" ,python-tabulate)))
730553d7
NG
1007 (home-page "https://silkaj.duniter.org/")
1008 (synopsis "Command line client for Duniter network")
1009 (description "@code{Silkaj} is a command line client for the
1010@uref{https://github.com/duniter/duniter/, Duniter} network.
1011
1012Its features are:
1013@itemize
1014@item information about currency,
1015@item issuers difficulty to generate next block,
1016@item network view of nodes,
1017@item list of last issuers,
1018@item send transactions,
1019@item get account amount.
1020@end itemize")
1021 (license license:agpl3+)))