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>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
50 (define-public bitcoin-core
57 (string-append "https://bitcoin.org/bin/bitcoin-core-"
58 version "/bitcoin-" version ".tar.gz"))
61 "1nhw2s8p1hg6715l6kc1c7psqhkzfwhfrrgiar17zccvd14p0z8c"))))
62 (build-system gnu-build-system)
64 `(("pkg-config" ,pkg-config)
65 ("python" ,python) ; for the tests
66 ("util-linux" ,util-linux))) ; provides the hexdump command for tests
68 `(("bdb" ,bdb-5.3) ; with 6.2.23, there is an error: ambiguous overload
70 ("libevent" ,libevent)
71 ("miniupnpc" ,miniupnpc)
73 ("protobuf" ,protobuf)
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")))
84 (modify-phases %standard-phases
85 (add-before 'check 'set-home
87 (setenv "HOME" (getenv "TMPDIR"))))))) ; Tests write to $HOME.
88 (home-page "https://bitcoin.org/en/")
89 (synopsis "Bitcoin peer-to-peer client")
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)))
106 "https://github.com/ledger/ledger/archive/v"
108 (file-name (string-append name "-" version ".tar.gz"))
111 "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))))
112 (build-system cmake-build-system)
114 `(#:modules ((guix build cmake-build-system)
116 (guix build emacs-utils))
117 #:imported-modules (,@%cmake-build-system-modules
118 (guix build emacs-utils))
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")
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))
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)
143 (string-append (assoc-ref inputs "tzdata")
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")))
154 (rename-file orig-dir dest-dir)
155 (emacs-generate-autoloads ,name dest-dir))
166 `(("emacs" ,emacs-minimal)
168 ("texinfo" ,texinfo)))
169 (home-page "http://ledger-cli.org/")
170 (synopsis "Command-line double-entry accounting program")
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.
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/*
196 (define-public geierlein
203 (uri (string-append "https://github.com/stesie/geierlein"
204 "/archive/V" version ".tar.gz"))
205 (file-name (string-append name "-" version ".tar.gz"))
208 "0b11fq8v5w8nxjb20jl4dsfhv76xky6n3sq3k3fbb0m2sq9ikikw"))))
209 (build-system gnu-build-system)
211 `(#:tests? #f ; would require npm, python and a lot more
213 (modify-phases %standard-phases
215 (add-after 'unpack 'override-target-directory-and-tool-paths
216 (lambda* (#:key inputs outputs #:allow-other-keys)
217 (substitute* "Makefile"
219 (string-append "prefix := " (assoc-ref outputs "out") "\n"))
220 ;; Required for tests, unused for now:
222 ;; (string-append (which "python") "\n")))
224 (string-append "INSTALL := " (which "install") "\n")))
225 (substitute* "bin/xgeierlein.in"
226 ;; Use icecat as XULRUNNER
228 (string-append "XULRUNNER=" (which "icecat") "\n"
232 `(("icecat" ,icecat)))
233 (home-page "http://stesie.github.io/geierlein/")
234 (synopsis "Free Elster client, for sending Germany VAT declarations")
236 "Geierlein is a free Elster client, i.e. an application that
237 allows to send VAT declarations to Germany's fiscal authorities.
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
244 (license license:agpl3+)))
246 (define-public electrum
253 (uri (string-append "https://download.electrum.org/"
258 "0vxdfl208if7mdsnva1jg37bnay2dsz3ww157aqwcv1j6512fi1n"))
259 (modules '((guix build utils)))
262 ;; Delete the bundled dependencies.
263 (delete-file-recursively "packages")
265 (build-system python-build-system)
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)))
280 (modify-phases %standard-phases
281 (add-before 'build 'patch-home
282 (lambda* (#:key outputs #:allow-other-keys)
283 (substitute* "setup.py"
285 (string-append (assoc-ref outputs "out") "/local/share"))))))))
286 (home-page "https://electrum.org/")
287 (synopsis "Bitcoin wallet")
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)))