2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, makeWrapper
|
2018-09-06 21:40:18 +02:00
|
|
|
, pkgconfig, cmake, gnumake, yasm, python2Packages
|
2017-03-22 07:08:01 +01:00
|
|
|
, libgcrypt, libgpgerror, libunistring
|
|
|
|
, boost, avahi, lame, autoreconfHook
|
2016-04-15 09:57:13 +02:00
|
|
|
, gettext, pcre-cpp, yajl, fribidi, which
|
2014-12-24 10:57:34 +01:00
|
|
|
, openssl, gperf, tinyxml2, taglib, libssh, swig, jre
|
2018-12-31 04:40:47 +01:00
|
|
|
, libX11, xorgproto, libxml2
|
|
|
|
, libXt, libXmu, libXext
|
|
|
|
, libXinerama, libXrandr
|
|
|
|
, libXtst, libXfixes, systemd
|
2018-02-24 14:12:44 +01:00
|
|
|
, alsaLib, libGLU_combined, glew, fontconfig, freetype, ftgl
|
2014-12-24 10:57:34 +01:00
|
|
|
, libjpeg, jasper, libpng, libtiff
|
|
|
|
, libmpeg2, libsamplerate, libmad
|
|
|
|
, libogg, libvorbis, flac, libxslt
|
|
|
|
, lzo, libcdio, libmodplug, libass, libbluray
|
2019-04-11 20:06:06 +02:00
|
|
|
, sqlite, mysql, nasm, gnutls, libva, libdrm
|
2014-12-24 10:57:34 +01:00
|
|
|
, curl, bzip2, zip, unzip, glxinfo, xdpyinfo
|
2016-02-21 15:31:41 +01:00
|
|
|
, libcec, libcec_platform, dcadec, libuuid
|
2017-03-22 07:08:01 +01:00
|
|
|
, libcrossguid, libmicrohttpd
|
|
|
|
, bluez, doxygen, giflib, glib, harfbuzz, lcms2, libidn, libpthreadstubs, libtasn1, libXdmcp
|
2018-10-09 21:17:07 +02:00
|
|
|
, libplist, p11-kit, zlib, flatbuffers, fmt, fstrcmp, rapidjson
|
2018-07-17 22:11:16 +02:00
|
|
|
, dbusSupport ? true, dbus ? null
|
2017-03-22 07:08:01 +01:00
|
|
|
, 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 ? null
|
|
|
|
, vdpauSupport ? true, libvdpau ? null
|
2019-04-11 20:06:06 +02:00
|
|
|
, useWayland ? false, wayland ? null, wayland-protocols ? null
|
|
|
|
, waylandpp ? null, libxkbcommon ? null
|
2014-12-24 10:57:34 +01:00
|
|
|
}:
|
|
|
|
|
2018-07-17 22:11:16 +02:00
|
|
|
assert dbusSupport -> dbus != null;
|
2017-03-22 07:08:01 +01:00
|
|
|
assert nfsSupport -> libnfs != null;
|
|
|
|
assert pulseSupport -> libpulseaudio != null;
|
|
|
|
assert rtmpSupport -> rtmpdump != null;
|
|
|
|
assert sambaSupport -> samba != null;
|
2014-12-24 10:57:34 +01:00
|
|
|
assert udevSupport -> udev != null;
|
|
|
|
assert usbSupport -> libusb != null && ! udevSupport; # libusb won't be used if udev is avaliable
|
|
|
|
assert vdpauSupport -> libvdpau != null;
|
2019-04-11 20:06:06 +02:00
|
|
|
assert useWayland -> wayland != null && wayland-protocols != null && waylandpp != null && libxkbcommon != null;
|
2017-03-22 07:08:01 +01:00
|
|
|
|
|
|
|
# TODO for Kodi 18.0
|
|
|
|
# - check if dbus support PR has been merged and add dbus as a buildInput
|
2014-12-24 10:57:34 +01:00
|
|
|
|
|
|
|
let
|
2018-10-09 21:17:07 +02:00
|
|
|
kodiReleaseDate = "20190129";
|
2019-03-23 17:03:56 +01:00
|
|
|
kodiVersion = "18.1";
|
2018-10-09 21:17:07 +02:00
|
|
|
rel = "Leia";
|
2017-03-22 07:08:01 +01:00
|
|
|
|
|
|
|
kodi_src = fetchFromGitHub {
|
|
|
|
owner = "xbmc";
|
|
|
|
repo = "xbmc";
|
|
|
|
rev = "${kodiVersion}-${rel}";
|
2019-03-23 17:03:56 +01:00
|
|
|
sha256 = "1w26aqvzxv4c70gcd1vw1pldapsc2xcacwq9b7dqx5m44j0zx1dc";
|
2014-12-24 10:57:34 +01:00
|
|
|
};
|
2017-03-22 07:08:01 +01:00
|
|
|
|
|
|
|
kodiDependency = { name, version, rev, sha256, ... } @attrs:
|
|
|
|
let
|
|
|
|
attrs' = builtins.removeAttrs attrs ["name" "version" "rev" "sha256"];
|
|
|
|
in stdenv.mkDerivation ({
|
|
|
|
name = "kodi-${lib.toLower name}-${version}";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xbmc";
|
|
|
|
repo = name;
|
|
|
|
inherit rev sha256;
|
|
|
|
};
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
} // attrs');
|
|
|
|
|
|
|
|
ffmpeg = kodiDependency rec {
|
|
|
|
name = "FFmpeg";
|
2018-10-09 21:17:07 +02:00
|
|
|
version = "4.0.3";
|
2019-03-23 17:03:56 +01:00
|
|
|
rev = "${version}-${rel}-18.2";
|
|
|
|
sha256 = "1krsjlr949iy5l6ljxancza1yi6w1annxc5s6k283i9mb15qy8cy";
|
2017-03-22 07:08:01 +01:00
|
|
|
preConfigure = ''
|
|
|
|
cp ${kodi_src}/tools/depends/target/ffmpeg/{CMakeLists.txt,*.cmake} .
|
|
|
|
'';
|
2018-02-25 03:23:58 +01:00
|
|
|
buildInputs = [ gnutls libidn libtasn1 p11-kit zlib libva ]
|
2017-12-23 09:28:53 +01:00
|
|
|
++ lib.optional vdpauSupport libvdpau;
|
2017-03-22 07:08:01 +01:00
|
|
|
nativeBuildInputs = [ cmake nasm pkgconfig ];
|
2017-04-02 14:12:24 +02:00
|
|
|
};
|
2017-03-22 07:08:01 +01:00
|
|
|
|
|
|
|
# we should be able to build these externally and have kodi reference them as buildInputs.
|
|
|
|
# Doesn't work ATM though so we just use them for the src
|
|
|
|
|
2018-10-09 21:17:07 +02:00
|
|
|
libdvdcss = kodiDependency rec {
|
2017-03-22 07:08:01 +01:00
|
|
|
name = "libdvdcss";
|
2018-10-09 21:17:07 +02:00
|
|
|
version = "1.4.2";
|
|
|
|
rev = "${version}-${rel}-Beta-5";
|
|
|
|
sha256 = "0j41ydzx0imaix069s3z07xqw9q95k7llh06fc27dcn6f7b8ydyl";
|
2017-03-22 07:08:01 +01:00
|
|
|
buildInputs = [ libdvdread ];
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
|
|
|
};
|
|
|
|
|
2018-10-09 21:17:07 +02:00
|
|
|
libdvdnav = kodiDependency rec {
|
2017-03-22 07:08:01 +01:00
|
|
|
name = "libdvdnav";
|
2018-10-09 21:17:07 +02:00
|
|
|
version = "6.0.0";
|
|
|
|
rev = "${version}-${rel}-Alpha-3";
|
|
|
|
sha256 = "0qwlf4lgahxqxk1r2pzl866mi03pbp7l1fc0rk522sc0ak2s9jhb";
|
2017-03-22 07:08:01 +01:00
|
|
|
buildInputs = [ libdvdread ];
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
2017-04-02 14:12:24 +02:00
|
|
|
};
|
2017-03-22 07:08:01 +01:00
|
|
|
|
2018-10-09 21:17:07 +02:00
|
|
|
libdvdread = kodiDependency rec {
|
2017-03-22 07:08:01 +01:00
|
|
|
name = "libdvdread";
|
2018-10-09 21:17:07 +02:00
|
|
|
version = "6.0.0";
|
|
|
|
rev = "${version}-${rel}-Alpha-3";
|
|
|
|
sha256 = "1xxn01mhkdnp10cqdr357wx77vyzfb5glqpqyg8m0skyi75aii59";
|
2017-03-22 07:08:01 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
|
|
|
};
|
|
|
|
|
2014-12-24 10:57:34 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-04-11 20:06:06 +02:00
|
|
|
name = "kodi-${lib.optionalString useWayland "wayland-"}${kodiVersion}";
|
2014-12-24 10:57:34 +01:00
|
|
|
|
2017-03-22 07:08:01 +01:00
|
|
|
src = kodi_src;
|
2014-12-24 10:57:34 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
2018-02-25 03:23:58 +01:00
|
|
|
gnutls libidn libtasn1 nasm p11-kit
|
2018-09-06 21:40:18 +02:00
|
|
|
libxml2 yasm python2Packages.python
|
2017-05-24 10:03:17 +02:00
|
|
|
boost libmicrohttpd
|
2018-03-25 23:33:23 +02:00
|
|
|
gettext pcre-cpp yajl fribidi libva libdrm
|
2014-12-24 10:57:34 +01:00
|
|
|
openssl gperf tinyxml2 taglib libssh swig jre
|
2018-12-31 04:40:47 +01:00
|
|
|
libX11 xorgproto libXt libXmu libXext
|
|
|
|
libXinerama libXrandr libXtst libXfixes
|
2018-02-24 14:12:44 +01:00
|
|
|
alsaLib libGLU_combined glew fontconfig freetype ftgl
|
2019-04-11 20:06:06 +02:00
|
|
|
libjpeg jasper libpng libtiff
|
2014-12-24 10:57:34 +01:00
|
|
|
libmpeg2 libsamplerate libmad
|
|
|
|
libogg libvorbis flac libxslt systemd
|
|
|
|
lzo libcdio libmodplug libass libbluray
|
2017-07-09 17:43:03 +02:00
|
|
|
sqlite mysql.connector-c avahi lame
|
2014-12-24 10:57:34 +01:00
|
|
|
curl bzip2 zip unzip glxinfo xdpyinfo
|
2016-02-21 15:31:41 +01:00
|
|
|
libcec libcec_platform dcadec libuuid
|
2017-03-22 07:08:01 +01:00
|
|
|
libgcrypt libgpgerror libunistring
|
|
|
|
libcrossguid cwiid libplist
|
|
|
|
bluez giflib glib harfbuzz lcms2 libpthreadstubs libXdmcp
|
2018-10-09 21:17:07 +02:00
|
|
|
ffmpeg flatbuffers fmt fstrcmp rapidjson
|
2017-03-22 07:08:01 +01:00
|
|
|
# libdvdcss libdvdnav libdvdread
|
2014-12-24 10:57:34 +01:00
|
|
|
]
|
2018-07-17 22:11:16 +02:00
|
|
|
++ lib.optional dbusSupport dbus
|
2017-12-23 09:28:53 +01:00
|
|
|
++ lib.optionals joystickSupport [ cwiid ]
|
2017-03-22 07:08:01 +01:00
|
|
|
++ lib.optional nfsSupport libnfs
|
|
|
|
++ lib.optional pulseSupport libpulseaudio
|
|
|
|
++ lib.optional rtmpSupport rtmpdump
|
|
|
|
++ lib.optional sambaSupport samba
|
|
|
|
++ lib.optional udevSupport udev
|
|
|
|
++ lib.optional usbSupport libusb
|
2019-04-11 20:06:06 +02:00
|
|
|
++ lib.optional vdpauSupport libvdpau
|
|
|
|
++ lib.optional useWayland [
|
|
|
|
wayland waylandpp
|
|
|
|
# Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise
|
|
|
|
libxkbcommon.dev
|
|
|
|
];
|
2016-02-29 08:31:58 +01:00
|
|
|
|
2017-05-24 10:03:17 +02:00
|
|
|
nativeBuildInputs = [
|
2017-03-22 07:08:01 +01:00
|
|
|
cmake
|
|
|
|
doxygen
|
|
|
|
makeWrapper
|
|
|
|
which
|
|
|
|
pkgconfig gnumake
|
|
|
|
autoconf automake libtool # still needed for some components. Check if that is the case with 18.0
|
2019-04-11 20:06:06 +02:00
|
|
|
] ++ lib.optional useWayland [ wayland-protocols ];
|
2014-12-24 10:57:34 +01:00
|
|
|
|
2017-03-22 07:08:01 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-Dlibdvdcss_URL=${libdvdcss.src}"
|
|
|
|
"-Dlibdvdnav_URL=${libdvdnav.src}"
|
|
|
|
"-Dlibdvdread_URL=${libdvdread.src}"
|
|
|
|
"-DGIT_VERSION=${kodiReleaseDate}"
|
|
|
|
"-DENABLE_EVENTCLIENTS=ON"
|
|
|
|
"-DENABLE_INTERNAL_CROSSGUID=OFF"
|
|
|
|
"-DENABLE_OPTICAL=ON"
|
|
|
|
"-DLIRC_DEVICE=/run/lirc/lircd"
|
2019-04-11 20:06:06 +02:00
|
|
|
] ++ lib.optional useWayland [
|
|
|
|
"-DCORE_PLATFORM_NAME=wayland"
|
|
|
|
"-DWAYLAND_RENDER_SYSTEM=gl"
|
2017-03-22 07:08:01 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
# 14 tests fail but the biggest issue is that every test takes 30 seconds -
|
|
|
|
# I'm guessing there is a thing waiting to time out
|
|
|
|
doCheck = false;
|
2014-12-24 10:57:34 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
2018-10-09 21:17:07 +02:00
|
|
|
substituteInPlace xbmc/platform/linux/LinuxTimezone.cpp \
|
2014-12-24 10:57:34 +01:00
|
|
|
--replace 'usr/share/zoneinfo' 'etc/zoneinfo'
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for p in $(ls $out/bin/) ; do
|
|
|
|
wrapProgram $out/bin/$p \
|
2018-09-06 21:40:18 +02:00
|
|
|
--prefix PATH ":" "${lib.makeBinPath [ python2Packages.python glxinfo xdpyinfo ]}" \
|
2015-10-06 15:32:17 +02:00
|
|
|
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
|
2018-09-03 22:33:38 +02:00
|
|
|
([ curl systemd libmad libvdpau libcec libcec_platform rtmpdump libass ] ++ lib.optional nfsSupport libnfs)}"
|
2014-12-24 10:57:34 +01:00
|
|
|
done
|
2017-03-22 07:08:01 +01:00
|
|
|
|
|
|
|
substituteInPlace $out/share/xsessions/kodi.desktop \
|
|
|
|
--replace kodi-standalone $out/bin/kodi-standalone
|
2014-12-24 10:57:34 +01:00
|
|
|
'';
|
|
|
|
|
2017-03-22 07:08:01 +01:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = "$out/bin/kodi --version";
|
|
|
|
|
2018-09-06 21:40:18 +02:00
|
|
|
passthru = {
|
|
|
|
pythonPackages = python2Packages;
|
|
|
|
};
|
|
|
|
|
2014-12-24 10:57:34 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Media center";
|
2017-03-22 07:08:01 +01:00
|
|
|
homepage = https://kodi.tv/;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2018-10-09 21:17:07 +02:00
|
|
|
maintainers = with maintainers; [ domenkozar titanous edwtjo peterhoeg sephalon ];
|
2014-12-24 10:57:34 +01:00
|
|
|
};
|
|
|
|
}
|