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>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
48 (define-public bitcoin-core
55 (string-append "https://bitcoin.org/bin/bitcoin-core-"
56 version "/bitcoin-" version ".tar.gz"))
59 "1nhw2s8p1hg6715l6kc1c7psqhkzfwhfrrgiar17zccvd14p0z8c"))))
60 (build-system gnu-build-system)
62 `(("pkg-config" ,pkg-config)
63 ("python" ,python) ; for the tests
64 ("util-linux" ,util-linux))) ; provides the hexdump command for tests
66 `(("bdb" ,bdb-5.3) ; with 6.2.23, there is an error: ambiguous overload
68 ("libevent" ,libevent)
69 ("miniupnpc" ,miniupnpc)
71 ("protobuf" ,protobuf)
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")))
82 (modify-phases %standard-phases
83 (add-before 'check 'set-home
85 (setenv "HOME" (getenv "TMPDIR"))))))) ; Tests write to $HOME.
86 (home-page "https://bitcoin.org/en/")
87 (synopsis "Bitcoin peer-to-peer client")
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)))
104 "https://github.com/ledger/ledger/archive/v"
106 (file-name (string-append name "-" version ".tar.gz"))
109 "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))))
110 (build-system cmake-build-system)
112 `(#:modules ((guix build cmake-build-system)
114 (guix build emacs-utils))
115 #:imported-modules (,@%cmake-build-system-modules
116 (guix build emacs-utils))
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")
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))
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)
141 (string-append (assoc-ref inputs "tzdata")
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")))
152 (rename-file orig-dir dest-dir)
153 (emacs-generate-autoloads ,name dest-dir))
164 `(("emacs" ,emacs-minimal)
166 ("texinfo" ,texinfo)))
167 (home-page "http://ledger-cli.org/")
168 (synopsis "Command-line double-entry accounting program")
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.
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/*
194 (define-public geierlein
201 (uri (string-append "https://github.com/stesie/geierlein"
202 "/archive/V" version ".tar.gz"))
203 (file-name (string-append name "-" version ".tar.gz"))
206 "0b11fq8v5w8nxjb20jl4dsfhv76xky6n3sq3k3fbb0m2sq9ikikw"))))
207 (build-system gnu-build-system)
209 `(#:tests? #f ; would require npm, python and a lot more
211 (modify-phases %standard-phases
213 (add-after 'unpack 'override-target-directory-and-tool-paths
214 (lambda* (#:key inputs outputs #:allow-other-keys)
215 (substitute* "Makefile"
217 (string-append "prefix := " (assoc-ref outputs "out") "\n"))
218 ;; Required for tests, unused for now:
220 ;; (string-append (which "python") "\n")))
222 (string-append "INSTALL := " (which "install") "\n")))
223 (substitute* "bin/xgeierlein.in"
224 ;; Use icecat as XULRUNNER
226 (string-append "XULRUNNER=" (which "icecat") "\n"
230 `(("icecat" ,icecat)))
231 (home-page "http://stesie.github.io/geierlein/")
232 (synopsis "Free Elster client, for sending Germany VAT declarations")
234 "Geierlein is a free Elster client, i.e. an application that
235 allows to send VAT declarations to Germany's fiscal authorities.
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
242 (license license:agpl3+)))