Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / kodi.scm
CommitLineData
34f5618b
DT
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)
1e3fbf3c 24 #:use-module (guix git-download)
34f5618b
DT
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)
99828fa7 37 #:use-module (gnu packages documentation)
34f5618b
DT
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)
09b87aff 69 #:use-module (gnu packages assembly)
34f5618b
DT
70 #:use-module (gnu packages zip))
71
1e3fbf3c
DT
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)))
7c776ddc 83 (file-name (string-append name "-" version "-checkout"))
1e3fbf3c
DT
84 (sha256
85 (base32
86 "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9"))))
87 (build-system gnu-build-system)
88 (arguments
89 '(#:phases
90 (modify-phases %standard-phases
91 (delete 'configure) ; no configure script
92 ;; There's no build system here, so we have to do it ourselves.
93 (replace 'build
94 (lambda _
95 (and (zero? (system* "g++" "-c" "guid.cpp" "-o" "guid.o"
96 "-std=c++11" "-DGUID_LIBUUID"))
97 (zero? (system* "ar" "rvs" "libcrossguid.a" "guid.o")))))
98 (replace 'check
99 (lambda _
100 (and (zero? (system* "g++" "-c" "test.cpp" "-o" "test.o"
101 "-std=c++11"))
102 (zero? (system* "g++" "-c" "testmain.cpp" "-o" "testmain.o"
103 "-std=c++11"))
104 (zero? (system* "g++" "test.o" "guid.o" "testmain.o"
105 "-o" "test" "-luuid"))
106 (zero? (system* (string-append (getcwd) "/test"))))))
107 (replace 'install
108 (lambda* (#:key outputs #:allow-other-keys)
109 (let ((out (assoc-ref outputs "out")))
110 (install-file "guid.h" (string-append out "/include"))
111 (install-file "libcrossguid.a"
112 (string-append out "/lib"))
113 #t))))))
114 (inputs
115 `(("util-linux" ,util-linux)))
116 (synopsis "Lightweight universal identifier library")
7c49ab5b 117 (description "CrossGuid is a minimal GUID/UUID
1e3fbf3c
DT
118generator library for C++.")
119 (home-page "https://github.com/graeme-hill/crossguid")
120 (license license:expat))))
121
34f5618b
DT
122(define-public kodi
123 (package
124 (name "kodi")
9ced12de 125 (version "16.0")
34f5618b
DT
126 (source (origin
127 (method url-fetch)
128 (uri (string-append "http://mirrors.kodi.tv/releases/source/"
9ced12de 129 version "-Jarvis.tar.gz"))
34f5618b
DT
130 (file-name (string-append name "-" version ".tar.gz"))
131 (sha256
132 (base32
9ced12de 133 "0iirspvv7czf785l2lqf232dvdaj87srbn9ni97ngvnd6w9yl884"))
34f5618b
DT
134 (snippet
135 ;; Delete bundled ffmpeg.
136 ;; TODO: Delete every other bundled library.
137 '(begin
138 (use-modules (guix build utils))
139 (delete-file-recursively "tools/depends/target/ffmpeg")))
140 (modules '((guix build utils)))))
141 (build-system gnu-build-system)
142 (arguments
143 '(#:configure-flags '("--with-ffmpeg=shared") ; don't use bundled ffmpeg
144 #:phases
145 (modify-phases %standard-phases
146 ;; JsonSchemaBuilder is a small tool needed by the build system that
147 ;; comes bundled with the source. The build system tries to build it
148 ;; during the bootstrapping phase, which causes serious issues
149 ;; because there's no time for shebangs to be patched. So, we
150 ;; bootstrap it on our own instead.
151 (add-after 'unpack 'bootstrap-jsonschemabuilder
152 (lambda* (#:key inputs #:allow-other-keys)
153 (let ((dir "tools/depends/native/JsonSchemaBuilder/src"))
154 (with-directory-excursion dir
155 (zero? (system* "sh" "autogen.sh"))))))
156 ;; Now we can do the regular bootstrapping process, but only after
157 ;; the first round of shebang patching. We must repeat the patching
158 ;; after bootstrapping so that all of the files generated by the
159 ;; Autotools et al. are patched appropriately.
160 (add-after 'patch-source-shebangs 'bootstrap
161 (lambda* (#:key inputs #:allow-other-keys)
162 ;; We bootstrapped JsonSchemaBuilder in the previous phase, so we
163 ;; need to make sure it isn't done a second time. Otherwise, it
164 ;; would undo the shebang patching that we worked so hard for.
165 (substitute* '("tools/depends/native/JsonSchemaBuilder/Makefile")
166 (("\\./autogen\\.sh") ""))
167 ;; This essentially does what their 'bootstrap' script does, but
168 ;; additionally passes the correct CONFIG_SHELL.
169 (let ((bash (string-append (assoc-ref inputs "bash") "/bin/sh")))
170 (define (run-make makefile)
171 (zero? (system* "make" "-f" makefile
172 "BOOTSTRAP_STANDALONE=1"
173 (string-append "CONFIG_SHELL=" bash))))
174 (and (run-make "bootstrap.mk")
175 (run-make "codegenerator.mk")))))
176 (add-after 'bootstrap 'patch-source-shebangs-again
177 (assoc-ref %standard-phases 'patch-source-shebangs))
178 ;; 3 tests fail that appear harmless, so we disable them.
179 (add-before 'check 'disable-some-tests
180 (lambda _
181 (substitute* '("xbmc/utils/test/TestSystemInfo.cpp")
182 (("TEST_F\\(TestSystemInfo, GetOsPrettyNameWithVersion\\)")
183 "TEST_F(TestSystemInfo, DISABLED_GetOsPrettyNameWithVersion)")
184 (("TEST_F\\(TestSystemInfo, GetOsName\\)")
185 "TEST_F(TestSystemInfo, DISABLED_GetOsName)")
186 (("TEST_F\\(TestSystemInfo, GetOsVersion\\)")
187 "TEST_F(TestSystemInfo, DISABLED_GetOsVersion)")))))))
188 ;; TODO: Add dependencies for:
189 ;; - vdpau
190 ;; - nfs
191 ;;
192 ;; FIXME: libusb detection fails.
193 ;;
194 ;; FIXME: As you can see, we use a lot of external libraries, but it seems
195 ;; that a few bundled ones are still being used.
196 (native-inputs
197 `(("autoconf" ,autoconf)
198 ("automake" ,automake)
199 ("cmake" ,cmake)
200 ("doxygen" ,doxygen)
201 ("gawk" ,gawk)
b94a6ca0 202 ("gettext" ,gettext-minimal)
d2540f80 203 ("icedtea" ,icedtea) ; needed at build-time only, mandatory
34f5618b
DT
204 ("libtool" ,libtool)
205 ("pkg-config" ,pkg-config)
206 ("swig" ,swig)
207 ("which" ,which)
208 ("yasm" ,yasm)))
209 (inputs
210 `(("alsa-lib" ,alsa-lib)
211 ("avahi" ,avahi)
212 ("bluez" ,bluez)
213 ("boost" ,boost)
214 ("bzip2" ,bzip2)
9ced12de 215 ("crossguid" ,crossguid)
34f5618b 216 ("curl" ,curl)
9ced12de 217 ("dcadec" ,dcadec)
34f5618b
DT
218 ("dbus" ,dbus)
219 ("enca" ,enca)
220 ("eudev" ,eudev)
221 ("ffmpeg" ,ffmpeg)
222 ("flac" ,flac)
223 ("fontconfig" ,fontconfig)
224 ("freetype" ,freetype)
225 ("fribidi" ,fribidi)
226 ("glew" ,glew)
227 ("gnutls" ,gnutls)
228 ("gperf" ,gperf)
229 ("jasper" ,jasper)
230 ("lame" ,lame)
231 ("libass" ,libass)
232 ("libbluray" ,libbluray)
233 ("libcap" ,libcap)
234 ("libcdio" ,libcdio)
235 ("libgcrypt" ,libgcrypt)
236 ("libjpeg" ,libjpeg)
237 ("libltdl" ,libltdl)
238 ("libmad" ,libmad)
239 ("libmicrohttpd" ,libmicrohttpd)
240 ("libmodplug" ,libmodplug)
241 ("libmpeg2" ,libmpeg2)
242 ("libogg" ,libogg)
243 ("libpng" ,libpng)
244 ("libsamplerate" ,libsamplerate)
245 ("libssh" ,libssh)
246 ("libtiff" ,libtiff)
247 ("libva" ,libva)
248 ("libvorbis" ,libvorbis)
249 ("libxml2" ,libxml2)
250 ("libxmu" ,libxmu)
251 ("libxrandr" ,libxrandr)
252 ("libxrender" ,libxrender)
253 ("libxslt" ,libxslt)
254 ("libxt" ,libxt)
255 ("libyajl" ,libyajl)
256 ("lzo" ,lzo)
257 ("mesa-utils" ,mesa-utils)
258 ("mysql" ,mysql)
259 ("openssl" ,openssl)
260 ("pcre" ,pcre)
261 ("pulseaudio" ,pulseaudio)
262 ("python" ,python-2)
263 ("samba" ,samba)
264 ("sdl2" ,sdl2)
265 ("sqlite" ,sqlite)
266 ("taglib" ,taglib)
267 ("tinyxml" ,tinyxml)
268 ("unzip" ,unzip)
9ced12de 269 ("util-linux" ,util-linux)
34f5618b
DT
270 ("zip" ,zip)
271 ("zlib" ,zlib)))
272 (synopsis "Media center for home theater computers")
273 (description "Kodi is a media center application for playing videos,
274music, games, etc. Kodi is highly customizable and features a theme and
275plug-in system.")
276 (home-page "http://kodi.tv")
277 (license license:gpl2+)))