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