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