gnu: xorg-sgml-doctools: Update to 1.12.
[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, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
11 ;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com>
12 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages gstreamer)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system meson)
37 #:use-module (guix build-system trivial)
38 #:use-module (guix utils)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages aidc)
41 #:use-module (gnu packages audio)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages bash)
45 #:use-module (gnu packages bison)
46 #:use-module (gnu packages cdrom)
47 #:use-module (gnu packages curl)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages documentation)
50 #:use-module (gnu packages elf)
51 #:use-module (gnu packages flex)
52 #:use-module (gnu packages freedesktop)
53 #:use-module (gnu packages gettext)
54 #:use-module (gnu packages ghostscript)
55 #:use-module (gnu packages gl)
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages gnupg)
59 #:use-module (gnu packages graphics)
60 #:use-module (gnu packages graphviz)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages image)
63 #:use-module (gnu packages image-processing)
64 #:use-module (gnu packages iso-codes)
65 #:use-module (gnu packages java)
66 #:use-module (gnu packages libunwind)
67 #:use-module (gnu packages libusb)
68 #:use-module (gnu packages linux)
69 #:use-module (gnu packages maths)
70 #:use-module (gnu packages mp3)
71 #:use-module (gnu packages multiprecision)
72 #:use-module (gnu packages music)
73 #:use-module (gnu packages ncurses)
74 #:use-module (gnu packages nettle)
75 #:use-module (gnu packages networking)
76 #:use-module (gnu packages ocr)
77 #:use-module (gnu packages perl)
78 #:use-module (gnu packages photo)
79 #:use-module (gnu packages pulseaudio)
80 #:use-module (gnu packages qt)
81 #:use-module (gnu packages rdf)
82 #:use-module (gnu packages sdl)
83 #:use-module (gnu packages shells)
84 #:use-module (gnu packages video)
85 #:use-module (gnu packages xorg)
86 #:use-module (gnu packages xdisorg)
87 #:use-module (gnu packages xiph)
88 #:use-module (gnu packages pkg-config)
89 #:use-module (gnu packages ruby)
90 #:use-module (gnu packages speech)
91 #:use-module (gnu packages python)
92 #:use-module (gnu packages ssh)
93 #:use-module (gnu packages telephony)
94 #:use-module (gnu packages tls)
95 #:use-module (gnu packages version-control)
96 #:use-module (gnu packages vulkan)
97 #:use-module (gnu packages webkit)
98 #:use-module (gnu packages assembly)
99 #:use-module (gnu packages xml))
100
101 (define-public openni2
102 (package
103 (name "openni2")
104 (version "2.2.0")
105 (source
106 (origin
107 (method git-fetch)
108 (uri
109 (git-reference
110 (url "https://github.com/occipital/OpenNI2")
111 (commit (string-append "v" version "-debian"))))
112 (file-name (git-file-name name version))
113 (sha256
114 (base32 "0mfnyzpq53wnzgjfx91xcbx0nrl0lp1vrk1rk20a3gb3kshsr675"))))
115 (build-system gnu-build-system)
116 (arguments
117 `(#:tests? #f ; No target
118 #:phases
119 (modify-phases %standard-phases
120 (delete 'configure))))
121 (native-inputs
122 `(("graphviz" ,graphviz)
123 ("doxygen" ,doxygen)
124 ("openjdk" ,openjdk14)
125 ("openjdk:jdk" ,openjdk14 "jdk")
126 ("python" ,python-wrapper)))
127 (inputs
128 `(("freeglut3" ,freeglut)
129 ("libudev" ,eudev)
130 ("libusb" ,libusb)))
131 (synopsis "Framework for sensor-based 'Natural Interaction")
132 (description "OpenNI is a framework for getting data to support
133 'Natural Interaction', i.e. skeleton tracking, gesture tracking, and similar
134 ways of getting data from humans. It provides the interface for physical devices
135 and for middleware components.")
136 (home-page "https://structure.io/openni")
137 (license license:asl2.0)))
138
139 (define-public libdc1394
140 (package
141 (name "libdc1394")
142 (version "2.2.6")
143 (source (origin
144 (method url-fetch)
145 (uri
146 (string-append "https://sourceforge.net/projects/" name "/files/"
147 name "-2" "/" version "/" name "-" version ".tar.gz"))
148 (sha256
149 (base32 "1v8gq54n1pg8izn7s15yylwjf8r1l1dmzbm2yvf6pv2fmb4mz41b"))))
150 (build-system gnu-build-system)
151 (native-inputs
152 (list doxygen perl pkg-config))
153 (inputs
154 (list glu
155 libraw1394
156 libusb
157 libxv
158 mesa
159 sdl
160 v4l-utils))
161 (synopsis "1394-Based Digital Camera Control Library")
162 (description "LibDC1394 is a library that provides functionality to control
163 any camera that conforms to the 1394-Based Digital Camera Specification written
164 by the 1394 Trade Association. It utilizes the lowlevel functionality provided
165 by libraw1394 to communicate with the camera. It also uses the video1394 kernel
166 module for the DMA capture of the video flow.")
167 (home-page "https://damien.douxchamps.net/ieee1394/libdc1394/")
168 (license license:lgpl2.0+)))
169
170 (define-public ccextractor
171 (package
172 (name "ccextractor")
173 (version "0.88")
174 (source
175 (origin
176 (method git-fetch)
177 (uri
178 (git-reference
179 (url "https://github.com/CCExtractor/ccextractor")
180 (commit (string-append "v" version))))
181 (file-name (git-file-name name version))
182 (sha256
183 (base32 "1sya45hvv4d46bk7541yimmafgvgyhkpsvwfz9kv6pm4yi1lz6nb"))))
184 (build-system cmake-build-system)
185 (arguments
186 `(#:tests? #f ; No target
187 #:configure-flags
188 (list
189 "-DWITH_FFMPEG=ON"
190 "-DWITH_OCR=ON"
191 "-DWITH_SHARING=ON"
192 "-DWITH_HARDSUBX=ON")
193 #:phases
194 (modify-phases %standard-phases
195 ;; The package is in a sub-dir of this repo.
196 (add-after 'unpack 'chdir
197 (lambda _
198 (chdir "src")
199 #t))
200 (add-after 'chdir 'fix-build-errors
201 (lambda _
202 (substitute* "CMakeLists.txt"
203 (("libnanomsg")
204 "nanomsg"))
205 #t)))))
206 (native-inputs
207 `(("perl" ,perl)
208 ("pkg-config" ,pkg-config)
209 ("python" ,python-wrapper)))
210 (inputs
211 `(("ffmeg" ,ffmpeg-3.4)
212 ("nanomsg" ,nanomsg)
213 ("leptonica" ,leptonica)
214 ("ocr" ,tesseract-ocr)
215 ("zlib" ,zlib)))
216 (synopsis "Closed Caption Extractor")
217 (description "CCExtractor is a tool that analyzes video files and produces
218 independent subtitle files from the closed captions data. It is portable, small,
219 and very fast.")
220 (home-page "https://www.ccextractor.org/")
221 (license license:gpl2+)))
222
223 (define-public libvisual
224 (package
225 (name "libvisual")
226 (version "0.4.0")
227 (source
228 (origin
229 (method git-fetch)
230 (uri
231 (git-reference
232 (url "https://github.com/Libvisual/libvisual")
233 (commit (string-append name "-" version))))
234 (file-name (git-file-name name version))
235 (sha256
236 (base32 "02xwakwkqjsznc03pjlb6hcv1li1gw3r8xvyswqsm4msix5xq18a"))))
237 (build-system gnu-build-system)
238 (arguments
239 `(#:phases
240 (modify-phases %standard-phases
241 ;; The package is in a sub-dir of this repo.
242 (add-after 'unpack 'chdir
243 (lambda _
244 (chdir "libvisual")
245 #t)))))
246 (native-inputs
247 `(("gettext" ,gettext-minimal)
248 ("libintl" ,intltool)
249 ("libtool" ,libtool)
250 ("pkg-config" ,pkg-config)))
251 (inputs
252 (list sdl))
253 (native-search-paths
254 (list
255 (search-path-specification
256 (variable "LIBVISUAL_PLUGINS_BASE_DIR")
257 (files '("lib/libvisual-0.4")))))
258 ;; To load libvisual-plugins.
259 (search-paths native-search-paths)
260 (synopsis "Audio visualisation library")
261 (description "Libvisual is a library that acts as a middle layer between
262 applications that want audio visualisation and audio visualisation plugins.")
263 (home-page "http://libvisual.org/")
264 (license
265 (list
266 ;; Libraries.
267 license:lgpl2.1+
268 ;; Examples and Tests.
269 license:gpl2+))))
270
271 (define-public libvisual-plugins
272 (package
273 (name "libvisual-plugins")
274 (version "0.4.0")
275 (source
276 (origin
277 (method git-fetch)
278 (uri
279 (git-reference
280 (url "https://github.com/Libvisual/libvisual")
281 (commit (string-append name "-" version))))
282 (file-name (git-file-name name version))
283 (sha256
284 (base32 "02xwakwkqjsznc03pjlb6hcv1li1gw3r8xvyswqsm4msix5xq18a"))))
285 (build-system gnu-build-system)
286 (arguments
287 `(#:configure-flags
288 (list
289 "--disable-gstreamer-plugin"
290 "--disable-corona"
291 "--disable-gforce"
292 (string-append "--with-plugins-base-dir=" (assoc-ref %outputs "out")
293 "/lib/libvisual-0.4"))
294 #:phases
295 (modify-phases %standard-phases
296 ;; The package is in a sub-dir of this repo.
297 (add-after 'unpack 'chdir
298 (lambda _
299 (chdir "libvisual-plugins")
300 #t)))))
301 (native-inputs
302 `(("bison" ,bison)
303 ("flex" ,flex)
304 ("gettext" ,gettext-minimal)
305 ("libintl" ,intltool)
306 ("libtool" ,libtool)
307 ("pkg-config" ,pkg-config)))
308 (inputs
309 `(("alsa-lib" ,alsa-lib)
310 ("esound" ,esound)
311 ("librsvg" ,librsvg)
312 ("gtk+" ,gtk+-2)
313 ("jack" ,jack-2)
314 ("libx11" ,libx11)
315 ("libxext" ,libxext)))
316 (propagated-inputs
317 (list libvisual))
318 (synopsis "Audio visualisation library")
319 (description "Libvisual is a library that acts as a middle layer between
320 applications that want audio visualisation and audio visualisation plugins.")
321 (home-page "http://libvisual.org/")
322 (license license:gpl2+)))
323
324 (define-public esound
325 (package
326 (name "esound")
327 (version "0.2.41")
328 (source
329 (origin
330 (method git-fetch)
331 (uri
332 (git-reference
333 (url "https://gitlab.gnome.org/Archive/esound.git")
334 (commit "ESOUND_0_2_41")))
335 (file-name (git-file-name name version))
336 (sha256
337 (base32 "141jg70fim276i8k2kyypm84gy89i1k9mm4yf68mfwnybvjw1d6n"))))
338 (build-system gnu-build-system)
339 (native-inputs
340 (list autoconf
341 automake
342 gettext-minimal
343 gnome-common
344 libtool
345 pkg-config
346 tcsh ; for the tests
347 which))
348 (inputs
349 (list alsa-lib pcaudiolib tcp-wrappers))
350 (propagated-inputs
351 (list audiofile))
352 (synopsis "Enlightened Sound Daemon")
353 (description "The Enlightened Sound Daemon mixes several audio streams for
354 playback by a single audio device. You can also pre-load samples, and play them
355 back without having to send all the data for the sound. Network transparency is
356 also built in, so you can play sounds on one machine, and listen to them on
357 another.")
358 (home-page "https://web.archive.org/web/20160528230227/
359 http://www.tux.org/~ricdude/overview.html")
360 (license
361 (list
362 ;; Libraries.
363 license:lgpl2.0+
364 ;; Others.
365 license:gpl2+))))
366
367 (define-public orc
368 (package
369 (name "orc")
370 (version "0.4.32")
371 (source (origin
372 (method url-fetch)
373 (uri (string-append "https://gstreamer.freedesktop.org/data/src/"
374 "orc/orc-" version ".tar.xz"))
375 (sha256
376 (base32
377 "1w0qmyj3v9sb2g7ff39pp38b9850y9hyy0bag26ifrby5f7ksvm6"))))
378 (build-system meson-build-system)
379 (arguments
380 `(#:phases
381 (modify-phases %standard-phases
382 (add-after 'unpack 'disable-faulty-test
383 (lambda _
384 ;; XXX Disable the 'test-limits' and 'exec_opcodes_sys'
385 ;; tests, which fail on some machines. See:
386 ;; https://bugzilla.gnome.org/show_bug.cgi?id=735273
387 (substitute* '("testsuite/test-limits.c"
388 "testsuite/exec_opcodes_sys.c")
389 (("if \\(error\\) return 1;")
390 "if (error) return 77;"))
391 #t)))))
392 (native-inputs
393 (list gtk-doc/stable))
394 (home-page "https://gstreamer.freedesktop.org/modules/orc.html")
395 (synopsis "Oil runtime compiler")
396 (description
397 "Orc is a just-in-time compiler implemented as a library and set of
398 associated tools for compiling and executing simple programs that operate on
399 arrays of data.")
400 ;; The source code implementing the Marsenne Twister algorithm is licensed
401 ;; under the 3-clause BSD license, the rest is under 2-clause BSD license.
402 (license (list license:bsd-2 license:bsd-3))))
403
404 (define-public gstreamer-docs
405 (package
406 (name "gstreamer-docs")
407 (version "1.18.5")
408 (source (origin
409 (method url-fetch)
410 (uri (string-append
411 "https://gstreamer.freedesktop.org/src/gstreamer-docs"
412 "/gstreamer-docs-" version ".tar.xz"))
413 (sha256
414 (base32
415 "1xvqrqv1zxqdpvd02dvr0xspk30c8b940vvnr9x75a08nx0x75xh"))))
416 (build-system trivial-build-system)
417 (arguments
418 `(#:modules ((guix build utils))
419 #:builder
420 (begin
421 (use-modules ((guix build utils)))
422 (let* ((source (assoc-ref %build-inputs "source"))
423 (tar (assoc-ref %build-inputs "tar"))
424 (xz (assoc-ref %build-inputs "xz"))
425 (out (assoc-ref %outputs "out"))
426 (books (string-append out "/share/devhelp/books")))
427 (setenv "PATH" (string-append xz "/bin"))
428 (mkdir-p books)
429 (with-directory-excursion books
430 (invoke (string-append tar "/bin/tar") "-xvf" source
431 "--strip-components=3"
432 (string-append ,name "-" ,version
433 "/devhelp/books/GStreamer")))))))
434 (native-inputs
435 (list tar xz))
436 (home-page "https://gstreamer.freedesktop.org/")
437 (synopsis "Developer documentation for GStreamer")
438 (description
439 "This package contains manuals, tutorials, and API reference for
440 the GStreamer multimedia framework.")
441 ;; The documentation is covered by multiple licenses. Anything not
442 ;; explicitly mentioned below is LGPL2.1+. See README.md for details.
443 (license (list
444 ;; The tutorial code can be used with either of these licenses,
445 ;; at the users option.
446 license:lgpl2.1+ license:bsd-2 license:expat
447 ;; The developer manual and plugin writer guide carries
448 ;; the Open Publication License v1.0.
449 (license:fsf-free "https://opencontent.org/openpub/"
450 "The Open Publication License v1.0")
451 ;; Tutorials are covered by CC-BY-SA 4.0.
452 license:cc-by-sa4.0))))
453
454 ;; Increase the test timeouts to accommodate slow or busy machines.
455 (define %common-gstreamer-phases
456 '((add-after 'unpack 'increase-test-timeout
457 (lambda _
458 (substitute* "tests/check/meson.build"
459 (("'CK_DEFAULT_TIMEOUT', '[0-9]*'")
460 "'CK_DEFAULT_TIMEOUT', '600'")
461 (("timeout ?: .*\\)")
462 "timeout: 90 * 60)"))))))
463
464 (define-public gstreamer
465 (package
466 (name "gstreamer")
467 (version "1.18.5")
468 (source
469 (origin
470 (method url-fetch)
471 (uri (string-append
472 "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-"
473 version ".tar.xz"))
474 (sha256
475 (base32
476 "02p8my6dzmm4rvd93s3qnh8w5bm9bh4f7gdydbsvnn9llqr251jm"))))
477 (build-system meson-build-system)
478 (arguments
479 `(#:phases
480 (modify-phases %standard-phases
481 ,@%common-gstreamer-phases
482 ;; FIXME: Since switching to the meson-build-system, two tests
483 ;; started failing on i686. See
484 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/499>.
485 ,@(if (string-prefix? "i686" (or (%current-target-system)
486 (%current-system)))
487 `((add-after 'unpack 'disable-some-tests
488 (lambda _
489 (substitute* "tests/check/gst/gstsystemclock.c"
490 (("tcase_add_test \\(tc_chain, test_stress_cleanup_unschedule.*")
491 "")
492 (("tcase_add_test \\(tc_chain, test_stress_reschedule.*")
493 "")))))
494 '())
495 (add-after 'unpack 'disable-problematic-tests
496 (lambda _
497 ;; Disable the 'pipelines-seek' test, which appears to be load
498 ;; sensitive (see:
499 ;; https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/854).
500 (substitute* "tests/check/meson.build"
501 ((".*'pipelines/seek.c'.*")
502 "")))))))
503 (propagated-inputs
504 ;; In gstreamer-1.0.pc:
505 ;; Requires: glib-2.0, gobject-2.0
506 ;; Requires.private: gmodule-no-export-2.0 libunwind libdw
507 (list elfutils ; libdw
508 glib libunwind))
509 (native-inputs
510 `(("bash-completion" ,bash-completion)
511 ("bison" ,bison)
512 ("flex" ,flex)
513 ("gettext" ,gettext-minimal)
514 ("glib" ,glib "bin")
515 ("gobject-introspection" ,gobject-introspection)
516 ("perl" ,perl)
517 ("pkg-config" ,pkg-config)
518 ("python-wrapper" ,python-wrapper)))
519 (inputs
520 (list gmp libcap
521 ;; For tests.
522 gsl))
523 (native-search-paths
524 (list (search-path-specification
525 (variable "GST_PLUGIN_SYSTEM_PATH")
526 (files '("lib/gstreamer-1.0")))))
527 (home-page "https://gstreamer.freedesktop.org/")
528 (synopsis "Multimedia framework")
529 (description
530 "GStreamer is a library for constructing graphs of media-handling
531 components. The applications it supports range from simple Ogg/Vorbis
532 playback, audio/video streaming to complex audio mixing and video
533 non-linear editing.
534
535 Applications can take advantage of advances in codec and filter technology
536 transparently. Developers can add new codecs and filters by writing a
537 simple plugin with a clean, generic interface.
538
539 This package provides the core library and elements.")
540 (license license:lgpl2.0+)))
541
542 (define-public gst-plugins-base
543 (package
544 (name "gst-plugins-base")
545 (version "1.18.5")
546 (source
547 (origin
548 (method url-fetch)
549 (uri (string-append "https://gstreamer.freedesktop.org/src/" name "/"
550 name "-" version ".tar.xz"))
551 (sha256
552 (base32
553 "18vg8kk7p2p8za8zaqg0v7z6898yw5a3b12vvl7xn02pb3s7l2wn"))))
554 (build-system meson-build-system)
555 (propagated-inputs
556 `(("glib" ,glib) ;required by gstreamer-sdp-1.0.pc
557 ("gstreamer" ,gstreamer) ;required by gstreamer-plugins-base-1.0.pc
558 ;; wayland-client.h is referred to in
559 ;; include/gstreamer-1.0/gst/gl/wayland/gstgldisplay_wayland.h
560 ("wayland" ,wayland)
561 ;; XXX: Do not enable Orc optimizations on ARM systems because
562 ;; it leads to two test failures.
563 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/683
564 ,@(if (string-prefix? "arm" (or (%current-target-system)
565 (%current-system)))
566 '()
567 `(("orc" ,orc))))) ;required by gstreamer-audio-1.0.pc
568 (inputs
569 ;; TODO: Add libvorbisidec
570 `(("cdparanoia" ,cdparanoia)
571 ("pango" ,pango)
572 ("libogg" ,libogg)
573 ("libtheora" ,libtheora)
574 ("libvorbis" ,libvorbis)
575 ("libx11" ,libx11)
576 ("zlib" ,zlib)
577 ("libXext" ,libxext)
578 ("libxv" ,libxv)
579 ("alsa-lib" ,alsa-lib)
580 ("opus" ,opus)
581 ("graphene" ,graphene)
582 ("iso-codes" ,iso-codes)
583 ("libgudev" ,libgudev)
584 ("libjpeg" ,libjpeg-turbo)
585 ("libpng" ,libpng)
586 ("libvisual" ,libvisual)
587 ("mesa" ,mesa)
588 ("wayland-protocols" ,wayland-protocols)))
589 (native-inputs
590 `(("pkg-config" ,pkg-config)
591 ("glib:bin" ,glib "bin")
592 ("gobject-introspection" ,gobject-introspection)
593 ("python-wrapper" ,python-wrapper)
594 ("gettext" ,gettext-minimal)
595 ("xorg-server" ,xorg-server-for-tests)))
596 (arguments
597 `(#:phases
598 (modify-phases %standard-phases
599 ,@%common-gstreamer-phases
600 (add-after 'unpack 'disable-problematic-tests
601 (lambda _
602 (substitute* "tests/check/meson.build"
603 ;; This test causes nondeterministic failures (see:
604 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/950).
605 ((".*'elements/appsrc.c'.*")
606 ""))))
607 (add-before 'configure 'patch
608 (lambda _
609 (substitute* "tests/check/libs/pbutils.c"
610 (("/bin/sh") (which "sh")))))
611 (add-before 'check 'pre-check
612 (lambda _
613 ;; Tests require a running X server.
614 (system "Xvfb :1 +extension GLX &")
615 (setenv "DISPLAY" ":1")
616 ;; Tests write to $HOME.
617 (setenv "HOME" (getcwd))
618 ;; Tests look for $XDG_RUNTIME_DIR.
619 (setenv "XDG_RUNTIME_DIR" (getcwd))
620 ;; For missing '/etc/machine-id'.
621 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
622 (home-page "https://gstreamer.freedesktop.org/")
623 (synopsis
624 "Plugins for the GStreamer multimedia library")
625 (description "This package provides an essential exemplary set of plug-ins
626 for the GStreamer multimedia library.")
627 (license license:lgpl2.0+)))
628
629 (define-public gst-plugins-good
630 (package
631 (name "gst-plugins-good")
632 (version "1.18.5")
633 (source
634 (origin
635 (method url-fetch)
636 (uri
637 (string-append
638 "https://gstreamer.freedesktop.org/src/" name "/"
639 name "-" version ".tar.xz"))
640 (patches (search-patches "gst-plugins-good-fix-test.patch"))
641 (sha256
642 (base32 "0svrapawych2s3lm4lx3x023zxq5kcx50jnfmh0qigszfskyxbis"))))
643 (build-system meson-build-system)
644 (arguments
645 `(#:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
646 #:phases
647 (modify-phases %standard-phases
648 ,@%common-gstreamer-phases
649 (add-before 'check 'pre-check
650 (lambda _
651 ;; Tests require a running X server.
652 (system "Xvfb :1 +extension GLX &")
653 (setenv "DISPLAY" ":1")
654 ;; Tests write to $HOME.
655 (setenv "HOME" (getcwd))
656 ;; Tests look for $XDG_RUNTIME_DIR.
657 (setenv "XDG_RUNTIME_DIR" (getcwd))
658 ;; For missing '/etc/machine-id'.
659 (setenv "DBUS_FATAL_WARNINGS" "0")
660 #t)))))
661 (native-inputs
662 `(("gettext" ,gettext-minimal)
663 ("glib:bin" ,glib "bin")
664 ("gobject-introspection" ,gobject-introspection)
665 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
666 ("perl" ,perl)
667 ("pkg-config" ,pkg-config)
668 ("python-wrapper" ,python-wrapper)
669 ("xmllint" ,libxml2)
670 ("xorg-server" ,xorg-server-for-tests)))
671 (inputs
672 `(("aalib" ,aalib)
673 ("bzip2" ,bzip2)
674 ("cairo" ,cairo)
675 ("flac" ,flac)
676 ("librsvg" ,(librsvg-for-system))
677 ("glib" ,glib)
678 ("glib-networking" ,glib-networking)
679 ("glu" ,glu)
680 ("gtk+" ,gtk+)
681 ("jack" ,jack-2)
682 ("lame" ,lame)
683 ("libavc1394" ,libavc1394)
684 ("libcaca" ,libcaca)
685 ("libdv" ,libdv)
686 ("libgudev" ,libgudev)
687 ("libiec61883" ,libiec61883)
688 ("libjpeg" ,libjpeg-turbo)
689 ("libpng" ,libpng)
690 ("libshout" ,libshout)
691 ("libsoup" ,libsoup)
692 ("libvpx" ,libvpx)
693 ("libx11" ,libx11)
694 ("libxdamage" ,libxdamage)
695 ("libxfixes" ,libxfixes)
696 ("libxext" ,libxext)
697 ("libxshm" ,libxshmfence)
698 ("mesa" ,mesa)
699 ("mpg123" ,mpg123)
700 ("orc" ,orc)
701 ("pulseaudio" ,pulseaudio)
702 ("speex" ,speex)
703 ("taglib" ,taglib)
704 ("twolame" ,twolame)
705 ("v4l-utils" ,v4l-utils)
706 ("wavpack" ,wavpack)
707 ("zlib" ,zlib)))
708 (propagated-inputs
709 (list gstreamer gst-plugins-base))
710 (synopsis "GStreamer plugins and helper libraries")
711 (description "GStreamer-Plugins-Good is a collection of plug-ins you'd want
712 to have right next to you on the battlefield. Shooting sharp and making no
713 mistakes, these plug-ins have it all: good looks, good code, and good
714 licensing. Documented and dressed up in tests. If you're looking for a role
715 model to base your own plug-in on, here it is.")
716 (home-page "https://gstreamer.freedesktop.org/")
717 (license license:lgpl2.0+)))
718
719 (define-public gst-plugins-bad
720 (package
721 (name "gst-plugins-bad")
722 (version "1.18.5")
723 (source (origin
724 (method url-fetch)
725 (uri (string-append "https://gstreamer.freedesktop.org/src/"
726 name "/" name "-" version ".tar.xz"))
727 (sha256
728 (base32
729 "13k7mm2wmsbhd04a20v9lj4afpf0w33ambpwlrw8bl7hjhxr4r51"))
730 (modules '((guix build utils)))
731 (snippet
732 '(begin
733 ;; Delete bundled copy of usrsctp.
734 (delete-file-recursively "ext/sctp/usrsctp")))))
735 (build-system meson-build-system)
736 (arguments
737 `(#:configure-flags '("-Dsctp-internal-usrsctp=disabled")
738 #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
739 #:phases
740 (modify-phases %standard-phases
741 ,@%common-gstreamer-phases
742 ,@(if (string-prefix? "arm" (or (%current-target-system)
743 (%current-system)))
744 ;; Disable test that fails on ARMv7.
745 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1188
746 `((add-after 'unpack 'disable-asfmux-test
747 (lambda _
748 (substitute* "tests/check/meson.build"
749 (("\\[\\['elements/asfmux\\.c'\\]\\],")
750 "")))))
751 '())
752 (add-after 'unpack 'adjust-tests
753 (lambda* (#:key native-inputs inputs #:allow-other-keys)
754 (let ((gst-plugins-good (assoc-ref (or native-inputs inputs)
755 "gst-plugins-good")))
756 (substitute* "tests/check/meson.build"
757 ;; Make gst-plugin-good available for tests, see
758 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1426
759 (("'GST_PLUGIN_SYSTEM_PATH_1_0', ''")
760 (string-append "'GST_PLUGIN_SYSTEM_PATH_1_0', '"
761 gst-plugins-good "/lib/gstreamer-1.0'"))
762
763 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1136
764 ((".*elements/msdkh264enc\\.c.*") "")
765 ((".*elements/svthevcenc\\.c.*") "")
766
767 ;; The 'elements_shm.test_shm_live' test sometimes times out
768 ;; (see:
769 ;; https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/790).
770 ((".*'elements/shm\\.c'.*") "")
771
772 ;; FIXME: Why is this failing.
773 ((".*elements/dash_mpd\\.c.*") "")
774
775 ;; These tests are flaky and occasionally time out:
776 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/932
777 ((".*elements/curlhttpsrc\\.c.*") "")
778 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1412
779 ((".*elements/dtls\\.c.*") ""))
780 (substitute* "tests/check/elements/zxing.c"
781 ;; zxing 1.2.0 seemingly changed the type representation of
782 ;; the EAN_13 structure; disable it.
783 ((".*\"EAN_13\".*")
784 "")))))
785 (add-before 'check 'pre-check
786 (lambda _
787 ;; Tests require a running X server.
788 (system "Xvfb :1 +extension GLX &")
789 (setenv "DISPLAY" ":1")
790 ;; Tests write to $HOME.
791 (setenv "HOME" (getcwd))
792 ;; Tests look for $XDG_RUNTIME_DIR.
793 (setenv "XDG_RUNTIME_DIR" (getcwd))
794 ;; For missing '/etc/machine-id'.
795 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
796 (propagated-inputs
797 (list gstreamer gst-plugins-base))
798 (native-inputs
799 `(("gettext" ,gettext-minimal)
800 ("glib:bin" ,glib "bin") ; for glib-mkenums, etc.
801 ("gobject-introspection" ,gobject-introspection)
802 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
803 ("gst-plugins-good" ,gst-plugins-good) ;for tests
804 ("perl" ,perl)
805 ("pkg-config" ,pkg-config)
806 ("python" ,python-wrapper)
807 ("xorg-server" ,xorg-server-for-tests)))
808 (inputs
809 `(("bluez" ,bluez)
810 ("bzip2" ,bzip2)
811 ("cairo" ,cairo)
812 ;; ("ccextractor" ,ccextractor)
813 ("chromaprint" ,chromaprint)
814 ("curl" ,curl)
815 ("directfb" ,directfb)
816 ;;("dssim" ,dssim)
817 ("faac" ,faac)
818 ("faad2" ,faad2)
819 ("flite" ,flite)
820 ("fluidsynth" ,fluidsynth)
821 ("glib" ,glib)
822 ("glib-networking" ,glib-networking)
823 ("glu" ,glu)
824 ("gsm" ,gsm)
825 ("gtk+" ,gtk+)
826 ("iqa" ,iqa)
827 ("ladspa" ,ladspa)
828 ("lcms" ,lcms)
829 ("libaom" ,libaom)
830 ("libass" ,libass)
831 ("libbs2b" ,libbs2b)
832 ("libdc1394" ,libdc1394)
833 ("libdca" ,libdca)
834 ("libde265" ,libde265)
835 ("libdrm" ,libdrm)
836 ("libdvdnav" ,libdvdnav)
837 ("libdvdread" ,libdvdread)
838 ("libexif" ,libexif)
839 ("libfdk" ,libfdk)
840 ("libgcrypt" ,libgcrypt)
841 ("libgme" ,libgme)
842 ("libgudev" ,libgudev)
843 ("libkate" ,libkate)
844 ("libmfx" ,mediasdk)
845 ("libmms" ,libmms)
846 ("libmodplug" ,libmodplug)
847 ("libmpcdec" ,libmpcdec)
848 ("libnice" ,libnice)
849 ("libofa" ,libofa)
850 ("libopenmpt" ,libopenmpt)
851 ("librsvg" ,librsvg)
852 ("libsndfile" ,libsndfile)
853 ("libsrtp" ,libsrtp)
854 ("libssh2" ,libssh2)
855 ("libtiff" ,libtiff)
856 ("libusb" ,libusb)
857 ("libva" ,libva)
858 ("libvdpau" ,libvdpau)
859 ("libwebp" ,libwebp)
860 ("libx11" ,libx11)
861 ("libxcb" ,libxcb)
862 ("libxext" ,libxext)
863 ("libxkbcommon" ,libxkbcommon)
864 ("libxml2" ,libxml2)
865 ("libxshm" ,libxshmfence)
866 ("lilv" ,lilv)
867 ("lrdf" ,lrdf)
868 ("lv2" ,lv2)
869 ("mesa" ,mesa)
870 ("mjpegtools" ,mjpegtools)
871 ("neon" ,neon)
872 ("nettle" ,nettle)
873 ("openal" ,openal)
874 ;; ("opencv" ,opencv)
875 ("openexr" ,openexr)
876 ("openh264" ,openh264)
877 ("openjpeg" ,openjpeg)
878 ;; ("openni2" ,openni2)
879 ("opensles" ,opensles)
880 ("openssl" ,openssl)
881 ("opus" ,opus)
882 ("orc" ,orc)
883 ("pango" ,pango)
884 ("rtmp" ,rtmpdump)
885 ("sbc" ,sbc)
886 ("sctp" ,lksctp-tools)
887 ("soundtouch" ,soundtouch)
888 ("spandsp" ,spandsp)
889 ("srt" ,srt)
890 ("svthevcenc" ,svt-hevc)
891 ("tinyalsa" ,tinyalsa)
892 ("transcode" ,transcode)
893 ("usrsctp" ,usrsctp)
894 ("v4l" ,v4l-utils)
895 ("voaacenc" ,vo-aacenc)
896 ("voamrwbenc" ,vo-amrwbenc)
897 ("vulkan-headers" ,vulkan-headers)
898 ("vulkan-loader" ,vulkan-loader)
899 ("x265" ,x265)
900 ("wayland" ,wayland)
901 ("webrtcdsp" ,webrtc-audio-processing)
902 ("wildmidi" ,wildmidi)
903 ("wpebackend-fdo" ,wpebackend-fdo)
904 ("zbar" ,zbar)
905 ("zxing" ,zxing-cpp-1.2)))
906 (home-page "https://gstreamer.freedesktop.org/")
907 (synopsis "Plugins for the GStreamer multimedia library")
908 (description
909 "GStreamer Bad Plug-ins is a set of plug-ins whose quality aren't up to
910 par compared to the rest.")
911 (license license:lgpl2.0+)))
912
913 (define-public gst-plugins-ugly
914 (package
915 (name "gst-plugins-ugly")
916 (version "1.18.5")
917 (source
918 (origin
919 (method url-fetch)
920 (uri
921 (string-append "https://gstreamer.freedesktop.org/src/"
922 name "/" name "-" version ".tar.xz"))
923 (sha256
924 (base32 "1nb6kz3gbn8r0sld6xkm16qpgyb2bvhafb7sff9rgagqk0z80cnz"))))
925 (build-system meson-build-system)
926 (arguments
927 `(#:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
928 #:phases
929 (modify-phases %standard-phases
930 ,@%common-gstreamer-phases
931 (add-before 'check 'pre-check
932 (lambda _
933 ;; Tests require a running X server.
934 (system "Xvfb :1 +extension GLX &")
935 (setenv "DISPLAY" ":1")
936 ;; Tests write to $HOME.
937 (setenv "HOME" (getcwd))
938 ;; Tests look for $XDG_RUNTIME_DIR.
939 (setenv "XDG_RUNTIME_DIR" (getcwd))
940 ;; For missing '/etc/machine-id'.
941 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
942 (native-inputs
943 `(("gettext" ,gettext-minimal)
944 ("glib:bin" ,glib "bin")
945 ("gobject-introspection" ,gobject-introspection)
946 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
947 ("perl" ,perl)
948 ("pkg-config" ,pkg-config)
949 ("python-wrapper" ,python-wrapper)
950 ("xorg-server" ,xorg-server-for-tests)))
951 (inputs
952 (list glib
953 glib-networking
954 liba52
955 libcdio
956 libdvdread
957 libmpeg2
958 libx264
959 opencore-amr
960 orc))
961 (propagated-inputs
962 (list gstreamer gst-plugins-base))
963 (synopsis "GStreamer plugins and helper libraries")
964 (description "Gst-Plugins-Ugly are the ones that might have a patent noose
965 around their neck, or a lock-up license, or any other problem that makes you
966 think twice about shipping them.")
967 (home-page "https://gstreamer.freedesktop.org/")
968 (license license:lgpl2.0+)))
969
970 (define-public gst-libav
971 (package
972 (name "gst-libav")
973 (version "1.18.5")
974 (source
975 (origin
976 (method url-fetch)
977 (uri
978 (string-append
979 "https://gstreamer.freedesktop.org/src/" name "/"
980 name "-" version ".tar.xz"))
981 (sha256
982 (base32 "0j55jgk9sbhinfx2gsg21q609x6yzrixrn5xxlxd378fj6500bl2"))))
983 (build-system meson-build-system)
984 (native-inputs
985 (list perl pkg-config python-wrapper ruby))
986 (inputs
987 (list ffmpeg))
988 (propagated-inputs
989 (list gstreamer gst-plugins-base))
990 (synopsis "GStreamer plugins and helper libraries")
991 (description "Gst-Libav contains a GStreamer plugin for using the encoders,
992 decoders, muxers, and demuxers provided by FFmpeg.")
993 (home-page "https://gstreamer.freedesktop.org/")
994 (license license:lgpl2.0+)))
995
996 (define-public gst-editing-services
997 (package
998 (name "gst-editing-services")
999 (version "1.18.5")
1000 (source (origin
1001 (method url-fetch)
1002 (uri (string-append
1003 "https://gstreamer.freedesktop.org/src/" name "/"
1004 "gst-editing-services-" version ".tar.xz"))
1005 (sha256
1006 (base32
1007 "1x8db4021qv4ypq1g6n5q2awrb7glr4xp1h650c3w7q59lwsix4a"))))
1008 (build-system meson-build-system)
1009 (arguments
1010 ;; FIXME: 16/22 failing tests.
1011 `(#:tests? #f
1012 #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
1013 #:phases (modify-phases %standard-phases
1014 ,@%common-gstreamer-phases)))
1015 (propagated-inputs
1016 (list gstreamer gst-plugins-base))
1017 (inputs
1018 (list glib glib-networking gtk+ libxml2))
1019 (native-inputs
1020 `(("flex" ,flex)
1021 ("gobject-introspection" ,gobject-introspection)
1022 ("glib:bin" ,glib "bin")
1023 ("gst-plugins-bad" ,gst-plugins-bad)
1024 ("gst-plugins-good" ,gst-plugins-good)
1025 ("perl" ,perl)
1026 ("pkg-config" ,pkg-config)
1027 ("python" ,python-wrapper)))
1028 (home-page "https://gstreamer.freedesktop.org/")
1029 (synopsis "GStreamer library for non-linear editors")
1030 (description
1031 "This is a high-level library for facilitating the creation of audio/video
1032 non-linear editors.")
1033 (license license:gpl2+)))
1034
1035 (define-public gst-plugins/selection
1036 (lambda* (pkg #:key plugins configure-flags)
1037 "Build PKG with only PLUGINS enabled. Optionally, if CONFIGURE-FLAGS are
1038 given, also pass them to the build system instead of the ones used by PKG."
1039 (package/inherit pkg
1040 (arguments
1041 (substitute-keyword-arguments (package-arguments pkg)
1042 ((#:configure-flags flags `(,@(or configure-flags '())))
1043 `(append
1044 (list
1045 ,@(map (lambda (plugin)
1046 (string-append "-D" plugin "=enabled"))
1047 plugins))
1048 (list ,@(or configure-flags flags))))
1049 ((#:phases phases)
1050 `(modify-phases ,phases
1051 (add-after 'unpack 'disable-auto-plugins
1052 (lambda _
1053 (substitute* "meson_options.txt"
1054 (("'auto'") "'disabled'"))
1055 #t)))))))))
1056
1057 (define-public python-gst
1058 (package
1059 (name "python-gst")
1060 (version "1.18.5")
1061 (source (origin
1062 (method url-fetch)
1063 (uri (string-append
1064 "https://gstreamer.freedesktop.org/src/gst-python/"
1065 "gst-python-" version ".tar.xz"))
1066 (sha256
1067 (base32
1068 "0lmwwmr3wm56qlrdrb0d5cpmqxkcmarz61wmp1nrv5852f3qadjk"))))
1069 (build-system meson-build-system)
1070 (arguments
1071 `(#:modules ((guix build meson-build-system)
1072 (guix build utils)
1073 ((guix build python-build-system) #:prefix python:))
1074 #:imported-modules (,@%meson-build-system-modules
1075 (guix build python-build-system))
1076 #:configure-flags
1077 (list (string-append
1078 "-Dpygi-overrides-dir="
1079 (python:site-packages %build-inputs %outputs) "/gi/overrides"))))
1080 (native-inputs
1081 (list pkg-config python))
1082 (propagated-inputs
1083 (list gst-plugins-base python-pygobject))
1084 (home-page "https://gstreamer.freedesktop.org/")
1085 (synopsis "GStreamer GObject Introspection overrides for Python")
1086 (description
1087 "This package contains GObject Introspection overrides for Python that can
1088 be used by Python applications using GStreamer.")
1089 (license license:lgpl2.1+)))
1090
1091 (define-public gst123
1092 (package
1093 (name "gst123")
1094 (version "0.3.5")
1095 (source (origin
1096 (method url-fetch)
1097 (uri (string-append "http://space.twc.de/~stefan/gst123/gst123-"
1098 version ".tar.bz2"))
1099 (sha256
1100 (base32
1101 "0zaa117n4wkya9p903vkj8hj58lmdb66pxsdx5wwcv7nffbp5d67"))))
1102 (build-system gnu-build-system)
1103 (inputs
1104 (list gtk+-2 ncurses gstreamer gst-plugins-base))
1105 (native-inputs
1106 (list pkg-config))
1107 (home-page "https://space.twc.de/~stefan/gst123.php")
1108 (synopsis "Flexible command line media player based on gstreamer")
1109 (description "The program gst123 is designed to be a more flexible command
1110 line player in the spirit of ogg123 and mpg123, based on the gstreamer media
1111 framework. It plays all file formats gstreamer supports, so if you have a
1112 music collection which contains different file formats, like flac, ogg and
1113 mp3, you can use gst123 to play all your music files.")
1114 (license license:lgpl2.0+)))