gstreamer.scm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
  3. ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
  4. ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
  5. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  6. ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
  7. ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. (define-module (gnu packages gstreamer)
  24. #:use-module ((guix licenses) #:prefix license:)
  25. #:use-module (guix packages)
  26. #:use-module (guix download)
  27. #:use-module (guix build-system gnu)
  28. #:use-module (guix utils)
  29. #:use-module (gnu packages)
  30. #:use-module (gnu packages audio)
  31. #:use-module (gnu packages bison)
  32. #:use-module (gnu packages cdrom)
  33. #:use-module (gnu packages curl)
  34. #:use-module (gnu packages compression)
  35. #:use-module (gnu packages flex)
  36. #:use-module (gnu packages freedesktop)
  37. #:use-module (gnu packages gl)
  38. #:use-module (gnu packages glib)
  39. #:use-module (gnu packages gnome)
  40. #:use-module (gnu packages gnupg)
  41. #:use-module (gnu packages graphics)
  42. #:use-module (gnu packages gtk)
  43. #:use-module (gnu packages image)
  44. #:use-module (gnu packages libusb)
  45. #:use-module (gnu packages linux)
  46. #:use-module (gnu packages mp3)
  47. #:use-module (gnu packages perl)
  48. #:use-module (gnu packages pulseaudio)
  49. #:use-module (gnu packages qt)
  50. #:use-module (gnu packages rdf)
  51. #:use-module (gnu packages video)
  52. #:use-module (gnu packages xorg)
  53. #:use-module (gnu packages xiph)
  54. #:use-module (gnu packages pkg-config)
  55. #:use-module (gnu packages python)
  56. #:use-module (gnu packages ssh)
  57. #:use-module (gnu packages telephony)
  58. #:use-module (gnu packages tls)
  59. #:use-module (gnu packages version-control)
  60. #:use-module (gnu packages assembly)
  61. #:use-module (gnu packages xml))
  62. (define-public orc
  63. (package
  64. (name "orc")
  65. (version "0.4.27")
  66. (source (origin
  67. (method url-fetch)
  68. (uri (string-append "https://gstreamer.freedesktop.org/data/src/"
  69. "orc/orc-" version ".tar.xz"))
  70. (sha256
  71. (base32
  72. "14vbwdydwarcvswzf744jdjb3ibhv6k4j6hzdacfan41zic3xrai"))))
  73. (build-system gnu-build-system)
  74. (arguments
  75. `(#:phases
  76. (modify-phases %standard-phases
  77. (add-before 'check 'disable-faulty-test
  78. (lambda _
  79. ;; XXX Disable the 'test-limits' and 'exec_opcodes_sys'
  80. ;; tests, which fail on some machines. See:
  81. ;; https://bugzilla.gnome.org/show_bug.cgi?id=735273
  82. (substitute* '("testsuite/test-limits.c"
  83. "testsuite/exec_opcodes_sys.c")
  84. (("if \\(error\\) return 1;")
  85. "if (error) return 77;")))))))
  86. (home-page "http://gstreamer.freedesktop.org/modules/orc.html")
  87. (synopsis "Oil runtime compiler")
  88. (description
  89. "Orc is a just-in-time compiler implemented as a library and set of
  90. associated tools for compiling and executing simple programs that operate on
  91. arrays of data.")
  92. ;; The source code implementing the Marsenne Twister algorithm is licensed
  93. ;; under the 3-clause BSD license, the rest is under 2-clause BSD license.
  94. (license (list license:bsd-2 license:bsd-3))))
  95. (define-public gstreamer
  96. (package
  97. (name "gstreamer")
  98. (version "1.12.3")
  99. (source
  100. (origin
  101. (method url-fetch)
  102. (uri (string-append
  103. "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-"
  104. version ".tar.xz"))
  105. (sha256
  106. (base32
  107. "0vi1g8rmmsnd630ds3jwv2iph46ll8y07fzf04mz15q88j9g926k"))))
  108. (build-system gnu-build-system)
  109. (outputs '("out" "doc"))
  110. (arguments
  111. `(#:configure-flags
  112. (list (string-append "--with-html-dir="
  113. (assoc-ref %outputs "doc")
  114. "/share/gtk-doc/html"))))
  115. (propagated-inputs `(("glib" ,glib))) ; required by gstreamer-1.0.pc.
  116. (native-inputs
  117. `(("bison" ,bison)
  118. ("flex" ,flex)
  119. ("glib" ,glib "bin")
  120. ("gobject-introspection" ,gobject-introspection)
  121. ("perl" ,perl)
  122. ("pkg-config" ,pkg-config)
  123. ("python-wrapper" ,python-wrapper)))
  124. (native-search-paths
  125. (list (search-path-specification
  126. (variable "GST_PLUGIN_SYSTEM_PATH")
  127. (files '("lib/gstreamer-1.0")))))
  128. (home-page "https://gstreamer.freedesktop.org/")
  129. (synopsis "Multimedia library")
  130. (description
  131. "GStreamer is a library for constructing graphs of media-handling
  132. components. The applications it supports range from simple Ogg/Vorbis
  133. playback, audio/video streaming to complex audio mixing and video
  134. non-linear editing.
  135. Applications can take advantage of advances in codec and filter technology
  136. transparently. Developers can add new codecs and filters by writing a
  137. simple plugin with a clean, generic interface.
  138. This package provides the core library and elements.")
  139. (license license:lgpl2.0+)))
  140. (define-public gst-plugins-base
  141. (package
  142. (name "gst-plugins-base")
  143. (version "1.12.3")
  144. (source
  145. (origin
  146. (method url-fetch)
  147. (uri (string-append "https://gstreamer.freedesktop.org/src/" name "/"
  148. name "-" version ".tar.xz"))
  149. (sha256
  150. (base32
  151. "19ffwdch7m777ragmwpy6prqmfb742ym1n3ki40s0zyki627plyk"))))
  152. (build-system gnu-build-system)
  153. (outputs '("out" "doc"))
  154. (propagated-inputs
  155. `(("gstreamer" ,gstreamer))) ; required by gstreamer-plugins-base-1.0.pc
  156. (inputs
  157. `(("cdparanoia" ,cdparanoia)
  158. ("opus" ,opus)
  159. ("orc" ,orc)
  160. ("pango" ,pango)
  161. ("libogg" ,libogg)
  162. ("libtheora" ,libtheora)
  163. ("libvorbis" ,libvorbis)
  164. ("libx11" ,libx11)
  165. ("zlib" ,zlib)
  166. ("libXext" ,libxext)
  167. ("libxv" ,libxv)
  168. ("alsa-lib" ,alsa-lib)))
  169. (native-inputs
  170. `(("pkg-config" ,pkg-config)
  171. ("glib" ,glib "bin")
  172. ("gobject-introspection" ,gobject-introspection)
  173. ("python-wrapper" ,python-wrapper)))
  174. (arguments
  175. `(#:parallel-tests? #f ; 'pipelines/tcp' fails in parallel
  176. #:configure-flags
  177. (list (string-append "--with-html-dir="
  178. (assoc-ref %outputs "doc")
  179. "/share/gtk-doc/html"))
  180. #:phases
  181. (modify-phases %standard-phases
  182. (add-before 'configure 'patch
  183. (lambda _
  184. (substitute* "tests/check/libs/pbutils.c"
  185. (("/bin/sh") (which "sh")))
  186. #t)))))
  187. (home-page "https://gstreamer.freedesktop.org/")
  188. (synopsis
  189. "Plugins for the GStreamer multimedia library")
  190. (description "This package provides an essential exemplary set of plug-ins
  191. for the GStreamer multimedia library.")
  192. (license license:lgpl2.0+)))
  193. (define-public gst-plugins-good
  194. (package
  195. (name "gst-plugins-good")
  196. (version "1.12.3")
  197. (source
  198. (origin
  199. (method url-fetch)
  200. (uri (string-append
  201. "https://gstreamer.freedesktop.org/src/" name "/"
  202. name "-" version ".tar.xz"))
  203. (sha256
  204. (base32
  205. "00sznj1sl97fqpn6j8ngps04clvxp8h8yhw6lvszx4b855wz9rqk"))))
  206. (build-system gnu-build-system)
  207. (inputs
  208. `(("aalib" ,aalib)
  209. ("cairo" ,cairo)
  210. ("flac" ,flac)
  211. ("gdk-pixbuf" ,gdk-pixbuf)
  212. ("gst-plugins-base" ,gst-plugins-base)
  213. ("jack" ,jack-1)
  214. ("libavc1394" ,libavc1394)
  215. ("libcaca" ,libcaca)
  216. ("libdv" ,libdv)
  217. ("libiec61883" ,libiec61883)
  218. ("libjpeg" ,libjpeg)
  219. ("libpng" ,libpng)
  220. ("libshout" ,libshout)
  221. ("libsoup" ,libsoup)
  222. ("libvpx" ,libvpx)
  223. ("orc" ,orc)
  224. ("pulseaudio" ,pulseaudio)
  225. ("speex" ,speex)
  226. ("taglib" ,taglib)
  227. ("wavpack" ,wavpack)))
  228. (native-inputs
  229. `(("glib:bin" ,glib "bin")
  230. ("pkg-config" ,pkg-config)
  231. ("python-wrapper" ,python-wrapper)))
  232. (arguments
  233. `(#:phases
  234. (modify-phases %standard-phases
  235. (add-after
  236. 'unpack 'disable-failing-tests
  237. (lambda _
  238. ;; Disable tests that fail non-deterministically.
  239. ;; This test fails on aarch64 on 1.12.x.
  240. (substitute* "tests/check/elements/alpha.c"
  241. (("tcase_add_test \\(tc_chain, test_chromakeying\\);" all)
  242. (string-append "/* " all " */")))
  243. #t)))))
  244. (home-page "https://gstreamer.freedesktop.org/")
  245. (synopsis
  246. "Plugins for the GStreamer multimedia library")
  247. (description "GStreamer Good Plug-ins is a set of plug-ins for the
  248. GStreamer multimedia library. This set contains those plug-ins which the
  249. developers consider to have good quality code and correct functionality.")
  250. (license license:lgpl2.0+)))
  251. (define-public gst-plugins-bad
  252. (package
  253. (name "gst-plugins-bad")
  254. (version "1.12.3")
  255. (source (origin
  256. (method url-fetch)
  257. (uri (string-append "https://gstreamer.freedesktop.org/src/"
  258. name "/" name "-" version ".tar.xz"))
  259. (sha256
  260. (base32
  261. "1v5z3i5ha20gmbb3r9dwsaaspv5fm1jfzlzwlzqx1gjj31v5kl1n"))))
  262. (outputs '("out" "doc"))
  263. (build-system gnu-build-system)
  264. (arguments
  265. '(#:tests? #f ; XXX: 18 of 65 tests fail
  266. #:configure-flags
  267. (list (string-append "--with-html-dir="
  268. (assoc-ref %outputs "doc")
  269. "/share/gtk-doc/html"))
  270. #:phases
  271. (modify-phases %standard-phases
  272. (add-after 'unpack 'patch-openjpeg-reference
  273. (lambda _
  274. ;; Remove hard-coded openjpeg-2.2 path. 2.3 is API- and
  275. ;; ABI-compatible.
  276. (substitute* "ext/openjpeg/gstopenjpeg.h"
  277. (("<openjpeg-2\\.2/") "<openjpeg-2.3/"))
  278. #t)))))
  279. (propagated-inputs
  280. `(("gst-plugins-base" ,gst-plugins-base)))
  281. (native-inputs
  282. `(("glib:bin" ,glib "bin") ; for glib-mkenums, etc.
  283. ("gobject-introspection" ,gobject-introspection)
  284. ("pkg-config" ,pkg-config)
  285. ("python" ,python)))
  286. (inputs
  287. ;; XXX: The following dependencies are missing:
  288. ;; vo-amrwbenc, vo-aacenc, bs2b, chromaprint, directfb, daala, libdts,
  289. ;; faac, flite, libgsm, libde265, libmms, libmimic, mjpegtools,
  290. ;; mpeg2enc, libofa, opencv, openh264, openni2, libtimemmgr, wildmidi,
  291. ;; openspc, gme, sbc, schroedinger, zbar, librtmp, spandsp
  292. `(("bluez" ,bluez)
  293. ("curl" ,curl)
  294. ("faad2" ,faad2)
  295. ("fluidsynth" ,fluidsynth)
  296. ("gtk+" ,gtk+)
  297. ("ladspa" ,ladspa)
  298. ("libass" ,libass)
  299. ("libdvdnav" ,libdvdnav)
  300. ("libdvdread" ,libdvdread)
  301. ("libgcrypt" ,libgcrypt)
  302. ("libgudev" ,libgudev)
  303. ("libkate" ,libkate)
  304. ("libmodplug" ,libmodplug)
  305. ("librsvg" ,librsvg)
  306. ("libsndfile" ,libsndfile)
  307. ("libsrtp" ,libsrtp)
  308. ("libssh2" ,libssh2)
  309. ("libusb" ,libusb)
  310. ("libvdpau" ,libvdpau)
  311. ("libwebp" ,libwebp)
  312. ("libxml2" ,libxml2)
  313. ("lrdf" ,lrdf)
  314. ("mesa" ,mesa)
  315. ("mpg123" ,mpg123)
  316. ("neon" ,neon)
  317. ("openal" ,openal)
  318. ("openexr" ,openexr)
  319. ("openjpeg" ,openjpeg)
  320. ("openssl" ,openssl)
  321. ("opus" ,opus)
  322. ("orc" ,orc)
  323. ;("qtbase" ,qtbase)
  324. ;("qtdeclarative" ,qtdeclarative)
  325. ;("qtx11extras" ,qtx11extras)
  326. ("soundtouch" ,soundtouch)
  327. ("x265" ,x265)
  328. ("wayland" ,wayland)))
  329. (home-page "https://gstreamer.freedesktop.org/")
  330. (synopsis "Plugins for the GStreamer multimedia library")
  331. (description
  332. "GStreamer Bad Plug-ins is a set of plug-ins whose quality aren't up to
  333. par compared to the rest.")
  334. (license license:lgpl2.0+)))
  335. (define-public gst-plugins-ugly
  336. (package
  337. (name "gst-plugins-ugly")
  338. (version "1.12.3")
  339. (source
  340. (origin
  341. (method url-fetch)
  342. (uri (string-append "https://gstreamer.freedesktop.org/src/"
  343. name "/" name "-" version ".tar.xz"))
  344. (sha256
  345. (base32
  346. "0lh00rg26iy5lr5al23lxsyncjqkgzph1bzkrgp8x9sfr62ab378"))))
  347. (build-system gnu-build-system)
  348. (inputs
  349. `(("gst-plugins-base" ,gst-plugins-base)
  350. ("liba52" ,liba52)
  351. ("libmad" ,libmad)
  352. ("lame" ,lame)
  353. ("libcdio" ,libcdio)
  354. ("twolame" ,twolame)
  355. ("libmpeg2" ,libmpeg2)
  356. ("libdvdread" ,libdvdread)
  357. ("libx264" ,libx264)
  358. ("mpg123" ,mpg123)
  359. ;; TODO:
  360. ;; * opencore-amr (for the AMR-NB decoder and encoder and the
  361. ;; AMR-WB decoder) <http://sourceforge.net/projects/opencore-amr/>
  362. ("orc" ,orc)))
  363. (native-inputs
  364. `(("glib:bin" ,glib "bin")
  365. ("pkg-config" ,pkg-config)
  366. ("python-wrapper" ,python-wrapper)))
  367. (home-page "https://gstreamer.freedesktop.org/")
  368. (synopsis "GStreamer plugins from the \"ugly\" set")
  369. (description "GStreamer Ugly Plug-ins. This set contains those plug-ins
  370. which the developers consider to have good quality code but that might pose
  371. distribution problems in some jurisdictions, e.g. due to patent threats.")
  372. (license license:lgpl2.0+)))
  373. (define-public gst-libav
  374. (package
  375. (name "gst-libav")
  376. (version "1.12.3")
  377. (source (origin
  378. (method url-fetch)
  379. (uri (string-append
  380. "https://gstreamer.freedesktop.org/src/" name "/"
  381. name "-" version ".tar.xz"))
  382. (sha256
  383. (base32
  384. "0l4nc6ikdx49l7bdrk3bd9p3pzry8a328r22zg48gyzpnv5ghph1"))))
  385. (build-system gnu-build-system)
  386. (arguments
  387. '(#:configure-flags '("--with-system-libav")
  388. #:phases
  389. (modify-phases %standard-phases
  390. (add-before 'configure 'patch-/bin/sh
  391. (lambda _
  392. (substitute* "gst-libs/ext/libav/configure"
  393. (("#! /bin/sh")
  394. (string-append "#! "(which "sh"))))
  395. #t)))))
  396. (native-inputs
  397. `(("pkg-config" ,pkg-config)
  398. ("python" ,python)))
  399. (inputs
  400. `(("gst-plugins-base" ,gst-plugins-base)
  401. ("ffmpeg" ,ffmpeg)
  402. ("orc" ,orc)
  403. ("zlib" ,zlib)))
  404. (home-page "http://gstreamer.freedesktop.org/")
  405. (synopsis "Plugins for the GStreamer multimedia library")
  406. (description
  407. "This GStreamer plugin supports a large number of audio and video
  408. compression formats through the use of the libav library.")
  409. (license license:gpl2+)))
  410. (define-public python-gst
  411. (package
  412. (name "python-gst")
  413. (version "1.12.3")
  414. (source (origin
  415. (method url-fetch)
  416. (uri (string-append
  417. "https://gstreamer.freedesktop.org/src/gst-python/"
  418. "gst-python-" version ".tar.xz"))
  419. (sha256
  420. (base32
  421. "19rb06x2m7103zwfm0plxx95gb8bp01ng04h4q9k6ii9q7g2kxf3"))))
  422. (build-system gnu-build-system)
  423. (arguments
  424. ;; XXX: Factorize python-sitedir with python-build-system.
  425. `(#:imported-modules (,@%gnu-build-system-modules
  426. (guix build python-build-system))
  427. #:configure-flags
  428. (let* ((python (assoc-ref %build-inputs "python"))
  429. (python-version ((@@ (guix build python-build-system)
  430. get-python-version)
  431. python))
  432. (python-sitedir (string-append
  433. "lib/python" python-version "/site-packages")))
  434. (list (string-append
  435. "--with-pygi-overrides-dir=" %output "/" python-sitedir
  436. "/gi/overrides")))))
  437. (native-inputs
  438. `(("pkg-config" ,pkg-config)
  439. ("python" ,python)))
  440. (propagated-inputs
  441. `(("gst-plugins-base" ,gst-plugins-base)
  442. ("python-pygobject" ,python-pygobject)))
  443. (home-page "https://gstreamer.freedesktop.org/")
  444. (synopsis "GStreamer GObject Introspection overrides for Python")
  445. (description
  446. "This package contains GObject Introspection overrides for Python that can
  447. be used by Python applications using GStreamer.")
  448. (license license:lgpl2.1+)
  449. (properties `((python2-variant . ,(delay python2-gst))))))
  450. (define-public python2-gst
  451. (package (inherit python-gst)
  452. (name "python2-gst")
  453. (native-inputs
  454. `(("pkg-config" ,pkg-config)
  455. ("python" ,python-2)))
  456. (propagated-inputs
  457. `(("gst-plugins-base" ,gst-plugins-base)
  458. ("python-pygobject" ,python2-pygobject)))))