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>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
75 (uri (string-append "https://gstreamer.freedesktop.org/data/src/"
76 "orc/orc-" version ".tar.xz"))
79 "0xb0c7q3xv1ldmz5ipybazb01gy3cijj8622dcx7rbm9lq85zax0"))))
80 (build-system meson-build-system)
83 (modify-phases %standard-phases
84 (add-after 'unpack 'disable-faulty-test
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;"))
95 `(("gtk-doc" ,gtk-doc)))
96 (home-page "https://gstreamer.freedesktop.org/modules/orc.html")
97 (synopsis "Oil runtime compiler")
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
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))))
106 (define-public gstreamer
114 "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-"
118 "0kp93622y29pck8asvil1fmzf55s2gx76wv475a6izc3cwj49w73"))))
119 (build-system meson-build-system)
120 (outputs '("out" "doc"))
123 (modify-phases %standard-phases
124 ;; FIXME: Since switching to the meson-build-system, two tests
125 ;; started failing on i686. See
126 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/499>.
127 ,@(if (string-prefix? "i686" (or (%current-target-system)
129 `((add-after 'unpack 'disable-some-tests
131 (substitute* "tests/check/gst/gstsystemclock.c"
132 (("tcase_add_test \\(tc_chain, test_stress_cleanup_unschedule.*")
134 (("tcase_add_test \\(tc_chain, test_stress_reschedule.*")
138 (add-after 'install 'move-docs
139 (lambda* (#:key outputs #:allow-other-keys)
140 (let ((out (assoc-ref outputs "out"))
141 (doc (assoc-ref outputs "doc")))
142 (mkdir-p (string-append doc "/share"))
143 (copy-recursively (string-append out "/share/gtk-doc")
144 (string-append doc "/share/gtk-doc"))
145 (delete-file-recursively (string-append out "/share/gtk-doc"))
147 (propagated-inputs `(("glib" ,glib))) ; required by gstreamer-1.0.pc.
152 ("gobject-introspection" ,gobject-introspection)
155 ("pkg-config" ,pkg-config)
156 ("python-wrapper" ,python-wrapper)))
158 (list (search-path-specification
159 (variable "GST_PLUGIN_SYSTEM_PATH")
160 (files '("lib/gstreamer-1.0")))))
161 (home-page "https://gstreamer.freedesktop.org/")
162 (synopsis "Multimedia library")
164 "GStreamer is a library for constructing graphs of media-handling
165 components. The applications it supports range from simple Ogg/Vorbis
166 playback, audio/video streaming to complex audio mixing and video
169 Applications can take advantage of advances in codec and filter technology
170 transparently. Developers can add new codecs and filters by writing a
171 simple plugin with a clean, generic interface.
173 This package provides the core library and elements.")
174 (license license:lgpl2.0+)))
176 (define-public gst-plugins-base
178 (name "gst-plugins-base")
183 (uri (string-append "https://gstreamer.freedesktop.org/src/" name "/"
184 name "-" version ".tar.xz"))
187 "0sl1hxlyq46r02k7z70v09vx1gi4rcypqmzra9jid93lzvi76gmi"))))
188 (build-system meson-build-system)
190 `(("glib" ,glib) ;required by gstreamer-sdp-1.0.pc
191 ("gstreamer" ,gstreamer) ;required by gstreamer-plugins-base-1.0.pc
193 ;; XXX: Do not enable Orc optimizations on ARM systems because
194 ;; it leads to two test failures.
195 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/683
196 ,@(if (string-prefix? "arm" (or (%current-target-system)
199 `(("orc" ,orc))))) ;required by gstreamer-audio-1.0.pc
201 `(("cdparanoia" ,cdparanoia)
204 ("libtheora" ,libtheora)
205 ("libvorbis" ,libvorbis)
210 ("alsa-lib" ,alsa-lib)
211 ;; XXX Don't build with opus on 32-bit systems:
212 ;; <https://bugs.gnu.org/32360>
213 ,@(if (target-64bit?)
217 `(("pkg-config" ,pkg-config)
218 ("glib:bin" ,glib "bin")
219 ("gobject-introspection" ,gobject-introspection)
220 ("python-wrapper" ,python-wrapper)))
222 '(#:configure-flags '("-Dgl=disabled"
223 ;; FIXME: Documentation fails to build without
224 ;; enabling GL above, which causes other problems.
227 (modify-phases %standard-phases
228 (add-before 'configure 'patch
230 (substitute* "tests/check/libs/pbutils.c"
231 (("/bin/sh") (which "sh")))
233 (home-page "https://gstreamer.freedesktop.org/")
235 "Plugins for the GStreamer multimedia library")
236 (description "This package provides an essential exemplary set of plug-ins
237 for the GStreamer multimedia library.")
238 (license license:lgpl2.0+)))
240 (define-public gst-plugins-good
242 (name "gst-plugins-good")
248 "https://gstreamer.freedesktop.org/src/" name "/"
249 name "-" version ".tar.xz"))
252 "068k3cbv1yf3gbllfdzqsg263kzwh21y8dpwr0wvgh15vapkpfs0"))))
253 (build-system meson-build-system)
258 ("gdk-pixbuf" ,gdk-pixbuf)
259 ("gst-plugins-base" ,gst-plugins-base)
263 ("libavc1394" ,libavc1394)
266 ("libiec61883" ,libiec61883)
269 ("libshout" ,libshout)
274 ("pulseaudio" ,pulseaudio)
278 ("wavpack" ,wavpack)))
280 `(("glib:bin" ,glib "bin")
281 ("pkg-config" ,pkg-config)
282 ("python-wrapper" ,python-wrapper)))
285 (modify-phases %standard-phases
286 ,@(if (string-prefix? "arm" (or (%current-target-system)
288 ;; FIXME: These tests started failing on armhf after switching to Meson.
289 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/689
290 `((add-after 'unpack 'disable-tests-for-armhf
292 (substitute* "tests/check/elements/rtpbin_buffer_list.c"
293 (("tcase_add_test \\(tc_chain, test_bufferlist\\);")
295 (substitute* "tests/check/elements/rtpulpfec.c"
296 (("tcase_add_loop_test.*rtpulpfecdec_recovered_from_many.*")
298 (("tcase_add.*rtpulpfecdec_recovered_using_recovered_packet.*")
303 'unpack 'disable-failing-tests
305 ;; Disable tests that fail non-deterministically.
306 ;; This test fails on aarch64 on 1.12.x.
307 (substitute* "tests/check/elements/alpha.c"
308 (("tcase_add_test \\(tc_chain, test_chromakeying\\);" all)
309 (string-append "/* " all " */")))
311 (home-page "https://gstreamer.freedesktop.org/")
313 "Plugins for the GStreamer multimedia library")
314 (description "GStreamer Good Plug-ins is a set of plug-ins for the
315 GStreamer multimedia library. This set contains those plug-ins which the
316 developers consider to have good quality code and correct functionality.")
317 (license license:lgpl2.0+)))
319 (define-public gst-plugins-bad
321 (name "gst-plugins-bad")
325 (uri (string-append "https://gstreamer.freedesktop.org/src/"
326 name "/" name "-" version ".tar.xz"))
329 "0x0y0hm0ga3zqi5q4090hw5sjh59y1ry9ak16qsaascm72i7mjzi"))))
330 (build-system meson-build-system)
333 (modify-phases %standard-phases
334 ,@(if (string-prefix? "arm" (or (%current-target-system)
336 ;; Disable test that fails on ARMv7.
337 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1188
338 `((add-after 'unpack 'disable-asfmux-test
340 (substitute* "tests/check/meson.build"
341 (("\\[\\['elements/asfmux\\.c'\\]\\],")
345 (add-after 'unpack 'disable-failing-test
347 ;; FIXME: Why is this failing.
348 (substitute* "tests/check/meson.build"
349 ((".*elements/dash_mpd\\.c.*")
353 `(("gst-plugins-base" ,gst-plugins-base)))
355 `(("glib:bin" ,glib "bin") ; for glib-mkenums, etc.
356 ("gobject-introspection" ,gobject-introspection)
357 ;; TODO: Enable documentation for 1.18.
358 ;;("gtk-doc" ,gtk-doc)
359 ("pkg-config" ,pkg-config)
362 ;; XXX: The following dependencies are missing:
363 ;; vo-amrwbenc, vo-aacenc, bs2b, chromaprint, directfb, daala, libdts,
364 ;; faac, flite, libgsm, libde265, libmms, libmimic, mjpegtools,
365 ;; mpeg2enc, libofa, opencv, openh264, openni2, libtimemmgr, wildmidi,
366 ;; openspc, gme, sbc, schroedinger, zbar, librtmp, spandsp
370 ("fluidsynth" ,fluidsynth)
374 ("libdvdnav" ,libdvdnav)
375 ("libdvdread" ,libdvdread)
376 ("libgcrypt" ,libgcrypt)
377 ("libgudev" ,libgudev)
379 ("libmodplug" ,libmodplug)
381 ("libsndfile" ,libsndfile)
385 ("libvdpau" ,libvdpau)
393 ("openjpeg" ,openjpeg)
398 ;("qtdeclarative" ,qtdeclarative)
399 ;("qtx11extras" ,qtx11extras)
400 ("soundtouch" ,soundtouch)
402 ("wayland" ,wayland)))
403 (home-page "https://gstreamer.freedesktop.org/")
404 (synopsis "Plugins for the GStreamer multimedia library")
406 "GStreamer Bad Plug-ins is a set of plug-ins whose quality aren't up to
407 par compared to the rest.")
408 (license license:lgpl2.0+)))
410 (define-public gst-plugins-ugly
412 (name "gst-plugins-ugly")
417 (uri (string-append "https://gstreamer.freedesktop.org/src/"
418 name "/" name "-" version ".tar.xz"))
421 "1jpvc32x6q01zjkfgh6gmq6aaikiyfwwnhj7bmvn52syhrdl202m"))))
422 (build-system meson-build-system)
424 `(("gst-plugins-base" ,gst-plugins-base)
427 ("libmpeg2" ,libmpeg2)
428 ("libdvdread" ,libdvdread)
431 ;; * opencore-amr (for the AMR-NB decoder and encoder and the
432 ;; AMR-WB decoder) <http://sourceforge.net/projects/opencore-amr/>
435 `(("glib:bin" ,glib "bin")
436 ("pkg-config" ,pkg-config)
437 ("python-wrapper" ,python-wrapper)))
438 (home-page "https://gstreamer.freedesktop.org/")
439 (synopsis "GStreamer plugins from the \"ugly\" set")
440 (description "GStreamer Ugly Plug-ins. This set contains those plug-ins
441 which the developers consider to have good quality code but that might pose
442 distribution problems in some jurisdictions, e.g. due to patent threats.")
443 (license license:lgpl2.0+)))
445 (define-public gst-libav
452 "https://gstreamer.freedesktop.org/src/" name "/"
453 name "-" version ".tar.xz"))
456 "1wpfilc98bad9nsv3y1qapxp35dvn2mvwvrmqwrsj58cf09gc967"))
457 (modules '((guix build utils)))
460 ;; Drop bundled ffmpeg.
461 (delete-file-recursively "gst-libs/ext/libav")
463 (build-system meson-build-system)
465 `(("pkg-config" ,pkg-config)
468 `(("gst-plugins-base" ,gst-plugins-base)
472 (home-page "https://gstreamer.freedesktop.org/")
473 (synopsis "Plugins for the GStreamer multimedia library")
475 "This GStreamer plugin supports a large number of audio and video
476 compression formats through the use of the libav library.")
477 (license license:gpl2+)))
479 (define-public python-gst
486 "https://gstreamer.freedesktop.org/src/gst-python/"
487 "gst-python-" version ".tar.xz"))
490 "1a48ca66izmm8hnp608jv5isg3jxb0vlfmhns0bg9nbkilag7390"))))
491 (build-system meson-build-system)
493 `(#:modules ((guix build meson-build-system)
495 ((guix build python-build-system) #:prefix python:))
496 #:imported-modules (,@%meson-build-system-modules
497 (guix build python-build-system))
500 "-Dpygi-overrides-dir="
501 (python:site-packages %build-inputs %outputs) "gi/overrides"))))
503 `(("pkg-config" ,pkg-config)
506 `(("gst-plugins-base" ,gst-plugins-base)
507 ("python-pygobject" ,python-pygobject)))
508 (home-page "https://gstreamer.freedesktop.org/")
509 (synopsis "GStreamer GObject Introspection overrides for Python")
511 "This package contains GObject Introspection overrides for Python that can
512 be used by Python applications using GStreamer.")
513 (license license:lgpl2.1+)
514 (properties `((python2-variant . ,(delay python2-gst))))))
516 (define-public python2-gst
517 (package (inherit python-gst)
520 `(("pkg-config" ,pkg-config)
521 ("python" ,python-2)))
523 `(("gst-plugins-base" ,gst-plugins-base)
524 ("python-pygobject" ,python2-pygobject)))))
526 (define-public gst123
532 (uri (string-append "http://space.twc.de/~stefan/gst123/gst123-"
536 "0zaa117n4wkya9p903vkj8hj58lmdb66pxsdx5wwcv7nffbp5d67"))))
537 (build-system gnu-build-system)
541 ("gstreamer" ,gstreamer)
542 ("gst-plugins-base" ,gst-plugins-base)))
544 `(("pkg-config" ,pkg-config)))
545 (home-page "http://space.twc.de/~stefan/gst123.php")
546 (synopsis "Flexible command line media player based on gstreamer")
547 (description "The program gst123 is designed to be a more flexible command
548 line player in the spirit of ogg123 and mpg123, based on the gstreamer media
549 framework. It plays all file formats gstreamer supports, so if you have a
550 music collection which contains different file formats, like flac, ogg and
551 mp3, you can use gst123 to play all your music files.")
552 (license license:lgpl2.0+)))