2018-04-16 11:34:07 +02:00
|
|
|
{ stdenv, fetchurl, autoreconfHook
|
|
|
|
, libarchive, perl, xorg, libdvdnav, libbluray
|
2011-08-01 11:23:10 +02:00
|
|
|
, zlib, a52dec, libmad, faad2, ffmpeg, alsaLib
|
2014-11-18 02:33:10 +01:00
|
|
|
, pkgconfig, dbus, fribidi, freefont_ttf, libebml, libmatroska
|
2018-04-16 11:34:07 +02:00
|
|
|
, libvorbis, libtheora, speex, lua5, libgcrypt, libgpgerror, libupnp
|
2015-05-27 21:42:15 +02:00
|
|
|
, libcaca, libpulseaudio, flac, schroedinger, libxml2, librsvg
|
2018-04-16 11:34:07 +02:00
|
|
|
, mpeg2dec, systemd, gnutls, avahi, libcddb, libjack2, SDL, SDL_image
|
2011-02-09 22:11:30 +01:00
|
|
|
, libmtp, unzip, taglib, libkate, libtiger, libv4l, samba, liboggz
|
2018-07-17 22:11:16 +02:00
|
|
|
, libass, libva, libdvbpsi, libdc1394, libraw1394, libopus
|
2018-04-16 11:34:07 +02:00
|
|
|
, libvdpau, libsamplerate, live555, fluidsynth, wayland, wayland-protocols
|
|
|
|
, onlyLibVLC ? false
|
|
|
|
, withQt5 ? true, qtbase ? null, qtsvg ? null, qtx11extras ? null
|
2015-06-24 12:19:37 +02:00
|
|
|
, jackSupport ? false
|
2018-10-28 02:03:37 +01:00
|
|
|
, removeReferencesTo
|
2019-03-30 17:41:09 +01:00
|
|
|
, chromecastSupport ? true, protobuf, libmicrodns
|
2006-06-29 14:41:25 +02:00
|
|
|
}:
|
2003-12-03 22:58:16 +01:00
|
|
|
|
2019-03-30 17:41:09 +01:00
|
|
|
# chromecastSupport requires TCP port 8010 to be open for it to work.
|
|
|
|
# If your firewall is enabled, make sure to have something like:
|
|
|
|
# networking.firewall.allowedTCPPorts = [ 8010 ];
|
|
|
|
|
2014-11-18 02:33:10 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2018-04-16 11:34:07 +02:00
|
|
|
assert (withQt5 -> qtbase != null && qtsvg != null && qtx11extras != null);
|
2014-11-18 02:33:10 +01:00
|
|
|
|
2011-02-09 22:11:30 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2013-09-26 16:37:49 +02:00
|
|
|
name = "vlc-${version}";
|
2019-06-18 18:45:23 +02:00
|
|
|
version = "3.0.7.1";
|
2011-02-09 22:11:30 +01:00
|
|
|
|
2003-12-03 22:58:16 +01:00
|
|
|
src = fetchurl {
|
2016-02-07 13:18:48 +01:00
|
|
|
url = "http://get.videolan.org/vlc/${version}/${name}.tar.xz";
|
2019-06-18 18:45:23 +02:00
|
|
|
sha256 = "1xb4c8n0hkwijzfdlbwadhxnx9z8rlhmrdq4c7q74rq9f51q0m86";
|
2003-12-03 22:58:16 +01:00
|
|
|
};
|
|
|
|
|
2018-04-16 11:34:07 +02:00
|
|
|
# VLC uses a *ton* of libraries for various pieces of functionality, many of
|
|
|
|
# which are not included here for no other reason that nobody has mentioned
|
|
|
|
# needing them
|
|
|
|
buildInputs = [
|
|
|
|
zlib a52dec libmad faad2 ffmpeg alsaLib libdvdnav libdvdnav.libdvdread
|
|
|
|
libbluray dbus fribidi libvorbis libtheora speex lua5 libgcrypt libgpgerror
|
|
|
|
libupnp libcaca libpulseaudio flac schroedinger libxml2 librsvg mpeg2dec
|
|
|
|
systemd gnutls avahi libcddb SDL SDL_image libmtp unzip taglib libarchive
|
2018-07-17 22:11:16 +02:00
|
|
|
libkate libtiger libv4l samba liboggz libass libdvbpsi libva
|
2018-04-16 11:34:07 +02:00
|
|
|
xorg.xlibsWrapper xorg.libXv xorg.libXvMC xorg.libXpm xorg.xcbutilkeysyms
|
2018-11-18 17:50:27 +01:00
|
|
|
libdc1394 libraw1394 libopus libebml libmatroska libvdpau libsamplerate
|
2018-04-16 11:34:07 +02:00
|
|
|
fluidsynth wayland wayland-protocols
|
2018-11-18 17:50:27 +01:00
|
|
|
] ++ optional (!stdenv.hostPlatform.isAarch64) live555
|
|
|
|
++ optionals withQt5 [ qtbase qtsvg qtx11extras ]
|
2019-03-30 17:41:09 +01:00
|
|
|
++ optional jackSupport libjack2
|
|
|
|
++ optionals chromecastSupport [ protobuf libmicrodns ];
|
2006-06-30 01:48:19 +02:00
|
|
|
|
2018-10-28 02:03:37 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook perl pkgconfig removeReferencesTo ];
|
2018-04-16 11:34:07 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2012-01-26 09:36:18 +01:00
|
|
|
|
2018-11-18 17:50:27 +01:00
|
|
|
LIVE555_PREFIX = if (!stdenv.hostPlatform.isAarch64) then live555 else null;
|
2015-10-26 14:40:23 +01:00
|
|
|
|
2018-04-16 11:34:07 +02:00
|
|
|
# vlc depends on a c11-gcc wrapper script which we don't have so we need to
|
|
|
|
# set the path to the compiler
|
|
|
|
BUILDCC = "${stdenv.cc}/bin/gcc";
|
2017-04-19 03:28:08 +02:00
|
|
|
|
2018-04-16 11:34:07 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace configure \
|
|
|
|
--replace /bin/echo echo
|
2012-02-15 16:42:59 +01:00
|
|
|
|
2018-04-16 11:34:07 +02:00
|
|
|
substituteInPlace modules/text_renderer/freetype/platform_fonts.h --replace \
|
|
|
|
/usr/share/fonts/truetype/freefont ${freefont_ttf}/share/fonts/truetype
|
|
|
|
'';
|
2009-03-10 23:45:27 +01:00
|
|
|
|
2018-10-28 02:03:37 +01:00
|
|
|
# - Touch plugins (plugins cache keyed off mtime and file size:
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/35124#issuecomment-370552830
|
|
|
|
# - Remove references to the Qt development headers (used in error messages)
|
2018-04-16 11:34:07 +02:00
|
|
|
postFixup = ''
|
|
|
|
find $out/lib/vlc/plugins -exec touch -d @1 '{}' ';'
|
|
|
|
$out/lib/vlc/vlc-cache-gen $out/vlc/plugins
|
2018-11-17 11:16:36 +01:00
|
|
|
'' + optionalString withQt5 ''
|
2018-10-28 02:03:37 +01:00
|
|
|
remove-references-to -t "${qtbase.dev}" $out/lib/vlc/plugins/gui/libqt_plugin.so
|
2009-03-10 23:45:27 +01:00
|
|
|
'';
|
2006-10-12 12:53:16 +02:00
|
|
|
|
2018-04-16 11:34:07 +02:00
|
|
|
# Most of the libraries are auto-detected so we don't need to set a bunch of
|
|
|
|
# "--enable-foo" flags here
|
|
|
|
configureFlags = [
|
|
|
|
"--with-kde-solid=$out/share/apps/solid/actions"
|
2019-03-30 17:41:09 +01:00
|
|
|
] ++ optional onlyLibVLC "--disable-vlc"
|
|
|
|
++ optionals chromecastSupport [
|
|
|
|
"--enable-sout"
|
|
|
|
"--enable-chromecast"
|
|
|
|
"--enable-microdns"
|
|
|
|
];
|
2018-04-16 11:34:07 +02:00
|
|
|
|
2018-10-28 00:11:35 +02:00
|
|
|
# Remove runtime dependencies on libraries
|
|
|
|
postConfigure = ''
|
|
|
|
sed -i 's|^#define CONFIGURE_LINE.*$|#define CONFIGURE_LINE "<removed>"|g' config.h
|
|
|
|
'';
|
|
|
|
|
2013-12-08 19:19:11 +01:00
|
|
|
meta = with stdenv.lib; {
|
2006-10-12 12:53:16 +02:00
|
|
|
description = "Cross-platform media player and streaming server";
|
2007-12-31 18:55:13 +01:00
|
|
|
homepage = http://www.videolan.org/vlc/;
|
2014-02-16 16:30:30 +01:00
|
|
|
license = licenses.lgpl21Plus;
|
2018-04-16 11:34:07 +02:00
|
|
|
platforms = platforms.linux;
|
2006-10-12 12:53:16 +02:00
|
|
|
};
|
2003-12-03 22:58:16 +01:00
|
|
|
}
|