Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / hyperledger.scm
CommitLineData
98355069
PN
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
cf311790 3;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
98355069
PN
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages hyperledger)
21 #:use-module (ice-9 match)
22 #:use-module (guix build-system go)
23 #:use-module (guix build-system trivial)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix licenses)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages curl)
31 #:use-module (gnu packages docker)
32 #:use-module (gnu packages golang)
33 #:use-module (gnu packages version-control))
34
35(define-public hyperledger-fabric
36 (package
37 (name "hyperledger-fabric")
cf311790 38 (version "1.4.0")
98355069
PN
39 ;; While the GitHub repository is supposed to be "just a mirror," the Go
40 ;; imports refer to it explicitly.
41 (home-page "https://github.com/hyperledger/fabric")
42 (source (origin
43 (method git-fetch)
44 (uri (git-reference
45 (url home-page)
cf311790
TGR
46 ;; ‘release-…’ are branches, and move. ‘v…’ are the tags.
47 (commit (string-append "v" version))))
98355069
PN
48 (sha256
49 (base32
cf311790 50 "0nmg24ishwddxm1i2vh5ah5ylmmcg0apnjbgv1hljvhl48k4pzxq"))
98355069
PN
51 (file-name (git-file-name name version))))
52 (build-system go-build-system)
53 (native-inputs
54 `(("which" ,which)
55 ("docker-cli" ,docker-cli)
56 ("git" ,git)
57 ("curl" ,curl)))
58 (arguments
59 `(#:import-path "github.com/hyperledger/fabric"
60 #:unpack-path "github.com/hyperledger/fabric"
61 ;; We don't need to install the source code for end-user applications.
62 #:install-source? #f
63 ;; TODO: Tests require a running Docker daemon.
64 #:tests? #f
65 #:phases
66 (modify-phases %standard-phases
67 (replace 'build
68 (lambda _
69 ;; Only linux-amd64 and linux-ppc64le seem to be supported at the moment.
2b613a1a
PN
70 (invoke "make"
71 "-j" (number->string (parallel-job-count))
72 "-C" "src/github.com/hyperledger/fabric"
98355069
PN
73 "release/linux-amd64")))
74 (add-after 'install 'install-commands
75 (lambda* (#:key outputs #:allow-other-keys)
76 (let ((out (assoc-ref outputs "out"))
77 (src "src/github.com/hyperledger/fabric/"))
78 (with-directory-excursion src
79 (copy-recursively
80 "release/linux-amd64/bin"
81 (string-append out "/bin"))
82 (install-file "LICENSE"
83 (string-append out "/share/licenses"))
84 (install-file "README.md"
85 (string-append out "/share/doc"))
86 (copy-recursively "sampleconfig"
87 (string-append out "/etc/hyperledger/fabric"))))
88 #t)))))
2b613a1a 89 (supported-systems '("x86_64-linux"))
98355069 90 (synopsis "Platform for distributed ledger solutions")
2b613a1a
PN
91 (description "Hyperledger Fabric is a platform for distributed ledger
92solutions, underpinned by a modular architecture focusing on confidentiality
93and resiliency. It is designed to support pluggable implementations of
94different components.")
98355069 95 (license asl2.0)))