gnu: Add FIL plugins.
[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 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages kodi)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix utils)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages algebra)
27 #:use-module (gnu packages audio)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages avahi)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages boost)
32 #:use-module (gnu packages cdrom)
33 #:use-module (gnu packages cmake)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages curl)
36 #:use-module (gnu packages databases)
37 #:use-module (gnu packages doxygen)
38 #:use-module (gnu packages fontutils)
39 #:use-module (gnu packages fribidi)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages ghostscript)
42 #:use-module (gnu packages gawk)
43 #:use-module (gnu packages gl)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gperf)
46 #:use-module (gnu packages gnunet)
47 #:use-module (gnu packages gnupg)
48 #:use-module (gnu packages image)
49 #:use-module (gnu packages java)
50 #:use-module (gnu packages libusb)
51 #:use-module (gnu packages linux)
52 #:use-module (gnu packages mp3)
53 #:use-module (gnu packages pcre)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages pulseaudio)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages samba)
58 #:use-module (gnu packages sdl)
59 #:use-module (gnu packages ssh)
60 #:use-module (gnu packages swig)
61 #:use-module (gnu packages textutils)
62 #:use-module (gnu packages tls)
63 #:use-module (gnu packages video)
64 #:use-module (gnu packages web)
65 #:use-module (gnu packages xdisorg)
66 #:use-module (gnu packages xiph)
67 #:use-module (gnu packages xml)
68 #:use-module (gnu packages xorg)
69 #:use-module (gnu packages yasm)
70 #:use-module (gnu packages zip))
71
72 (define-public crossguid
73 (let ((commit "8f399e8bd4252be9952f3dfa8199924cc8487ca4"))
74 (package
75 (name "crossguid")
76 (version (string-append "0.0-1." (string-take commit 7)))
77 ;; There's no official release. Just a Git repository.
78 (source (origin
79 (method git-fetch)
80 (uri (git-reference
81 (url "https://github.com/graeme-hill/crossguid.git")
82 (commit commit)))
83 (sha256
84 (base32
85 "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9"))))
86 (build-system gnu-build-system)
87 (arguments
88 '(#:phases
89 (modify-phases %standard-phases
90 (delete 'configure) ; no configure script
91 ;; There's no build system here, so we have to do it ourselves.
92 (replace 'build
93 (lambda _
94 (and (zero? (system* "g++" "-c" "guid.cpp" "-o" "guid.o"
95 "-std=c++11" "-DGUID_LIBUUID"))
96 (zero? (system* "ar" "rvs" "libcrossguid.a" "guid.o")))))
97 (replace 'check
98 (lambda _
99 (and (zero? (system* "g++" "-c" "test.cpp" "-o" "test.o"
100 "-std=c++11"))
101 (zero? (system* "g++" "-c" "testmain.cpp" "-o" "testmain.o"
102 "-std=c++11"))
103 (zero? (system* "g++" "test.o" "guid.o" "testmain.o"
104 "-o" "test" "-luuid"))
105 (zero? (system* (string-append (getcwd) "/test"))))))
106 (replace 'install
107 (lambda* (#:key outputs #:allow-other-keys)
108 (let ((out (assoc-ref outputs "out")))
109 (install-file "guid.h" (string-append out "/include"))
110 (install-file "libcrossguid.a"
111 (string-append out "/lib"))
112 #t))))))
113 (inputs
114 `(("util-linux" ,util-linux)))
115 (synopsis "Lightweight universal identifier library")
116 (description "CrossGuid is a minimal @acronym{GUID}/@acronym{UUID}
117 generator library for C++.")
118 (home-page "https://github.com/graeme-hill/crossguid")
119 (license license:expat))))
120
121 (define-public kodi
122 (package
123 (name "kodi")
124 (version "16.0")
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "http://mirrors.kodi.tv/releases/source/"
128 version "-Jarvis.tar.gz"))
129 (file-name (string-append name "-" version ".tar.gz"))
130 (sha256
131 (base32
132 "0iirspvv7czf785l2lqf232dvdaj87srbn9ni97ngvnd6w9yl884"))
133 (snippet
134 ;; Delete bundled ffmpeg.
135 ;; TODO: Delete every other bundled library.
136 '(begin
137 (use-modules (guix build utils))
138 (delete-file-recursively "tools/depends/target/ffmpeg")))
139 (modules '((guix build utils)))))
140 (build-system gnu-build-system)
141 (arguments
142 '(#:configure-flags '("--with-ffmpeg=shared") ; don't use bundled ffmpeg
143 #:phases
144 (modify-phases %standard-phases
145 ;; JsonSchemaBuilder is a small tool needed by the build system that
146 ;; comes bundled with the source. The build system tries to build it
147 ;; during the bootstrapping phase, which causes serious issues
148 ;; because there's no time for shebangs to be patched. So, we
149 ;; bootstrap it on our own instead.
150 (add-after 'unpack 'bootstrap-jsonschemabuilder
151 (lambda* (#:key inputs #:allow-other-keys)
152 (let ((dir "tools/depends/native/JsonSchemaBuilder/src"))
153 (with-directory-excursion dir
154 (zero? (system* "sh" "autogen.sh"))))))
155 ;; Now we can do the regular bootstrapping process, but only after
156 ;; the first round of shebang patching. We must repeat the patching
157 ;; after bootstrapping so that all of the files generated by the
158 ;; Autotools et al. are patched appropriately.
159 (add-after 'patch-source-shebangs 'bootstrap
160 (lambda* (#:key inputs #:allow-other-keys)
161 ;; We bootstrapped JsonSchemaBuilder in the previous phase, so we
162 ;; need to make sure it isn't done a second time. Otherwise, it
163 ;; would undo the shebang patching that we worked so hard for.
164 (substitute* '("tools/depends/native/JsonSchemaBuilder/Makefile")
165 (("\\./autogen\\.sh") ""))
166 ;; This essentially does what their 'bootstrap' script does, but
167 ;; additionally passes the correct CONFIG_SHELL.
168 (let ((bash (string-append (assoc-ref inputs "bash") "/bin/sh")))
169 (define (run-make makefile)
170 (zero? (system* "make" "-f" makefile
171 "BOOTSTRAP_STANDALONE=1"
172 (string-append "CONFIG_SHELL=" bash))))
173 (and (run-make "bootstrap.mk")
174 (run-make "codegenerator.mk")))))
175 (add-after 'bootstrap 'patch-source-shebangs-again
176 (assoc-ref %standard-phases 'patch-source-shebangs))
177 ;; 3 tests fail that appear harmless, so we disable them.
178 (add-before 'check 'disable-some-tests
179 (lambda _
180 (substitute* '("xbmc/utils/test/TestSystemInfo.cpp")
181 (("TEST_F\\(TestSystemInfo, GetOsPrettyNameWithVersion\\)")
182 "TEST_F(TestSystemInfo, DISABLED_GetOsPrettyNameWithVersion)")
183 (("TEST_F\\(TestSystemInfo, GetOsName\\)")
184 "TEST_F(TestSystemInfo, DISABLED_GetOsName)")
185 (("TEST_F\\(TestSystemInfo, GetOsVersion\\)")
186 "TEST_F(TestSystemInfo, DISABLED_GetOsVersion)")))))))
187 ;; TODO: Add dependencies for:
188 ;; - vdpau
189 ;; - nfs
190 ;;
191 ;; FIXME: libusb detection fails.
192 ;;
193 ;; FIXME: As you can see, we use a lot of external libraries, but it seems
194 ;; that a few bundled ones are still being used.
195 (native-inputs
196 `(("autoconf" ,autoconf)
197 ("automake" ,automake)
198 ("cmake" ,cmake)
199 ("doxygen" ,doxygen)
200 ("gawk" ,gawk)
201 ("gettext" ,gnu-gettext)
202 ("icedtea" ,icedtea) ; needed at build-time only, mandatory
203 ("libtool" ,libtool)
204 ("pkg-config" ,pkg-config)
205 ("swig" ,swig)
206 ("which" ,which)
207 ("yasm" ,yasm)))
208 (inputs
209 `(("alsa-lib" ,alsa-lib)
210 ("avahi" ,avahi)
211 ("bluez" ,bluez)
212 ("boost" ,boost)
213 ("bzip2" ,bzip2)
214 ("crossguid" ,crossguid)
215 ("curl" ,curl)
216 ("dcadec" ,dcadec)
217 ("dbus" ,dbus)
218 ("enca" ,enca)
219 ("eudev" ,eudev)
220 ("ffmpeg" ,ffmpeg)
221 ("flac" ,flac)
222 ("fontconfig" ,fontconfig)
223 ("freetype" ,freetype)
224 ("fribidi" ,fribidi)
225 ("glew" ,glew)
226 ("gnutls" ,gnutls)
227 ("gperf" ,gperf)
228 ("jasper" ,jasper)
229 ("lame" ,lame)
230 ("libass" ,libass)
231 ("libbluray" ,libbluray)
232 ("libcap" ,libcap)
233 ("libcdio" ,libcdio)
234 ("libgcrypt" ,libgcrypt)
235 ("libjpeg" ,libjpeg)
236 ("libltdl" ,libltdl)
237 ("libmad" ,libmad)
238 ("libmicrohttpd" ,libmicrohttpd)
239 ("libmodplug" ,libmodplug)
240 ("libmpeg2" ,libmpeg2)
241 ("libogg" ,libogg)
242 ("libpng" ,libpng)
243 ("libsamplerate" ,libsamplerate)
244 ("libssh" ,libssh)
245 ("libtiff" ,libtiff)
246 ("libva" ,libva)
247 ("libvorbis" ,libvorbis)
248 ("libxml2" ,libxml2)
249 ("libxmu" ,libxmu)
250 ("libxrandr" ,libxrandr)
251 ("libxrender" ,libxrender)
252 ("libxslt" ,libxslt)
253 ("libxt" ,libxt)
254 ("libyajl" ,libyajl)
255 ("lzo" ,lzo)
256 ("mesa-utils" ,mesa-utils)
257 ("mysql" ,mysql)
258 ("openssl" ,openssl)
259 ("pcre" ,pcre)
260 ("pulseaudio" ,pulseaudio)
261 ("python" ,python-2)
262 ("samba" ,samba)
263 ("sdl2" ,sdl2)
264 ("sqlite" ,sqlite)
265 ("taglib" ,taglib)
266 ("tinyxml" ,tinyxml)
267 ("unzip" ,unzip)
268 ("util-linux" ,util-linux)
269 ("zip" ,zip)
270 ("zlib" ,zlib)))
271 (synopsis "Media center for home theater computers")
272 (description "Kodi is a media center application for playing videos,
273 music, games, etc. Kodi is highly customizable and features a theme and
274 plug-in system.")
275 (home-page "http://kodi.tv")
276 (license license:gpl2+)))