gstreamer.scm 37 KB

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