From 453fba73eaa50da0e83c74c4e86a39f9578cdf98 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sat, 28 Dec 2024 11:41:39 +0100 Subject: [PATCH 1/2] vlc: fix dependencies Eliminate various problems with dependencies: * Add explicit dependencies on various libraries that are directly checked for, and happened to work before because they leaked in. * Remove dependencies that were unused, either because VLC does not support them (any more) or because they need to be paired with other dependencies that were not present (and no one noticed). * Drop obsolete workarounds. --- pkgs/by-name/vl/vlc/package.nix | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/pkgs/by-name/vl/vlc/package.nix b/pkgs/by-name/vl/vlc/package.nix index 38bb14b8b89c..f6052bcbfaa3 100644 --- a/pkgs/by-name/vl/vlc/package.nix +++ b/pkgs/by-name/vl/vlc/package.nix @@ -4,6 +4,7 @@ alsa-lib, autoreconfHook, avahi, + cairo, curl, dbus, faad2, @@ -13,17 +14,18 @@ ffmpeg_6, flac, fluidsynth, + fontconfig, freefont_ttf, freetype, fribidi, genericUpdater, gnutls, + harfbuzz, + libGL, libSM, libXext, libXinerama, libXpm, - libXv, - libXvMC, libarchive, libass, libbluray, @@ -36,17 +38,19 @@ libgcrypt, libgpg-error, libjack2, + libjpeg, libkate, libmad, libmatroska, libmicrodns, libmodplug, + libmpeg2, libmtp, - liboggz, + libogg, libopus, libplacebo_5, + libpng, libpulseaudio, - libraw1394, librsvg, libsForQt5, libsamplerate, @@ -62,7 +66,6 @@ libxml2, live555, lua5, - mpeg2dec, ncurses, perl, pkg-config, @@ -74,7 +77,7 @@ speex, srt, stdenv, - systemd, + systemdLibs, taglib_1, unzip, wayland, @@ -109,6 +112,8 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-JNu+HX367qCZTV3vC73iABdzRxNtv+Vz9bakzuJa+7A="; }; + depsBuildBuild = optionals waylandSupport [ pkg-config ]; + nativeBuildInputs = [ autoreconfHook @@ -133,17 +138,19 @@ stdenv.mkDerivation (finalAttrs: { a52dec alsa-lib avahi + cairo dbus faad2 ffmpeg_6 flac fluidsynth + fontconfig + freetype fribidi gnutls + harfbuzz + libGL libSM - libXpm - libXv - libXvMC libarchive libass libbluray @@ -156,16 +163,18 @@ stdenv.mkDerivation (finalAttrs: { libebml libgcrypt libgpg-error + libjpeg libkate libmad libmatroska libmodplug + libmpeg2 libmtp - liboggz + libogg libopus libplacebo_5 + libpng libpulseaudio - libraw1394 librsvg libsamplerate libspatialaudio @@ -179,26 +188,23 @@ stdenv.mkDerivation (finalAttrs: { libvorbis libxml2 lua5 - mpeg2dec ncurses samba schroedinger speex srt - systemd + systemdLibs taglib_1 xcbutilkeysyms - wayland-scanner # only required for configure script zlib ] - ++ optionals (!stdenv.hostPlatform.isAarch && !onlyLibVLC) [ live555 ] + ++ optionals (!onlyLibVLC) [ live555 ] ++ optionals jackSupport [ libjack2 ] ++ optionals chromecastSupport [ libmicrodns protobuf ] ++ optionals skins2Support [ - freetype libXext libXinerama libXpm @@ -220,16 +226,12 @@ stdenv.mkDerivation (finalAttrs: { env = { - # vlc depends on a c11-gcc wrapper script which we don't have so we need to - # set the path to the compiler + # vlc searches for c11-gcc, c11, c99-gcc, c99, which don't exist and would be wrong for cross compilation anyway. BUILDCC = "${pkgsBuildBuild.stdenv.cc}/bin/gcc"; - PKG_CONFIG_WAYLAND_SCANNER_WAYLAND_SCANNER = "wayland-scanner"; + LIVE555_PREFIX = live555; } // lib.optionalAttrs stdenv.cc.isGNU { NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - } - // lib.optionalAttrs (!stdenv.hostPlatform.isAarch) { - LIVE555_PREFIX = live555; }; patches = [ @@ -269,10 +271,7 @@ stdenv.mkDerivation (finalAttrs: { # Most of the libraries are auto-detected so we don't need to set a bunch of # "--enable-foo" flags here configureFlags = - [ - "--enable-srt" # Explicit enable srt to ensure the patch is applied. - "--with-kde-solid=$out/share/apps/solid/actions" - ] + [ "--with-kde-solid=$out/share/apps/solid/actions" ] ++ optionals onlyLibVLC [ "--disable-vlc" ] ++ optionals skins2Support [ "--enable-skins2" ] ++ optionals waylandSupport [ "--enable-wayland" ] @@ -311,6 +310,7 @@ stdenv.mkDerivation (finalAttrs: { # should be the same as pkgsBuildBuild.qt5.qttranslations. postFixup = '' + patchelf --add-rpath ${libv4l}/lib "$out/lib/vlc/plugins/access/libv4l2_plugin.so" find $out/lib/vlc/plugins -exec touch -d @1 '{}' ';' ${ if stdenv.buildPlatform.canExecute stdenv.hostPlatform then "$out" else pkgsBuildBuild.libvlc From 242694006e7dfdadc91f37567bcfdad762797b87 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sat, 28 Dec 2024 11:41:39 +0100 Subject: [PATCH 2/2] vlc: disable VDPAU for now It is reportedly [1] broken, and I am not able to work out the reason. As videos playing properly without hardware acceleration is better than videos not playing at all, disable it for now. [1] https://github.com/NixOS/nixpkgs/issues/299174 --- pkgs/by-name/vl/vlc/package.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkgs/by-name/vl/vlc/package.nix b/pkgs/by-name/vl/vlc/package.nix index f6052bcbfaa3..ecd7d85d0064 100644 --- a/pkgs/by-name/vl/vlc/package.nix +++ b/pkgs/by-name/vl/vlc/package.nix @@ -61,7 +61,6 @@ libupnp, libv4l, libva, - libvdpau, libvorbis, libxml2, live555, @@ -184,7 +183,6 @@ stdenv.mkDerivation (finalAttrs: { libupnp libv4l libva - libvdpau libvorbis libxml2 lua5 @@ -286,11 +284,6 @@ stdenv.mkDerivation (finalAttrs: { sed -i 's|^#define CONFIGURE_LINE.*$|#define CONFIGURE_LINE ""|g' config.h ''; - # fails on high core machines - # ld: cannot find -lvlc_vdpau: No such file or directory - # https://code.videolan.org/videolan/vlc/-/issues/27338 - enableParallelInstalling = false; - # Add missing SOFA files # Given in EXTRA_DIST, but not in install-data target postInstall = ''