gnu: Add sslh.
[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>
4bc0c634 3;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
d3699b31 4;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
20c6b9da
AE
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages finance)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build utils)
26 #:use-module (guix build-system gnu)
d3699b31
AG
27 #:use-module (guix build-system cmake)
28 #:use-module (gnu packages base)
20c6b9da
AE
29 #:use-module (gnu packages boost)
30 #:use-module (gnu packages databases)
d3699b31
AG
31 #:use-module (gnu packages emacs)
32 #:use-module (gnu packages groff)
33 #:use-module (gnu packages libedit)
14ea30e4 34 #:use-module (gnu packages libevent)
20c6b9da 35 #:use-module (gnu packages linux)
d3699b31 36 #:use-module (gnu packages multiprecision)
20c6b9da
AE
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages protobuf)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages qt)
d3699b31
AG
41 #:use-module (gnu packages texinfo)
42 #:use-module (gnu packages textutils)
20c6b9da
AE
43 #:use-module (gnu packages tls)
44 #:use-module (gnu packages upnp))
45
46(define-public bitcoin-core
47 (package
48 (name "bitcoin-core")
e49e74f5 49 (version "0.13.0")
20c6b9da
AE
50 (source (origin
51 (method url-fetch)
52 (uri
53 (string-append "https://bitcoin.org/bin/bitcoin-core-"
14ea30e4 54 version "/bitcoin-" version ".tar.gz"))
20c6b9da
AE
55 (sha256
56 (base32
e49e74f5 57 "1nhw2s8p1hg6715l6kc1c7psqhkzfwhfrrgiar17zccvd14p0z8c"))))
20c6b9da
AE
58 (build-system gnu-build-system)
59 (native-inputs
60 `(("pkg-config" ,pkg-config)
e49e74f5 61 ("python" ,python) ; for the tests
20c6b9da
AE
62 ("util-linux" ,util-linux))) ; provides the hexdump command for tests
63 (inputs
fe7fa353 64 `(("bdb" ,bdb-5.3) ; with 6.2.23, there is an error: ambiguous overload
20c6b9da 65 ("boost" ,boost)
14ea30e4 66 ("libevent" ,libevent)
20c6b9da
AE
67 ("miniupnpc" ,miniupnpc)
68 ("openssl" ,openssl)
69 ("protobuf" ,protobuf)
05fe53c6 70 ("qtbase" ,qtbase)))
20c6b9da
AE
71 (arguments
72 `(#:configure-flags
73 (list
74 ;; We use a bdb version newer than 4.8.
75 "--with-incompatible-bdb"
76 ;; Boost is not found unless specified manually.
77 (string-append "--with-boost="
78 (assoc-ref %build-inputs "boost")))
79 #:phases
80 (modify-phases %standard-phases
81 (add-before 'check 'set-home
82 (lambda _
83 (setenv "HOME" (getenv "TMPDIR"))))))) ; Tests write to $HOME.
84 (home-page "https://bitcoin.org/en/")
85 (synopsis "Bitcoin peer-to-peer client")
86 (description
87 "Bitcoin is a digital currency that enables instant payments to anyone
88anywhere in the world. It uses peer-to-peer technology to operate without
89central authority: managing transactions and issuing money are carried out
90collectively by the network. Bitcoin Core is the reference implementation
91of the bitcoin protocol. This package provides the Bitcoin Core command
92line client and a client based on Qt.")
93 (license license:expat)))
d3699b31
AG
94
95(define-public ledger
96 (package
97 (name "ledger")
98 (version "3.1.1")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append
102 "https://github.com/ledger/ledger/archive/v"
103 version ".tar.gz"))
104 (file-name (string-append name "-" version ".tar.gz"))
105 (sha256
106 (base32
107 "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))))
108 (build-system cmake-build-system)
109 (arguments
110 `(#:modules ((guix build cmake-build-system)
111 (guix build utils)
112 (guix build emacs-utils))
113 #:imported-modules (,@%cmake-build-system-modules
114 (guix build emacs-utils))
115 #:configure-flags
116 `("-DBUILD_DOCS:BOOL=ON"
117 "-DBUILD_WEB_DOCS:BOOL=ON"
118 "-DBUILD_EMACSLISP:BOOL=ON"
119 "-DUSE_PYTHON:BOOL=ON"
120 "-DCMAKE_INSTALL_LIBDIR:PATH=lib"
121 ,(string-append "-DUTFCPP_INCLUDE_DIR:PATH="
122 (assoc-ref %build-inputs "utfcpp")
123 "/include"))
124 #:phases
125 (modify-phases %standard-phases
126 (add-before 'configure 'install-examples
127 (lambda* (#:key outputs #:allow-other-keys)
128 (let ((examples (string-append (assoc-ref outputs "out")
129 "/share/doc/ledger/examples")))
130 (install-file "test/input/sample.dat" examples)
131 (install-file "test/input/demo.ledger" examples))
132 #t))
133 (add-after 'build 'build-doc
134 (lambda _ (zero? (system* "make" "doc"))))
135 (add-before 'check 'check-setup
136 ;; One test fails if it can't set the timezone.
137 (lambda* (#:key inputs #:allow-other-keys)
138 (setenv "TZDIR"
139 (string-append (assoc-ref inputs "tzdata")
140 "/share/zoneinfo"))
141 #t))
142 (add-after 'install 'relocate-elisp
143 (lambda* (#:key outputs #:allow-other-keys)
144 (let* ((site-dir (string-append (assoc-ref outputs "out")
145 "/share/emacs/site-lisp"))
146 (guix-dir (string-append site-dir "/guix.d"))
147 (orig-dir (string-append site-dir "/ledger-mode"))
148 (dest-dir (string-append guix-dir "/ledger-mode")))
149 (mkdir-p guix-dir)
150 (rename-file orig-dir dest-dir)
151 (emacs-generate-autoloads ,name dest-dir))
152 #t)))))
153 (inputs
154 `(("boost" ,boost)
155 ("gmp" ,gmp)
156 ("libedit" ,libedit)
157 ("mpfr" ,mpfr)
158 ("python" ,python-2)
159 ("tzdata" ,tzdata)
160 ("utfcpp" ,utfcpp)))
161 (native-inputs
b8fc3622 162 `(("emacs" ,emacs-minimal)
d3699b31
AG
163 ("groff" ,groff)
164 ("texinfo" ,texinfo)))
165 (home-page "http://ledger-cli.org/")
166 (synopsis "Command-line double-entry accounting program")
167 (description
168 "Ledger is a powerful, double-entry accounting system that is
169accessed from the UNIX command-line. This may put off some users, since
170there is no flashy UI, but for those who want unparalleled reporting
171access to their data there are few alternatives.
172
173Ledger uses text files for input. It reads the files and generates
174reports; there is no other database or stored state. To use Ledger,
175you create a file of your account names and transactions, run from the
176command line with some options to specify input and requested reports, and
177get output. The output is generally plain text, though you could generate
178a graph or html instead. Ledger is simple in concept, surprisingly rich
179in ability, and easy to use.")
180 ;; There are some extra licenses in files which do not presently get
181 ;; installed when you build this package. Different versions of the GPL
182 ;; are used in the contrib and python subdirectories. The bundled version
183 ;; of utfcpp is under the Boost 1.0 license. Also the file
184 ;; `tools/update_copyright_year` has an Expat license.
185 (license (list license:bsd-3
186 license:asl2.0 ; src/strptime.cc
187 (license:non-copyleft
188 "file://src/wcwidth.cc"
189 "See src/wcwidth.cc in the distribution.")
190 license:gpl2+)))) ; lisp/*