Commit | Line | Data |
---|---|---|
98355069 | 1 | ;;; GNU Guix --- Functional package management for GNU |
37109658 | 2 | ;;; Copyright © 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz> |
cf311790 | 3 | ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
04ff192e | 4 | ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il> |
98355069 PN |
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 hyperledger) | |
22 | #:use-module (ice-9 match) | |
04ff192e | 23 | #:use-module (guix build-system cmake) |
98355069 | 24 | #:use-module (guix build-system go) |
98355069 PN |
25 | #:use-module (guix packages) |
26 | #:use-module (guix download) | |
27 | #:use-module (guix git-download) | |
28 | #:use-module (guix licenses) | |
29 | #:use-module (gnu packages) | |
30 | #:use-module (gnu packages base) | |
04ff192e PN |
31 | #:use-module (gnu packages boost) |
32 | #:use-module (gnu packages check) | |
98355069 | 33 | #:use-module (gnu packages curl) |
04ff192e | 34 | #:use-module (gnu packages databases) |
98355069 PN |
35 | #:use-module (gnu packages docker) |
36 | #:use-module (gnu packages golang) | |
04ff192e PN |
37 | #:use-module (gnu packages logging) |
38 | #:use-module (gnu packages machine-learning) | |
39 | #:use-module (gnu packages popt) | |
40 | #:use-module (gnu packages pretty-print) | |
41 | #:use-module (gnu packages protobuf) | |
c61557b1 | 42 | #:use-module (gnu packages rpc) |
04ff192e PN |
43 | #:use-module (gnu packages tbb) |
44 | #:use-module (gnu packages version-control) | |
45 | #:use-module (gnu packages web)) | |
98355069 PN |
46 | |
47 | (define-public hyperledger-fabric | |
48 | (package | |
49 | (name "hyperledger-fabric") | |
cf311790 | 50 | (version "1.4.0") |
98355069 PN |
51 | ;; While the GitHub repository is supposed to be "just a mirror," the Go |
52 | ;; imports refer to it explicitly. | |
53 | (home-page "https://github.com/hyperledger/fabric") | |
54 | (source (origin | |
55 | (method git-fetch) | |
56 | (uri (git-reference | |
57 | (url home-page) | |
cf311790 TGR |
58 | ;; ‘release-…’ are branches, and move. ‘v…’ are the tags. |
59 | (commit (string-append "v" version)))) | |
98355069 PN |
60 | (sha256 |
61 | (base32 | |
cf311790 | 62 | "0nmg24ishwddxm1i2vh5ah5ylmmcg0apnjbgv1hljvhl48k4pzxq")) |
98355069 PN |
63 | (file-name (git-file-name name version)))) |
64 | (build-system go-build-system) | |
65 | (native-inputs | |
8394619b | 66 | (list which docker-cli git curl)) |
98355069 PN |
67 | (arguments |
68 | `(#:import-path "github.com/hyperledger/fabric" | |
69 | #:unpack-path "github.com/hyperledger/fabric" | |
70 | ;; We don't need to install the source code for end-user applications. | |
71 | #:install-source? #f | |
72 | ;; TODO: Tests require a running Docker daemon. | |
73 | #:tests? #f | |
74 | #:phases | |
75 | (modify-phases %standard-phases | |
76 | (replace 'build | |
77 | (lambda _ | |
78 | ;; Only linux-amd64 and linux-ppc64le seem to be supported at the moment. | |
2b613a1a PN |
79 | (invoke "make" |
80 | "-j" (number->string (parallel-job-count)) | |
81 | "-C" "src/github.com/hyperledger/fabric" | |
98355069 PN |
82 | "release/linux-amd64"))) |
83 | (add-after 'install 'install-commands | |
84 | (lambda* (#:key outputs #:allow-other-keys) | |
85 | (let ((out (assoc-ref outputs "out")) | |
86 | (src "src/github.com/hyperledger/fabric/")) | |
87 | (with-directory-excursion src | |
88 | (copy-recursively | |
89 | "release/linux-amd64/bin" | |
90 | (string-append out "/bin")) | |
91 | (install-file "LICENSE" | |
92 | (string-append out "/share/licenses")) | |
93 | (install-file "README.md" | |
94 | (string-append out "/share/doc")) | |
95 | (copy-recursively "sampleconfig" | |
96 | (string-append out "/etc/hyperledger/fabric")))) | |
97 | #t))))) | |
2b613a1a | 98 | (supported-systems '("x86_64-linux")) |
98355069 | 99 | (synopsis "Platform for distributed ledger solutions") |
2b613a1a PN |
100 | (description "Hyperledger Fabric is a platform for distributed ledger |
101 | solutions, underpinned by a modular architecture focusing on confidentiality | |
102 | and resiliency. It is designed to support pluggable implementations of | |
103 | different components.") | |
98355069 | 104 | (license asl2.0))) |
37109658 PN |
105 | |
106 | (define-public hyperledger-iroha-ed25519 | |
107 | (package | |
108 | (name "hyperledger-iroha-ed25519") | |
109 | (version "2.0.2") | |
110 | (home-page "https://github.com/hyperledger/iroha-ed25519") | |
111 | (source (origin | |
112 | (method git-fetch) | |
113 | (uri (git-reference | |
114 | (url home-page) | |
115 | (commit version))) | |
116 | (file-name (git-file-name name version)) | |
117 | (sha256 | |
118 | (base32 | |
119 | "0kr1zwah8mhnpfrpk3h6hdafyqdl3ixhs7czdfscqv6vxqfiabc4")))) | |
120 | (build-system cmake-build-system) | |
121 | (native-inputs | |
8394619b | 122 | (list googletest)) |
37109658 PN |
123 | (arguments |
124 | `(#:tests? #f ; Tests don't build because CMake cannot find GTest main. | |
125 | #:configure-flags '("-DHUNTER_ENABLED=OFF" | |
126 | "-DBUILD=SHARED" | |
127 | ;; TODO: x86_64 should use amd64-64-24k-pic but it | |
128 | ;; fails to link when built as a shared library. | |
129 | "-DEDIMPL=ref10" | |
130 | "-DHASH=sha3_brainhub"))) | |
131 | (synopsis "Ed25519 digital signature algorithm") | |
132 | (description "This repository aims to provide modularized implementation | |
133 | of the Ed25519 digital signature algorithm which is is described in | |
134 | RFC8032 (@url{https://tools.ietf.org/html/rfc8032}). | |
135 | ||
136 | Originally Ed25519 consists of three modules: | |
137 | ||
138 | @itemize | |
139 | @item digital signature algorithm itself | |
140 | @item SHA512 hash function | |
7230f6d5 | 141 | @item random number generator, to generate key pairs |
37109658 PN |
142 | @end itemize |
143 | ||
144 | This project offers at least two different C implementations for every | |
145 | module. Every implementation can be replaced with another one at | |
146 | link-time. New implementations can be added as well.") | |
147 | (license asl2.0))) | |
04ff192e PN |
148 | |
149 | (define-public hyperledger-iroha | |
150 | (package | |
151 | (name "hyperledger-iroha") | |
152 | (version "1.1.1") | |
153 | (home-page "https://github.com/hyperledger/iroha") | |
154 | (source (origin | |
155 | (method git-fetch) | |
156 | (uri (git-reference | |
157 | (url home-page) | |
158 | (commit version))) | |
159 | (file-name (git-file-name name version)) | |
160 | (sha256 | |
161 | (base32 | |
162 | "014mbwq059yxwihw0mq8zgns53fsw8ckczi1lw8q9pz3pk86pa9b")) | |
163 | (modules '((guix build utils))) | |
164 | (snippet | |
165 | '(begin | |
166 | ;; https://github.com/hyperledger/iroha/commit/4dc710d2e9a067af866771318f673c7392797e48 | |
167 | ;; Backport unversioned fmt dependency, remove next update: | |
168 | (substitute* "libs/logger/logger.hpp" | |
169 | (("fmt::v5") "fmt")) | |
170 | #t)))) | |
171 | (build-system cmake-build-system) | |
172 | (arguments | |
173 | `(#:configure-flags | |
174 | '("-DTESTING=OFF" ; The tests fail to link correctly to googletest. | |
175 | ;; Don't install the shared libraries of the dependencies: | |
176 | "-DENABLE_LIBS_PACKAGING=OFF") | |
177 | #:tests? #f | |
178 | ;; https://iroha.readthedocs.io/en/latest/build/index.html#running-tests-optional | |
179 | #:test-target ".")) | |
180 | ;; https://github.com/hyperledger/iroha/blob/master/vcpkg/VCPKG_DEPS_LIST | |
181 | (native-inputs | |
8394619b | 182 | (list fmt googletest rapidjson rxcpp spdlog)) |
04ff192e | 183 | (inputs |
8394619b LC |
184 | (list boost |
185 | gflags | |
186 | grpc-1.16.1 | |
187 | hyperledger-iroha-ed25519 | |
188 | postgresql | |
189 | protobuf | |
190 | soci | |
191 | tbb)) | |
04ff192e PN |
192 | (synopsis "Simple, decentralized ledger") |
193 | (description "Iroha is a distributed ledger technology (DLT). Iroha has | |
194 | essential functionality for your asset, information and identity management | |
195 | needs, at the same time being a crash fault-tolerant tool. | |
196 | ||
197 | Iroha has the following features: | |
198 | ||
199 | @itemize | |
200 | @item Creation and management of custom fungible assets, such as currencies, | |
201 | kilos of gold, etc. | |
202 | @item Management of user accounts | |
203 | @item Taxonomy of accounts based on domains in the system | |
204 | @item The system of rights and verification of user permissions for the | |
205 | execution of transactions and queries in the system | |
206 | @item Validation of business rules for transactions and queries in the system | |
207 | @item Multisignature transactions | |
208 | @end itemize\n") | |
209 | (license asl2.0))) |