protobuf.scm 7.3 KB

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