1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Daniel Pimentel <d4n1@d4n1.org>
4 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
23 (define-module (gnu packages protobuf)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system python)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages gcc)
31 #:use-module (gnu packages libevent)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages python))
42 (uri (string-append "https://dl.farsightsecurity.com/dist/" name "/"
43 name "-" version ".tar.gz"))
46 "1i9y8a1712aj80p5a1kcp378bnjrg3s2127q7304hklhmjcrjl1d"))))
47 (build-system gnu-build-system)
49 `(("pkg-config" ,pkg-config)))
51 `(("libevent" ,libevent)))
52 (home-page "https://github.com/farsightsec/fstrm")
53 (synopsis "Implementation of the Frame Streams data transport protocol")
55 "fstrm is an optimised implementation of Frame Streams as a C library and
56 several tools built on top of it.
58 @dfn{Frame Streams} is a light-weight, binary-clean protocol that allows for
59 the transport of arbitrarily-encoded data payload sequences with minimal
60 framing overhead---just four bytes per data frame. It does not specify an
61 encoding format for these data frames and can be used with any data
62 serialisation format that produces byte sequences, such as Protocol Buffers,
63 XML, JSON, MessagePack, YAML, etc.
65 Frame Streams can be used either as a streaming transport over a reliable byte
66 stream socket (TCP sockets, TLS connections, @code{AF_UNIX} sockets, etc.) for
67 data in motion, or as a file format for data at rest.")
68 (license (list license:asl2.0
69 (license:non-copyleft #f "See libmy/argv*")))))
71 (define-public protobuf
77 (uri (string-append "https://github.com/google/protobuf/releases/"
78 "download/v" version "/protobuf-cpp-"
82 "14j0427ykjzrd9a66c2mpk0sjcccjlsx6q8ww6hzwb6sha3vm3f2"))))
83 (build-system gnu-build-system)
84 (inputs `(("zlib" ,zlib)))
86 "static")) ; ~12 MiB of .a files
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")))
98 (for-each (lambda (file)
99 (install-file file slib)
101 (find-files lib "\\.a$"))
103 (home-page "https://github.com/google/protobuf")
104 (synopsis "Data encoding for remote procedure calls (RPCs)")
106 "Protocol Buffers are a way of encoding structured data in an efficient
107 yet extensible format. Google uses Protocol Buffers for almost all of its
108 internal RPC protocols and file formats.")
109 (license license:bsd-3)))
111 ;; XXX Remove this old version when no other packages depend on it.
112 (define-public protobuf-2
113 (package (inherit protobuf)
117 (uri (string-append "https://github.com/google/protobuf/releases/"
118 "download/v" version "/protobuf-"
122 "040rcs9fpv4bslhiy43v7dcrzakz4vwwpyqg4jp8bn24sl95ci7f"))))))
124 (define-public protobuf-c
130 (uri (string-append "https://github.com/protobuf-c/protobuf-c/"
131 "releases/download/v" version
132 "/protobuf-c-" version ".tar.gz"))
135 "0rr2kn7804cvhdm6lzz04gz76vy0fzj15dijbr17nv8x34x2sisi"))))
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")
142 "This is protobuf-c, a C implementation of the Google Protocol Buffers
143 data serialization format. It includes @code{libprotobuf-c}, a pure C library
144 that implements protobuf encoding and decoding, and @code{protoc-c}, a code
145 generator that converts Protocol Buffer @code{.proto} files to C descriptor
147 (license license:bsd-2)))
149 (define-public python-protobuf
151 (name "python-protobuf")
156 (uri (pypi-uri "protobuf" version))
159 "1q4b1m55w4gvcbzklbk8iylaii98n4in41k27d94w8ypbwlrm1q9"))))
160 (build-system python-build-system)
162 `(("python-six" ,python-six)))
163 (home-page "https://github.com/google/protobuf")
164 (synopsis "Protocol buffers is a data interchange format")
166 "Protocol buffers are a language-neutral, platform-neutral extensible
167 mechanism for serializing structured data.")
168 (license license:bsd-3)))
170 (define-public python2-protobuf
171 (package-with-python2 python-protobuf))