2022-01-03 13:23:26 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, SDL
|
|
|
|
, SDL_image
|
|
|
|
, a52dec
|
|
|
|
, alsa-lib
|
|
|
|
, autoreconfHook
|
|
|
|
, avahi
|
|
|
|
, dbus
|
|
|
|
, faad2
|
2022-02-05 00:20:22 +00:00
|
|
|
, ffmpeg_4
|
2022-01-03 13:23:26 +00:00
|
|
|
, flac
|
|
|
|
, fluidsynth
|
|
|
|
, freefont_ttf
|
|
|
|
, fribidi
|
|
|
|
, gnutls
|
|
|
|
, libarchive
|
|
|
|
, libass
|
|
|
|
, libbluray
|
|
|
|
, libcaca
|
|
|
|
, libcddb
|
|
|
|
, libdc1394
|
|
|
|
, libdvbpsi
|
|
|
|
, libdvdnav
|
|
|
|
, libebml
|
|
|
|
, libgcrypt
|
|
|
|
, libgpg-error
|
|
|
|
, libjack2
|
|
|
|
, libkate
|
|
|
|
, libmad
|
|
|
|
, libmatroska
|
2022-04-28 12:07:47 +00:00
|
|
|
, libmodplug
|
2022-01-03 13:23:26 +00:00
|
|
|
, libmtp
|
|
|
|
, liboggz
|
|
|
|
, libopus
|
2022-06-25 17:43:56 +00:00
|
|
|
, libplacebo
|
2022-01-03 13:23:26 +00:00
|
|
|
, libpulseaudio
|
|
|
|
, libraw1394
|
|
|
|
, librsvg
|
|
|
|
, libsamplerate
|
|
|
|
, libspatialaudio
|
|
|
|
, libssh2
|
|
|
|
, libtheora
|
|
|
|
, libtiger
|
|
|
|
, libupnp
|
|
|
|
, libv4l
|
|
|
|
, libva
|
|
|
|
, libvdpau
|
|
|
|
, libvorbis
|
|
|
|
, libxml2
|
|
|
|
, live555
|
|
|
|
, lua5
|
|
|
|
, mpeg2dec
|
|
|
|
, ncurses
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, removeReferencesTo
|
|
|
|
, samba
|
|
|
|
, schroedinger
|
|
|
|
, speex
|
|
|
|
, srt
|
|
|
|
, systemd
|
|
|
|
, taglib
|
|
|
|
, unzip
|
|
|
|
, xorg
|
|
|
|
, zlib
|
|
|
|
, chromecastSupport ? true, libmicrodns, protobuf
|
2015-06-24 10:19:37 +00:00
|
|
|
, jackSupport ? false
|
2022-01-03 13:23:26 +00:00
|
|
|
, onlyLibVLC ? false
|
2021-01-17 12:56:15 +00:00
|
|
|
, skins2Support ? !onlyLibVLC, freetype
|
2022-01-22 00:37:57 +00:00
|
|
|
, waylandSupport ? true, wayland, wayland-protocols
|
|
|
|
, withQt5 ? true, qtbase, qtsvg, qtwayland, qtx11extras, wrapQtAppsHook
|
2006-06-29 12:41:25 +00: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 ];
|
|
|
|
|
2022-01-03 13:23:26 +00:00
|
|
|
let
|
|
|
|
inherit (lib) optionalString optional optionals;
|
|
|
|
in
|
2011-02-09 21:11:30 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-10-02 00:58:12 +00:00
|
|
|
pname = "${optionalString onlyLibVLC "lib"}vlc";
|
2022-05-03 13:10:23 +00:00
|
|
|
version = "3.0.17.3";
|
2011-02-09 21:11:30 +00:00
|
|
|
|
2003-12-03 21:58:16 +00:00
|
|
|
src = fetchurl {
|
2020-10-02 05:50:51 +00:00
|
|
|
url = "http://get.videolan.org/vlc/${version}/vlc-${version}.tar.xz";
|
2022-05-03 13:10:23 +00:00
|
|
|
sha256 = "sha256-b36Q74lz0x2W3mTbgXFz40UVCClxepQISxu4MhzeIBQ=";
|
2003-12-03 21:58:16 +00:00
|
|
|
};
|
|
|
|
|
2018-04-16 09:34:07 +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 = [
|
2022-01-03 13:23:26 +00:00
|
|
|
SDL
|
|
|
|
SDL_image
|
|
|
|
a52dec
|
|
|
|
alsa-lib
|
|
|
|
avahi
|
|
|
|
dbus
|
|
|
|
faad2
|
2022-02-05 00:20:22 +00:00
|
|
|
ffmpeg_4
|
2022-01-03 13:23:26 +00:00
|
|
|
flac
|
|
|
|
fluidsynth
|
|
|
|
fribidi
|
|
|
|
gnutls
|
|
|
|
libarchive
|
|
|
|
libass
|
|
|
|
libbluray
|
|
|
|
libcaca
|
|
|
|
libcddb
|
|
|
|
libdc1394
|
|
|
|
libdvbpsi
|
|
|
|
libdvdnav
|
|
|
|
libdvdnav.libdvdread
|
|
|
|
libebml
|
|
|
|
libgcrypt
|
|
|
|
libgpg-error
|
|
|
|
libkate
|
|
|
|
libmad
|
|
|
|
libmatroska
|
|
|
|
libmtp
|
2022-04-28 12:07:47 +00:00
|
|
|
libmodplug
|
2022-01-03 13:23:26 +00:00
|
|
|
liboggz
|
|
|
|
libopus
|
2022-06-25 17:43:56 +00:00
|
|
|
libplacebo
|
2022-01-03 13:23:26 +00:00
|
|
|
libpulseaudio
|
|
|
|
libraw1394
|
|
|
|
librsvg
|
|
|
|
libsamplerate
|
|
|
|
libspatialaudio
|
|
|
|
libssh2
|
|
|
|
libtheora
|
|
|
|
libtiger
|
|
|
|
libupnp
|
|
|
|
libv4l
|
|
|
|
libva
|
|
|
|
libvdpau
|
|
|
|
libvorbis
|
|
|
|
libxml2
|
|
|
|
lua5
|
|
|
|
mpeg2dec
|
|
|
|
ncurses
|
|
|
|
samba
|
|
|
|
schroedinger
|
|
|
|
speex
|
|
|
|
srt
|
|
|
|
systemd
|
|
|
|
taglib
|
|
|
|
zlib
|
|
|
|
]
|
|
|
|
++ (with xorg; [
|
|
|
|
libXpm
|
|
|
|
libXv
|
|
|
|
libXvMC
|
|
|
|
xcbutilkeysyms
|
|
|
|
xlibsWrapper
|
|
|
|
])
|
2022-07-30 16:18:27 +00:00
|
|
|
++ optional (!stdenv.hostPlatform.isAarch && !onlyLibVLC) live555
|
2022-01-03 13:23:26 +00:00
|
|
|
++ optional jackSupport libjack2
|
|
|
|
++ optionals chromecastSupport [ libmicrodns protobuf ]
|
2022-01-22 00:37:57 +00:00
|
|
|
++ optionals skins2Support (with xorg; [
|
|
|
|
freetype
|
|
|
|
libXext
|
|
|
|
libXinerama
|
|
|
|
libXpm
|
|
|
|
])
|
|
|
|
++ optionals waylandSupport [ wayland wayland-protocols ]
|
|
|
|
++ optionals withQt5 [ qtbase qtsvg qtx11extras ]
|
|
|
|
++ optional (waylandSupport && withQt5) qtwayland;
|
2022-01-03 13:23:26 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
perl
|
|
|
|
pkg-config
|
|
|
|
removeReferencesTo
|
|
|
|
unzip
|
|
|
|
]
|
2022-01-22 00:37:57 +00:00
|
|
|
++ optionals withQt5 [ wrapQtAppsHook ]
|
|
|
|
++ optionals waylandSupport [ wayland wayland-protocols ];
|
2018-04-16 09:34:07 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2012-01-26 08:36:18 +00:00
|
|
|
|
2022-07-30 16:18:27 +00:00
|
|
|
LIVE555_PREFIX = if stdenv.hostPlatform.isAarch then null else live555;
|
2015-10-26 13:40:23 +00:00
|
|
|
|
2018-04-16 09:34:07 +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";
|
2017-04-19 01:28:08 +00:00
|
|
|
|
2021-07-28 17:44:52 +00:00
|
|
|
patches = [
|
2022-01-20 08:47:24 +00:00
|
|
|
# patches to build with recent live555
|
|
|
|
# upstream issue: https://code.videolan.org/videolan/vlc/-/issues/25473
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://code.videolan.org/videolan/vlc/uploads/3c84ea58d7b94d7a8d354eaffe4b7d55/0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch";
|
|
|
|
sha256 = "171d3qjl9a4dm13sqig3ra8s2zcr76wfnqz4ba4asg139cyc1axd";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://code.videolan.org/videolan/vlc/uploads/eb1c313d2d499b8a777314f789794f9d/0001-Add-lssl-and-lcrypto-to-liblive555_plugin_la_LIBADD.patch";
|
|
|
|
sha256 = "0kyi8q2zn2ww148ngbia9c7qjgdrijf4jlvxyxgrj29cb5iy1kda";
|
|
|
|
})
|
2021-07-28 17:44:52 +00:00
|
|
|
];
|
|
|
|
|
2018-04-16 09:34:07 +00: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 09:34:07 +00: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 10:53:16 +00:00
|
|
|
|
2018-04-16 09:34:07 +00:00
|
|
|
# Most of the libraries are auto-detected so we don't need to set a bunch of
|
|
|
|
# "--enable-foo" flags here
|
|
|
|
configureFlags = [
|
2021-07-28 17:44:52 +00:00
|
|
|
"--enable-srt" # Explicit enable srt to ensure the patch is applied.
|
2022-01-03 13:23:26 +00:00
|
|
|
"--with-kde-solid=$out/share/apps/solid/actions"
|
2022-01-22 00:37:57 +00:00
|
|
|
]
|
|
|
|
++ optional onlyLibVLC "--disable-vlc"
|
|
|
|
++ optional skins2Support "--enable-skins2"
|
|
|
|
++ optional waylandSupport "--enable-wayland"
|
|
|
|
++ optionals chromecastSupport [
|
2019-03-30 16:41:09 +00:00
|
|
|
"--enable-sout"
|
|
|
|
"--enable-chromecast"
|
|
|
|
"--enable-microdns"
|
|
|
|
];
|
2018-04-16 09:34:07 +00:00
|
|
|
|
2018-10-27 22:11:35 +00:00
|
|
|
# Remove runtime dependencies on libraries
|
|
|
|
postConfigure = ''
|
|
|
|
sed -i 's|^#define CONFIGURE_LINE.*$|#define CONFIGURE_LINE "<removed>"|g' config.h
|
|
|
|
'';
|
|
|
|
|
2021-12-15 15:50:28 +00:00
|
|
|
# Add missing SOFA files
|
|
|
|
# Given in EXTRA_DIST, but not in install-data target
|
|
|
|
postInstall = ''
|
|
|
|
cp -R share/hrtfs $out/share/vlc
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2006-10-12 10:53:16 +00:00
|
|
|
description = "Cross-platform media player and streaming server";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.videolan.org/vlc/";
|
2014-02-16 15:30:30 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2022-01-03 13:27:13 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
2018-04-16 09:34:07 +00:00
|
|
|
platforms = platforms.linux;
|
2006-10-12 10:53:16 +00:00
|
|
|
};
|
2003-12-03 21:58:16 +00:00
|
|
|
}
|