2014-12-24 12:57:34 +03:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper
|
|
|
|
, pkgconfig, cmake, gnumake, yasm, pythonFull
|
|
|
|
, boost, avahi, libdvdcss, lame, autoreconfHook
|
|
|
|
, gettext, pcre, yajl, fribidi, which
|
|
|
|
, 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 10:31:58 +03:00
|
|
|
, SDL, SDL2, SDL_image, SDL_mixer, alsaLib
|
2014-12-24 12:57:34 +03: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 17:31:41 +03:00
|
|
|
, libcec, libcec_platform, dcadec, libuuid
|
|
|
|
, libcrossguid
|
2014-12-24 12:57:34 +03: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 08:33:27 +03:00
|
|
|
, rtmpdump ? null, rtmpSupport ? true
|
2014-12-24 12:57:34 +03:00
|
|
|
, libvdpau ? null, vdpauSupport ? true
|
2015-05-27 22:42:15 +03:00
|
|
|
, libpulseaudio ? null, pulseSupport ? true
|
2016-02-29 10:31:58 +03:00
|
|
|
, joystickSupport ? true
|
2014-12-24 12:57:34 +03: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 22:42:15 +03:00
|
|
|
assert pulseSupport -> libpulseaudio != null;
|
2015-06-03 08:33:27 +03:00
|
|
|
assert rtmpSupport -> rtmpdump != null;
|
2014-12-24 12:57:34 +03:00
|
|
|
|
|
|
|
let
|
2016-02-21 17:31:41 +03:00
|
|
|
rel = "Jarvis";
|
|
|
|
ffmpeg_2_8_6 = fetchurl {
|
|
|
|
url = "https://github.com/xbmc/FFmpeg/archive/2.8.6-${rel}-16.0.tar.gz";
|
|
|
|
sha256 = "00cvjwfpz6ladmln4yny4d4viwflrbgrid1na412g5pif70qv3dh";
|
2014-12-24 12:57:34 +03:00
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2015-02-02 22:14:50 +03:00
|
|
|
name = "kodi-" + version;
|
2016-02-21 17:31:41 +03:00
|
|
|
version = "16.0";
|
2014-12-24 12:57:34 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-02-02 22:14:50 +03:00
|
|
|
url = "https://github.com/xbmc/xbmc/archive/${version}-${rel}.tar.gz";
|
2016-02-21 17:31:41 +03:00
|
|
|
sha256 = "0iirspvv7czf785l2lqf232dvdaj87srbn9ni97ngvnd6w9yl884";
|
2014-12-24 12:57:34 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
makeWrapper libxml2 gnutls
|
|
|
|
pkgconfig cmake gnumake yasm pythonFull
|
|
|
|
boost libmicrohttpd autoreconfHook
|
|
|
|
gettext pcre yajl fribidi libva
|
|
|
|
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 02:39:50 +03:00
|
|
|
sqlite mysql.lib nasm avahi libdvdcss lame
|
2014-12-24 12:57:34 +03:00
|
|
|
curl bzip2 zip unzip glxinfo xdpyinfo
|
2016-02-21 17:31:41 +03:00
|
|
|
libcec libcec_platform dcadec libuuid
|
|
|
|
libcrossguid
|
2014-12-24 12:57:34 +03: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 22:42:15 +03:00
|
|
|
++ lib.optional pulseSupport libpulseaudio
|
2016-02-29 10:31:58 +03:00
|
|
|
++ lib.optional rtmpSupport rtmpdump
|
|
|
|
++ lib.optional joystickSupport SDL2;
|
|
|
|
|
2014-12-24 12:57:34 +03: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-02-21 17:31:41 +03:00
|
|
|
cp ${ffmpeg_2_8_6} tools/depends/target/ffmpeg/ffmpeg-2.8.6-${rel}-16.0.tar.gz
|
2014-12-24 12:57:34 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
./bootstrap
|
|
|
|
'';
|
|
|
|
|
2015-08-04 02:51:42 +03:00
|
|
|
configureFlags = [ ]
|
2014-12-24 12:57:34 +03:00
|
|
|
++ lib.optional (!sambaSupport) "--disable-samba"
|
|
|
|
++ lib.optional vdpauSupport "--enable-vdpau"
|
2015-06-03 08:33:27 +03:00
|
|
|
++ lib.optional pulseSupport "--enable-pulse"
|
2016-02-29 10:31:58 +03:00
|
|
|
++ lib.optional rtmpSupport "--enable-rtmp"
|
|
|
|
++ lib.optional joystickSupport "--enable-joystick";
|
2014-12-24 12:57:34 +03:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for p in $(ls $out/bin/) ; do
|
|
|
|
wrapProgram $out/bin/$p \
|
|
|
|
--prefix PATH ":" "${pythonFull}/bin" \
|
|
|
|
--prefix PATH ":" "${glxinfo}/bin" \
|
|
|
|
--prefix PATH ":" "${xdpyinfo}/bin" \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" "${curl}/lib" \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" "${systemd}/lib" \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" "${libmad}/lib" \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" "${libvdpau}/lib" \
|
2015-06-03 08:33:27 +03:00
|
|
|
--prefix LD_LIBRARY_PATH ":" "${libcec}/lib" \
|
2015-08-04 02:51:42 +03:00
|
|
|
--prefix LD_LIBRARY_PATH ":" "${libcec_platform}/lib" \
|
2015-10-14 12:24:06 +03:00
|
|
|
--prefix LD_LIBRARY_PATH ":" "${libass}/lib" \
|
2016-02-29 10:31:58 +03:00
|
|
|
--prefix LD_LIBRARY_PATH ":" "${rtmpdump}/lib" \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" "${SDL2}/lib"
|
2014-12-24 12:57:34 +03:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://kodi.tv/;
|
|
|
|
description = "Media center";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2015-02-02 22:14:50 +03:00
|
|
|
maintainers = with maintainers; [ iElectric titanous edwtjo ];
|
2014-12-24 12:57:34 +03:00
|
|
|
};
|
|
|
|
}
|