Commit | Line | Data |
---|---|---|
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> | |
c22c803e | 5 | ;;; Copyright © 2017, 2018 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) |
44d10b1f RW |
33 | #:use-module (gnu packages python) |
34 | #:use-module (gnu packages python-xyz)) | |
14d17788 | 35 | |
7d9935b4 TGR |
36 | (define-public fstrm |
37 | (package | |
38 | (name "fstrm") | |
39 | (version "0.3.2") | |
40 | (source | |
41 | (origin | |
42 | (method url-fetch) | |
43 | (uri (string-append "https://dl.farsightsecurity.com/dist/" name "/" | |
44 | name "-" version ".tar.gz")) | |
45 | (sha256 | |
46 | (base32 | |
47 | "1i9y8a1712aj80p5a1kcp378bnjrg3s2127q7304hklhmjcrjl1d")))) | |
48 | (build-system gnu-build-system) | |
49 | (native-inputs | |
50 | `(("pkg-config" ,pkg-config))) | |
51 | (inputs | |
52 | `(("libevent" ,libevent))) | |
53 | (home-page "https://github.com/farsightsec/fstrm") | |
54 | (synopsis "Implementation of the Frame Streams data transport protocol") | |
55 | (description | |
56 | "fstrm is an optimised implementation of Frame Streams as a C library and | |
57 | several tools built on top of it. | |
58 | ||
59 | @dfn{Frame Streams} is a light-weight, binary-clean protocol that allows for | |
60 | the transport of arbitrarily-encoded data payload sequences with minimal | |
61 | framing overhead---just four bytes per data frame. It does not specify an | |
62 | encoding format for these data frames and can be used with any data | |
63 | serialisation format that produces byte sequences, such as Protocol Buffers, | |
64 | XML, JSON, MessagePack, YAML, etc. | |
65 | ||
66 | Frame Streams can be used either as a streaming transport over a reliable byte | |
67 | stream socket (TCP sockets, TLS connections, @code{AF_UNIX} sockets, etc.) for | |
68 | data in motion, or as a file format for data at rest.") | |
7e685dee TGR |
69 | (license (list license:asl2.0 |
70 | (license:non-copyleft #f "See libmy/argv*"))))) | |
7d9935b4 | 71 | |
14d17788 LC |
72 | (define-public protobuf |
73 | (package | |
74 | (name "protobuf") | |
66e86f26 | 75 | (version "3.5.1") |
14d17788 LC |
76 | (source (origin |
77 | (method url-fetch) | |
de30a6e0 | 78 | (uri (string-append "https://github.com/google/protobuf/releases/" |
dd12d4aa RW |
79 | "download/v" version "/protobuf-cpp-" |
80 | version ".tar.gz")) | |
14d17788 LC |
81 | (sha256 |
82 | (base32 | |
66e86f26 | 83 | "14j0427ykjzrd9a66c2mpk0sjcccjlsx6q8ww6hzwb6sha3vm3f2")))) |
14d17788 LC |
84 | (build-system gnu-build-system) |
85 | (inputs `(("zlib" ,zlib))) | |
ffe7eee5 TGR |
86 | (outputs (list "out" |
87 | "static")) ; ~12 MiB of .a files | |
88 | (arguments | |
89 | `(#:phases | |
90 | (modify-phases %standard-phases | |
91 | (add-after 'install 'move-static-libraries | |
92 | (lambda* (#:key outputs #:allow-other-keys) | |
93 | ;; Move static libraries to the "static" output. | |
94 | (let* ((out (assoc-ref outputs "out")) | |
95 | (lib (string-append out "/lib")) | |
96 | (static (assoc-ref outputs "static")) | |
97 | (slib (string-append static "/lib"))) | |
98 | (mkdir-p slib) | |
99 | (for-each (lambda (file) | |
100 | (install-file file slib) | |
101 | (delete-file file)) | |
102 | (find-files lib "\\.a$")) | |
103 | #t)))))) | |
3b0ac795 | 104 | (home-page "https://github.com/google/protobuf") |
14d17788 LC |
105 | (synopsis "Data encoding for remote procedure calls (RPCs)") |
106 | (description | |
107 | "Protocol Buffers are a way of encoding structured data in an efficient | |
108 | yet extensible format. Google uses Protocol Buffers for almost all of its | |
109 | internal RPC protocols and file formats.") | |
7e685dee | 110 | (license license:bsd-3))) |
8d63ddda | 111 | |
c22c803e RW |
112 | (define-public protobuf-next |
113 | (package (inherit protobuf) | |
114 | (name "protobuf") | |
115 | (version "3.6.1") | |
116 | (source (origin | |
117 | (method url-fetch) | |
118 | (uri (string-append "https://github.com/google/protobuf/releases/" | |
119 | "download/v" version "/protobuf-cpp-" | |
120 | version ".tar.gz")) | |
121 | (sha256 | |
122 | (base32 | |
123 | "0a955bz59ihrb5wg7dwi12xajdi5pmz4bl0g147rbdwv393jwwxk")))))) | |
124 | ||
fa9ac83e TGR |
125 | ;; XXX Remove this old version when no other packages depend on it. |
126 | (define-public protobuf-2 | |
127 | (package (inherit protobuf) | |
128 | (version "2.6.1") | |
129 | (source (origin | |
130 | (method url-fetch) | |
131 | (uri (string-append "https://github.com/google/protobuf/releases/" | |
132 | "download/v" version "/protobuf-" | |
133 | version ".tar.bz2")) | |
134 | (sha256 | |
135 | (base32 | |
136 | "040rcs9fpv4bslhiy43v7dcrzakz4vwwpyqg4jp8bn24sl95ci7f")))))) | |
137 | ||
bfd07331 RW |
138 | (define-public protobuf-c |
139 | (package | |
140 | (name "protobuf-c") | |
4a6785f6 | 141 | (version "1.3.1") |
bfd07331 RW |
142 | (source (origin |
143 | (method url-fetch) | |
144 | (uri (string-append "https://github.com/protobuf-c/protobuf-c/" | |
145 | "releases/download/v" version | |
146 | "/protobuf-c-" version ".tar.gz")) | |
147 | (sha256 | |
148 | (base32 | |
4a6785f6 | 149 | "0rr2kn7804cvhdm6lzz04gz76vy0fzj15dijbr17nv8x34x2sisi")))) |
bfd07331 RW |
150 | (build-system gnu-build-system) |
151 | (inputs `(("protobuf" ,protobuf))) | |
152 | (native-inputs `(("pkg-config" ,pkg-config))) | |
153 | (home-page "https://github.com/protobuf-c/protobuf-c") | |
154 | (synopsis "Protocol Buffers implementation in C") | |
155 | (description | |
156 | "This is protobuf-c, a C implementation of the Google Protocol Buffers | |
157 | data serialization format. It includes @code{libprotobuf-c}, a pure C library | |
158 | that implements protobuf encoding and decoding, and @code{protoc-c}, a code | |
159 | generator that converts Protocol Buffer @code{.proto} files to C descriptor | |
160 | code.") | |
7e685dee | 161 | (license license:bsd-2))) |
bfd07331 | 162 | |
8d63ddda DP |
163 | (define-public python-protobuf |
164 | (package | |
165 | (name "python-protobuf") | |
c9ec726c | 166 | (version "3.5.2") |
8d63ddda DP |
167 | (source |
168 | (origin | |
169 | (method url-fetch) | |
170 | (uri (pypi-uri "protobuf" version)) | |
171 | (sha256 | |
172 | (base32 | |
c9ec726c | 173 | "1q4b1m55w4gvcbzklbk8iylaii98n4in41k27d94w8ypbwlrm1q9")))) |
8d63ddda | 174 | (build-system python-build-system) |
f22efa01 | 175 | (propagated-inputs |
8d63ddda DP |
176 | `(("python-six" ,python-six))) |
177 | (home-page "https://github.com/google/protobuf") | |
178 | (synopsis "Protocol buffers is a data interchange format") | |
179 | (description | |
180 | "Protocol buffers are a language-neutral, platform-neutral extensible | |
181 | mechanism for serializing structured data.") | |
7e685dee | 182 | (license license:bsd-3))) |
8d63ddda DP |
183 | |
184 | (define-public python2-protobuf | |
5c31f4aa | 185 | (package-with-python2 python-protobuf)) |