gnu: OpenSSH: Update to 7.9p1.
[jackhill/guix/guix.git] / gnu / packages / kodi.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
3 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
4 ;;; Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages kodi)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix utils)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system trivial)
31 #:use-module (gnu packages algebra)
32 #:use-module (gnu packages audio)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages avahi)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages bash)
37 #:use-module (gnu packages cdrom)
38 #:use-module (gnu packages cmake)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages databases)
42 #:use-module (gnu packages documentation)
43 #:use-module (gnu packages fontutils)
44 #:use-module (gnu packages fribidi)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages gawk)
48 #:use-module (gnu packages gl)
49 #:use-module (gnu packages glib)
50 #:use-module (gnu packages gperf)
51 #:use-module (gnu packages gnunet)
52 #:use-module (gnu packages gnupg)
53 #:use-module (gnu packages image)
54 #:use-module (gnu packages java)
55 #:use-module (gnu packages libusb)
56 #:use-module (gnu packages linux)
57 #:use-module (gnu packages mp3)
58 #:use-module (gnu packages pcre)
59 #:use-module (gnu packages pkg-config)
60 #:use-module (gnu packages pretty-print)
61 #:use-module (gnu packages pulseaudio)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages samba)
64 #:use-module (gnu packages sdl)
65 #:use-module (gnu packages ssh)
66 #:use-module (gnu packages swig)
67 #:use-module (gnu packages textutils)
68 #:use-module (gnu packages tls)
69 #:use-module (gnu packages video)
70 #:use-module (gnu packages web)
71 #:use-module (gnu packages xdisorg)
72 #:use-module (gnu packages xiph)
73 #:use-module (gnu packages xml)
74 #:use-module (gnu packages xorg)
75 #:use-module (gnu packages assembly))
76
77 (define-public crossguid
78 (let ((commit "8f399e8bd4252be9952f3dfa8199924cc8487ca4"))
79 (package
80 (name "crossguid")
81 (version (string-append "0.0-1." (string-take commit 7)))
82 ;; There's no official release. Just a Git repository.
83 (source (origin
84 (method git-fetch)
85 (uri (git-reference
86 (url "https://github.com/graeme-hill/crossguid.git")
87 (commit commit)))
88 (file-name (string-append name "-" version "-checkout"))
89 (sha256
90 (base32
91 "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9"))))
92 (build-system gnu-build-system)
93 (arguments
94 '(#:phases
95 (modify-phases %standard-phases
96 (delete 'configure) ; no configure script
97 ;; There's no build system here, so we have to do it ourselves.
98 (replace 'build
99 (lambda _
100 (invoke "g++" "-c" "guid.cpp" "-o" "guid.o"
101 "-std=c++11" "-DGUID_LIBUUID")
102 (invoke "ar" "rvs" "libcrossguid.a" "guid.o")))
103 (replace 'check
104 (lambda _
105 (invoke "g++" "-c" "test.cpp" "-o" "test.o"
106 "-std=c++11")
107 (invoke "g++" "-c" "testmain.cpp" "-o" "testmain.o"
108 "-std=c++11")
109 (invoke "g++" "test.o" "guid.o" "testmain.o"
110 "-o" "test" "-luuid")
111 (invoke (string-append (getcwd) "/test"))))
112 (replace 'install
113 (lambda* (#:key outputs #:allow-other-keys)
114 (let ((out (assoc-ref outputs "out")))
115 (install-file "guid.h" (string-append out "/include"))
116 (install-file "libcrossguid.a"
117 (string-append out "/lib"))
118 #t))))))
119 (inputs
120 `(("util-linux" ,util-linux)))
121 (synopsis "Lightweight universal identifier library")
122 (description "CrossGuid is a minimal GUID/UUID
123 generator library for C++.")
124 (home-page "https://github.com/graeme-hill/crossguid")
125 (license license:expat))))
126
127 ;; Kodi requires using their own special forks of these libraries.
128 ;; In addition, it insists on downloading and building these as part
129 ;; of the standard build process. To make things easier, we bootstrap
130 ;; and patch shebangs here, so we don't have to worry about it later.
131 (define libdvdnav/kodi
132 (let ((commit "6.0.0-Leia-Alpha-1"))
133 (package
134 (name "libdvdnav-bootstrapped")
135 (version commit)
136 (source (origin
137 (method git-fetch)
138 (uri (git-reference
139 (url "https://github.com/xbmc/libdvdnav.git")
140 (commit commit)))
141 (file-name (string-append name "-" version "-checkout"))
142 (sha256
143 (base32
144 "1xiyfgf8v8aknlxlzsvk6pbzkhclz0hbh3s1b0w6ivkng2k310j9"))))
145 (build-system gnu-build-system)
146 (arguments
147 '(#:tests? #f
148 #:phases
149 (modify-phases %standard-phases
150 (delete 'configure)
151 (delete 'build)
152 (replace 'install
153 (lambda* (#:key outputs #:allow-other-keys)
154 (copy-recursively "." (assoc-ref outputs "out"))
155 #t)))))
156 (native-inputs
157 `(("autoconf" ,autoconf)
158 ("automake" ,automake)
159 ("libtool" ,libtool)
160 ("pkg-config" ,pkg-config)))
161 (home-page "https://github.com/xbmc/libdvdnav")
162 (synopsis (package-synopsis libdvdnav))
163 (description (package-description libdvdnav))
164 (license license:gpl2+))))
165
166 (define libdvdread/kodi
167 (let ((commit "6.0.0-Leia-Alpha-1"))
168 (package
169 (name "libdvdread-bootstrapped")
170 (version commit)
171 (source (origin
172 (method git-fetch)
173 (uri (git-reference
174 (url "https://github.com/xbmc/libdvdread.git")
175 (commit commit)))
176 (file-name (string-append name "-" version "-checkout"))
177 (sha256
178 (base32
179 "1c3g18n2vwhgcfz3dka1pmw58bnv2ram7xjvizfiykb3sgi9zfwp"))))
180 (build-system gnu-build-system)
181 (arguments
182 '(#:tests? #f
183 #:phases
184 (modify-phases %standard-phases
185 (delete 'configure)
186 (delete 'build)
187 (replace 'install
188 (lambda* (#:key outputs #:allow-other-keys)
189 (copy-recursively "." (assoc-ref outputs "out"))
190 #t)))))
191 (native-inputs
192 `(("autoconf" ,autoconf)
193 ("automake" ,automake)
194 ("libtool" ,libtool)
195 ("pkg-config" ,pkg-config)))
196 (home-page "https://github.com/xbmc/libdvdread")
197 (synopsis (package-synopsis libdvdread))
198 (description (package-description libdvdread))
199 (license (list license:gpl2+ license:lgpl2.1+)))))
200
201 (define libdvdcss/kodi
202 (let ((commit "1.4.1-Leia-Alpha-1"))
203 (package
204 (name "libdvdcss-bootstrapped")
205 (version commit)
206 (source (origin
207 (method git-fetch)
208 (uri (git-reference
209 (url "https://github.com/xbmc/libdvdcss.git")
210 (commit commit)))
211 (file-name (string-append name "-" version "-checkout"))
212 (sha256
213 (base32
214 "0adafwsawxssj3nilkql447v0l4a2584rdpmy5rfjmznh91lykgh"))))
215 (build-system gnu-build-system)
216 (arguments
217 '(#:tests? #f
218 #:phases
219 (modify-phases %standard-phases
220 (delete 'configure)
221 (delete 'build)
222 (replace 'install
223 (lambda* (#:key outputs #:allow-other-keys)
224 (copy-recursively "." (assoc-ref outputs "out"))
225 #t)))))
226 (native-inputs
227 `(("autoconf" ,autoconf)
228 ("automake" ,automake)
229 ("libtool" ,libtool)
230 ("pkg-config" ,pkg-config)))
231 (home-page "https://github.com/xbmc/libdvdcss")
232 (synopsis (package-synopsis libdvdcss))
233 (description (package-description libdvdcss))
234 (license license:gpl2+))))
235
236 (define-public kodi
237 ;; We package the git version because the current released
238 ;; version was cut while the cmake transition was in turmoil.
239 (let ((commit "ec16dbca4dcf2923f53f819695a6d47c52e68d74")
240 (revision "8"))
241 (package
242 (name "kodi")
243 (version (git-version "18.0_alpha" revision commit))
244 (source (origin
245 (method git-fetch)
246 (uri (git-reference
247 (url "https://github.com/xbmc/xbmc.git")
248 (commit commit)))
249 (file-name (git-file-name name version))
250 (sha256
251 (base32
252 "1rxg752cl59124cfpfwmyjldn6qpq5jginxddpzvgagfadf10i4d"))
253 (snippet
254 '(begin
255 (use-modules (guix build utils))
256 (for-each delete-file-recursively
257 '("project/BuildDependencies/bin/"
258 ;; TODO: Purge these jars.
259 ;;"tools/codegenerator/groovy"
260 ;; And these sources:
261 ;; "tools/depend/native/JsonSchemaBuilder"
262 ;; "tools/depend/native/TexturePacker"
263 ;; "lib/gtest"
264 ;; "lib/cpluff"
265 ;; "lib/libUPnP"
266 "lib/libUPnP/Neptune/ThirdParty"
267 "project/Win32BuildSetup/tools/7z"))
268 #t))
269 (modules '((guix build utils)))))
270 (build-system cmake-build-system)
271 (arguments
272 '(#:modules ((srfi srfi-1)
273 (guix build cmake-build-system)
274 (guix build utils))
275 #:configure-flags
276 (list "-DENABLE_INTERNAL_FFMPEG=OFF"
277 "-DENABLE_INTERNAL_CROSSGUID=OFF"
278 (string-append "-Dlibdvdread_URL="
279 (assoc-ref %build-inputs "libdvdread-bootstrapped"))
280 (string-append "-Dlibdvdnav_URL="
281 (assoc-ref %build-inputs "libdvdnav-bootstrapped"))
282 (string-append "-Dlibdvdcss_URL="
283 (assoc-ref %build-inputs "libdvdcss-bootstrapped"))
284 (string-append "-DSYSTEM_LDFLAGS=-Wl,-rpath="
285 (assoc-ref %build-inputs "curl") "/lib"))
286 #:phases
287 (modify-phases %standard-phases
288 ;; The build system tries to bootstrap these bundled components
289 ;; during the regular build phase, which causes serious issues
290 ;; because there's no time for shebangs to be patched. So, we
291 ;; bootstrap it on our own instead.
292 (add-after 'unpack 'bootstrap-bundled-software
293 (lambda _
294 (let ((dirs '("tools/depends/native/JsonSchemaBuilder/src"
295 "lib/cpluff")))
296 (every (lambda (third-party)
297 (with-directory-excursion third-party
298 (invoke "autoreconf" "-vif")))
299 dirs))))
300 (add-after 'bootstrap-bundled-software 'patch-stuff
301 (lambda* (#:key inputs #:allow-other-keys)
302 ;; Prevent the build scripts from calling autoreconf in the
303 ;; build stage. Otherwise, it would undo the bootstrapping
304 ;; and shebang patching that we worked so hard for.
305 (substitute* "cmake/modules/FindCpluff.cmake"
306 (("autoreconf -vif") "true"))
307 (substitute* "lib/cpluff/po/Makefile.in.in"
308 (("/bin/sh") (which "sh")))
309 (substitute* "cmake/modules/FindLibDvd.cmake"
310 ;; The libdvd* sources that we bootstrapped separately are
311 ;; unpacked in the build phase. This is our best opportunity
312 ;; to make them writable before the build process starts.
313 (("autoreconf -vif") "chmod -R u+w ."))
314
315 (substitute* "xbmc/platform/linux/LinuxTimezone.cpp"
316 (("/usr/share/zoneinfo")
317 (string-append (assoc-ref inputs "tzdata")
318 "/share/zoneinfo")))
319
320 ;; Don't phone home to check for updates.¬
321 (substitute* "system/addon-manifest.xml"¬
322 (("<addon optional=\\\"true\\\">service.xbmc.versioncheck</addon>")
323 ""))
324
325 ;; Let's disable some tests that are known not to work here.
326 ;; Doing this later while in the cmake "../build" directory
327 ;; is trickier.
328 (substitute* '("xbmc/utils/test/TestSystemInfo.cpp")
329 (("TEST_F\\(TestSystemInfo, GetOsPrettyNameWithVersion\\)")
330 "TEST_F(TestSystemInfo, DISABLED_GetOsPrettyNameWithVersion)")
331 (("TEST_F\\(TestSystemInfo, GetOsName\\)")
332 "TEST_F(TestSystemInfo, DISABLED_GetOsName)")
333 (("TEST_F\\(TestSystemInfo, GetOsVersion\\)")
334 "TEST_F(TestSystemInfo, DISABLED_GetOsVersion)"))
335 #t))
336 (add-before 'build 'set-build-environment
337 (lambda _
338 ;; Some bundled build scripts fall back to /bin/sh
339 ;; if this is not set.
340 (setenv "CONFIG_SHELL" (which "sh"))
341 #t))
342 (add-before 'check 'build-kodi-test
343 (lambda _
344 (invoke "make" "kodi-test"))))))
345 ;; TODO: Add dependencies for:
346 ;; - nfs
347 ;; - cec
348 ;; - plist
349 ;; - shairplay
350 (native-inputs
351 `(("autoconf" ,autoconf)
352 ("automake" ,automake)
353 ("gettext" ,gettext-minimal)
354 ("icedtea" ,icedtea) ; needed at build-time only, mandatory
355 ("libdvdcss-bootstrapped" ,libdvdcss/kodi)
356 ("libdvdnav-bootstrapped" ,libdvdnav/kodi)
357 ("libdvdread-bootstrapped" ,libdvdread/kodi)
358 ("libtool" ,libtool)
359 ("pkg-config" ,pkg-config)
360 ("swig" ,swig)
361 ("yasm" ,yasm)))
362 (inputs
363 `(("alsa-lib" ,alsa-lib)
364 ("avahi" ,avahi)
365 ("bluez" ,bluez)
366 ("crossguid" ,crossguid)
367 ("curl" ,curl)
368 ("dcadec" ,dcadec)
369 ("dbus" ,dbus)
370 ("eudev" ,eudev)
371 ("ffmpeg" ,ffmpeg)
372 ("flac" ,flac)
373 ("fmt" ,fmt)
374 ("fontconfig" ,fontconfig)
375 ("freetype" ,freetype)
376 ("fribidi" ,fribidi)
377 ("giflib" ,giflib)
378 ("glew" ,glew)
379 ("gnutls" ,gnutls)
380 ("lame" ,lame)
381 ("lcms" ,lcms)
382 ("libass" ,libass)
383 ("libbluray" ,libbluray)
384 ("libcap" ,libcap)
385 ("libcdio" ,libcdio)
386 ("libdrm" ,libdrm)
387 ("libgcrypt" ,libgcrypt)
388 ("libjpeg" ,libjpeg)
389 ("libltdl" ,libltdl)
390 ("libmad" ,libmad)
391 ("libmicrohttpd" ,libmicrohttpd)
392 ("libmpeg2" ,libmpeg2)
393 ("libogg" ,libogg)
394 ("libpng" ,libpng)
395 ("libssh" ,libssh)
396 ("libtiff" ,libtiff)
397 ("libva" ,libva)
398 ("libvorbis" ,libvorbis)
399 ("libxml2" ,libxml2)
400 ("libxrandr" ,libxrandr)
401 ("libxrender" ,libxrender)
402 ("libxslt" ,libxslt)
403 ("lzo" ,lzo)
404 ("mariadb" ,mariadb)
405 ("openssl" ,openssl)
406 ("pcre" ,pcre)
407 ("pulseaudio" ,pulseaudio)
408 ("python" ,python-2)
409 ("rapidjson" ,rapidjson)
410 ("samba" ,samba)
411 ("sqlite" ,sqlite)
412 ("taglib" ,taglib)
413 ("tinyxml" ,tinyxml)
414 ("tzdata" ,tzdata)
415 ("util-linux" ,util-linux)
416 ("zip" ,zip)
417 ("zlib" ,zlib)))
418 (synopsis "Media center for home theater computers")
419 (description "Kodi is a media center application for playing videos,
420 music, games, etc. Kodi is highly customizable and features a theme and
421 plug-in system.")
422 (home-page "https://kodi.tv")
423 ;; XBMC is largely GPL2+, with some library components as LGPL2.1+, but
424 ;; there are some other licenses spread throughout.
425 (license (list license:gpl2+ license:lgpl2.1+
426 license:gpl3+ ;WiiRemote client
427 license:expat ;cpluff, dbwrappers
428 license:public-domain ;cpluff/examples
429 license:bsd-3 ;misc, gtest
430 license:bsd-2))))) ;xbmc/freebsd
431
432 (define-public kodi-cli
433 (let ((commit "104dc23b2a993c8e6db8c46f4f8bec24b146549b") ; Add support for
434 (revision "1")) ; `$HOME/.kodirc'.
435 (package
436 (name "kodi-cli")
437 (version (string-append "1.1-" revision "." (string-take commit 7)))
438 (source (origin
439 (method git-fetch)
440 (uri (git-reference (url "https://github.com/nawar/kodi-cli")
441 (commit commit)))
442 (sha256
443 (base32
444 "1xjhasc5gngfxpr1dlzy6q24w0wpdfjx12p43fanjppxw4i49n5p"))
445 (file-name (string-append name "-" version "-checkout"))))
446 (build-system trivial-build-system)
447 (inputs
448 `(("bash" ,bash)
449 ("curl" ,curl)
450 ("mps-youtube" ,mps-youtube)))
451 (arguments
452 `(#:modules ((guix build utils))
453 #:builder
454 (begin
455 (use-modules (guix build utils))
456 (copy-recursively (assoc-ref %build-inputs "source") ".")
457 (substitute* "kodi-cli"
458 (("/bin/bash") (string-append (assoc-ref %build-inputs "bash")
459 "/bin/bash"))
460 (("output=\\$\\((curl)" all curl)
461 (string-append "output=$("
462 (assoc-ref %build-inputs "curl")
463 "/bin/" curl))
464 (("play_youtube `(mpsyt)" all mpsyt)
465 (string-append "play_youtube `"
466 (assoc-ref %build-inputs "mps-youtube")
467 "/bin/" mpsyt)))
468 (install-file "kodi-cli" (string-append %output "/bin"))
469 #t)))
470 (home-page "https://github.com/nawar/kodi-cli")
471 (synopsis "Control Kodi from the command line")
472 (description "@code{kodi-cli} is a tool for sending commands to a Kodi
473 server using JSON RPC.
474
475 Features:
476
477 @itemize
478 @item Play, pause, stop the currently playing item.
479 @item Skip forward or backward in the currently playing item.
480 @item Play or queue to the currently list of YouTube videos.
481 @item Interactive and noninteractive volume control.
482 @item Interactive navigation.
483 @item Send text to the Kodi keyboard.
484 @item Toggle fullscreen.
485 @item Update or clean Kodi libraries.
486 @end itemize\n")
487 (license license:gpl2+))))