Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / protobuf.scm
CommitLineData
14d17788
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
8d63ddda
DP
3;;; Copyright © 2016 Daniel Pimentel <d4n1@d4n1.org>
4;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
dd12d4aa 5;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
c9ec726c 6;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
14d17788
LC
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages protobuf)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
8d63ddda 27 #:use-module (guix build-system python)
7e685dee 28 #:use-module ((guix licenses) #:prefix license:)
8d63ddda
DP
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages gcc)
7d9935b4 31 #:use-module (gnu packages libevent)
bfd07331 32 #:use-module (gnu packages pkg-config)
8d63ddda 33 #:use-module (gnu packages python))
14d17788 34
7d9935b4
TGR
35(define-public fstrm
36 (package
37 (name "fstrm")
38 (version "0.3.2")
39 (source
40 (origin
41 (method url-fetch)
42 (uri (string-append "https://dl.farsightsecurity.com/dist/" name "/"
43 name "-" version ".tar.gz"))
44 (sha256
45 (base32
46 "1i9y8a1712aj80p5a1kcp378bnjrg3s2127q7304hklhmjcrjl1d"))))
47 (build-system gnu-build-system)
48 (native-inputs
49 `(("pkg-config" ,pkg-config)))
50 (inputs
51 `(("libevent" ,libevent)))
52 (home-page "https://github.com/farsightsec/fstrm")
53 (synopsis "Implementation of the Frame Streams data transport protocol")
54 (description
55 "fstrm is an optimised implementation of Frame Streams as a C library and
56several tools built on top of it.
57
58@dfn{Frame Streams} is a light-weight, binary-clean protocol that allows for
59the transport of arbitrarily-encoded data payload sequences with minimal
60framing overhead---just four bytes per data frame. It does not specify an
61encoding format for these data frames and can be used with any data
62serialisation format that produces byte sequences, such as Protocol Buffers,
63XML, JSON, MessagePack, YAML, etc.
64
65Frame Streams can be used either as a streaming transport over a reliable byte
66stream socket (TCP sockets, TLS connections, @code{AF_UNIX} sockets, etc.) for
67data in motion, or as a file format for data at rest.")
7e685dee
TGR
68 (license (list license:asl2.0
69 (license:non-copyleft #f "See libmy/argv*")))))
7d9935b4 70
14d17788
LC
71(define-public protobuf
72 (package
73 (name "protobuf")
66e86f26 74 (version "3.5.1")
14d17788
LC
75 (source (origin
76 (method url-fetch)
de30a6e0 77 (uri (string-append "https://github.com/google/protobuf/releases/"
dd12d4aa
RW
78 "download/v" version "/protobuf-cpp-"
79 version ".tar.gz"))
14d17788
LC
80 (sha256
81 (base32
66e86f26 82 "14j0427ykjzrd9a66c2mpk0sjcccjlsx6q8ww6hzwb6sha3vm3f2"))))
14d17788
LC
83 (build-system gnu-build-system)
84 (inputs `(("zlib" ,zlib)))
ffe7eee5
TGR
85 (outputs (list "out"
86 "static")) ; ~12 MiB of .a files
87 (arguments
88 `(#:phases
89 (modify-phases %standard-phases
90 (add-after 'install 'move-static-libraries
91 (lambda* (#:key outputs #:allow-other-keys)
92 ;; Move static libraries to the "static" output.
93 (let* ((out (assoc-ref outputs "out"))
94 (lib (string-append out "/lib"))
95 (static (assoc-ref outputs "static"))
96 (slib (string-append static "/lib")))
97 (mkdir-p slib)
98 (for-each (lambda (file)
99 (install-file file slib)
100 (delete-file file))
101 (find-files lib "\\.a$"))
102 #t))))))
3b0ac795 103 (home-page "https://github.com/google/protobuf")
14d17788
LC
104 (synopsis "Data encoding for remote procedure calls (RPCs)")
105 (description
106 "Protocol Buffers are a way of encoding structured data in an efficient
107yet extensible format. Google uses Protocol Buffers for almost all of its
108internal RPC protocols and file formats.")
7e685dee 109 (license license:bsd-3)))
8d63ddda 110
fa9ac83e
TGR
111;; XXX Remove this old version when no other packages depend on it.
112(define-public protobuf-2
113 (package (inherit protobuf)
114 (version "2.6.1")
115 (source (origin
116 (method url-fetch)
117 (uri (string-append "https://github.com/google/protobuf/releases/"
118 "download/v" version "/protobuf-"
119 version ".tar.bz2"))
120 (sha256
121 (base32
122 "040rcs9fpv4bslhiy43v7dcrzakz4vwwpyqg4jp8bn24sl95ci7f"))))))
123
bfd07331
RW
124(define-public protobuf-c
125 (package
126 (name "protobuf-c")
127 (version "1.3.0")
128 (source (origin
129 (method url-fetch)
130 (uri (string-append "https://github.com/protobuf-c/protobuf-c/"
131 "releases/download/v" version
132 "/protobuf-c-" version ".tar.gz"))
133 (sha256
134 (base32
135 "18aj4xfv26zjmj44zbb01wk90jl7y4aj5xvbzz4gg748kdxavjax"))))
136 (build-system gnu-build-system)
137 (inputs `(("protobuf" ,protobuf)))
138 (native-inputs `(("pkg-config" ,pkg-config)))
139 (home-page "https://github.com/protobuf-c/protobuf-c")
140 (synopsis "Protocol Buffers implementation in C")
141 (description
142 "This is protobuf-c, a C implementation of the Google Protocol Buffers
143data serialization format. It includes @code{libprotobuf-c}, a pure C library
144that implements protobuf encoding and decoding, and @code{protoc-c}, a code
145generator that converts Protocol Buffer @code{.proto} files to C descriptor
146code.")
7e685dee 147 (license license:bsd-2)))
bfd07331 148
8d63ddda
DP
149(define-public python-protobuf
150 (package
151 (name "python-protobuf")
c9ec726c 152 (version "3.5.2")
8d63ddda
DP
153 (source
154 (origin
155 (method url-fetch)
156 (uri (pypi-uri "protobuf" version))
157 (sha256
158 (base32
c9ec726c 159 "1q4b1m55w4gvcbzklbk8iylaii98n4in41k27d94w8ypbwlrm1q9"))))
8d63ddda 160 (build-system python-build-system)
f22efa01 161 (propagated-inputs
8d63ddda
DP
162 `(("python-six" ,python-six)))
163 (home-page "https://github.com/google/protobuf")
164 (synopsis "Protocol buffers is a data interchange format")
165 (description
166 "Protocol buffers are a language-neutral, platform-neutral extensible
167mechanism for serializing structured data.")
7e685dee 168 (license license:bsd-3)))
8d63ddda
DP
169
170(define-public python2-protobuf
5c31f4aa 171 (package-with-python2 python-protobuf))