2014-12-24 10:57:34 +01:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper
|
2016-10-18 14:53:18 +02:00
|
|
|
, pkgconfig, cmake, gnumake, yasm, python2
|
2016-10-08 18:07:15 +02:00
|
|
|
, boost, avahi, libdvdcss, libdvdnav, libdvdread, 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
|
|
|
|
, libX11, xproto, inputproto, libxml2
|
|
|
|
, libXt, libXmu, libXext, xextproto
|
|
|
|
, libXinerama, libXrandr, randrproto
|
|
|
|
, libXtst, libXfixes, fixesproto, systemd
|
2016-02-29 08:31:58 +01:00
|
|
|
, SDL, SDL2, SDL_image, SDL_mixer, alsaLib
|
2014-12-24 10:57:34 +01:00
|
|
|
, mesa, glew, fontconfig, freetype, ftgl
|
|
|
|
, libjpeg, jasper, libpng, libtiff
|
|
|
|
, libmpeg2, libsamplerate, libmad
|
|
|
|
, libogg, libvorbis, flac, libxslt
|
|
|
|
, lzo, libcdio, libmodplug, libass, libbluray
|
|
|
|
, sqlite, mysql, nasm, gnutls, libva, wayland
|
|
|
|
, curl, bzip2, zip, unzip, glxinfo, xdpyinfo
|
2016-02-21 15:31:41 +01:00
|
|
|
, libcec, libcec_platform, dcadec, libuuid
|
|
|
|
, libcrossguid
|
2014-12-24 10:57:34 +01:00
|
|
|
, dbus_libs ? null, dbusSupport ? true
|
|
|
|
, udev, udevSupport ? true
|
|
|
|
, libusb ? null, usbSupport ? false
|
|
|
|
, samba ? null, sambaSupport ? true
|
|
|
|
, libmicrohttpd, bash
|
|
|
|
# TODO: would be nice to have nfsSupport (needs libnfs library)
|
2015-06-03 07:33:27 +02:00
|
|
|
, rtmpdump ? null, rtmpSupport ? true
|
2014-12-24 10:57:34 +01:00
|
|
|
, libvdpau ? null, vdpauSupport ? true
|
2015-05-27 21:42:15 +02:00
|
|
|
, libpulseaudio ? null, pulseSupport ? true
|
2016-02-29 08:31:58 +01:00
|
|
|
, joystickSupport ? true
|
2014-12-24 10:57:34 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert dbusSupport -> dbus_libs != null;
|
|
|
|
assert udevSupport -> udev != null;
|
|
|
|
assert usbSupport -> libusb != null && ! udevSupport; # libusb won't be used if udev is avaliable
|
|
|
|
assert sambaSupport -> samba != null;
|
|
|
|
assert vdpauSupport -> libvdpau != null;
|
2015-05-27 21:42:15 +02:00
|
|
|
assert pulseSupport -> libpulseaudio != null;
|
2015-06-03 07:33:27 +02:00
|
|
|
assert rtmpSupport -> rtmpdump != null;
|
2014-12-24 10:57:34 +01:00
|
|
|
|
|
|
|
let
|
2016-10-08 18:07:15 +02:00
|
|
|
rel = "Krypton";
|
|
|
|
ffmpeg_3_1_6 = fetchurl {
|
|
|
|
url = "https://github.com/xbmc/FFmpeg/archive/3.1.6-${rel}.tar.gz";
|
|
|
|
sha256 = "14jicb26s20nr3qmfpazszpc892yjwjn81zbsb8szy3a5xs19y81";
|
2014-12-24 10:57:34 +01:00
|
|
|
};
|
2017-04-02 14:12:24 +02:00
|
|
|
# Usage of kodi fork of libdvdnav and libdvdread is necessary for functional dvd playback:
|
|
|
|
libdvdnav_src = fetchurl {
|
|
|
|
url = "https://github.com/xbmc/libdvdnav/archive/981488f.tar.gz";
|
|
|
|
sha256 = "312b3d15bc448d24e92f4b2e7248409525eccc4e75776026d805478e51c5ef3d";
|
|
|
|
};
|
|
|
|
libdvdread_src = fetchurl {
|
|
|
|
url = "https://github.com/xbmc/libdvdread/archive/17d99db.tar.gz";
|
|
|
|
sha256 = "e7179b2054163652596a56301c9f025515cb08c6d6310b42b897c3ad11c0199b";
|
|
|
|
};
|
2014-12-24 10:57:34 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2017-03-22 07:16:39 +01:00
|
|
|
name = "kodi-${version}";
|
|
|
|
version = "17.1";
|
2014-12-24 10:57:34 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-02-02 20:14:50 +01:00
|
|
|
url = "https://github.com/xbmc/xbmc/archive/${version}-${rel}.tar.gz";
|
2017-03-22 07:16:39 +01:00
|
|
|
sha256 = "1vmvrq0qdjnphw34yils2b5jnm05cmsg777hc4lwqz5mrc1kjgrh";
|
2014-12-24 10:57:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
makeWrapper libxml2 gnutls
|
2016-10-18 14:53:18 +02:00
|
|
|
pkgconfig cmake gnumake yasm python2
|
2014-12-24 10:57:34 +01:00
|
|
|
boost libmicrohttpd autoreconfHook
|
2016-04-15 09:57:13 +02:00
|
|
|
gettext pcre-cpp yajl fribidi libva
|
2014-12-24 10:57:34 +01:00
|
|
|
openssl gperf tinyxml2 taglib libssh swig jre
|
|
|
|
libX11 xproto inputproto which
|
|
|
|
libXt libXmu libXext xextproto
|
|
|
|
libXinerama libXrandr randrproto
|
|
|
|
libXtst libXfixes fixesproto
|
|
|
|
SDL SDL_image SDL_mixer alsaLib
|
|
|
|
mesa glew fontconfig freetype ftgl
|
|
|
|
libjpeg jasper libpng libtiff wayland
|
|
|
|
libmpeg2 libsamplerate libmad
|
|
|
|
libogg libvorbis flac libxslt systemd
|
|
|
|
lzo libcdio libmodplug libass libbluray
|
2015-04-02 01:39:50 +02:00
|
|
|
sqlite mysql.lib nasm avahi libdvdcss 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
|
|
|
|
libcrossguid
|
2014-12-24 10:57:34 +01:00
|
|
|
]
|
|
|
|
++ lib.optional dbusSupport dbus_libs
|
|
|
|
++ lib.optional udevSupport udev
|
|
|
|
++ lib.optional usbSupport libusb
|
|
|
|
++ lib.optional sambaSupport samba
|
|
|
|
++ lib.optional vdpauSupport libvdpau
|
2015-05-27 21:42:15 +02:00
|
|
|
++ lib.optional pulseSupport libpulseaudio
|
2016-02-29 08:31:58 +01:00
|
|
|
++ lib.optional rtmpSupport rtmpdump
|
|
|
|
++ lib.optional joystickSupport SDL2;
|
|
|
|
|
2014-12-24 10:57:34 +01:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace xbmc/linux/LinuxTimezone.cpp \
|
|
|
|
--replace 'usr/share/zoneinfo' 'etc/zoneinfo'
|
|
|
|
substituteInPlace tools/depends/target/ffmpeg/autobuild.sh \
|
|
|
|
--replace "/bin/bash" "${bash}/bin/bash -ex"
|
2016-10-08 18:07:15 +02:00
|
|
|
cp ${ffmpeg_3_1_6} tools/depends/target/ffmpeg/ffmpeg-3.1.6-${rel}.tar.gz
|
|
|
|
ln -s ${libdvdcss.src} tools/depends/target/libdvdcss/libdvdcss-master.tar.gz
|
2017-04-02 14:12:24 +02:00
|
|
|
cp ${libdvdnav_src} tools/depends/target/libdvdnav/libdvdnav-master.tar.gz
|
|
|
|
cp ${libdvdread_src} tools/depends/target/libdvdread/libdvdread-master.tar.gz
|
2014-12-24 10:57:34 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
2017-03-22 07:16:39 +01:00
|
|
|
patchShebangs .
|
2014-12-24 10:57:34 +01:00
|
|
|
./bootstrap
|
2017-03-22 07:16:39 +01:00
|
|
|
# tests here fail
|
|
|
|
sed -i '/TestSystemInfo.cpp/d' xbmc/utils/test/{Makefile,CMakeLists.txt}
|
|
|
|
# tests here trigger a segfault in kodi.bin
|
|
|
|
sed -i '/TestWebServer.cpp/d' xbmc/network/test/{Makefile,CMakeLists.txt}
|
2014-12-24 10:57:34 +01:00
|
|
|
'';
|
|
|
|
|
2017-03-22 07:16:39 +01:00
|
|
|
enableParallelBuild = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2017-02-25 00:22:28 +01:00
|
|
|
configureFlags = [ "--enable-libcec" ]
|
2014-12-24 10:57:34 +01:00
|
|
|
++ lib.optional (!sambaSupport) "--disable-samba"
|
|
|
|
++ lib.optional vdpauSupport "--enable-vdpau"
|
2015-06-03 07:33:27 +02:00
|
|
|
++ lib.optional pulseSupport "--enable-pulse"
|
2016-02-29 08:31:58 +01:00
|
|
|
++ lib.optional rtmpSupport "--enable-rtmp"
|
|
|
|
++ lib.optional joystickSupport "--enable-joystick";
|
2014-12-24 10:57:34 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for p in $(ls $out/bin/) ; do
|
|
|
|
wrapProgram $out/bin/$p \
|
2017-03-22 07:16:39 +01:00
|
|
|
--prefix PATH ":" "${lib.makeBinPath
|
|
|
|
[ python2 glxinfo xdpyinfo ]}" \
|
2015-10-06 15:32:17 +02:00
|
|
|
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
|
2017-03-22 07:16:39 +01:00
|
|
|
[ curl systemd libmad libvdpau libcec libcec_platform rtmpdump libass SDL2 ]}"
|
2014-12-24 10:57:34 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://kodi.tv/;
|
|
|
|
description = "Media center";
|
2017-03-22 07:16:39 +01:00
|
|
|
license = licenses.gpl2;
|
2014-12-24 10:57:34 +01:00
|
|
|
platforms = platforms.linux;
|
2016-05-17 13:57:28 +02:00
|
|
|
maintainers = with maintainers; [ domenkozar titanous edwtjo ];
|
2014-12-24 10:57:34 +01:00
|
|
|
};
|
|
|
|
}
|