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