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

82 lines
3 KiB
Nix
Raw Normal View History

2018-04-16 11:34:07 +02:00
{ stdenv, fetchurl, autoreconfHook
, libarchive, perl, xorg, libdvdnav, libbluray
, 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
, libcaca, libpulseaudio, flac, schroedinger, libxml2, librsvg
2018-04-16 11:34:07 +02:00
, mpeg2dec, systemd, gnutls, avahi, libcddb, libjack2, SDL, SDL_image
, libmtp, unzip, taglib, libkate, libtiger, libv4l, samba, liboggz
, 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
, jackSupport ? false
2017-10-02 17:42:54 +02:00
, fetchpatch
}:
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
stdenv.mkDerivation rec {
2013-09-26 16:37:49 +02:00
name = "vlc-${version}";
2018-09-26 23:22:40 +02:00
version = "3.0.4";
src = fetchurl {
url = "http://get.videolan.org/vlc/${version}/${name}.tar.xz";
2018-09-26 23:22:40 +02:00
sha256 = "17jsq0zqpqyxw4ckvjba0hf6zk8ywc4wf8sy3z03hh3ij0vxpwq1";
};
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
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
libdc1394 libraw1394 libopus libebml libmatroska libvdpau libsamplerate live555
fluidsynth wayland wayland-protocols
] ++ optionals withQt5 [ qtbase qtsvg qtx11extras ]
++ optional jackSupport libjack2;
2018-04-16 11:34:07 +02:00
nativeBuildInputs = [ autoreconfHook perl pkgconfig ];
enableParallelBuilding = true;
2015-10-26 14:40:23 +01:00
LIVE555_PREFIX = live555;
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";
vlc: Fix build for Qt >= 5.7.0 This basically does something similar than the AUR build: https://aur.archlinux.org/packages/vlc-qt5/ On our side, all there is to do is to force compiling using C++11 mode and use a patch that the AUR package took from the following upstream patchwork URL: https://patches.videolan.org/patch/14061/ Instead of passing CXXFLAGS to the configure script, I'm using sed here to make sure we don't override flags figured out by configure. For example if ./configure is used with CXXFLAGS=-std=c++11 appended or prepended, we have something like: ... -I../include -std=c++11 -Wall -Wextra -Wsign-compare ... While if we don't do that at all, we have something like: ... -I../include -g -O2 -Wall -Wextra -Wsign-compare ... Another way would be to use NIX_CFLAGS_COMPILE, but that would affect even compilation of C code and thus resulting in a bunch of warnings like this: cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C So with our approach the flags during build look much better: ... -I../include -std=c++11 -g -O2 -Wall -Wextra -Wsign-compare ... Another thing I've changed is that the vlc_qt5 attribute in all-packages.nix now uses the latest Qt 5 version, because the build for Qt >= 5.7.0 is now no longer broken. I've also ordered the preConfigure attribute before the configureFlags attribute, because it makes more sense in terms of context (pre -> configure -> post). Tested by building on x86_64-linux with libsForQt56.vlc, libsForQt58.vlc and vlc (the Qt 4 version, just to be sure I didn't accidentally break it). Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @ttuegel
2017-04-19 03:28:08 +02:00
2018-04-16 11:34:07 +02:00
postPatch = ''
substituteInPlace configure \
--replace /bin/echo echo
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
'';
2018-04-16 11:34:07 +02:00
# https://github.com/NixOS/nixpkgs/pull/35124#issuecomment-370552830
postFixup = ''
find $out/lib/vlc/plugins -exec touch -d @1 '{}' ';'
$out/lib/vlc/vlc-cache-gen $out/vlc/plugins
'';
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"
] ++ optional onlyLibVLC "--disable-vlc";
2013-12-08 19:19:11 +01:00
meta = with stdenv.lib; {
description = "Cross-platform media player and streaming server";
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;
};
}