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