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