summaryrefslogtreecommitdiff
path: root/gnu/packages/hyperledger.scm
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2019-02-21 19:07:09 +0100
committerPierre Neidhardt <mail@ambrevar.xyz>2019-03-09 10:15:46 +0100
commit983550692dbf5a41afef1b1cae53fece42b3d4bf (patch)
tree506773c3745abcd013de5511d208106826d4e5d3 /gnu/packages/hyperledger.scm
parent373abfb3985ea85bc574d707764ac739987c022c (diff)
gnu: Add hyperledger-fabric.
* gnu/local.mk (hyperledger): New variable.
Diffstat (limited to 'gnu/packages/hyperledger.scm')
-rw-r--r--gnu/packages/hyperledger.scm89
1 files changed, 89 insertions, 0 deletions
diff --git a/gnu/packages/hyperledger.scm b/gnu/packages/hyperledger.scm
new file mode 100644
index 00000000000..5f8b7828187
--- /dev/null
+++ b/gnu/packages/hyperledger.scm
@@ -0,0 +1,89 @@
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages hyperledger)
20 #:use-module (ice-9 match)
21 #:use-module (guix build-system go)
22 #:use-module (guix build-system trivial)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix licenses)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages curl)
30 #:use-module (gnu packages docker)
31 #:use-module (gnu packages golang)
32 #:use-module (gnu packages version-control))
33
34(define-public hyperledger-fabric
35 (package
36 (name "hyperledger-fabric")
37 (version "1.4")
38 ;; While the GitHub repository is supposed to be "just a mirror," the Go
39 ;; imports refer to it explicitly.
40 (home-page "https://github.com/hyperledger/fabric")
41 (source (origin
42 (method git-fetch)
43 (uri (git-reference
44 (url home-page)
45 (commit (string-append "release-" version))))
46 (sha256
47 (base32
48 "1g003wf6439f2c9i2vphf4sh463yyasq1vpqmkpw9lj170a6kl8k"))
49 (file-name (git-file-name name version))))
50 (build-system go-build-system)
51 (native-inputs
52 `(("which" ,which)
53 ("docker-cli" ,docker-cli)
54 ("git" ,git)
55 ("curl" ,curl)))
56 (arguments
57 `(#:import-path "github.com/hyperledger/fabric"
58 #:unpack-path "github.com/hyperledger/fabric"
59 ;; We don't need to install the source code for end-user applications.
60 #:install-source? #f
61 ;; TODO: Tests require a running Docker daemon.
62 #:tests? #f
63 #:phases
64 (modify-phases %standard-phases
65 (replace 'build
66 (lambda _
67 ;; Only linux-amd64 and linux-ppc64le seem to be supported at the moment.
68 (invoke "make" "-C" "src/github.com/hyperledger/fabric"
69 "release/linux-amd64")))
70 (add-after 'install 'install-commands
71 (lambda* (#:key outputs #:allow-other-keys)
72 (let ((out (assoc-ref outputs "out"))
73 (src "src/github.com/hyperledger/fabric/"))
74 (with-directory-excursion src
75 (copy-recursively
76 "release/linux-amd64/bin"
77 (string-append out "/bin"))
78 (install-file "LICENSE"
79 (string-append out "/share/licenses"))
80 (install-file "README.md"
81 (string-append out "/share/doc"))
82 (copy-recursively "sampleconfig"
83 (string-append out "/etc/hyperledger/fabric"))))
84 #t)))))
85 (synopsis "Platform for distributed ledger solutions")
86 (description "A platform for distributed ledger solutions, underpinned by
87a modular architecture delivering high degrees of confidentiality, resiliency,
88flexibility and scalability.")
89 (license asl2.0)))