about summary refs log tree commit diff
path: root/pkgs/applications/video/kodi
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2021-03-10 21:27:38 -0500
committerAaron Andersen <aaron@fosslib.net>2021-03-11 20:35:54 -0500
commit901b43d439db00e3e03f969ffb2df0530ef8bf17 (patch)
tree9f1f4fe93c4ed01d7e458c797b0ef223d44086d5 /pkgs/applications/video/kodi
parent4ef33dd12d508a1f459283ca23bd03d1a36ac71a (diff)
kodi: miscellaneous cleanup
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'pkgs/applications/video/kodi')
-rw-r--r--pkgs/applications/video/kodi/packages.nix4
-rw-r--r--pkgs/applications/video/kodi/unwrapped.nix51
2 files changed, 23 insertions, 32 deletions
diff --git a/pkgs/applications/video/kodi/packages.nix b/pkgs/applications/video/kodi/packages.nix
index 1bcbaaa4b166f..8e0ecbf9b9b71 100644
--- a/pkgs/applications/video/kodi/packages.nix
+++ b/pkgs/applications/video/kodi/packages.nix
@@ -49,7 +49,7 @@ let self = rec {
   buildKodiAddon =
     { name ? "${attrs.pname}-${attrs.version}"
     , namespace
-    , sourceDir ? null
+    , sourceDir ? ""
     , ... } @ attrs:
   toKodiAddon (stdenv.mkDerivation ({
     name = "kodi-" + name;
@@ -59,7 +59,7 @@ let self = rec {
     extraRuntimeDependencies = [ ];
 
     installPhase = ''
-      ${if sourceDir == null then "" else "cd $src/$sourceDir"}
+      cd $src/$sourceDir
       d=$out${addonDir}/${namespace}
       mkdir -p $d
       sauce="."
diff --git a/pkgs/applications/video/kodi/unwrapped.nix b/pkgs/applications/video/kodi/unwrapped.nix
index d1a451f7b61eb..2a713324c3fbf 100644
--- a/pkgs/applications/video/kodi/unwrapped.nix
+++ b/pkgs/applications/video/kodi/unwrapped.nix
@@ -19,30 +19,22 @@
 , libplist, p11-kit, zlib, flatbuffers, fmt, fstrcmp, rapidjson
 , lirc
 , x11Support ? true, libX11, xorgproto, libXt, libXmu, libXext, libXinerama, libXrandr, libXtst, libXfixes, xdpyinfo, libXdmcp
-, dbusSupport ? true, dbus ? null
-, joystickSupport ? true, cwiid ? null
-, nfsSupport ? true, libnfs ? null
-, pulseSupport ? true, libpulseaudio ? null
-, rtmpSupport ? true, rtmpdump ? null
-, sambaSupport ? true, samba ? null
-, udevSupport ? true, udev ? null
-, usbSupport  ? false, libusb-compat-0_1 ? null
-, vdpauSupport ? true, libvdpau ? null
-, waylandSupport ? false, wayland ? null, wayland-protocols ? null
-, waylandpp ?  null, libxkbcommon ? null
-, gbmSupport ? false, mesa ? null, libinput ? null
+, dbusSupport ? true, dbus
+, joystickSupport ? true, cwiid
+, nfsSupport ? true, libnfs
+, pulseSupport ? true, libpulseaudio
+, rtmpSupport ? true, rtmpdump
+, sambaSupport ? true, samba
+, udevSupport ? true, udev
+, usbSupport  ? false, libusb-compat-0_1
+, vdpauSupport ? true, libvdpau
+, waylandSupport ? false, wayland, wayland-protocols
+, waylandpp ?  null, libxkbcommon
+, gbmSupport ? false, mesa, libinput
 , buildPackages
 }:
 
-assert dbusSupport  -> dbus != null;
-assert nfsSupport   -> libnfs != null;
-assert pulseSupport -> libpulseaudio != null;
-assert rtmpSupport  -> rtmpdump != null;
-assert sambaSupport -> samba != null;
-assert udevSupport  -> udev != null;
-assert usbSupport   -> libusb-compat-0_1 != null && ! udevSupport; # libusb-compat-0_1 won't be used if udev is avaliable
-assert vdpauSupport -> libvdpau != null;
-assert waylandSupport -> wayland != null && wayland-protocols != null && waylandpp != null && libxkbcommon != null;
+assert usbSupport -> !udevSupport; # libusb-compat-0_1 won't be used if udev is avaliable
 assert gbmSupport || waylandSupport || x11Support;
 
 let
@@ -78,7 +70,7 @@ let
       "-DPKG_CONFIG_EXECUTABLE=pkg-config"
     ];
     buildInputs = [ libidn libtasn1 p11-kit zlib libva ]
-      ++ lib.optional  vdpauSupport    libvdpau;
+      ++ lib.optional vdpauSupport libvdpau;
     nativeBuildInputs = [ cmake nasm pkg-config gnutls ];
   };
 
@@ -105,11 +97,9 @@ let
     sha256 = "1xxn01mhkdnp10cqdr357wx77vyzfb5glqpqyg8m0skyi75aii59";
   };
 
-  kodi_platforms =
-    lib.optional gbmSupport "gbm" ++
-    lib.optional waylandSupport "wayland" ++
-    lib.optional x11Support "x11"
-  ;
+  kodi_platforms = lib.optional gbmSupport "gbm"
+    ++ lib.optional waylandSupport "wayland"
+    ++ lib.optional x11Support "x11";
 
 in stdenv.mkDerivation {
     pname = "kodi";
@@ -143,7 +133,7 @@ in stdenv.mkDerivation {
       libXinerama libXrandr.dev libXtst libXfixes
     ]
     ++ lib.optional  dbusSupport     dbus
-    ++ lib.optional joystickSupport cwiid
+    ++ lib.optional  joystickSupport cwiid
     ++ lib.optional  nfsSupport      libnfs
     ++ lib.optional  pulseSupport    libpulseaudio
     ++ lib.optional  rtmpSupport     rtmpdump
@@ -222,7 +212,8 @@ in stdenv.mkDerivation {
     postInstall = ''
       for p in $(ls $out/bin/) ; do
         wrapProgram $out/bin/$p \
-          --prefix PATH            ":" "${lib.makeBinPath ([ python3Packages.python glxinfo ] ++ lib.optional x11Support xdpyinfo ++ lib.optional sambaSupport samba)}" \
+          --prefix PATH ":" "${lib.makeBinPath ([ python3Packages.python glxinfo ]
+            ++ lib.optional x11Support xdpyinfo ++ lib.optional sambaSupport samba)}" \
           --prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
               ([ curl systemd libmad libvdpau libcec libcec_platform libass ]
                  ++ lib.optional nfsSupport libnfs
@@ -244,7 +235,7 @@ in stdenv.mkDerivation {
     meta = with lib; {
       description = "Media center";
       homepage    = "https://kodi.tv/";
-      license     = licenses.gpl2;
+      license     = licenses.gpl2Plus;
       platforms   = platforms.linux;
       maintainers = with maintainers; [ titanous edwtjo peterhoeg sephalon ];
     };