1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 documentation)
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 assembly)
70 #:use-module (gnu packages zip))
72 (define-public crossguid
73 (let ((commit "8f399e8bd4252be9952f3dfa8199924cc8487ca4"))
76 (version (string-append "0.0-1." (string-take commit 7)))
77 ;; There's no official release. Just a Git repository.
81 (url "https://github.com/graeme-hill/crossguid.git")
83 (file-name (string-append name "-" version "-checkout"))
86 "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9"))))
87 (build-system gnu-build-system)
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.
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")))))
100 (and (zero? (system* "g++" "-c" "test.cpp" "-o" "test.o"
102 (zero? (system* "g++" "-c" "testmain.cpp" "-o" "testmain.o"
104 (zero? (system* "g++" "test.o" "guid.o" "testmain.o"
105 "-o" "test" "-luuid"))
106 (zero? (system* (string-append (getcwd) "/test"))))))
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"))
115 `(("util-linux" ,util-linux)))
116 (synopsis "Lightweight universal identifier library")
117 (description "CrossGuid is a minimal GUID/UUID
118 generator library for C++.")
119 (home-page "https://github.com/graeme-hill/crossguid")
120 (license license:expat))))
128 (uri (string-append "http://mirrors.kodi.tv/releases/source/"
129 version "-Jarvis.tar.gz"))
130 (file-name (string-append name "-" version ".tar.gz"))
133 "0iirspvv7czf785l2lqf232dvdaj87srbn9ni97ngvnd6w9yl884"))
135 ;; Delete bundled ffmpeg.
136 ;; TODO: Delete every other bundled library.
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)
143 '(#:configure-flags '("--with-ffmpeg=shared") ; don't use bundled ffmpeg
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
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:
192 ;; FIXME: libusb detection fails.
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.
197 `(("autoconf" ,autoconf)
198 ("automake" ,automake)
202 ("gettext" ,gettext-minimal)
203 ("icedtea" ,icedtea) ; needed at build-time only, mandatory
205 ("pkg-config" ,pkg-config)
210 `(("alsa-lib" ,alsa-lib)
215 ("crossguid" ,crossguid)
223 ("fontconfig" ,fontconfig)
224 ("freetype" ,freetype)
232 ("libbluray" ,libbluray)
235 ("libgcrypt" ,libgcrypt)
239 ("libmicrohttpd" ,libmicrohttpd)
240 ("libmodplug" ,libmodplug)
241 ("libmpeg2" ,libmpeg2)
244 ("libsamplerate" ,libsamplerate)
248 ("libvorbis" ,libvorbis)
251 ("libxrandr" ,libxrandr)
252 ("libxrender" ,libxrender)
257 ("mesa-utils" ,mesa-utils)
261 ("pulseaudio" ,pulseaudio)
269 ("util-linux" ,util-linux)
272 (synopsis "Media center for home theater computers")
273 (description "Kodi is a media center application for playing videos,
274 music, games, etc. Kodi is highly customizable and features a theme and
276 (home-page "http://kodi.tv")
277 (license license:gpl2+)))