projects/guix·blob python-team · refs

1454 lines · 56.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2015 Andreas Enge <[email protected]>
3;;; Copyright © 2014 John Darrington <[email protected]>
4;;; Copyright © 2015, 2016 Sou Bunnbu <[email protected]>
5;;; Copyright © 2015, 2018 Mark H Weaver <[email protected]>
6;;; Copyright © 2016, 2017, 2022-2025 Efraim Flashner <[email protected]>
7;;; Copyright © 2016, 2018 Leo Famulari <[email protected]>
8;;; Copyright © 2017, 2023 Ricardo Wurmus <[email protected]>
9;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2019, 2020 Marius Bakke <[email protected]>
11;;; Copyright © 2020 Liliana Marie Prikler <[email protected]>
12;;; Copyright © 2020 Michael Rohleder <[email protected]>
13;;; Copyright © 2023-2026 Maxim Cournoyer <[email protected]>
14;;; Copyright © 2024 Remco van 't Veer <[email protected]>
15;;; Copyright © 2024 Janneke Nieuwenhuizen <[email protected]>
16;;; Copyright © 2026 Noé Lopez <[email protected]>
17;;;
18;;; This file is part of GNU Guix.
19;;;
20;;; GNU Guix is free software; you can redistribute it and/or modify it
21;;; under the terms of the GNU General Public License as published by
22;;; the Free Software Foundation; either version 3 of the License, or (at
23;;; your option) any later version.
24;;;
25;;; GNU Guix is distributed in the hope that it will be useful, but
26;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28;;; GNU General Public License for more details.
29;;;
30;;; You should have received a copy of the GNU General Public License
31;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33(define-module (gnu packages gstreamer)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix gexp)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix build-system cargo)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system meson)
42 #:use-module (guix build-system pyproject)
43 #:use-module (guix build-system trivial)
44 #:use-module (guix utils)
45 #:use-module (gnu packages)
46 #:use-module (gnu packages aidc)
47 #:use-module (gnu packages audio)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages bash)
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages build-tools)
53 #:use-module (gnu packages cdrom)
54 #:use-module (gnu packages crypto)
55 #:use-module (gnu packages curl)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages documentation)
58 #:use-module (gnu packages elf)
59 #:use-module (gnu packages compiler-tools)
60 #:use-module (gnu packages freedesktop)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages ghostscript)
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages gnome)
66 #:use-module (gnu packages gnupg)
67 #:use-module (gnu packages graphics)
68 #:use-module (gnu packages graphviz)
69 #:use-module (gnu packages gtk)
70 #:use-module (gnu packages image)
71 #:use-module (gnu packages image-processing)
72 #:use-module (gnu packages iso-codes)
73 #:use-module (gnu packages java)
74 #:use-module (gnu packages libunwind)
75 #:use-module (gnu packages libusb)
76 #:use-module (gnu packages linux)
77 #:use-module (gnu packages maths)
78 #:use-module (gnu packages mp3)
79 #:use-module (gnu packages multiprecision)
80 #:use-module (gnu packages music)
81 #:use-module (gnu packages ncurses)
82 #:use-module (gnu packages nettle)
83 #:use-module (gnu packages networking)
84 #:use-module (gnu packages ocr)
85 #:use-module (gnu packages perl)
86 #:use-module (gnu packages photo)
87 #:use-module (gnu packages pulseaudio)
88 #:use-module (gnu packages qt)
89 #:use-module (gnu packages rdf)
90 #:use-module (gnu packages rust)
91 #:use-module (gnu packages rust-apps)
92 #:use-module (gnu packages sdl)
93 #:use-module (gnu packages shells)
94 #:use-module (gnu packages video)
95 #:use-module (gnu packages xorg)
96 #:use-module (gnu packages xdisorg)
97 #:use-module (gnu packages xiph)
98 #:use-module (gnu packages pkg-config)
99 #:use-module (gnu packages ruby)
100 #:use-module (gnu packages speech)
101 #:use-module (gnu packages python)
102 #:use-module (gnu packages ssh)
103 #:use-module (gnu packages telephony)
104 #:use-module (gnu packages tls)
105 #:use-module (gnu packages version-control)
106 #:use-module (gnu packages vulkan)
107 #:use-module (gnu packages webkit)
108 #:use-module (gnu packages assembly)
109 #:use-module (gnu packages xml))
110
111(define-public libdc1394
112 (package
113 (name "libdc1394")
114 (version "2.2.6")
115 (source (origin
116 (method url-fetch)
117 (uri
118 (string-append "https://sourceforge.net/projects/" name "/files/"
119 name "-2" "/" version "/" name "-" version ".tar.gz"))
120 (sha256
121 (base32 "1v8gq54n1pg8izn7s15yylwjf8r1l1dmzbm2yvf6pv2fmb4mz41b"))))
122 (build-system gnu-build-system)
123 (native-inputs
124 (list doxygen perl pkg-config))
125 (inputs
126 (list glu
127 libraw1394
128 libusb
129 libxv
130 mesa
131 sdl
132 v4l-utils))
133 (synopsis "1394-Based Digital Camera Control Library")
134 (description "LibDC1394 is a library that provides functionality to control
135any camera that conforms to the 1394-Based Digital Camera Specification written
136by the 1394 Trade Association. It utilizes the lowlevel functionality provided
137by libraw1394 to communicate with the camera. It also uses the video1394 kernel
138module for the DMA capture of the video flow.")
139 (home-page "https://damien.douxchamps.net/ieee1394/libdc1394/")
140 (license license:lgpl2.0+)))
141
142(define-public ccextractor
143 (let ((commit "81fdecd5af683ff25b953339fdb0d84e141d60c1")
144 (revision "0"))
145 (package
146 (name "ccextractor")
147 (version (git-version "0.94" revision commit))
148 (source
149 (origin
150 (method git-fetch)
151 (uri (git-reference
152 (url "https://github.com/CCExtractor/ccextractor")
153 (commit commit)))
154 (file-name (git-file-name name version))
155 ;; FIXME: Delete the 'src/thirdparty directory and unbundle the
156 ;; libraries it contains, such as freetype, libpng, zlib, and others.
157 (sha256
158 (base32 "0rcig2zma4nrvlx90pkcy1spc1ha2ig0jixm2dnc0f04bzf2n00q"))))
159 (build-system gnu-build-system)
160 (arguments
161 (list #:configure-flags
162 #~(list "--enable-ffmpeg"
163 "--enable-ocr"
164 "--enable-hardsubx"
165 ;; Disable Rust support, as there's no rust source included
166 ;; and cargo wants to fetch the crates from the network
167 ;; (see:
168 ;; https://github.com/CCExtractor/ccextractor/issues/1502).
169 "--without-rust"
170 ;; Workaround the lack of a link directive to tesseract
171 ;; for the hardsubx module.
172 "LDFLAGS=-ltesseract")
173 #:phases #~(modify-phases %standard-phases
174 (add-after 'unpack 'chdir
175 (lambda _
176 (chdir "linux")))
177 (add-after 'chdir 'patch-pre-build.sh
178 (lambda _
179 (substitute* "pre-build.sh"
180 (("/usr/bin/env") (which "env")))))
181 (replace 'check
182 (lambda* (#:key tests? #:allow-other-keys)
183 (when tests?
184 ;; There is no test suite; simply run the binary
185 ;; to validate there are no obvious problems.
186 (invoke "./ccextractor" "--help")))))))
187 (native-inputs (list autoconf-2.72 automake pkg-config))
188 (inputs (list ffmpeg-6 gpac leptonica tesseract-ocr))
189 (synopsis "Closed Caption Extractor")
190 (description "CCExtractor is a tool that analyzes video files and produces
191independent subtitle files from the closed captions data. It is portable, small,
192and very fast.")
193 (home-page "https://ccextractor.org/")
194 (license license:gpl2+))))
195
196(define-public libvisual
197 (package
198 (name "libvisual")
199 (version "0.4.2")
200 (source
201 (origin
202 (method git-fetch)
203 (uri
204 (git-reference
205 (url "https://github.com/Libvisual/libvisual")
206 (commit (string-append name "-" version))))
207 (file-name (git-file-name name version))
208 (sha256
209 (base32 "12xf0qzn9w090kakrj59makjbjg9vhga5mgchmx6c1ypw10fjfbc"))))
210 (build-system gnu-build-system)
211 (arguments
212 (list #:configure-flags
213 #~(list "CFLAGS=-g -O2 -Wno-error=implicit-function-declaration")
214 #:phases
215 #~(modify-phases %standard-phases
216 ;; The package is in a sub-dir of this repo.
217 (add-after 'unpack 'chdir
218 (lambda _
219 (chdir "libvisual"))))))
220 (native-inputs
221 (list autoconf
222 autoconf-archive
223 automake
224 gettext-minimal
225 intltool
226 libtool
227 pkg-config))
228 (inputs
229 (list sdl12-compat))
230 (native-search-paths
231 (list
232 (search-path-specification
233 (variable "LIBVISUAL_PLUGINS_BASE_DIR")
234 (files '("lib/libvisual-0.4")))))
235 ;; To load libvisual-plugins.
236 (search-paths native-search-paths)
237 (synopsis "Audio visualisation library")
238 (description "Libvisual is a library that acts as a middle layer between
239applications that want audio visualisation and audio visualisation plugins.")
240 (home-page "http://libvisual.org/")
241 (license
242 (list
243 ;; Libraries.
244 license:lgpl2.1+
245 ;; Examples and Tests.
246 license:gpl2+))))
247
248(define-public libvisual-plugins
249 (package
250 (name "libvisual-plugins")
251 (version "0.4.2")
252 (source
253 (origin
254 (method git-fetch)
255 (uri (git-reference
256 (url "https://github.com/Libvisual/libvisual")
257 (commit (string-append name "-" version))))
258 (file-name (git-file-name name version))
259 (sha256
260 (base32 "12xf0qzn9w090kakrj59makjbjg9vhga5mgchmx6c1ypw10fjfbc"))))
261 (build-system gnu-build-system)
262 (arguments
263 `(#:configure-flags (list "--disable-gstreamer-plugin"
264 "--disable-oinksie"
265 "--disable-corona"
266 "--disable-gforce"
267 (string-append "--with-plugins-base-dir="
268 (assoc-ref %outputs "out")
269 "/lib/libvisual-0.4"))
270 #:phases (modify-phases %standard-phases
271 ;; The package is in a sub-dir of this repo.
272 (add-after 'unpack 'chdir
273 (lambda _
274 (chdir "libvisual-plugins"))))))
275 (native-inputs
276 (list automake
277 autoconf
278 autoconf-archive
279 bison
280 flex
281 gettext-minimal
282 intltool
283 libtool
284 pkg-config))
285 (inputs
286 (list alsa-lib
287 esound
288 (librsvg-for-system)
289 gtk+
290 jack-2
291 libx11
292 libxext))
293 (propagated-inputs (list libvisual))
294 (synopsis "Audio visualisation library")
295 (description "Libvisual is a library that acts as a middle layer between
296applications that want audio visualisation and audio visualisation plugins.")
297 (home-page "http://libvisual.org/")
298 (license license:gpl2+)))
299
300(define-public esound
301 (package
302 (name "esound")
303 (version "0.2.41")
304 (source
305 (origin
306 (method git-fetch)
307 (uri
308 (git-reference
309 (url "https://gitlab.gnome.org/Archive/esound.git")
310 (commit "ESOUND_0_2_41")))
311 (file-name (git-file-name name version))
312 (sha256
313 (base32 "141jg70fim276i8k2kyypm84gy89i1k9mm4yf68mfwnybvjw1d6n"))
314 (patches (search-patches "esound-c99.patch"))))
315 (build-system gnu-build-system)
316 (native-inputs
317 (list autoconf
318 automake
319 gettext-minimal
320 gnome-common
321 libtool
322 pkg-config
323 tcsh ; for the tests
324 which))
325 (inputs
326 (list alsa-lib pcaudiolib tcp-wrappers))
327 (propagated-inputs
328 (list audiofile))
329 (synopsis "Enlightened Sound Daemon")
330 (description "The Enlightened Sound Daemon mixes several audio streams for
331playback by a single audio device. You can also pre-load samples, and play them
332back without having to send all the data for the sound. Network transparency is
333also built in, so you can play sounds on one machine, and listen to them on
334another.")
335 (home-page "https://web.archive.org/web/20160528230227/http://www.tux.org/~ricdude/overview.html")
336 (license
337 (list
338 ;; Libraries.
339 license:lgpl2.0+
340 ;; Others.
341 license:gpl2+))))
342
343(define-public orc
344 (package
345 (name "orc")
346 (version "0.4.42")
347 (source (origin
348 (method url-fetch)
349 (uri (string-append "https://gstreamer.freedesktop.org/data/src/"
350 "orc/orc-" version ".tar.xz"))
351 (sha256
352 (base32
353 "03694b8jnaqhi9z49v45qchcbvp1i9maamn4fiwcjg5gb6mi5jby"))))
354 (build-system meson-build-system)
355 (arguments
356 `(#:phases
357 (modify-phases %standard-phases
358 (add-after 'unpack 'disable-faulty-test
359 (lambda _
360 ;; XXX Disable the 'test-limits' and 'exec_opcodes_sys'
361 ;; tests, which fail on some machines. See:
362 ;; https://bugzilla.gnome.org/show_bug.cgi?id=735273
363 (substitute* '("testsuite/test-limits.c"
364 "testsuite/exec_opcodes_sys.c")
365 (("if \\(error\\) return 1;")
366 "if (error) return 77;"))
367 #t)))))
368 (native-inputs
369 (list gtk-doc/stable))
370 (home-page "https://gstreamer.freedesktop.org/modules/orc.html")
371 (synopsis "Oil runtime compiler")
372 (description
373 "Orc is a just-in-time compiler implemented as a library and set of
374associated tools for compiling and executing simple programs that operate on
375arrays of data.")
376 ;; The source code implementing the Marsenne Twister algorithm is licensed
377 ;; under the 3-clause BSD license, the rest is under 2-clause BSD license.
378 (license (list license:bsd-2 license:bsd-3))))
379
380(define-public gstreamer-docs
381 (package
382 (name "gstreamer-docs")
383 (version "1.28.1")
384 (source (origin
385 (method url-fetch)
386 (uri (string-append
387 "https://gstreamer.freedesktop.org/src/gstreamer-docs"
388 "/gstreamer-docs-" version ".tar.xz"))
389 (sha256
390 (base32
391 "0bp2rffj82a8c5l119dv4kxjkl1l35d9b0lynfc0vk2krcrb5xyv"))))
392 (build-system trivial-build-system)
393 (arguments
394 `(#:modules ((guix build utils))
395 #:builder
396 (begin
397 (use-modules ((guix build utils)))
398 (let* ((source (assoc-ref %build-inputs "source"))
399 (tar (assoc-ref %build-inputs "tar"))
400 (xz (assoc-ref %build-inputs "xz"))
401 (out (assoc-ref %outputs "out"))
402 (books (string-append out "/share/devhelp/books")))
403 (setenv "PATH" (string-append xz "/bin"))
404 (mkdir-p books)
405 (with-directory-excursion books
406 (invoke (string-append tar "/bin/tar") "-xvf" source
407 "--strip-components=3"
408 (string-append ,name "-" ,version
409 "/devhelp/books/GStreamer")))))))
410 (native-inputs
411 (list tar xz))
412 (home-page "https://gstreamer.freedesktop.org/")
413 (synopsis "Developer documentation for GStreamer")
414 (description
415 "This package contains manuals, tutorials, and API reference for
416the GStreamer multimedia framework.")
417 ;; The documentation is covered by multiple licenses. Anything not
418 ;; explicitly mentioned below is LGPL2.1+. See README.md for details.
419 (license (list
420 ;; The tutorial code can be used with either of these licenses,
421 ;; at the users option.
422 license:lgpl2.1+ license:bsd-2 license:expat
423 ;; The developer manual and plugin writer guide carries
424 ;; the Open Publication License v1.0.
425 (license:fsf-free "https://opencontent.org/openpub/"
426 "The Open Publication License v1.0")
427 ;; Tutorials are covered by CC-BY-SA 4.0.
428 license:cc-by-sa4.0))))
429
430;; Increase the test timeouts to accommodate slow or busy machines.
431(define %common-gstreamer-phases
432 '((add-after 'unpack 'increase-test-timeout
433 (lambda _
434 (substitute* "tests/check/meson.build"
435 (("'CK_DEFAULT_TIMEOUT', '[0-9]*'")
436 "'CK_DEFAULT_TIMEOUT', '600'")
437 (("timeout ?: .*\\)")
438 "timeout: 90 * 60)"))))))
439
440(define-public gstreamer
441 (package
442 (name "gstreamer")
443 (version "1.28.1")
444 (source
445 (origin
446 (method url-fetch)
447 (uri (string-append
448 "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-"
449 version ".tar.xz"))
450 (sha256
451 (base32
452 "0125cqbm5a2bhi37bzs6hgj89r057py3zhkmrfc8ggxx6px2ypmn"))))
453 (build-system meson-build-system)
454 (arguments
455 (list #:disallowed-references (list (this-package-native-input "python"))
456 #:phases
457 #~(modify-phases %standard-phases
458 #$@%common-gstreamer-phases
459 #$@(if (string-prefix? "i686" (or (%current-target-system)
460 (%current-system)))
461 ;; FIXME: These tests consistently fail in the Guix CI:
462 ;; https://issues.guix.gnu.org/57868
463 '((add-after 'unpack 'disable-systemclock-test
464 (lambda _
465 (substitute* "tests/check/gst/gstsystemclock.c"
466 (("tcase_add_test \\(tc_chain, \
467test_stress_cleanup_unschedule.*")
468 "")
469 (("tcase_add_test \\(tc_chain, \
470test_stress_reschedule.*")
471 "")))))
472 '())
473 (add-after 'patch-shebangs 'do-not-capture-python
474 (lambda _
475 ;; The patch-source-shebangs phase causes the following build
476 ;; script to reference Python in its shebang, which is
477 ;; unnecessary.
478 (substitute* (string-append
479 #$output "/libexec/gstreamer-1.0/"
480 "gst-plugins-doc-cache-generator")
481 (((which "python3"))
482 "/usr/bin/env python3")))))))
483 (propagated-inputs
484 ;; In gstreamer-1.0.pc:
485 ;; Requires: glib-2.0, gobject-2.0
486 ;; Requires.private: gmodule-no-export-2.0 libunwind libdw
487 (list elfutils ;libdw
488 glib libunwind))
489 (native-inputs
490 (list bash-completion
491 bison flex
492 gettext-minimal
493 `(,glib "bin")
494 gobject-introspection
495 perl
496 pkg-config
497 python))
498 (inputs
499 (list gmp libcap
500 ;; For tests.
501 gsl))
502 (native-search-paths
503 (list (search-path-specification
504 (variable "GST_PLUGIN_SYSTEM_PATH")
505 (files '("lib/gstreamer-1.0")))))
506 (home-page "https://gstreamer.freedesktop.org/")
507 (synopsis "Multimedia framework")
508 (description
509 "GStreamer is a library for constructing graphs of media-handling
510components. The applications it supports range from simple Ogg/Vorbis
511playback, audio/video streaming to complex audio mixing and video
512non-linear editing.
513
514Applications can take advantage of advances in codec and filter technology
515transparently. Developers can add new codecs and filters by writing a
516simple plugin with a clean, generic interface.
517
518This package provides the core library and elements.")
519 (license license:lgpl2.0+)))
520
521(define-public gst-plugins-base
522 (package
523 (name "gst-plugins-base")
524 (version "1.28.1")
525 (source
526 (origin
527 (method url-fetch)
528 (uri (string-append "https://gstreamer.freedesktop.org/src/" name "/"
529 name "-" version ".tar.xz"))
530 (sha256
531 (base32
532 "15r42ff1mwkj5p3z0dij6d9isi1q02gmjnp8i26xgx9gm71a8ihl"))
533 (patches (search-patches "gst-plugins-base-null-pointer.patch"))))
534 (build-system meson-build-system)
535 (propagated-inputs
536 (list glib ;required by gstreamer-sdp-1.0.pc
537 gstreamer ;required by gstreamer-plugins-base-1.0.pc
538 libdrm ;required by gstreamer-allocators-1.0.pc
539 libgudev ;required by gstreamer-gl-1.0.pc
540 ;; wayland-client.h is referred to in
541 ;; include/gstreamer-1.0/gst/gl/wayland/gstgldisplay_wayland.h
542 wayland
543 orc)) ;required by gstreamer-audio-1.0.pc
544 (inputs
545 ;; TODO: Add libvorbisidec
546 (list alsa-lib
547 cdparanoia
548 graphene
549 iso-codes/pinned
550 libjpeg-turbo
551 libogg
552 libpng
553 libtheora
554 libvisual
555 libvorbis
556 libx11
557 libxext
558 libxv
559 mesa
560 opus
561 pango
562 wayland-protocols
563 zlib))
564 (native-inputs
565 (list pkg-config
566 `(,glib "bin")
567 gobject-introspection
568 python-wrapper
569 gettext-minimal
570 xorg-server-for-tests))
571 (arguments
572 (list
573 #:phases
574 #~(modify-phases %standard-phases
575 #$@%common-gstreamer-phases
576 (add-after 'unpack 'disable-problematic-tests
577 (lambda _
578 (substitute* "tests/check/meson.build"
579 ;; This test causes nondeterministic failures (see:
580 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/895>).
581 ((".*'elements/appsrc.c'.*") "")
582 ;; This one is flaky (see:
583 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/work_items/5016>).
584 ((".*'elements/inputselector.c'.*") ""))
585 ;; Some other tests fail on other architectures.
586 #$@(cond
587 ((target-x86-32?)
588 #~((substitute* "tests/check/meson.build"
589 ((".*'libs/dsd\\.c'.*") "")
590 ((".*'libs/libsabi\\.c'.*") "")
591 ((".*'elements/volume\\.c'.*") ""))))
592 ((target-ppc64le?)
593 #~((substitute* "tests/check/meson.build"
594 ((".*'elements/glimagesink\\.c'.*") "")
595 ((".*'pipelines/gl-launch-lines\\.c'.*") ""))))
596 ((target-arm32?)
597 #~((substitute* "tests/check/meson.build"
598 ((".*'orc_adder.*") ""))))
599 ((target-riscv64?)
600 #~((substitute* "tests/check/meson.build"
601 ((".*'libs/gstglcolorconvert\\.c'.*") "")
602 ((".*'libs/gstglcontext\\.c'.*") "")
603 ((".*'libs/gstglmemory\\.c'.*") "")
604 ((".*'libs/gstglupload\\.c'.*") "")
605 ((".*'elements/glimagesink\\.c'.*") "")
606 ((".*'pipelines/gl-launch-lines\\.c'.*") "")
607 ((".*'elements/glstereo\\.c'.*") "")
608 ((".*'elements/glmixer\\.c'.*") ""))))
609 (else
610 #~()))))
611 (add-before 'configure 'patch
612 (lambda _
613 (substitute* "tests/check/libs/pbutils.c"
614 (("/bin/sh") (which "sh")))))
615 (add-before 'check 'pre-check
616 (lambda _
617 ;; Tests require a running X server.
618 (system "Xvfb :1 +extension GLX &")
619 (setenv "DISPLAY" ":1")
620 ;; Tests write to $HOME.
621 (setenv "HOME" (getcwd))
622 ;; Tests look for $XDG_RUNTIME_DIR.
623 (setenv "XDG_RUNTIME_DIR" (getcwd))
624 ;; For missing '/etc/machine-id'.
625 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
626 (home-page "https://gstreamer.freedesktop.org/")
627 (synopsis
628 "Plugins for the GStreamer multimedia library")
629 (description "This package provides an essential exemplary set of plug-ins
630for the GStreamer multimedia library.")
631 (license license:lgpl2.0+)))
632
633(define-public gst-plugins-good
634 (package
635 (name "gst-plugins-good")
636 (version "1.28.1")
637 (source
638 (origin
639 (method url-fetch)
640 (uri
641 (string-append
642 "https://gstreamer.freedesktop.org/src/" name "/"
643 name "-" version ".tar.xz"))
644 (sha256
645 (base32 "139n8in88003dbx4kv6i69zhl4bs07f1mf201q2n4yhvwjp2d3kk"))))
646 (build-system meson-build-system)
647 (arguments
648 (list
649 #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
650 #:phases
651 #~(modify-phases %standard-phases
652 #$@%common-gstreamer-phases
653 (add-after 'unpack 'absolutize-libsoup-library
654 (lambda* (#:key inputs #:allow-other-keys)
655 (define libsoup
656 (search-input-file inputs "lib/libsoup-3.0.so"))
657
658 (substitute* "ext/soup/gstsouploader.c"
659 (("(#define LIBSOUP_3_SONAME ).+$" _ prefix)
660 (string-append prefix "\"" libsoup "\"\n")))))
661 (add-after 'unpack 'skip-failing-tests
662 (lambda _
663 (substitute* "tests/check/elements/flvmux.c"
664 ;; This test randomly times out (see:
665 ;; https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/786).
666 ((".*tcase_add_test.*test_video_caps_late.*")
667 ""))
668 (substitute* "tests/check/meson.build"
669 ;; Reported as shaky upstream, see
670 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/785>
671 (("\\[ 'elements/flvmux' \\]") "[ 'elements/flvmux', true ]")
672 ;; The elements_matroskademux test fails on i686
673 ;; because of a off-by-one error (see:
674 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/work_items/5127>).
675 #$@(if (target-32bit?)
676 #~(((".*'elements/matroskademux'.*") ""))
677 #~()))))
678 (add-before 'check 'pre-check
679 (lambda _
680 ;; Tests require a running X server.
681 (system "Xvfb :1 +extension GLX &")
682 (setenv "DISPLAY" ":1")
683 ;; Tests write to $HOME.
684 (setenv "HOME" (getcwd))
685 ;; Tests look for $XDG_RUNTIME_DIR.
686 (setenv "XDG_RUNTIME_DIR" (getcwd))
687 ;; For missing '/etc/machine-id'.
688 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
689 (native-inputs
690 (list gettext-minimal
691 `(,glib "bin")
692 gobject-introspection
693 gsettings-desktop-schemas
694 libxml2
695 perl
696 pkg-config
697 python-wrapper
698 xorg-server-for-tests))
699 (inputs
700 (list aalib
701 bzip2
702 cairo
703 flac
704 (librsvg-for-system)
705 glib
706 glib-networking
707 glu
708 gtk+
709 jack-2
710 lame
711 libavc1394
712 libcaca
713 libdv
714 libgudev
715 libiec61883
716 libjpeg-turbo
717 libmpg123
718 libpng
719 libshout
720 libsoup
721 libvpx
722 libx11
723 libxdamage
724 libxext
725 libxfixes
726 libxshmfence
727 mesa
728 orc
729 pulseaudio
730 speex
731 taglib
732 twolame
733 v4l-utils
734 wavpack
735 zlib))
736 (propagated-inputs
737 (list gstreamer gst-plugins-base))
738 (synopsis "GStreamer plugins and helper libraries")
739 (description "GStreamer-Plugins-Good is a collection of plug-ins you'd want
740to have right next to you on the battlefield. Shooting sharp and making no
741mistakes, these plug-ins have it all: good looks, good code, and good
742licensing. Documented and dressed up in tests. If you're looking for a role
743model to base your own plug-in on, here it is.")
744 (home-page "https://gstreamer.freedesktop.org/")
745 (license license:lgpl2.0+)))
746
747(define-public gst-plugins-good-qt
748 (package
749 (inherit gst-plugins-good)
750 (name "gst-plugins-good-qt")
751 (inputs
752 (modify-inputs inputs
753 (prepend qtbase
754 qtdeclarative
755 qtshadertools
756 qttools
757 qtwayland)))))
758
759(define-public gst-plugins-bad
760 (package
761 (name "gst-plugins-bad")
762 (version "1.28.1")
763 (source (origin
764 (method url-fetch)
765 (uri (string-append "https://gstreamer.freedesktop.org/src/"
766 name "/" name "-" version ".tar.xz"))
767 (sha256
768 (base32
769 "18hk8gh97r2cwdazl5ikjwsczk3bkvr4z7nmjc45bdgqhwvmkhan"))
770 (modules '((guix build utils)))
771 (snippet
772 '(begin
773 ;; Delete bundled copy of usrsctp.
774 (delete-file-recursively "ext/sctp/usrsctp")))))
775 (build-system meson-build-system)
776 (arguments
777 (list
778 #:configure-flags #~(list "-Dgpl=enabled"
779 "-Dsctp-internal-usrsctp=disabled"
780 ;; TODO: Figure out why audiovisualizer test
781 ;; fails on riscv64-linux.
782 #$@(if (target-riscv64?)
783 #~("-Daudiovisualizers=disabled")
784 #~()))
785 #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
786 #:phases
787 #~(modify-phases %standard-phases
788 #$@%common-gstreamer-phases
789 (add-after 'unpack 'patch-paths
790 (lambda* (#:key inputs #:allow-other-keys)
791 (substitute* "ext/resindvd/resindvdsrc.c"
792 ;; `g_module_open' is a wrapper above dlopen; pass it the
793 ;; absolute file name of the library to ensure it is always
794 ;; found.
795 (("\"libdvdcss\"")
796 (format #f "~s"
797 (search-input-file inputs "lib/libdvdcss.so"))))))
798 (add-after 'unpack 'adjust-tests
799 (lambda* (#:key native-inputs inputs #:allow-other-keys)
800 (let ((gst-plugins-good (assoc-ref (or native-inputs inputs)
801 "gst-plugins-good")))
802 (substitute* "tests/check/meson.build"
803 ;; Make gst-plugin-good available for tests, see
804 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1426
805 (("'GST_PLUGIN_SYSTEM_PATH_1_0', ''")
806 (string-append "'GST_PLUGIN_SYSTEM_PATH_1_0', '"
807 gst-plugins-good "/lib/gstreamer-1.0'"))
808
809 ;; The 'elements_shm.test_shm_live' test sometimes times out
810 ;; (see:
811 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/790>).
812 ((".*'elements/shm\\.c'.*") "")
813
814 ;; The 'elements_curlhttpsrc' test sometimes times out.
815 ((".*'elements/curlhttpsrc\\.c'.*") "")
816
817 ;; The 'mxfdemux' test fails for unknown reasons (see:
818 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3921>).
819 ((".*'elements/mxfdemux.c'.*") "")
820
821 ;; Unexpected critical/warning, see
822 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/792>
823 ((".*'elements/netsim\\.c'.*") "")
824
825 ;; TODO: Figure out why this test fails on riscv64-linux.
826 #$@(if (target-riscv64?)
827 `((("'elements/viewfinderbin\\.c'\\].*],")
828 "'elements/viewfinderbin.c'], true, ],"))
829 '())
830
831 ;; This test is flaky.
832 ;; https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1244
833 (("'elements/camerabin\\.c'\\].*],")
834 "'elements/camerabin.c'], true, ],")
835
836 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1412
837 ((".*elements/dtls\\.c.*") "")
838
839 ;; Unable to create pipeline 'bin.
840 ;; ( vulkanupload ! vulkancolorconvert ! vulkandownload )':
841 ;; no element "vulkanupload"
842 ((".*elements/vkcolorconvert\\.c.*") "")
843 ((".*elements/vkupload\\.c.*") "")))))
844 (add-before 'check 'pre-check
845 (lambda _
846 ;; Tests require a running X server.
847 (system "Xvfb :1 +extension GLX &")
848 (setenv "DISPLAY" ":1")
849 ;; Tests write to $HOME.
850 (setenv "HOME" (getcwd))
851 ;; Tests look for $XDG_RUNTIME_DIR.
852 (setenv "XDG_RUNTIME_DIR" (getcwd))
853 ;; For missing '/etc/machine-id'.
854 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
855 (propagated-inputs
856 (list gstreamer gst-plugins-base))
857 (native-inputs
858 (list gettext-minimal
859 `(,glib "bin") ; for glib-mkenums, etc.
860 gobject-introspection
861 gsettings-desktop-schemas
862 gst-plugins-good ;for tests
863 perl
864 pkg-config
865 python-wrapper
866 xorg-server-for-tests))
867 (inputs
868 (append
869 (if (target-x86?) (list mediasdk) '())
870 ;; Note: svt-hevc cannot be used, as it would break the package for
871 ;; older x86_64 CPUs that lack AVX2, such as the Core 2 Duo (see:
872 ;; https://github.com/OpenVisualCloud/SVT-HEVC/issues/573#issuecomment-680678144).
873 (list bluez
874 bzip2
875 cairo
876 chromaprint
877 curl
878 directfb
879 ;; dssim
880 faad2
881 flite
882 fluidsynth
883 glib
884 glib-networking
885 glu
886 gsm
887 gtk+
888 iqa
889 ladspa
890 lcms
891 libaom
892 libass
893 libbs2b
894 libdc1394
895 libdca
896 libde265
897 libdrm
898 libdvdnav
899 libdvdread
900 libexif
901 libfdk
902 libgcrypt
903 libgme
904 libgudev
905 libkate
906 libmms
907 libmodplug
908 libmpcdec
909 libnice
910 libofa
911 libopenmpt
912 (librsvg-for-system)
913 libsndfile
914 libsrtp
915 libssh2
916 libtiff
917 libusb
918 libva
919 libvdpau
920 libwebp
921 libx11
922 libxcb
923 libxext
924 libxkbcommon
925 libxml2
926 libxshmfence
927 lilv
928 lrdf
929 lv2
930 mesa
931 mjpegtools
932 neon
933 nettle
934 openal
935 ;; opencv ;would increase the closure size by ca. 430MB
936 openexr
937 openh264
938 openjpeg
939 opensles
940 openssl
941 opus
942 orc
943 pango
944 rtmpdump
945 sbc
946 lksctp-tools
947 soundtouch
948 spandsp
949 srt
950 tinyalsa
951 transcode
952 usrsctp
953 v4l-utils
954 vo-aacenc
955 vo-amrwbenc
956 vulkan-headers
957 vulkan-loader
958 x265
959 wayland
960 webrtc-audio-processing
961 wildmidi
962 wpebackend-fdo
963 zbar-minimal)))
964 (home-page "https://gstreamer.freedesktop.org/")
965 (synopsis "Plugins for the GStreamer multimedia library")
966 (description
967 "GStreamer Bad Plug-ins is a set of plug-ins whose quality aren't up to
968par compared to the rest.")
969 (license license:lgpl2.0+)))
970
971(define-public gst-plugins-rs
972 (package
973 (name "gst-plugins-rs")
974 (version "1.28.1")
975 (source
976 (origin
977 (method git-fetch)
978 (uri (git-reference
979 (url (string-append "https://gitlab.freedesktop.org/gstreamer/"
980 name ".git"))
981 (commit (string-append "gstreamer-" version))))
982 (file-name (git-file-name name version))
983 (sha256
984 (base32
985 "1sfmjrmzqd87fg1y97ysj2348s256dra8wzh7fsbv6a9jd3k76h4"))))
986 (build-system meson-build-system)
987 (outputs '("out" ;mux, text, utils and generic plugins
988 "analytics"
989 "audio"
990 "net"
991 "video"))
992 (properties
993 `((output-synopsis "out" "generic, mux, text and utils plugins")))
994 (arguments
995 (list
996 #:glib-or-gtk? #t
997 #:imported-modules `(,@%meson-build-system-modules
998 ,@%cargo-build-system-modules)
999 #:modules `(((guix build cargo-build-system) #:prefix cargo:)
1000 (guix build meson-build-system)
1001 (guix build utils)
1002 (ice-9 match))
1003 #:configure-flags
1004 #~(list "-Ddebugseimetainserter=disabled" ;test fails
1005 "-Ddoc=disabled" ;requires hotdoc
1006 "-Delevenlabs=disabled" ;test fails
1007 "-Dexamples=disabled" ;causes cargo feature conflicts
1008 "-Dhlssink3=disabled" ;test fails
1009 "-Disobmff=disabled" ;test fails
1010 "-Dquinn=disabled" ;test fails
1011 "-Dskia=disabled" ;attempts to download binaries
1012 "-Dsodium-source=system"
1013 "-Dtests=enabled"
1014 "-Dtracers=disabled" ;test fails
1015 "-Dthreadshare=disabled" ;test fails
1016 "-Dvalidate=disabled" ;requires gst-devtools
1017 "-Dwebrtc=disabled" ;test fails
1018 ;; The 'whisper' option causes "failed to run custom build
1019 ;; command for `whisper-rs-sys v0.14.1`".
1020 "-Dwhisper=disabled")
1021 #:phases
1022 #~(modify-phases %standard-phases
1023 (add-after 'unpack 'use-guix-vendored-dependencies
1024 (lambda _
1025 (substitute* "Cargo.toml"
1026 ;; Prefer to fetch the released crates from crates.io
1027 ;; instead of fetching them from Git.
1028 (("git =.*, branch = \"[^\"]+\",")
1029 ""))
1030 ;; Override dependencies declared with git repos/revisions.
1031 (substitute* "mux/flavors/Cargo.toml"
1032 (("flavors = .*")
1033 "flavors = \"*\"\n"))
1034 (substitute* "video/ffv1/Cargo.toml"
1035 (("ffv1 = .*")
1036 "ffv1 = \"*\"\n"))))
1037 (add-after 'unpack 'delete-conflicting-cargo-config
1038 (lambda _
1039 (delete-file ".cargo/config.toml")))
1040 (add-after 'unpack 'prepare-cargo-build-system
1041 (lambda args
1042 (for-each
1043 (lambda (phase)
1044 (format #t "Running cargo phase: ~a~%" phase)
1045 (apply (assoc-ref cargo:%standard-phases phase)
1046 #:cargo-target #$(cargo-triplet)
1047 args))
1048 '(prepare-rust-crates
1049 unpack-rust-crates
1050 configure
1051 check-for-pregenerated-files
1052 patch-cargo-checksums))))
1053 (add-before 'check 'make-HOME-writable
1054 (lambda _
1055 ;; Some tests like 'hlssink3' require a writable HOME directory.
1056 (setenv "HOME" "/tmp")))
1057 (add-after 'install 'split-into-outputs
1058 (lambda _
1059 (let ((plugins-dir "/lib/gstreamer-1.0/")
1060 (install-plan `((,#$output:analytics
1061 . ("libgstburn.so"
1062 "libgstrsanalytics.so"))
1063 (,#$output:audio
1064 . ("libgstclaxon.so"
1065 "libgstdemucs.so"
1066 "libgstlewton.so"
1067 "libgstrsaudiofx.so"
1068 "libgstrsaudioparsers.so"
1069 "libgstspeechmatics.so"
1070 "libgstspotify.so"))
1071 (,#$output:net
1072 . ("libgstdeepgram.so"
1073 "libgsthlsmultivariantsink.so"
1074 "libgsticecast.so"
1075 "libgstmpegtslive.so"
1076 "libgstndi.so"
1077 "libgstraptorq.so"
1078 "libgstreqwest.so"
1079 "libgstrsonvif.so"
1080 "libgstrsrtp.so"
1081 "libgstrsrtsp.so"
1082 "libgstwebrtchttp.so"))
1083 (,#$output:video
1084 . ("libgstcdg.so"
1085 "libgstffv1.so"
1086 "libgstgif.so"
1087 "libgstgtk4.so"
1088 "libgsthsv.so"
1089 "libgstrav1e.so"
1090 "libgstrsclosedcaption.so"
1091 "libgstrspng.so"
1092 "libgstrsvideofx.so"))
1093 ;; We leave the generic, mux, text and
1094 ;; utils plugins in the default output, as
1095 ;; they are often relied on in gstreamer
1096 ;; pipelines.
1097 ;; (,#$output:generic
1098 ;; . ("libgstrsfile.so"
1099 ;; "libgstrsinter.so"
1100 ;; "libgstgopbuffer.so"
1101 ;; "libgstoriginalbuffer.so"
1102 ;; "libgstsodium.so"
1103 ;; "libgststreamgrouper.so"))
1104 ;; (,#$output:mux
1105 ;; . ("libgstrsflv.so"))
1106 ;; (,#$output:text
1107 ;; . ("libgstjson.so"
1108 ;; "libgstregex.so"
1109 ;; "libgsttextaccumulate.so"
1110 ;; "libgsttextahead.so"
1111 ;; "libgsttextwrap.so"))
1112 ;; (,#$output:utils
1113 ;; . ("libgstfallbackswitch.so"
1114 ;; "libgstlivesync.so"
1115 ;; "libgsttogglerecord.so"
1116 ;; "libgsturiplaylistbin.so"))
1117 )))
1118 (for-each (match-lambda
1119 ((out . plugins)
1120 (let ((src (string-append #$output plugins-dir))
1121 (dest (string-append out plugins-dir)))
1122 (mkdir-p dest)
1123 (for-each (lambda (p)
1124 (rename-file (string-append src p)
1125 (string-append dest p)))
1126 plugins))))
1127 install-plan)))))))
1128 (home-page "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs")
1129 (native-inputs
1130 (list gst-plugins-good ;provides elements used in some tests
1131 nasm
1132 pkg-config
1133 python
1134 rust
1135 rust-cargo-c))
1136 (inputs
1137 (cons* csound
1138 gstreamer
1139 gst-plugins-bad
1140 gst-plugins-base
1141 gst-plugins-good
1142 gtk
1143 libsodium
1144 `(,zstd "lib")
1145 (cargo-inputs 'gst-plugins-rs)))
1146 (synopsis "GStreamer plugins written in Rust")
1147 (description "This package provides a collection of GStreamer plugins
1148written in Rust. The plugins cover many areas such as networking, audio,
1149video, text, and analytics. The default output contains the mux, text, utils
1150and generic plugins, while the other plugins are grouped in outputs named
1151after their category.")
1152 ;; The various plugins in the collection are covered by one of the
1153 ;; following licneses.
1154 (license (list license:mpl2.0
1155 license:asl2.0
1156 license:expat))))
1157
1158(define-public gst-plugins-ugly
1159 (package
1160 (name "gst-plugins-ugly")
1161 (version "1.28.1")
1162 (source
1163 (origin
1164 (method url-fetch)
1165 (uri
1166 (string-append "https://gstreamer.freedesktop.org/src/"
1167 name "/" name "-" version ".tar.xz"))
1168 (sha256
1169 (base32 "0y2sz79ms498mag3rsvkng8q5pmg9f2v0njfq3zw7k1z0v5z70j0"))))
1170 (build-system meson-build-system)
1171 (arguments
1172 (list #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
1173 #:configure-flags #~(list "-Dgpl=enabled")
1174 #:phases
1175 #~(modify-phases %standard-phases
1176 #$@%common-gstreamer-phases
1177 (add-after 'unpack 'patch-paths
1178 (lambda* (#:key inputs #:allow-other-keys)
1179 (substitute* "ext/dvdread/dvdreadsrc.c"
1180 ;; `g_module_open' is a wrapper above dlopen; pass it the
1181 ;; absolute file name of the library to ensure it is always
1182 ;; found.
1183 (("\"libdvdcss\"")
1184 (format #f "~s"
1185 (search-input-file inputs "lib/libdvdcss.so"))))))
1186 (add-before 'check 'pre-check
1187 (lambda _
1188 ;; Tests require a running X server.
1189 (system "Xvfb :1 +extension GLX &")
1190 (setenv "DISPLAY" ":1")
1191 ;; Tests write to $HOME.
1192 (setenv "HOME" (getcwd))
1193 ;; Tests look for $XDG_RUNTIME_DIR.
1194 (setenv "XDG_RUNTIME_DIR" (getcwd))
1195 ;; For missing '/etc/machine-id'.
1196 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
1197 (native-inputs
1198 (list gettext-minimal
1199 `(,glib "bin")
1200 gobject-introspection
1201 gsettings-desktop-schemas
1202 perl
1203 pkg-config
1204 python-wrapper
1205 xorg-server-for-tests))
1206 (inputs
1207 (list glib
1208 glib-networking
1209 liba52
1210 libcdio
1211 libdvdread
1212 libmpeg2
1213 libx264
1214 opencore-amr
1215 orc))
1216 (propagated-inputs
1217 (list gstreamer gst-plugins-base))
1218 (synopsis "GStreamer plugins and helper libraries")
1219 (description "Gst-Plugins-Ugly are the ones that might have a patent noose
1220around their neck, or a lock-up license, or any other problem that makes you
1221think twice about shipping them.")
1222 (home-page "https://gstreamer.freedesktop.org/")
1223 (license license:lgpl2.0+)))
1224
1225(define-public gst-libav
1226 (package
1227 (name "gst-libav")
1228 (version "1.28.1")
1229 (source
1230 (origin
1231 (method url-fetch)
1232 (uri
1233 (string-append
1234 "https://gstreamer.freedesktop.org/src/" name "/"
1235 name "-" version ".tar.xz"))
1236 (sha256
1237 (base32 "16zfxw6h865sqi71j47lllr3y7jlnwsrwmfxvjnxh3wdlfn1madz"))))
1238 (build-system meson-build-system)
1239 (native-inputs (list perl pkg-config python-wrapper ruby))
1240 (inputs (list ffmpeg))
1241 (propagated-inputs (list gstreamer gst-plugins-base))
1242 (synopsis "GStreamer plugins and helper libraries")
1243 (description "Gst-Libav contains a GStreamer plugin for using the encoders,
1244decoders, muxers, and demuxers provided by FFmpeg.")
1245 (home-page "https://gstreamer.freedesktop.org/")
1246 (license license:lgpl2.0+)))
1247
1248(define-public gst-editing-services
1249 (package
1250 (name "gst-editing-services")
1251 (version "1.28.1")
1252 (source (origin
1253 (method url-fetch)
1254 (uri (string-append
1255 "https://gstreamer.freedesktop.org/src/" name "/"
1256 "gst-editing-services-" version ".tar.xz"))
1257 (sha256
1258 (base32
1259 "1p0ml4yyqs840l9zlgw41k1lh8z9jvaangap5azfwsrmw75h0q1x"))))
1260 (build-system meson-build-system)
1261 (arguments
1262 (list
1263 ;; Most of the tests fail (see:
1264 ;; https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2489).
1265 #:tests? #f
1266 #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
1267 #:phases #~(modify-phases %standard-phases
1268 #$@%common-gstreamer-phases)))
1269 (propagated-inputs
1270 (list gstreamer gst-plugins-base))
1271 (inputs
1272 (list glib glib-networking gtk+ libxml2))
1273 (native-inputs
1274 (list flex
1275 gobject-introspection
1276 `(,glib "bin")
1277 gst-plugins-bad
1278 gst-plugins-good
1279 perl
1280 pkg-config
1281 python-wrapper))
1282 (home-page "https://gstreamer.freedesktop.org/")
1283 (synopsis "GStreamer library for non-linear editors")
1284 (description
1285 "This is a high-level library for facilitating the creation of audio/video
1286non-linear editors.")
1287 (license license:gpl2+)))
1288
1289(define-public gst-plugins/selection
1290 (lambda* (pkg #:key plugins configure-flags)
1291 "Build PKG with only PLUGINS enabled. Optionally, if CONFIGURE-FLAGS are
1292given, also pass them to the build system instead of the ones used by PKG."
1293 (package/inherit pkg
1294 (arguments
1295 (substitute-keyword-arguments arguments
1296 ((#:configure-flags flags #~'())
1297 #~(append
1298 (list
1299 #$@(map (lambda (plugin)
1300 (string-append "-D" plugin "=enabled"))
1301 plugins))
1302 #$(or configure-flags flags)))
1303 ((#:phases phases)
1304 #~(modify-phases #$phases
1305 (add-after 'unpack 'disable-auto-plugins
1306 (lambda _
1307 (substitute* "meson.options"
1308 (("'auto'") "'disabled'")))))))))))
1309
1310(define-public gst-plugins-bad-minimal
1311 (package
1312 (inherit (gst-plugins/selection gst-plugins-bad #:plugins '()))
1313 (name "gst-plugins-bad-minimal")
1314 (description "This package provides the smallest selection of GStreamer's
1315\"bad\" plugin set, essentially containing libraries and the gst-transcoder
1316binary, but none of the actual plugins.")))
1317
1318(define-public gst-rtsp-server
1319 (package
1320 (name "gst-rtsp-server")
1321 (version "1.28.1")
1322 (source
1323 (origin
1324 (method url-fetch)
1325 (uri (string-append "https://gstreamer.freedesktop.org/src/" name "/"
1326 name "-" version ".tar.xz"))
1327 (sha256
1328 (base32 "0cpqvdxr7falww14xblqs7la6q2f1z1zbli4vjdp9yqcy9mfil3c"))))
1329 (build-system meson-build-system)
1330 (arguments
1331 (list #:phases
1332 #~(modify-phases %standard-phases
1333 (add-after 'unpack 'disable-failing-tests
1334 (lambda _
1335 (define failing
1336 (list "client" "media" "mediafactory" "rtspserver"
1337 "sessionmedia" "stream" "onvif" "rtspclientsink"))
1338 (substitute* "tests/check/meson.build"
1339 (("'gst/(.*)',?" all test)
1340 (if (member test failing) "" all))))))))
1341 (propagated-inputs
1342 (list gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad))
1343 (native-inputs (list gobject-introspection
1344 `(,glib "bin")
1345 pkg-config
1346 python-wrapper))
1347 (home-page "https://gstreamer.freedesktop.org/")
1348 (synopsis "Library for building RTSP servers with GStreamer")
1349 (description "This package provides a GStreamer extension to handle
1350RTSP connections and messages.")
1351 (license license:lgpl2.0+)))
1352
1353(define-public python-gst
1354 (package
1355 (name "python-gst")
1356 (version "1.28.1")
1357 (source (origin
1358 (method url-fetch)
1359 (uri (string-append
1360 "https://gstreamer.freedesktop.org/src/gst-python/"
1361 "gst-python-" version ".tar.xz"))
1362 (sha256
1363 (base32
1364 "11bhdylgkfcgdlfcv61vyjp0f27sqp3i4y7d8c2a2nxrmnaylz6l"))))
1365 (build-system meson-build-system)
1366 (arguments
1367 (list
1368 #:modules `((guix build meson-build-system)
1369 (guix build utils)
1370 ((guix build pyproject-build-system) #:prefix py:))
1371 #:imported-modules (append %meson-build-system-modules
1372 %pyproject-build-system-modules)
1373 #:configure-flags
1374 #~(list (string-append
1375 "-Dpygi-overrides-dir="
1376 (py:site-packages %build-inputs %outputs) "/gi/overrides"))
1377 #:phases
1378 #~(modify-phases %standard-phases
1379 (add-after 'unpack 'disable-problematic-tests
1380 (lambda _
1381 ;; The 'fundamentals' test fails with a segmentation fault since
1382 ;; 1.28.1 (see:
1383 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4937>).
1384 (substitute* "testsuite/meson.build"
1385 ((".*'fundamentals',.*") ""))))
1386 (delete 'check) ;moved after install
1387 (add-after 'install 'check
1388 (assoc-ref %standard-phases 'check))
1389 (add-before 'check 'add-install-to-pythonpath
1390 ;; Required for the 'plugins' test.
1391 (assoc-ref py:%standard-phases 'add-install-to-pythonpath)))))
1392 (native-inputs
1393 (list pkg-config python))
1394 ;; XXX: Move back to propagated-inputs once we no longer need to use
1395 ;; the old 3.50 version.
1396 (inputs (list python-pygobject-3.50))
1397 (propagated-inputs
1398 (list gst-plugins-base
1399 gst-plugins-bad ; for gst-analytics
1400 gst-rtsp-server))
1401 (home-page "https://gstreamer.freedesktop.org/")
1402 (synopsis "GStreamer GObject Introspection overrides for Python")
1403 (description
1404 "This package contains GObject Introspection overrides for Python that can
1405be used by Python applications using GStreamer.")
1406 (license license:lgpl2.1+)
1407 (properties `((upstream-name . "gst-python")))))
1408
1409(define-public gst123
1410 (package
1411 (name "gst123")
1412 (version "0.3.5")
1413 (source (origin
1414 (method url-fetch)
1415 (uri (string-append "http://space.twc.de/~stefan/gst123/gst123-"
1416 version ".tar.bz2"))
1417 (sha256
1418 (base32
1419 "0zaa117n4wkya9p903vkj8hj58lmdb66pxsdx5wwcv7nffbp5d67"))))
1420 (build-system gnu-build-system)
1421 (inputs
1422 (list gtk+-2 ncurses gstreamer gst-plugins-base))
1423 (native-inputs
1424 (list pkg-config))
1425 (home-page "https://space.twc.de/~stefan/gst123.php")
1426 (synopsis "Flexible command line media player based on gstreamer")
1427 (description "The program gst123 is designed to be a more flexible command
1428line player in the spirit of ogg123 and mpg123, based on the gstreamer media
1429framework. It plays all file formats gstreamer supports, so if you have a
1430music collection which contains different file formats, like flac, ogg and
1431mp3, you can use gst123 to play all your music files.")
1432 (license license:lgpl2.0+)))
1433
1434(define-public gst-plugins-espeak
1435 (package
1436 (name "gst-plugins-espeak")
1437 (version "0.6.0")
1438 (source (origin
1439 (method git-fetch)
1440 (uri (git-reference
1441 (url "https://github.com/sugarlabs/gst-plugins-espeak")
1442 (commit (string-append "v" version))))
1443 (file-name (git-file-name name version))
1444 (sha256
1445 (base32
1446 "0c9j5gbsl0rzwkqgg1c1a2vlyvcsliyl8a57qkwsqrnqrwnvw28w"))))
1447 (build-system gnu-build-system)
1448 (inputs (list espeak-ng gstreamer gst-plugins-base))
1449 (native-inputs (list autoconf automake libtool pkg-config))
1450 (home-page "http://wiki.sugarlabs.org/go/Activity_Team/gst-plugins-espeak")
1451 (synopsis "Gstreamer plugin for Espeak")
1452 (description "This is a Gstreamer @code{src} plugin to use the espeak
1453speech synthesizer as a sound source.")
1454 (license license:lgpl2.0+)))