gnu: Add external-program.
[jackhill/guix/guix.git] / gnu / packages / kodi.scm
index 21e7b12..23afd13 100644 (file)
@@ -1,8 +1,9 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017, 2019 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
-;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +29,7 @@
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
+  #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
@@ -41,6 +43,7 @@
   #:use-module (gnu packages databases)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages fribidi)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
@@ -48,6 +51,7 @@
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gperf)
+  #:use-module (gnu packages groff)
   #:use-module (gnu packages gnunet)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages image)
@@ -62,6 +66,8 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages samba)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages serialization)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages ssh)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages assembly))
 
 (define-public crossguid
-  (let ((commit "8f399e8bd4252be9952f3dfa8199924cc8487ca4"))
+  (let ((commit "fef89a4174a7bf8cd99fa9154864ce9e8e3bf989")
+        (revision "2"))
     (package
       (name "crossguid")
-      (version (string-append "0.0-1." (string-take commit 7)))
-      ;; There's no official release.  Just a Git repository.
+      (version (string-append "0.0-" revision "." (string-take commit 7)))
+      ;; This is the commit that Kodi wants.
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
                 (file-name (string-append name "-" version "-checkout"))
                 (sha256
                  (base32
-                  "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9"))))
+                  "1blrkc7zcqrqcr5msvhyhm98s2jvm9hr0isqs4288q2r4mdnrfq0"))))
       (build-system gnu-build-system)
       (arguments
        '(#:phases
          (modify-phases %standard-phases
            (delete 'configure)          ; no configure script
-           ;; There's no build system here, so we have to do it ourselves.
            (replace 'build
              (lambda _
                (invoke "g++" "-c" "guid.cpp" "-o" "guid.o"
-                       "-std=c++11" "-DGUID_LIBUUID")
+                        "-DGUID_LIBUUID")
                (invoke "ar" "rvs" "libcrossguid.a" "guid.o")))
            (replace 'check
              (lambda _
-               (invoke "g++" "-c" "test.cpp" "-o" "test.o"
-                       "-std=c++11")
-               (invoke "g++" "-c" "testmain.cpp" "-o" "testmain.o"
-                       "-std=c++11")
+               (invoke "g++" "-c" "test.cpp" "-o" "test.o")
+               (invoke "g++" "-c" "testmain.cpp" "-o" "testmain.o")
                (invoke "g++" "test.o" "guid.o" "testmain.o"
                        "-o" "test" "-luuid")
                (invoke (string-append (getcwd) "/test"))))
@@ -129,7 +133,7 @@ generator library for C++.")
 ;; of the standard build process. To make things easier, we bootstrap
 ;; and patch shebangs here, so we don't have to worry about it later.
 (define libdvdnav/kodi
-  (let ((commit "6.0.0-Leia-Alpha-1"))
+  (let ((commit "6.0.0-Leia-Alpha-3"))
     (package
       (name "libdvdnav-bootstrapped")
       (version commit)
@@ -141,7 +145,7 @@ generator library for C++.")
                 (file-name (string-append name "-" version "-checkout"))
                 (sha256
                  (base32
-                  "1xiyfgf8v8aknlxlzsvk6pbzkhclz0hbh3s1b0w6ivkng2k310j9"))))
+                  "0qwlf4lgahxqxk1r2pzl866mi03pbp7l1fc0rk522sc0ak2s9jhb"))))
       (build-system gnu-build-system)
       (arguments
        '(#:tests? #f
@@ -164,7 +168,7 @@ generator library for C++.")
       (license license:gpl2+))))
 
 (define libdvdread/kodi
-  (let ((commit "6.0.0-Leia-Alpha-1"))
+  (let ((commit "6.0.0-Leia-Alpha-3"))
     (package
       (name "libdvdread-bootstrapped")
       (version commit)
@@ -176,7 +180,7 @@ generator library for C++.")
                 (file-name (string-append name "-" version "-checkout"))
                 (sha256
                  (base32
-                  "1c3g18n2vwhgcfz3dka1pmw58bnv2ram7xjvizfiykb3sgi9zfwp"))))
+                  "1xxn01mhkdnp10cqdr357wx77vyzfb5glqpqyg8m0skyi75aii59"))))
       (build-system gnu-build-system)
       (arguments
        '(#:tests? #f
@@ -199,7 +203,7 @@ generator library for C++.")
       (license (list license:gpl2+ license:lgpl2.1+)))))
 
 (define libdvdcss/kodi
-  (let ((commit "1.4.1-Leia-Alpha-1"))
+  (let ((commit "1.4.2-Leia-Beta-5"))
     (package
       (name "libdvdcss-bootstrapped")
       (version commit)
@@ -211,7 +215,7 @@ generator library for C++.")
                 (file-name (string-append name "-" version "-checkout"))
                 (sha256
                  (base32
-                  "0adafwsawxssj3nilkql447v0l4a2584rdpmy5rfjmznh91lykgh"))))
+                  "0j41ydzx0imaix069s3z07xqw9q95k7llh06fc27dcn6f7b8ydyl"))))
       (build-system gnu-build-system)
       (arguments
        '(#:tests? #f
@@ -233,28 +237,56 @@ generator library for C++.")
       (description (package-description libdvdcss))
       (license license:gpl2+))))
 
+(define-public fstrcmp
+  (package
+    (name "fstrcmp")
+    (version "0.7.D001")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "http://fstrcmp.sourceforge.net/fstrcmp-"
+                            version ".tar.gz"))
+        (sha256
+         (base32
+          "0xilghiy3mz78bjmfldi39qyy7jvw5b6wafsx370lw401y2qw0g4"))))
+    (build-system gnu-build-system)
+    (home-page "http://fstrcmp.sourceforge.net/")
+    (arguments
+     '(#:configure-flags '("SH=sh")))
+    (native-inputs
+     `(("ghostscript" ,ghostscript) ; ps2pdf
+       ("groff" ,groff)
+       ("libtool" ,libtool)
+       ("which" ,which)))
+    (synopsis "fuzzy comparison of strings")
+    (description
+     "The fstrcmp project provides a library that is used to make fuzzy
+comparisons of strings and byte arrays, including multi-byte character strings.
+This can be useful in error messages, enabling the suggestion of likely valid
+alternatives. In compilers, this can reduce the cascade of secondary errors.")
+    (license license:gpl3+)))
+
 (define-public kodi
-  ;; We package the git version because the current released
-  ;; version was cut while the cmake transition was in turmoil.
-  (let ((commit "ec16dbca4dcf2923f53f819695a6d47c52e68d74")
-        (revision "8"))
   (package
     (name "kodi")
-    (version (git-version "18.0_alpha" revision commit))
+    (version "18.4")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/xbmc/xbmc.git")
-                    (commit commit)))
+                    (commit (string-append version "-Leia"))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1rxg752cl59124cfpfwmyjldn6qpq5jginxddpzvgagfadf10i4d"))
+                "1m0295czxabdcqyqf5m94av9d88pzhnzjvyfs1q07xqq82h313p7"))
+              (patches (search-patches "kodi-skip-test-449.patch"
+                                       "kodi-increase-test-timeout.patch"
+                                       "kodi-set-libcurl-ssl-parameters.patch"))
               (snippet
                '(begin
                   (use-modules (guix build utils))
                   (for-each delete-file-recursively
-                            '("project/BuildDependencies/bin/"
+                            '("project/BuildDependencies/"
                               ;; TODO: Purge these jars.
                               ;;"tools/codegenerator/groovy"
                               ;; And these sources:
@@ -317,8 +349,8 @@ generator library for C++.")
                 (string-append (assoc-ref inputs "tzdata")
                                "/share/zoneinfo")))
 
-             ;; Don't phone home to check for updates.¬
-             (substitute* "system/addon-manifest.xml"¬
+             ;; Don't phone home to check for updates.
+             (substitute* "system/addon-manifest.xml"
                (("<addon optional=\\\"true\\\">service.xbmc.versioncheck</addon>")
                 ""))
 
@@ -370,10 +402,12 @@ generator library for C++.")
        ("eudev" ,eudev)
        ("ffmpeg" ,ffmpeg)
        ("flac" ,flac)
+       ("flatbuffers" ,flatbuffers)
        ("fmt" ,fmt)
        ("fontconfig" ,fontconfig)
        ("freetype" ,freetype)
        ("fribidi" ,fribidi)
+       ("fstrcmp" ,fstrcmp)
        ("giflib" ,giflib)
        ("glew" ,glew)
        ("gnutls" ,gnutls)
@@ -401,7 +435,8 @@ generator library for C++.")
        ("libxrender" ,libxrender)
        ("libxslt" ,libxslt)
        ("lzo" ,lzo)
-       ("mariadb" ,mariadb)
+       ("mariadb" ,mariadb "lib")
+       ("mariadb-dev" ,mariadb "dev")
        ("openssl" ,openssl)
        ("pcre" ,pcre)
        ("pulseaudio" ,pulseaudio)
@@ -427,7 +462,24 @@ plug-in system.")
                    license:expat                  ;cpluff, dbwrappers
                    license:public-domain          ;cpluff/examples
                    license:bsd-3                  ;misc, gtest
-                   license:bsd-2)))))             ;xbmc/freebsd
+                   license:bsd-2))))              ;xbmc/freebsd
+
+(define-public kodi/wayland
+  (package/inherit kodi
+    (name "kodi-wayland")
+    (arguments
+     (substitute-keyword-arguments (package-arguments kodi)
+       ((#:configure-flags flags)
+        `(append '("-DCORE_PLATFORM_NAME=wayland"
+                   "-DWAYLAND_RENDER_SYSTEM=gl")
+                   ,flags))))
+    (inputs
+     `(("libinput" ,libinput)
+       ("libxkbcommon" ,libxkbcommon)
+       ("waylandpp" ,waylandpp)
+       ("waylandp-protocols" ,wayland-protocols)
+       ,@(package-inputs kodi)))
+    (synopsis "Kodi with Wayland rendering backend")))
 
 (define-public kodi-cli
   (let ((commit "104dc23b2a993c8e6db8c46f4f8bec24b146549b") ; Add support for