gnu: r-go-db: Update to 3.5.0.
[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>
fa7647c6 3;;; Copyright © 2016, 2017 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>
20c6b9da
AE
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages finance)
fa4f95a7
CB
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system python)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages boost)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages databases)
35 #:use-module (gnu packages documentation)
36 #:use-module (gnu packages dns)
37 #:use-module (gnu packages emacs)
38 #:use-module (gnu packages graphviz)
39 #:use-module (gnu packages groff)
40 #:use-module (gnu packages libedit)
41 #:use-module (gnu packages libevent)
42 #:use-module (gnu packages libunwind)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages multiprecision)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages protobuf)
47 #:use-module (gnu packages python)
cc6f4912 48 #:use-module (gnu packages python-crypto)
589e3f4e 49 #:use-module (gnu packages python-web)
fa4f95a7
CB
50 #:use-module (gnu packages qt)
51 #:use-module (gnu packages texinfo)
52 #:use-module (gnu packages textutils)
53 #:use-module (gnu packages tls)
54 #:use-module (gnu packages upnp)
55 #:use-module (gnu packages web)
56 #:use-module (gnu packages xml)
57 #:use-module (gnu packages gnuzilla))
20c6b9da
AE
58
59(define-public bitcoin-core
60 (package
61 (name "bitcoin-core")
12ae25db 62 (version "0.15.0.1")
20c6b9da
AE
63 (source (origin
64 (method url-fetch)
65 (uri
66 (string-append "https://bitcoin.org/bin/bitcoin-core-"
14ea30e4 67 version "/bitcoin-" version ".tar.gz"))
20c6b9da
AE
68 (sha256
69 (base32
12ae25db 70 "16si3skhm6jhw1pkniv2b9y1kkdhjmhj392palphir0qc1srwzmm"))))
20c6b9da
AE
71 (build-system gnu-build-system)
72 (native-inputs
73 `(("pkg-config" ,pkg-config)
e49e74f5 74 ("python" ,python) ; for the tests
0193812a
MB
75 ("util-linux" ,util-linux) ; provides the hexdump command for tests
76 ("qttools" ,qttools)))
20c6b9da 77 (inputs
fe7fa353 78 `(("bdb" ,bdb-5.3) ; with 6.2.23, there is an error: ambiguous overload
20c6b9da 79 ("boost" ,boost)
14ea30e4 80 ("libevent" ,libevent)
20c6b9da
AE
81 ("miniupnpc" ,miniupnpc)
82 ("openssl" ,openssl)
83 ("protobuf" ,protobuf)
0193812a 84 ("qtbase" ,qtbase)))
20c6b9da
AE
85 (arguments
86 `(#:configure-flags
87 (list
88 ;; We use a bdb version newer than 4.8.
89 "--with-incompatible-bdb"
90 ;; Boost is not found unless specified manually.
91 (string-append "--with-boost="
0193812a
MB
92 (assoc-ref %build-inputs "boost"))
93 ;; XXX: The configure script looks up Qt paths by
94 ;; `pkg-config --variable=host_bins Qt5Core`, which fails to pick
95 ;; up executables residing in 'qttools', so we specify them here.
96 (string-append "ac_cv_path_LRELEASE="
97 (assoc-ref %build-inputs "qttools")
98 "/bin/lrelease")
99 (string-append "ac_cv_path_LUPDATE="
100 (assoc-ref %build-inputs "qttools")
101 "/bin/lupdate"))
20c6b9da
AE
102 #:phases
103 (modify-phases %standard-phases
104 (add-before 'check 'set-home
105 (lambda _
106 (setenv "HOME" (getenv "TMPDIR"))))))) ; Tests write to $HOME.
107 (home-page "https://bitcoin.org/en/")
108 (synopsis "Bitcoin peer-to-peer client")
109 (description
110 "Bitcoin is a digital currency that enables instant payments to anyone
111anywhere in the world. It uses peer-to-peer technology to operate without
112central authority: managing transactions and issuing money are carried out
113collectively by the network. Bitcoin Core is the reference implementation
114of the bitcoin protocol. This package provides the Bitcoin Core command
115line client and a client based on Qt.")
116 (license license:expat)))
d3699b31
AG
117
118(define-public ledger
119 (package
120 (name "ledger")
121 (version "3.1.1")
122 (source (origin
123 (method url-fetch)
124 (uri (string-append
125 "https://github.com/ledger/ledger/archive/v"
126 version ".tar.gz"))
127 (file-name (string-append name "-" version ".tar.gz"))
128 (sha256
129 (base32
130 "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))))
131 (build-system cmake-build-system)
132 (arguments
133 `(#:modules ((guix build cmake-build-system)
134 (guix build utils)
135 (guix build emacs-utils))
136 #:imported-modules (,@%cmake-build-system-modules
137 (guix build emacs-utils))
138 #:configure-flags
139 `("-DBUILD_DOCS:BOOL=ON"
140 "-DBUILD_WEB_DOCS:BOOL=ON"
141 "-DBUILD_EMACSLISP:BOOL=ON"
142 "-DUSE_PYTHON:BOOL=ON"
143 "-DCMAKE_INSTALL_LIBDIR:PATH=lib"
144 ,(string-append "-DUTFCPP_INCLUDE_DIR:PATH="
145 (assoc-ref %build-inputs "utfcpp")
146 "/include"))
147 #:phases
148 (modify-phases %standard-phases
149 (add-before 'configure 'install-examples
150 (lambda* (#:key outputs #:allow-other-keys)
151 (let ((examples (string-append (assoc-ref outputs "out")
152 "/share/doc/ledger/examples")))
153 (install-file "test/input/sample.dat" examples)
154 (install-file "test/input/demo.ledger" examples))
155 #t))
156 (add-after 'build 'build-doc
157 (lambda _ (zero? (system* "make" "doc"))))
158 (add-before 'check 'check-setup
159 ;; One test fails if it can't set the timezone.
160 (lambda* (#:key inputs #:allow-other-keys)
161 (setenv "TZDIR"
162 (string-append (assoc-ref inputs "tzdata")
163 "/share/zoneinfo"))
164 #t))
165 (add-after 'install 'relocate-elisp
166 (lambda* (#:key outputs #:allow-other-keys)
167 (let* ((site-dir (string-append (assoc-ref outputs "out")
168 "/share/emacs/site-lisp"))
169 (guix-dir (string-append site-dir "/guix.d"))
170 (orig-dir (string-append site-dir "/ledger-mode"))
171 (dest-dir (string-append guix-dir "/ledger-mode")))
172 (mkdir-p guix-dir)
173 (rename-file orig-dir dest-dir)
174 (emacs-generate-autoloads ,name dest-dir))
175 #t)))))
176 (inputs
177 `(("boost" ,boost)
178 ("gmp" ,gmp)
179 ("libedit" ,libedit)
180 ("mpfr" ,mpfr)
181 ("python" ,python-2)
182 ("tzdata" ,tzdata)
183 ("utfcpp" ,utfcpp)))
184 (native-inputs
b8fc3622 185 `(("emacs" ,emacs-minimal)
d3699b31
AG
186 ("groff" ,groff)
187 ("texinfo" ,texinfo)))
188 (home-page "http://ledger-cli.org/")
189 (synopsis "Command-line double-entry accounting program")
190 (description
191 "Ledger is a powerful, double-entry accounting system that is
192accessed from the UNIX command-line. This may put off some users, since
193there is no flashy UI, but for those who want unparalleled reporting
194access to their data there are few alternatives.
195
196Ledger uses text files for input. It reads the files and generates
197reports; there is no other database or stored state. To use Ledger,
198you create a file of your account names and transactions, run from the
199command line with some options to specify input and requested reports, and
200get output. The output is generally plain text, though you could generate
201a graph or html instead. Ledger is simple in concept, surprisingly rich
202in ability, and easy to use.")
203 ;; There are some extra licenses in files which do not presently get
204 ;; installed when you build this package. Different versions of the GPL
205 ;; are used in the contrib and python subdirectories. The bundled version
206 ;; of utfcpp is under the Boost 1.0 license. Also the file
207 ;; `tools/update_copyright_year` has an Expat license.
208 (license (list license:bsd-3
209 license:asl2.0 ; src/strptime.cc
210 (license:non-copyleft
211 "file://src/wcwidth.cc"
212 "See src/wcwidth.cc in the distribution.")
213 license:gpl2+)))) ; lisp/*
cb0866c3
HG
214
215(define-public geierlein
216 (package
217 (name "geierlein")
218 (version "0.9.5")
219 (source
220 (origin
221 (method url-fetch)
222 (uri (string-append "https://github.com/stesie/geierlein"
223 "/archive/V" version ".tar.gz"))
224 (file-name (string-append name "-" version ".tar.gz"))
225 (sha256
226 (base32
227 "0b11fq8v5w8nxjb20jl4dsfhv76xky6n3sq3k3fbb0m2sq9ikikw"))))
228 (build-system gnu-build-system)
229 (arguments
230 `(#:tests? #f ; would require npm, python and a lot more
231 #:phases
232 (modify-phases %standard-phases
233 (delete 'configure)
234 (add-after 'unpack 'override-target-directory-and-tool-paths
235 (lambda* (#:key inputs outputs #:allow-other-keys)
236 (substitute* "Makefile"
237 (("prefix := .*")
238 (string-append "prefix := " (assoc-ref outputs "out") "\n"))
239 ;; Required for tests, unused for now:
240 ;;(("PYTHON := .*")
241 ;; (string-append (which "python") "\n")))
242 (("INSTALL := .*")
243 (string-append "INSTALL := " (which "install") "\n")))
244 (substitute* "bin/xgeierlein.in"
245 ;; Use icecat as XULRUNNER
246 (("^for search ")
247 (string-append "XULRUNNER=" (which "icecat") "\n"
248 "for search ")))
249 #t)))))
250 (inputs
251 `(("icecat" ,icecat)))
252 (home-page "http://stesie.github.io/geierlein/")
253 (synopsis "Free Elster client, for sending Germany VAT declarations")
254 (description
255 "Geierlein is a free Elster client, i.e. an application that
256allows to send VAT declarations to Germany's fiscal authorities.
257
258Currently it is *not* possible to send returns that are due annually
259(especially the income tax return) since the fiscal authority doesn't
260allow to do that off the ERiC library (which is proprietary however).
261It's not clear at the moment whether one day it will be possible to
262do so.")
263 (license license:agpl3+)))
9475fd92
CZ
264
265(define-public electrum
266 (package
267 (name "electrum")
47bd32d9 268 (version "3.0")
9475fd92
CZ
269 (source
270 (origin
271 (method url-fetch)
272 (uri (string-append "https://download.electrum.org/"
273 version "/Electrum-"
274 version ".tar.gz"))
275 (sha256
276 (base32
47bd32d9 277 "184cmpfqcznnm0wfjiarb6dps2vs0s2aykmy2ji7p77x20fbisfi"))
9475fd92
CZ
278 (modules '((guix build utils)))
279 (snippet
280 '(begin
281 ;; Delete the bundled dependencies.
282 (delete-file-recursively "packages")
283 #t))))
284 (build-system python-build-system)
285 (inputs
47bd32d9
CZ
286 `(("python-pyaes" ,python-pyaes)
287 ("python-pysocks" ,python-pysocks)
288 ("python-sip" ,python-sip)
289 ("python-pyqt" ,python-pyqt)
290 ("python-ecdsa" ,python-ecdsa)
291 ("python-pbkdf2" ,python-pbkdf2)
292 ("python-requests" ,python-requests)
293 ("python-qrcode" ,python-qrcode)
294 ("python-protobuf" ,python-protobuf)
295 ("python-dnspython" ,python-dnspython)
296 ("python-jsonrpclib-pelix" ,python-jsonrpclib-pelix)))
9475fd92 297 (arguments
47bd32d9 298 `(#:tests? #f ;; package doesn't have any tests
9475fd92
CZ
299 #:phases
300 (modify-phases %standard-phases
301 (add-before 'build 'patch-home
302 (lambda* (#:key outputs #:allow-other-keys)
303 (substitute* "setup.py"
304 (("~/.local/share")
305 (string-append (assoc-ref outputs "out") "/local/share"))))))))
306 (home-page "https://electrum.org/")
307 (synopsis "Bitcoin wallet")
308 (description
309 "Electrum is a lightweight Bitcoin client, based on a client-server
310protocol. It supports Simple Payment Verification (SPV) and deterministic key
311generation from a seed. Your secret keys are encrypted and are never sent to
312other machines/servers. Electrum does not download the Bitcoin blockchain.")
313 (license license:expat)))
8514662b
TF
314
315(define-public monero
316 ;; This package bundles easylogging++ and lmdb.
317 ;; The bundled easylogging++ is modified, and the changes will not be upstreamed.
318 ;; The devs deem the lmdb driver too critical a consenus component, to use
319 ;; the system's dynamically linked library.
320 (package
321 (name "monero")
322 (version "0.11.0.0")
323 (source
324 (origin
325 (method url-fetch)
326 (uri (string-append "https://github.com/monero-project/monero/archive/v"
327 version ".tar.gz"))
328 (file-name (string-append name "-" version ".tar.gz"))
329 (modules '((guix build utils)))
330 (snippet
331 '(begin
332 ;; Delete bundled dependencies.
333 (for-each
334 delete-file-recursively
335 '("external/miniupnpc" "external/rapidjson"
336 "external/unbound"))
337 #t))
338 (sha256
339 (base32
340 "083w40a553c0r3i18020jcrv5s0b64vx3d8xrn9nwkb2237ighlk"))))
341 (build-system cmake-build-system)
342 (native-inputs
343 `(("doxygen" ,doxygen)
344 ("googletest" ,googletest)
345 ("graphviz" ,graphviz)
346 ("pkg-config" ,pkg-config)))
347 (inputs
348 `(("bind" ,isc-bind)
349 ("boost" ,boost)
350 ("expat" ,expat)
351 ("libunwind" ,libunwind)
352 ("lmdb" ,lmdb)
353 ("miniupnpc" ,miniupnpc)
354 ("openssl" ,openssl)
355 ("rapidjson" ,rapidjson)
356 ("unbound" ,unbound)))
357 (arguments
358 `(#:out-of-source? #t
359 #:configure-flags '("-DBUILD_TESTS=ON"
fa7647c6
EF
360 ,@(if (string=? "aarch64-linux" (%current-system))
361 '("-DARCH=armv8-a")
362 '())
8514662b
TF
363 "-DBUILD_GUI_DEPS=ON")
364 #:phases
365 (modify-phases %standard-phases
366 ;; tests/core_tests need a valid HOME
367 (add-before 'configure 'set-home
368 (lambda _
369 (setenv "HOME" (getcwd))
370 #t))
371 (add-after 'set-home 'fix-wallet-path-for-unit-tests
372 (lambda _
373 (substitute* "tests/unit_tests/serialization.cpp"
374 (("\\.\\./\\.\\./\\.\\./\\.\\./") "../../"))
375 #t))
376 (add-after 'fix-wallet-path-for-unit-tests 'change-log-path
377 (lambda _
378 (substitute* "contrib/epee/src/mlog.cpp"
379 (("epee::string_tools::get_current_module_folder\\(\\)")
380 "\".bitmonero\""))
381 (substitute* "contrib/epee/src/mlog.cpp"
382 (("return \\(") "return ((std::string(getenv(\"HOME\"))) / "))
383 #t))
384 (replace 'check
385 (lambda _
386 (zero?
387 (system* "make" "ARGS=-E 'unit_tests|libwallet_api_tests'"
388 "test"))))
389 ;; The excluded unit tests need network access
390 (add-after 'check 'unit-tests
391 (lambda _
392 (let ((excluded-unit-tests
393 (string-join
394 '("AddressFromURL.Success"
395 "AddressFromURL.Failure"
396 "DNSResolver.IPv4Success"
397 "DNSResolver.DNSSECSuccess"
398 "DNSResolver.DNSSECFailure"
399 "DNSResolver.GetTXTRecord")
400 ":")))
401 (zero?
402 (system* "tests/unit_tests/unit_tests"
403 (string-append "--gtest_filter=-"
404 excluded-unit-tests))))))
405 (add-after 'install 'install-blockchain-import-export
406 (lambda* (#:key outputs #:allow-other-keys)
407 (let* ((out (assoc-ref outputs "out"))
408 (bin (string-append out "/bin")))
409 (install-file "bin/monero-blockchain-import" bin)
410 (install-file "bin/monero-blockchain-export" bin)))))))
411 (home-page "https://getmonero.org/")
412 (synopsis "Command-line interface to the Monero currency")
413 (description
414 "Monero is a secure, private, untraceable currency. This package provides the
415Monero command line client and daemon.")
416 (license license:bsd-3)))
79228a52
TF
417
418(define-public monero-core
419 (package
420 (name "monero-core")
421 (version "0.11.0.0")
422 (source
423 (origin
424 (method url-fetch)
425 (uri (string-append "https://github.com/monero-project/monero-core/archive/v"
426 version ".tar.gz"))
427 (file-name (string-append name "-" version ".tar.gz"))
428 (sha256
429 (base32
430 "0hnrkgwb1sva67pcjym2gvb4zifp2s849dfbnjzbxk3yczpcyqzg"))))
431 (build-system gnu-build-system)
432 (native-inputs
433 `(("doxygen" ,doxygen)
434 ("graphviz" ,graphviz)
435 ("pkg-config" ,pkg-config)))
436 (inputs
437 `(("boost" ,boost)
438 ("libunwind" ,libunwind)
439 ("openssl" ,openssl)
440 ("qt" ,qt)
441 ("unbound" ,unbound)))
442 (propagated-inputs
443 `(("monero" ,monero)))
444 (arguments
445 `(#:phases
446 (modify-phases %standard-phases
447 (delete 'configure)
448 (delete 'check)
449 (add-before 'build 'fix-makefile-vars
450 (lambda _
451 (substitute* "src/zxcvbn-c/makefile"
452 (("\\?=") "="))
453 #t))
454 (add-after 'fix-makefile-vars 'fix-library-paths
455 (lambda* (#:key inputs #:allow-other-keys)
456 (substitute* "monero-wallet-gui.pro"
457 (("-L/usr/local/lib") "")
458 (("-L/usr/local/opt/openssl/lib")
459 (string-append "-L"
460 (assoc-ref inputs "openssl")
461 "/lib"))
462 (("-L/usr/local/opt/boost/lib")
463 (string-append "-L"
464 (assoc-ref inputs "boost")
465 "/lib")))
466 #t))
467 (add-after 'fix-library-paths 'fix-monerod-path
468 (lambda* (#:key inputs #:allow-other-keys)
469 (substitute* "src/daemon/DaemonManager.cpp"
470 (("QApplication::applicationDirPath\\(\\) \\+ \"/monerod")
471 (string-append "\""(assoc-ref inputs "monero")
472 "/bin/monerod")))
473 #t))
474 (replace 'build
475 (lambda _
476 (zero? (system* "./build.sh"))))
477 (add-after 'build 'fix-install-path
478 (lambda* (#:key outputs #:allow-other-keys)
479 (substitute* "build/Makefile"
480 (("/opt/monero-wallet-gui")
481 (assoc-ref outputs "out")))
482 #t))
483 (add-before 'install 'change-dir
484 (lambda _
485 (chdir "build"))))))
486 (home-page "https://getmonero.org/")
487 (synopsis "Graphical user interface for the Monero currency")
488 (description
489 "Monero is a secure, private, untraceable currency. This package provides the
490Monero GUI client.")
491 (license license:bsd-3)))