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 ;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages gstreamer)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system meson)
34 #:use-module (guix utils)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages audio)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages cdrom)
39 #:use-module (gnu packages curl)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages flex)
42 #:use-module (gnu packages freedesktop)
43 #:use-module (gnu packages gl)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gnome)
46 #:use-module (gnu packages gnupg)
47 #:use-module (gnu packages graphics)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages image)
50 #:use-module (gnu packages libusb)
51 #:use-module (gnu packages linux)
52 #:use-module (gnu packages mp3)
53 #:use-module (gnu packages ncurses)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages pulseaudio)
56 #:use-module (gnu packages qt)
57 #:use-module (gnu packages rdf)
58 #:use-module (gnu packages video)
59 #:use-module (gnu packages xorg)
60 #:use-module (gnu packages xiph)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages ssh)
64 #:use-module (gnu packages telephony)
65 #:use-module (gnu packages tls)
66 #:use-module (gnu packages version-control)
67 #:use-module (gnu packages assembly)
68 #:use-module (gnu packages xml))
76 (uri (string-append "https://gstreamer.freedesktop.org/data/src/"
77 "orc/orc-" version ".tar.xz"))
80 "0xb0c7q3xv1ldmz5ipybazb01gy3cijj8622dcx7rbm9lq85zax0"))))
81 (build-system meson-build-system)
84 (modify-phases %standard-phases
85 (add-after 'unpack 'disable-faulty-test
87 ;; XXX Disable the 'test-limits' and 'exec_opcodes_sys'
88 ;; tests, which fail on some machines. See:
89 ;; https://bugzilla.gnome.org/show_bug.cgi?id=735273
90 (substitute* '("testsuite/test-limits.c"
91 "testsuite/exec_opcodes_sys.c")
92 (("if \\(error\\) return 1;")
93 "if (error) return 77;"))
96 `(("gtk-doc" ,gtk-doc)))
97 (home-page "https://gstreamer.freedesktop.org/modules/orc.html")
98 (synopsis "Oil runtime compiler")
100 "Orc is a just-in-time compiler implemented as a library and set of
101 associated tools for compiling and executing simple programs that operate on
103 ;; The source code implementing the Marsenne Twister algorithm is licensed
104 ;; under the 3-clause BSD license, the rest is under 2-clause BSD license.
105 (license (list license:bsd-2 license:bsd-3))))
107 (define-public gstreamer
115 "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-"
119 "0kp93622y29pck8asvil1fmzf55s2gx76wv475a6izc3cwj49w73"))))
120 (build-system meson-build-system)
121 (outputs '("out" "doc"))
124 (modify-phases %standard-phases
125 ;; FIXME: Since switching to the meson-build-system, two tests
126 ;; started failing on i686. See
127 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/499>.
128 ,@(if (string-prefix? "i686" (or (%current-target-system)
130 `((add-after 'unpack 'disable-some-tests
132 (substitute* "tests/check/gst/gstsystemclock.c"
133 (("tcase_add_test \\(tc_chain, test_stress_cleanup_unschedule.*")
135 (("tcase_add_test \\(tc_chain, test_stress_reschedule.*")
139 (add-after 'install 'move-docs
140 (lambda* (#:key outputs #:allow-other-keys)
141 (let ((out (assoc-ref outputs "out"))
142 (doc (assoc-ref outputs "doc")))
143 (mkdir-p (string-append doc "/share"))
144 (copy-recursively (string-append out "/share/gtk-doc")
145 (string-append doc "/share/gtk-doc"))
146 (delete-file-recursively (string-append out "/share/gtk-doc"))
148 (propagated-inputs `(("glib" ,glib))) ; required by gstreamer-1.0.pc.
153 ("gobject-introspection" ,gobject-introspection)
156 ("pkg-config" ,pkg-config)
157 ("python-wrapper" ,python-wrapper)))
159 (list (search-path-specification
160 (variable "GST_PLUGIN_SYSTEM_PATH")
161 (files '("lib/gstreamer-1.0")))))
162 (home-page "https://gstreamer.freedesktop.org/")
163 (synopsis "Multimedia library")
165 "GStreamer is a library for constructing graphs of media-handling
166 components. The applications it supports range from simple Ogg/Vorbis
167 playback, audio/video streaming to complex audio mixing and video
170 Applications can take advantage of advances in codec and filter technology
171 transparently. Developers can add new codecs and filters by writing a
172 simple plugin with a clean, generic interface.
174 This package provides the core library and elements.")
175 (license license:lgpl2.0+)))
177 (define-public gst-plugins-base
179 (name "gst-plugins-base")
184 (uri (string-append "https://gstreamer.freedesktop.org/src/" name "/"
185 name "-" version ".tar.xz"))
188 "0sl1hxlyq46r02k7z70v09vx1gi4rcypqmzra9jid93lzvi76gmi"))))
189 (build-system meson-build-system)
191 `(("glib" ,glib) ;required by gstreamer-sdp-1.0.pc
192 ("gstreamer" ,gstreamer) ;required by gstreamer-plugins-base-1.0.pc
194 ;; XXX: Do not enable Orc optimizations on ARM systems because
195 ;; it leads to two test failures.
196 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/683
197 ,@(if (string-prefix? "arm" (or (%current-target-system)
200 `(("orc" ,orc))))) ;required by gstreamer-audio-1.0.pc
202 `(("cdparanoia" ,cdparanoia)
205 ("libtheora" ,libtheora)
206 ("libvorbis" ,libvorbis)
211 ("alsa-lib" ,alsa-lib)
212 ;; XXX Don't build with opus on 32-bit systems:
213 ;; <https://bugs.gnu.org/32360>
214 ,@(if (target-64bit?)
218 `(("pkg-config" ,pkg-config)
219 ("glib:bin" ,glib "bin")
220 ("gobject-introspection" ,gobject-introspection)
221 ("python-wrapper" ,python-wrapper)))
223 '(#:configure-flags '("-Dgl=disabled"
224 ;; FIXME: Documentation fails to build without
225 ;; enabling GL above, which causes other problems.
228 (modify-phases %standard-phases
229 (add-before 'configure 'patch
231 (substitute* "tests/check/libs/pbutils.c"
232 (("/bin/sh") (which "sh")))
234 (home-page "https://gstreamer.freedesktop.org/")
236 "Plugins for the GStreamer multimedia library")
237 (description "This package provides an essential exemplary set of plug-ins
238 for the GStreamer multimedia library.")
239 (license license:lgpl2.0+)))
241 (define-public gst-plugins-good
243 (name "gst-plugins-good")
249 "https://gstreamer.freedesktop.org/src/" name "/"
250 name "-" version ".tar.xz"))
253 "068k3cbv1yf3gbllfdzqsg263kzwh21y8dpwr0wvgh15vapkpfs0"))))
254 (build-system meson-build-system)
259 ("gdk-pixbuf" ,gdk-pixbuf)
260 ("gst-plugins-base" ,gst-plugins-base)
264 ("libavc1394" ,libavc1394)
267 ("libiec61883" ,libiec61883)
268 ("libjpeg" ,libjpeg-turbo)
270 ("libshout" ,libshout)
275 ("pulseaudio" ,pulseaudio)
279 ("wavpack" ,wavpack)))
281 `(("glib:bin" ,glib "bin")
282 ("pkg-config" ,pkg-config)
283 ("python-wrapper" ,python-wrapper)))
286 (modify-phases %standard-phases
287 ,@(if (string-prefix? "arm" (or (%current-target-system)
289 ;; FIXME: These tests started failing on armhf after switching to Meson.
290 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/689
291 `((add-after 'unpack 'disable-tests-for-armhf
293 (substitute* "tests/check/elements/rtpbin_buffer_list.c"
294 (("tcase_add_test \\(tc_chain, test_bufferlist\\);")
296 (substitute* "tests/check/elements/rtpulpfec.c"
297 (("tcase_add_loop_test.*rtpulpfecdec_recovered_from_many.*")
299 (("tcase_add.*rtpulpfecdec_recovered_using_recovered_packet.*")
304 'unpack 'disable-failing-tests
306 ;; Disable tests that fail non-deterministically.
307 ;; This test fails on aarch64 on 1.12.x.
308 (substitute* "tests/check/elements/alpha.c"
309 (("tcase_add_test \\(tc_chain, test_chromakeying\\);" all)
310 (string-append "/* " all " */")))
312 (home-page "https://gstreamer.freedesktop.org/")
314 "Plugins for the GStreamer multimedia library")
315 (description "GStreamer Good Plug-ins is a set of plug-ins for the
316 GStreamer multimedia library. This set contains those plug-ins which the
317 developers consider to have good quality code and correct functionality.")
318 (license license:lgpl2.0+)))
320 (define-public gst-plugins-bad
322 (name "gst-plugins-bad")
326 (uri (string-append "https://gstreamer.freedesktop.org/src/"
327 name "/" name "-" version ".tar.xz"))
330 "0x0y0hm0ga3zqi5q4090hw5sjh59y1ry9ak16qsaascm72i7mjzi"))))
331 (build-system meson-build-system)
334 (modify-phases %standard-phases
335 ,@(if (string-prefix? "arm" (or (%current-target-system)
337 ;; Disable test that fails on ARMv7.
338 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1188
339 `((add-after 'unpack 'disable-asfmux-test
341 (substitute* "tests/check/meson.build"
342 (("\\[\\['elements/asfmux\\.c'\\]\\],")
346 (add-after 'unpack 'disable-failing-test
348 ;; FIXME: Why is this failing.
349 (substitute* "tests/check/meson.build"
350 ((".*elements/dash_mpd\\.c.*")
354 `(("gst-plugins-base" ,gst-plugins-base)))
356 `(("glib:bin" ,glib "bin") ; for glib-mkenums, etc.
357 ("gobject-introspection" ,gobject-introspection)
358 ;; TODO: Enable documentation for 1.18.
359 ;;("gtk-doc" ,gtk-doc)
360 ("pkg-config" ,pkg-config)
363 ;; XXX: The following dependencies are missing:
364 ;; vo-amrwbenc, vo-aacenc, bs2b, chromaprint, directfb, daala, libdts,
365 ;; faac, flite, libgsm, libde265, libmms, libmimic, mjpegtools,
366 ;; mpeg2enc, libofa, opencv, openh264, openni2, libtimemmgr, wildmidi,
367 ;; openspc, gme, sbc, schroedinger, zbar, librtmp, spandsp
371 ("fluidsynth" ,fluidsynth)
375 ("libdvdnav" ,libdvdnav)
376 ("libdvdread" ,libdvdread)
377 ("libgcrypt" ,libgcrypt)
378 ("libgudev" ,libgudev)
380 ("libmodplug" ,libmodplug)
382 ("libsndfile" ,libsndfile)
386 ("libvdpau" ,libvdpau)
394 ("openjpeg" ,openjpeg)
399 ;("qtdeclarative" ,qtdeclarative)
400 ;("qtx11extras" ,qtx11extras)
401 ("soundtouch" ,soundtouch)
403 ("wayland" ,wayland)))
404 (home-page "https://gstreamer.freedesktop.org/")
405 (synopsis "Plugins for the GStreamer multimedia library")
407 "GStreamer Bad Plug-ins is a set of plug-ins whose quality aren't up to
408 par compared to the rest.")
409 (license license:lgpl2.0+)))
411 (define-public gst-plugins-ugly
413 (name "gst-plugins-ugly")
418 (uri (string-append "https://gstreamer.freedesktop.org/src/"
419 name "/" name "-" version ".tar.xz"))
422 "1jpvc32x6q01zjkfgh6gmq6aaikiyfwwnhj7bmvn52syhrdl202m"))))
423 (build-system meson-build-system)
425 `(("gst-plugins-base" ,gst-plugins-base)
428 ("libmpeg2" ,libmpeg2)
429 ("libdvdread" ,libdvdread)
432 ;; * opencore-amr (for the AMR-NB decoder and encoder and the
433 ;; AMR-WB decoder) <http://sourceforge.net/projects/opencore-amr/>
436 `(("glib:bin" ,glib "bin")
437 ("pkg-config" ,pkg-config)
438 ("python-wrapper" ,python-wrapper)))
439 (home-page "https://gstreamer.freedesktop.org/")
440 (synopsis "GStreamer plugins from the \"ugly\" set")
441 (description "GStreamer Ugly Plug-ins. This set contains those plug-ins
442 which the developers consider to have good quality code but that might pose
443 distribution problems in some jurisdictions, e.g. due to patent threats.")
444 (license license:lgpl2.0+)))
446 (define-public gst-libav
453 "https://gstreamer.freedesktop.org/src/" name "/"
454 name "-" version ".tar.xz"))
457 "1wpfilc98bad9nsv3y1qapxp35dvn2mvwvrmqwrsj58cf09gc967"))
458 (modules '((guix build utils)))
461 ;; Drop bundled ffmpeg.
462 (delete-file-recursively "gst-libs/ext/libav")
464 (build-system meson-build-system)
466 `(("pkg-config" ,pkg-config)
469 `(("gst-plugins-base" ,gst-plugins-base)
473 (home-page "https://gstreamer.freedesktop.org/")
474 (synopsis "Plugins for the GStreamer multimedia library")
476 "This GStreamer plugin supports a large number of audio and video
477 compression formats through the use of the libav library.")
478 (license license:gpl2+)))
480 (define-public gst-editing-services
482 (name "gst-editing-services")
487 "https://gstreamer.freedesktop.org/src/" name "/"
488 "gstreamer-editing-services-" version ".tar.xz"))
491 "05hcf3prna8ajjnqd53221gj9syarrrjbgvjcbhicv0c38csc1hf"))))
492 (build-system meson-build-system)
494 ;; FIXME: 16/22 failing tests.
497 `(("gst-plugins-base" ,gst-plugins-base)
498 ("libxml2" ,libxml2)))
501 ("gst-plugins-bad" ,gst-plugins-bad)
502 ("gst-plugins-good" ,gst-plugins-good)
504 ("pkg-config" ,pkg-config)
506 (home-page "https://gstreamer.freedesktop.org/")
507 (synopsis "GStreamer library for non-linear editors")
509 "This is a high-level library for facilitating the creation of audio/video
510 non-linear editors.")
511 (license license:gpl2+)))
513 (define-public python-gst
520 "https://gstreamer.freedesktop.org/src/gst-python/"
521 "gst-python-" version ".tar.xz"))
524 "1a48ca66izmm8hnp608jv5isg3jxb0vlfmhns0bg9nbkilag7390"))
526 (search-patches "python-gst-fix-build-with-python-3.8.patch"))))
527 (build-system meson-build-system)
529 `(#:modules ((guix build meson-build-system)
531 ((guix build python-build-system) #:prefix python:))
532 #:imported-modules (,@%meson-build-system-modules
533 (guix build python-build-system))
536 "-Dpygi-overrides-dir="
537 (python:site-packages %build-inputs %outputs) "gi/overrides"))))
539 `(("pkg-config" ,pkg-config)
542 `(("gst-plugins-base" ,gst-plugins-base)
543 ("python-pygobject" ,python-pygobject)))
544 (home-page "https://gstreamer.freedesktop.org/")
545 (synopsis "GStreamer GObject Introspection overrides for Python")
547 "This package contains GObject Introspection overrides for Python that can
548 be used by Python applications using GStreamer.")
549 (license license:lgpl2.1+)
550 (properties `((python2-variant . ,(delay python2-gst))))))
552 (define-public python2-gst
553 (package (inherit python-gst)
556 `(("pkg-config" ,pkg-config)
557 ("python" ,python-2)))
559 `(("gst-plugins-base" ,gst-plugins-base)
560 ("python-pygobject" ,python2-pygobject)))))
562 (define-public gst123
568 (uri (string-append "http://space.twc.de/~stefan/gst123/gst123-"
572 "0zaa117n4wkya9p903vkj8hj58lmdb66pxsdx5wwcv7nffbp5d67"))))
573 (build-system gnu-build-system)
577 ("gstreamer" ,gstreamer)
578 ("gst-plugins-base" ,gst-plugins-base)))
580 `(("pkg-config" ,pkg-config)))
581 (home-page "http://space.twc.de/~stefan/gst123.php")
582 (synopsis "Flexible command line media player based on gstreamer")
583 (description "The program gst123 is designed to be a more flexible command
584 line player in the spirit of ogg123 and mpg123, based on the gstreamer media
585 framework. It plays all file formats gstreamer supports, so if you have a
586 music collection which contains different file formats, like flac, ogg and
587 mp3, you can use gst123 to play all your music files.")
588 (license license:lgpl2.0+)))