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> | |
1eeae57b | 5 | ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net> |
599d0190 | 6 | ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
d59c84f5 | 7 | ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
ba4d96d2 | 8 | ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net> |
a90cf896 | 9 | ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org> |
14d17788 LC |
10 | ;;; |
11 | ;;; This file is part of GNU Guix. | |
12 | ;;; | |
13 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
14 | ;;; under the terms of the GNU General Public License as published by | |
15 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
16 | ;;; your option) any later version. | |
17 | ;;; | |
18 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
19 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | ;;; GNU General Public License for more details. | |
22 | ;;; | |
23 | ;;; You should have received a copy of the GNU General Public License | |
24 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
25 | ||
26 | (define-module (gnu packages protobuf) | |
27 | #:use-module (guix packages) | |
28 | #:use-module (guix download) | |
dc8621a2 TGR |
29 | #:use-module (guix git-download) |
30 | #:use-module (guix build-system cmake) | |
14d17788 | 31 | #:use-module (guix build-system gnu) |
8d63ddda | 32 | #:use-module (guix build-system python) |
d78bfd27 | 33 | #:use-module (guix build-system emacs) |
d59c84f5 | 34 | #:use-module (guix build-system ruby) |
7e685dee | 35 | #:use-module ((guix licenses) #:prefix license:) |
6f1784fa | 36 | #:use-module (guix utils) |
8d63ddda | 37 | #:use-module (gnu packages compression) |
6f1784fa | 38 | #:use-module (gnu packages check) |
8d63ddda | 39 | #:use-module (gnu packages gcc) |
7d9935b4 | 40 | #:use-module (gnu packages libevent) |
bfd07331 | 41 | #:use-module (gnu packages pkg-config) |
44d10b1f | 42 | #:use-module (gnu packages python) |
dbcd2050 | 43 | #:use-module (gnu packages python-build) |
6f1784fa | 44 | #:use-module (gnu packages python-check) |
d59c84f5 MC |
45 | #:use-module (gnu packages python-xyz) |
46 | #:use-module (gnu packages ruby)) | |
14d17788 | 47 | |
7d9935b4 TGR |
48 | (define-public fstrm |
49 | (package | |
50 | (name "fstrm") | |
51 | (version "0.3.2") | |
52 | (source | |
53 | (origin | |
54 | (method url-fetch) | |
55 | (uri (string-append "https://dl.farsightsecurity.com/dist/" name "/" | |
56 | name "-" version ".tar.gz")) | |
57 | (sha256 | |
58 | (base32 | |
59 | "1i9y8a1712aj80p5a1kcp378bnjrg3s2127q7304hklhmjcrjl1d")))) | |
60 | (build-system gnu-build-system) | |
61 | (native-inputs | |
62 | `(("pkg-config" ,pkg-config))) | |
63 | (inputs | |
64 | `(("libevent" ,libevent))) | |
65 | (home-page "https://github.com/farsightsec/fstrm") | |
66 | (synopsis "Implementation of the Frame Streams data transport protocol") | |
67 | (description | |
68 | "fstrm is an optimised implementation of Frame Streams as a C library and | |
69 | several tools built on top of it. | |
70 | ||
71 | @dfn{Frame Streams} is a light-weight, binary-clean protocol that allows for | |
72 | the transport of arbitrarily-encoded data payload sequences with minimal | |
73 | framing overhead---just four bytes per data frame. It does not specify an | |
74 | encoding format for these data frames and can be used with any data | |
75 | serialisation format that produces byte sequences, such as Protocol Buffers, | |
76 | XML, JSON, MessagePack, YAML, etc. | |
77 | ||
78 | Frame Streams can be used either as a streaming transport over a reliable byte | |
79 | stream socket (TCP sockets, TLS connections, @code{AF_UNIX} sockets, etc.) for | |
80 | data in motion, or as a file format for data at rest.") | |
7e685dee TGR |
81 | (license (list license:asl2.0 |
82 | (license:non-copyleft #f "See libmy/argv*"))))) | |
7d9935b4 | 83 | |
14d17788 LC |
84 | (define-public protobuf |
85 | (package | |
86 | (name "protobuf") | |
a90cf896 | 87 | (version "3.14.0") |
14d17788 LC |
88 | (source (origin |
89 | (method url-fetch) | |
de30a6e0 | 90 | (uri (string-append "https://github.com/google/protobuf/releases/" |
dd12d4aa RW |
91 | "download/v" version "/protobuf-cpp-" |
92 | version ".tar.gz")) | |
14d17788 LC |
93 | (sha256 |
94 | (base32 | |
a90cf896 | 95 | "0nan2wkkwkcx3qyx0cf5vfzjcjhr5qgh4jfx6v2lwpf5q03mmv2h")))) |
14d17788 LC |
96 | (build-system gnu-build-system) |
97 | (inputs `(("zlib" ,zlib))) | |
ffe7eee5 TGR |
98 | (outputs (list "out" |
99 | "static")) ; ~12 MiB of .a files | |
100 | (arguments | |
101 | `(#:phases | |
102 | (modify-phases %standard-phases | |
103 | (add-after 'install 'move-static-libraries | |
104 | (lambda* (#:key outputs #:allow-other-keys) | |
105 | ;; Move static libraries to the "static" output. | |
106 | (let* ((out (assoc-ref outputs "out")) | |
107 | (lib (string-append out "/lib")) | |
108 | (static (assoc-ref outputs "static")) | |
109 | (slib (string-append static "/lib"))) | |
110 | (mkdir-p slib) | |
111 | (for-each (lambda (file) | |
112 | (install-file file slib) | |
113 | (delete-file file)) | |
114 | (find-files lib "\\.a$")) | |
115 | #t)))))) | |
3b0ac795 | 116 | (home-page "https://github.com/google/protobuf") |
14d17788 LC |
117 | (synopsis "Data encoding for remote procedure calls (RPCs)") |
118 | (description | |
119 | "Protocol Buffers are a way of encoding structured data in an efficient | |
120 | yet extensible format. Google uses Protocol Buffers for almost all of its | |
121 | internal RPC protocols and file formats.") | |
7e685dee | 122 | (license license:bsd-3))) |
8d63ddda | 123 | |
7373eb83 MB |
124 | ;; Tensorflow requires version 3.6 specifically. |
125 | (define-public protobuf-3.6 | |
126 | (package/inherit protobuf | |
c22c803e RW |
127 | (version "3.6.1") |
128 | (source (origin | |
129 | (method url-fetch) | |
130 | (uri (string-append "https://github.com/google/protobuf/releases/" | |
131 | "download/v" version "/protobuf-cpp-" | |
132 | version ".tar.gz")) | |
133 | (sha256 | |
134 | (base32 | |
135 | "0a955bz59ihrb5wg7dwi12xajdi5pmz4bl0g147rbdwv393jwwxk")))))) | |
136 | ||
7373eb83 MB |
137 | ;; The 3.5 series are the last versions that do not require C++ 11. |
138 | (define-public protobuf-3.5 | |
139 | (package/inherit | |
140 | protobuf | |
141 | (version "3.5.1") | |
142 | (source (origin | |
143 | (method url-fetch) | |
144 | (uri (string-append "https://github.com/google/protobuf/releases/" | |
145 | "download/v" version "/protobuf-cpp-" | |
146 | version ".tar.gz")) | |
147 | (sha256 | |
148 | (base32 | |
149 | "14j0427ykjzrd9a66c2mpk0sjcccjlsx6q8ww6hzwb6sha3vm3f2")))))) | |
150 | ||
fa9ac83e TGR |
151 | ;; XXX Remove this old version when no other packages depend on it. |
152 | (define-public protobuf-2 | |
153 | (package (inherit protobuf) | |
154 | (version "2.6.1") | |
155 | (source (origin | |
156 | (method url-fetch) | |
157 | (uri (string-append "https://github.com/google/protobuf/releases/" | |
158 | "download/v" version "/protobuf-" | |
159 | version ".tar.bz2")) | |
160 | (sha256 | |
161 | (base32 | |
162 | "040rcs9fpv4bslhiy43v7dcrzakz4vwwpyqg4jp8bn24sl95ci7f")))))) | |
163 | ||
bfd07331 RW |
164 | (define-public protobuf-c |
165 | (package | |
166 | (name "protobuf-c") | |
e68ae709 | 167 | (version "1.3.3") |
bfd07331 RW |
168 | (source (origin |
169 | (method url-fetch) | |
170 | (uri (string-append "https://github.com/protobuf-c/protobuf-c/" | |
171 | "releases/download/v" version | |
172 | "/protobuf-c-" version ".tar.gz")) | |
173 | (sha256 | |
174 | (base32 | |
e68ae709 | 175 | "0y3yaanq97si7iyld06p8w20m0shpj7sf4xwzbhhvijhxw36d592")))) |
bfd07331 RW |
176 | (build-system gnu-build-system) |
177 | (inputs `(("protobuf" ,protobuf))) | |
178 | (native-inputs `(("pkg-config" ,pkg-config))) | |
179 | (home-page "https://github.com/protobuf-c/protobuf-c") | |
180 | (synopsis "Protocol Buffers implementation in C") | |
181 | (description | |
182 | "This is protobuf-c, a C implementation of the Google Protocol Buffers | |
183 | data serialization format. It includes @code{libprotobuf-c}, a pure C library | |
184 | that implements protobuf encoding and decoding, and @code{protoc-c}, a code | |
185 | generator that converts Protocol Buffer @code{.proto} files to C descriptor | |
186 | code.") | |
7e685dee | 187 | (license license:bsd-2))) |
bfd07331 | 188 | |
dc8621a2 TGR |
189 | (define-public protozero |
190 | (package | |
191 | (name "protozero") | |
599d0190 | 192 | (version "1.6.8") |
dc8621a2 TGR |
193 | (source |
194 | (origin | |
195 | (method git-fetch) | |
196 | (uri (git-reference | |
b0e7b699 | 197 | (url "https://github.com/mapbox/protozero") |
dc8621a2 TGR |
198 | (commit (string-append "v" version)))) |
199 | (file-name (git-file-name name version)) | |
200 | (sha256 | |
599d0190 | 201 | (base32 "1hfijpfylf1c71wa3mk70gjc88b6k1q7cxb87cwqdflw5q2x8ma6")))) |
dc8621a2 TGR |
202 | (build-system cmake-build-system) |
203 | (home-page "https://github.com/mapbox/protozero") | |
204 | (synopsis "Minimalistic protocol buffer decoder and encoder in C++") | |
205 | (description "Protozero is a minimalistic protocol buffer decoder and | |
206 | encoder in C++. The developer using protozero has to manually translate the | |
207 | @file{.proto} description into code.") | |
208 | (license (list | |
209 | license:asl2.0 ; for folly | |
210 | license:bsd-2)))) | |
211 | ||
8d63ddda DP |
212 | (define-public python-protobuf |
213 | (package | |
214 | (name "python-protobuf") | |
ba4d96d2 | 215 | (version "3.12.4") |
8d63ddda DP |
216 | (source |
217 | (origin | |
218 | (method url-fetch) | |
219 | (uri (pypi-uri "protobuf" version)) | |
220 | (sha256 | |
221 | (base32 | |
ba4d96d2 | 222 | "0mj6z58aiw532s1mq48m9xdrm3gdyp2vv9cdinfb5wmnfpm5m7n9")))) |
8d63ddda | 223 | (build-system python-build-system) |
ba4d96d2 VM |
224 | (native-inputs |
225 | `(("python-wheel" ,python-wheel))) | |
f22efa01 | 226 | (propagated-inputs |
8d63ddda DP |
227 | `(("python-six" ,python-six))) |
228 | (home-page "https://github.com/google/protobuf") | |
229 | (synopsis "Protocol buffers is a data interchange format") | |
230 | (description | |
231 | "Protocol buffers are a language-neutral, platform-neutral extensible | |
232 | mechanism for serializing structured data.") | |
7e685dee | 233 | (license license:bsd-3))) |
8d63ddda | 234 | |
6f1784fa LP |
235 | (define-public python-pure-protobuf |
236 | (package | |
237 | (name "python-pure-protobuf") | |
7a0491ad | 238 | (version "2.0.1") |
6f1784fa LP |
239 | (source |
240 | (origin | |
7a0491ad | 241 | ;; The PyPI tarball is broken: it has no tests. |
6f1784fa LP |
242 | (method git-fetch) |
243 | (uri (git-reference | |
244 | (url "https://github.com/eigenein/protobuf") | |
245 | (commit version))) | |
246 | (file-name (git-file-name name version)) | |
247 | (sha256 | |
7a0491ad | 248 | (base32 "15dp5pvazd0jx4wzzh79080ah7hkpd3axh40al9vhzs2hf3v90hx")))) |
6f1784fa LP |
249 | (build-system python-build-system) |
250 | (native-inputs | |
251 | `(("python-flake8" ,python-flake8) | |
252 | ("python-pytest" ,python-pytest) | |
253 | ("python-pytest-cov" ,python-pytest-cov) | |
254 | ("python-isort" ,python-isort))) | |
255 | (arguments | |
256 | `(#:phases | |
257 | (modify-phases %standard-phases | |
258 | (add-before 'check 'setup-test-env | |
259 | (lambda* (#:key outputs #:allow-other-keys) | |
260 | (let* ((out (assoc-ref outputs "out")) | |
261 | (py3sitedir | |
262 | (string-append out "/lib/python" | |
263 | ,(version-major+minor | |
264 | (package-version python)) | |
265 | "/site-packages"))) | |
266 | (setenv "PYTHONPATH" | |
267 | (string-append py3sitedir ":" | |
268 | (getenv "PYTHONPATH")))) | |
269 | #t)) | |
270 | (replace 'check | |
271 | (lambda _ | |
272 | (invoke "pytest" "--cov-report" "term-missing" "--cov" | |
273 | "pure_protobuf") | |
274 | (invoke "flake8" "pure_protobuf" "tests" | |
275 | "--ignore=F541") | |
276 | (invoke "isort" "-rc" "-c" "pure_protobuf" "tests") | |
277 | #t))))) | |
278 | (home-page "https://pypi.org/project/pure-protobuf/") | |
279 | (synopsis "Protobuf implementation using dataclasses") | |
280 | (description | |
81fe5863 | 281 | "@code{python-pure-protobuf} takes advantage of the standard |
6f1784fa LP |
282 | dataclasses module to define message types. Protocol buffers are a |
283 | language-neutral, platform-neutral extensible mechanism for serializing | |
284 | structured data.") | |
285 | (license license:expat))) | |
286 | ||
8d63ddda | 287 | (define-public python2-protobuf |
5c31f4aa | 288 | (package-with-python2 python-protobuf)) |
d78bfd27 | 289 | |
7373eb83 MB |
290 | ;; For tensorflow. |
291 | (define-public python-protobuf-3.6 | |
292 | (package/inherit python-protobuf | |
1eeae57b | 293 | (name "python-protobuf") |
7373eb83 | 294 | (version (package-version protobuf-3.6) ) |
1eeae57b RW |
295 | (source |
296 | (origin | |
297 | (method url-fetch) | |
298 | (uri (pypi-uri "protobuf" version)) | |
299 | (sha256 | |
300 | (base32 | |
301 | "04bqb12smlckzmgkj6vgmpbr3cby0n6726cmz33bqr7kn1vb728l")))))) | |
302 | ||
d78bfd27 CZ |
303 | (define-public emacs-protobuf-mode |
304 | (package | |
305 | (name "emacs-protobuf-mode") | |
306 | (version (package-version protobuf)) | |
307 | (source (package-source protobuf)) | |
308 | (build-system emacs-build-system) | |
309 | (arguments | |
310 | `(#:phases | |
311 | (modify-phases %standard-phases | |
63edbb65 | 312 | (add-before 'add-source-to-load-path 'change-working-directory |
d78bfd27 CZ |
313 | (lambda _ (chdir "editors") #t))))) |
314 | (home-page "https://github.com/protocolbuffers/protobuf") | |
315 | (synopsis "Protocol buffers major mode for Emacs") | |
316 | (description | |
317 | "This package provides an Emacs major mode for editing Protocol Buffer | |
318 | source files.") | |
319 | (license license:bsd-3))) | |
d59c84f5 MC |
320 | |
321 | (define-public ruby-protobuf | |
322 | (package | |
323 | (name "ruby-protobuf") | |
324 | (version "3.10.3") | |
325 | (source (origin | |
326 | (method git-fetch) | |
327 | (uri (git-reference | |
b0e7b699 | 328 | (url "https://github.com/ruby-protobuf/protobuf") |
d59c84f5 MC |
329 | (commit (string-append "v" version)))) |
330 | (file-name (git-file-name name version)) | |
331 | (sha256 | |
332 | (base32 | |
333 | "1yzz7jgpp6qip5d6qhzbkf5gqaydfk3z3c1ngccwzp6w6wa75g8a")))) | |
334 | (build-system ruby-build-system) | |
335 | (arguments | |
336 | `(#:phases | |
337 | (modify-phases %standard-phases | |
338 | (add-after 'unpack 'do-not-use-bundler-for-tests | |
339 | (lambda _ | |
340 | (substitute* "spec/spec_helper.rb" | |
341 | (("Bundler\\.setup.*") "")) | |
342 | #t)) | |
343 | (add-after 'unpack 'relax-version-requirements | |
344 | (lambda _ | |
345 | (substitute* ((@@ (guix build ruby-build-system) first-gemspec)) | |
346 | (("'rake',.*") | |
347 | "'rake'\n") | |
348 | (("\"rubocop\",.*") | |
349 | "'rubocop'\n") | |
350 | (("\"parser\",.*") | |
351 | "'parser'\n")) | |
352 | #t)) | |
353 | (add-after 'unpack 'patch-protoc | |
354 | (lambda* (#:key inputs #:allow-other-keys) | |
355 | (let ((protoc (assoc-ref inputs "protobuf"))) | |
356 | (substitute* "lib/protobuf/tasks/compile.rake" | |
357 | (("\"protoc\"") | |
358 | (string-append "\"" protoc "/bin/protoc" "\""))) | |
359 | #t))) | |
360 | (add-after 'unpack 'skip-failing-test | |
361 | ;; See: https://github.com/ruby-protobuf/protobuf/issues/419 | |
362 | (lambda _ | |
363 | (substitute* "spec/lib/protobuf/rpc/connectors/ping_spec.rb" | |
364 | (("expect\\(::IO\\)\\.to receive\\(:select\\).*" all) | |
365 | (string-append " pending\n" all))) | |
366 | #t)) | |
367 | (add-after 'replace-git-ls-files 'replace-more-git-ls-files | |
368 | (lambda _ | |
369 | (substitute* ((@@ (guix build ruby-build-system) first-gemspec)) | |
370 | (("`git ls-files -- \\{test,spec,features\\}/*`") | |
371 | "`find test spec features -type f | sort`") | |
372 | (("`git ls-files -- bin/*`") | |
373 | "`find bin -type f | sort`")) | |
374 | #t)) | |
375 | (replace 'check | |
376 | (lambda _ | |
377 | (invoke "rspec")))))) | |
378 | (native-inputs | |
379 | `(("ruby-benchmark-ips" ,ruby-benchmark-ips) | |
380 | ("ruby-ffi-rzmq" ,ruby-ffi-rzmq) | |
381 | ("ruby-parser" ,ruby-parser) | |
382 | ("ruby-pry-byebug" ,ruby-pry-byebug) | |
383 | ("ruby-pry-stack-explorer" ,ruby-pry-stack-explorer) | |
384 | ("ruby-rake" ,ruby-rake) | |
385 | ("ruby-rspec" ,ruby-rspec) | |
386 | ("ruby-rubocop" ,ruby-rubocop) | |
387 | ("ruby-ruby-prof" ,ruby-ruby-prof) | |
388 | ("ruby-simplecov" ,ruby-simplecov) | |
389 | ("ruby-timecop" ,ruby-timecop) | |
390 | ("ruby-varint" ,ruby-varint) | |
391 | ("ruby-yard" ,ruby-yard))) | |
392 | (inputs | |
393 | `(("protobuf" ,protobuf))) | |
394 | (propagated-inputs | |
395 | `(("ruby-activesupport" ,ruby-activesupport) | |
396 | ("ruby-middleware" ,ruby-middleware) | |
b7672304 EF |
397 | ("ruby-thor" ,ruby-thor) |
398 | ("ruby-thread-safe" ,ruby-thread-safe))) | |
d59c84f5 MC |
399 | (home-page "https://github.com/ruby-protobuf/protobuf") |
400 | (synopsis "Implementation of Google's Protocol Buffers in Ruby") | |
401 | (description "Protobuf is an implementation of Google's Protocol Buffers | |
402 | in pure Ruby.") | |
403 | (license license:expat))) | |
77f66f53 MC |
404 | |
405 | ;;; This is a modified ruby-protobuf package used by ruby-cucumber-messages | |
406 | ;;; until https://github.com/ruby-protobuf/protobuf/pull/411 and | |
407 | ;;; https://github.com/ruby-protobuf/protobuf/pull/415 are merged upstream. | |
408 | (define-public ruby-protobuf-cucumber | |
409 | (hidden-package | |
410 | (package | |
411 | (inherit ruby-protobuf) | |
412 | (name "ruby-protobuf-cucumber") | |
413 | (version "3.10.8") | |
414 | (source | |
415 | (origin | |
416 | (method url-fetch) | |
417 | (uri (rubygems-uri "protobuf-cucumber" version)) | |
418 | (sha256 | |
419 | (base32 | |
420 | "1rd6naabhpfb1i5dr6fp5mqwaawsx0mqm73h5ycwkgbm1n2si872"))))))) |