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