2021-08-05 21:33:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, libarchive, perl, xorg, libdvdnav, libbluray
|
2021-06-28 23:13:55 +00:00
|
|
|
, zlib, a52dec, libmad, faad2, ffmpeg, alsa-lib
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config, dbus, fribidi, freefont_ttf, libebml, libmatroska
|
2021-10-08 15:17:17 +00:00
|
|
|
, libvorbis, libtheora, speex, lua5, libgcrypt, libgpg-error, libupnp
|
2020-04-24 23:36:52 +00:00
|
|
|
, libcaca, libpulseaudio, flac, schroedinger, libxml2, librsvg
|
|
|
|
, mpeg2dec, systemd, gnutls, avahi, libcddb, libjack2, SDL, SDL_image
|
|
|
|
, libmtp, unzip, taglib, libkate, libtiger, libv4l, samba, libssh2, liboggz
|
|
|
|
, libass, libva, libdvbpsi, libdc1394, libraw1394, libopus
|
|
|
|
, libvdpau, libsamplerate, live555, fluidsynth, wayland, wayland-protocols
|
2021-08-05 21:33:18 +00:00
|
|
|
, ncurses, srt
|
2020-04-24 23:36:52 +00:00
|
|
|
, onlyLibVLC ? false
|
2021-02-05 17:12:51 +00:00
|
|
|
, withQt5 ? true, qtbase, qtsvg, qtx11extras, wrapQtAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, jackSupport ? false
|
2021-02-05 17:12:51 +00:00
|
|
|
, skins2Support ? !onlyLibVLC, freetype
|
2020-04-24 23:36:52 +00:00
|
|
|
, removeReferencesTo
|
|
|
|
, chromecastSupport ? true, protobuf, libmicrodns
|
|
|
|
}:
|
|
|
|
|
|
|
|
# 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 ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-10-07 09:15:18 +00:00
|
|
|
pname = "${optionalString onlyLibVLC "lib"}vlc";
|
2021-07-03 03:11:41 +00:00
|
|
|
version = "3.0.16";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-10-07 09:15:18 +00:00
|
|
|
url = "http://get.videolan.org/vlc/${version}/vlc-${version}.tar.xz";
|
2021-07-03 03:11:41 +00:00
|
|
|
sha256 = "sha256-/641/GT2JcF1Vx0jRrxfYge+mXYlF/FUI+dPGDmUEPY=";
|
2020-04-24 23:36:52 +00: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 = [
|
2021-06-28 23:13:55 +00:00
|
|
|
zlib a52dec libmad faad2 ffmpeg alsa-lib libdvdnav libdvdnav.libdvdread
|
2021-10-08 15:17:17 +00:00
|
|
|
libbluray dbus fribidi libvorbis libtheora speex lua5 libgcrypt libgpg-error
|
2020-04-24 23:36:52 +00:00
|
|
|
libupnp libcaca libpulseaudio flac schroedinger libxml2 librsvg mpeg2dec
|
2021-03-19 17:17:44 +00:00
|
|
|
systemd gnutls avahi libcddb SDL SDL_image libmtp taglib libarchive
|
2020-04-24 23:36:52 +00:00
|
|
|
libkate libtiger libv4l samba libssh2 liboggz libass libdvbpsi libva
|
|
|
|
xorg.xlibsWrapper xorg.libXv xorg.libXvMC xorg.libXpm xorg.xcbutilkeysyms
|
|
|
|
libdc1394 libraw1394 libopus libebml libmatroska libvdpau libsamplerate
|
2021-08-05 21:33:18 +00:00
|
|
|
fluidsynth wayland wayland-protocols ncurses srt
|
2021-10-17 02:12:59 +00:00
|
|
|
] ++ optional (!stdenv.hostPlatform.isAarch64 && !stdenv.hostPlatform.isAarch32) live555
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optionals withQt5 [ qtbase qtsvg qtx11extras ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ optionals skins2Support (with xorg; [ libXpm freetype libXext libXinerama ])
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optional jackSupport libjack2
|
|
|
|
++ optionals chromecastSupport [ protobuf libmicrodns ];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook perl pkg-config removeReferencesTo unzip ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optionals withQt5 [ wrapQtAppsHook ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-10-17 02:12:59 +00:00
|
|
|
LIVE555_PREFIX = if (!stdenv.hostPlatform.isAarch64 && !stdenv.hostPlatform.isAarch32) then live555 else null;
|
2020-04-24 23:36:52 +00: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";
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/4250fe8f28c220d883db454cec2b2c76a07473eb/trunk/vlc-3.0.11.1-srt_1.4.2.patch";
|
|
|
|
sha256 = "53poWjZfwq/6l316sqiCp0AtcGweyXBntcLDFPSokHQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace modules/text_renderer/freetype/platform_fonts.h --replace \
|
|
|
|
/usr/share/fonts/truetype/freefont ${freefont_ttf}/share/fonts/truetype
|
|
|
|
'';
|
|
|
|
|
|
|
|
# - 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)
|
|
|
|
postFixup = ''
|
|
|
|
find $out/lib/vlc/plugins -exec touch -d @1 '{}' ';'
|
|
|
|
$out/lib/vlc/vlc-cache-gen $out/vlc/plugins
|
|
|
|
'' + optionalString withQt5 ''
|
|
|
|
remove-references-to -t "${qtbase.dev}" $out/lib/vlc/plugins/gui/libqt_plugin.so
|
|
|
|
'';
|
|
|
|
|
|
|
|
# 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"
|
2021-08-05 21:33:18 +00:00
|
|
|
"--enable-srt" # Explicit enable srt to ensure the patch is applied.
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ optional onlyLibVLC "--disable-vlc"
|
2021-02-05 17:12:51 +00:00
|
|
|
++ optional skins2Support "--enable-skins2"
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optionals chromecastSupport [
|
|
|
|
"--enable-sout"
|
|
|
|
"--enable-chromecast"
|
|
|
|
"--enable-microdns"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Remove runtime dependencies on libraries
|
|
|
|
postConfigure = ''
|
|
|
|
sed -i 's|^#define CONFIGURE_LINE.*$|#define CONFIGURE_LINE "<removed>"|g' config.h
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Cross-platform media player and streaming server";
|
|
|
|
homepage = "http://www.videolan.org/vlc/";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|