nixpkgs/pkgs/applications/video/kodi/default.nix

122 lines
4.2 KiB
Nix
Raw Normal View History

{ 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
, SDL, SDL_image, SDL_mixer, alsaLib
, 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
2015-08-04 00:51:42 +01:00
, libcec, libcec_platform
, 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)
, rtmpdump ? null, rtmpSupport ? true
, libvdpau ? null, vdpauSupport ? true
, libpulseaudio ? null, pulseSupport ? true
}:
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;
assert pulseSupport -> libpulseaudio != null;
assert rtmpSupport -> rtmpdump != null;
let
2015-07-22 14:27:14 +01:00
rel = "Isengard";
2015-08-18 23:33:21 +01:00
ffmpeg_2_6_4 = fetchurl {
url = "https://github.com/xbmc/FFmpeg/archive/2.6.4-${rel}.tar.gz";
sha256 = "0gsjz8sr0dqq68gcln29xhz3h35n77769h1gb0ias0apmpaad1r4";
};
in stdenv.mkDerivation rec {
name = "kodi-" + version;
2015-10-26 03:15:38 +00:00
version = "15.2";
src = fetchurl {
url = "https://github.com/xbmc/xbmc/archive/${version}-${rel}.tar.gz";
2015-10-26 03:15:38 +00:00
sha256 = "043i0f1crx9glwxil4xm45z5kxpkrx316gi4ir4d3rbd5safp2nx";
};
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
sqlite mysql.lib nasm avahi libdvdcss lame
curl bzip2 zip unzip glxinfo xdpyinfo
2015-08-04 00:51:42 +01:00
libcec libcec_platform
]
++ lib.optional dbusSupport dbus_libs
++ lib.optional udevSupport udev
++ lib.optional usbSupport libusb
++ lib.optional sambaSupport samba
++ lib.optional vdpauSupport libvdpau
++ lib.optional pulseSupport libpulseaudio
++ lib.optional rtmpSupport rtmpdump;
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"
2015-08-18 23:33:21 +01:00
cp ${ffmpeg_2_6_4} tools/depends/target/ffmpeg/ffmpeg-2.6.4-${rel}.tar.gz
'';
preConfigure = ''
./bootstrap
'';
2015-08-04 00:51:42 +01:00
configureFlags = [ ]
++ lib.optional (!sambaSupport) "--disable-samba"
++ lib.optional vdpauSupport "--enable-vdpau"
++ lib.optional pulseSupport "--enable-pulse"
++ lib.optional rtmpSupport "--enable-rtmp";
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 ":" "${lib.makeLibraryPath
[ curl systemd libmad libvdpau libcec libcec_platform rtmpdump ]
}"
2015-10-14 10:24:06 +01:00
--prefix LD_LIBRARY_PATH ":" "${libass}/lib" \
done
'';
meta = with stdenv.lib; {
homepage = http://kodi.tv/;
description = "Media center";
license = stdenv.lib.licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ iElectric titanous edwtjo ];
};
}