gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / finance.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
5 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
6 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages finance)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build utils)
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 databases)
34 #:use-module (gnu packages emacs)
35 #:use-module (gnu packages groff)
36 #:use-module (gnu packages libedit)
37 #:use-module (gnu packages libevent)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages multiprecision)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages protobuf)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages qt)
44 #:use-module (gnu packages texinfo)
45 #:use-module (gnu packages textutils)
46 #:use-module (gnu packages tls)
47 #:use-module (gnu packages upnp)
48 #:use-module (gnu packages gnuzilla))
49
50 (define-public bitcoin-core
51 (package
52 (name "bitcoin-core")
53 (version "0.13.0")
54 (source (origin
55 (method url-fetch)
56 (uri
57 (string-append "https://bitcoin.org/bin/bitcoin-core-"
58 version "/bitcoin-" version ".tar.gz"))
59 (sha256
60 (base32
61 "1nhw2s8p1hg6715l6kc1c7psqhkzfwhfrrgiar17zccvd14p0z8c"))))
62 (build-system gnu-build-system)
63 (native-inputs
64 `(("pkg-config" ,pkg-config)
65 ("python" ,python) ; for the tests
66 ("util-linux" ,util-linux))) ; provides the hexdump command for tests
67 (inputs
68 `(("bdb" ,bdb-5.3) ; with 6.2.23, there is an error: ambiguous overload
69 ("boost" ,boost)
70 ("libevent" ,libevent)
71 ("miniupnpc" ,miniupnpc)
72 ("openssl" ,openssl)
73 ("protobuf" ,protobuf)
74 ("qtbase" ,qtbase)))
75 (arguments
76 `(#:configure-flags
77 (list
78 ;; We use a bdb version newer than 4.8.
79 "--with-incompatible-bdb"
80 ;; Boost is not found unless specified manually.
81 (string-append "--with-boost="
82 (assoc-ref %build-inputs "boost")))
83 #:phases
84 (modify-phases %standard-phases
85 (add-before 'check 'set-home
86 (lambda _
87 (setenv "HOME" (getenv "TMPDIR"))))))) ; Tests write to $HOME.
88 (home-page "https://bitcoin.org/en/")
89 (synopsis "Bitcoin peer-to-peer client")
90 (description
91 "Bitcoin is a digital currency that enables instant payments to anyone
92 anywhere in the world. It uses peer-to-peer technology to operate without
93 central authority: managing transactions and issuing money are carried out
94 collectively by the network. Bitcoin Core is the reference implementation
95 of the bitcoin protocol. This package provides the Bitcoin Core command
96 line client and a client based on Qt.")
97 (license license:expat)))
98
99 (define-public ledger
100 (package
101 (name "ledger")
102 (version "3.1.1")
103 (source (origin
104 (method url-fetch)
105 (uri (string-append
106 "https://github.com/ledger/ledger/archive/v"
107 version ".tar.gz"))
108 (file-name (string-append name "-" version ".tar.gz"))
109 (sha256
110 (base32
111 "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))))
112 (build-system cmake-build-system)
113 (arguments
114 `(#:modules ((guix build cmake-build-system)
115 (guix build utils)
116 (guix build emacs-utils))
117 #:imported-modules (,@%cmake-build-system-modules
118 (guix build emacs-utils))
119 #:configure-flags
120 `("-DBUILD_DOCS:BOOL=ON"
121 "-DBUILD_WEB_DOCS:BOOL=ON"
122 "-DBUILD_EMACSLISP:BOOL=ON"
123 "-DUSE_PYTHON:BOOL=ON"
124 "-DCMAKE_INSTALL_LIBDIR:PATH=lib"
125 ,(string-append "-DUTFCPP_INCLUDE_DIR:PATH="
126 (assoc-ref %build-inputs "utfcpp")
127 "/include"))
128 #:phases
129 (modify-phases %standard-phases
130 (add-before 'configure 'install-examples
131 (lambda* (#:key outputs #:allow-other-keys)
132 (let ((examples (string-append (assoc-ref outputs "out")
133 "/share/doc/ledger/examples")))
134 (install-file "test/input/sample.dat" examples)
135 (install-file "test/input/demo.ledger" examples))
136 #t))
137 (add-after 'build 'build-doc
138 (lambda _ (zero? (system* "make" "doc"))))
139 (add-before 'check 'check-setup
140 ;; One test fails if it can't set the timezone.
141 (lambda* (#:key inputs #:allow-other-keys)
142 (setenv "TZDIR"
143 (string-append (assoc-ref inputs "tzdata")
144 "/share/zoneinfo"))
145 #t))
146 (add-after 'install 'relocate-elisp
147 (lambda* (#:key outputs #:allow-other-keys)
148 (let* ((site-dir (string-append (assoc-ref outputs "out")
149 "/share/emacs/site-lisp"))
150 (guix-dir (string-append site-dir "/guix.d"))
151 (orig-dir (string-append site-dir "/ledger-mode"))
152 (dest-dir (string-append guix-dir "/ledger-mode")))
153 (mkdir-p guix-dir)
154 (rename-file orig-dir dest-dir)
155 (emacs-generate-autoloads ,name dest-dir))
156 #t)))))
157 (inputs
158 `(("boost" ,boost)
159 ("gmp" ,gmp)
160 ("libedit" ,libedit)
161 ("mpfr" ,mpfr)
162 ("python" ,python-2)
163 ("tzdata" ,tzdata)
164 ("utfcpp" ,utfcpp)))
165 (native-inputs
166 `(("emacs" ,emacs-minimal)
167 ("groff" ,groff)
168 ("texinfo" ,texinfo)))
169 (home-page "http://ledger-cli.org/")
170 (synopsis "Command-line double-entry accounting program")
171 (description
172 "Ledger is a powerful, double-entry accounting system that is
173 accessed from the UNIX command-line. This may put off some users, since
174 there is no flashy UI, but for those who want unparalleled reporting
175 access to their data there are few alternatives.
176
177 Ledger uses text files for input. It reads the files and generates
178 reports; there is no other database or stored state. To use Ledger,
179 you create a file of your account names and transactions, run from the
180 command line with some options to specify input and requested reports, and
181 get output. The output is generally plain text, though you could generate
182 a graph or html instead. Ledger is simple in concept, surprisingly rich
183 in ability, and easy to use.")
184 ;; There are some extra licenses in files which do not presently get
185 ;; installed when you build this package. Different versions of the GPL
186 ;; are used in the contrib and python subdirectories. The bundled version
187 ;; of utfcpp is under the Boost 1.0 license. Also the file
188 ;; `tools/update_copyright_year` has an Expat license.
189 (license (list license:bsd-3
190 license:asl2.0 ; src/strptime.cc
191 (license:non-copyleft
192 "file://src/wcwidth.cc"
193 "See src/wcwidth.cc in the distribution.")
194 license:gpl2+)))) ; lisp/*
195
196 (define-public geierlein
197 (package
198 (name "geierlein")
199 (version "0.9.5")
200 (source
201 (origin
202 (method url-fetch)
203 (uri (string-append "https://github.com/stesie/geierlein"
204 "/archive/V" version ".tar.gz"))
205 (file-name (string-append name "-" version ".tar.gz"))
206 (sha256
207 (base32
208 "0b11fq8v5w8nxjb20jl4dsfhv76xky6n3sq3k3fbb0m2sq9ikikw"))))
209 (build-system gnu-build-system)
210 (arguments
211 `(#:tests? #f ; would require npm, python and a lot more
212 #:phases
213 (modify-phases %standard-phases
214 (delete 'configure)
215 (add-after 'unpack 'override-target-directory-and-tool-paths
216 (lambda* (#:key inputs outputs #:allow-other-keys)
217 (substitute* "Makefile"
218 (("prefix := .*")
219 (string-append "prefix := " (assoc-ref outputs "out") "\n"))
220 ;; Required for tests, unused for now:
221 ;;(("PYTHON := .*")
222 ;; (string-append (which "python") "\n")))
223 (("INSTALL := .*")
224 (string-append "INSTALL := " (which "install") "\n")))
225 (substitute* "bin/xgeierlein.in"
226 ;; Use icecat as XULRUNNER
227 (("^for search ")
228 (string-append "XULRUNNER=" (which "icecat") "\n"
229 "for search ")))
230 #t)))))
231 (inputs
232 `(("icecat" ,icecat)))
233 (home-page "http://stesie.github.io/geierlein/")
234 (synopsis "Free Elster client, for sending Germany VAT declarations")
235 (description
236 "Geierlein is a free Elster client, i.e. an application that
237 allows to send VAT declarations to Germany's fiscal authorities.
238
239 Currently it is *not* possible to send returns that are due annually
240 (especially the income tax return) since the fiscal authority doesn't
241 allow to do that off the ERiC library (which is proprietary however).
242 It's not clear at the moment whether one day it will be possible to
243 do so.")
244 (license license:agpl3+)))
245
246 (define-public electrum
247 (package
248 (name "electrum")
249 (version "2.7.12")
250 (source
251 (origin
252 (method url-fetch)
253 (uri (string-append "https://download.electrum.org/"
254 version "/Electrum-"
255 version ".tar.gz"))
256 (sha256
257 (base32
258 "0vxdfl208if7mdsnva1jg37bnay2dsz3ww157aqwcv1j6512fi1n"))
259 (modules '((guix build utils)))
260 (snippet
261 '(begin
262 ;; Delete the bundled dependencies.
263 (delete-file-recursively "packages")
264 #t))))
265 (build-system python-build-system)
266 (inputs
267 `(("python-slowaes" ,python2-slowaes)
268 ("python-sip" ,python2-sip)
269 ("python-pyqt" ,python2-pyqt-4)
270 ("python-ecdsa" ,python2-ecdsa)
271 ("python-pbkdf2" ,python2-pbkdf2)
272 ("python-requests" ,python2-requests)
273 ("python-qrcode" ,python2-qrcode)
274 ("python-protobuf" ,python2-protobuf)
275 ("python-dnspython" ,python2-dnspython)
276 ("python-jsonrpclib" ,python2-jsonrpclib)))
277 (arguments
278 `(#:python ,python-2
279 #:phases
280 (modify-phases %standard-phases
281 (add-before 'build 'patch-home
282 (lambda* (#:key outputs #:allow-other-keys)
283 (substitute* "setup.py"
284 (("~/.local/share")
285 (string-append (assoc-ref outputs "out") "/local/share"))))))))
286 (home-page "https://electrum.org/")
287 (synopsis "Bitcoin wallet")
288 (description
289 "Electrum is a lightweight Bitcoin client, based on a client-server
290 protocol. It supports Simple Payment Verification (SPV) and deterministic key
291 generation from a seed. Your secret keys are encrypted and are never sent to
292 other machines/servers. Electrum does not download the Bitcoin blockchain.")
293 (license license:expat)))