Merge pull request #330648 from emilazy/push-kzllwxyyqvtu

{qt5,qt6}.qtwebengine: add patches for FFmpeg 7
This commit is contained in:
Johannes Jöns
2024-07-31 19:36:28 +02:00
committed by GitHub
9 changed files with 72 additions and 70 deletions
@@ -1,6 +1,6 @@
{ stdenv, lib, fetchFromGitHub, copyDesktopItems, makeDesktopItem, qmake
{ stdenv, lib, fetchFromGitHub, fetchpatch2, copyDesktopItems, makeDesktopItem, qmake
, qtbase, qtxmlpatterns, qttools, qtwebengine, libGL, fontconfig, openssl, poppler, wrapQtAppsHook
, ffmpeg, libva, alsa-lib, SDL, x264, libvpx, libvorbis, libtheora, libogg
, ffmpeg_7, libva, alsa-lib, SDL, x264, libvpx, libvorbis, libtheora, libogg
, libopus, lame, fdk_aac, libass, quazip, libXext, libXfixes }:
let
@@ -34,6 +34,22 @@ in stdenv.mkDerivation (finalAttrs: {
hash = "sha256-OSAogtZoMisyRziv63ag9w8HQaaRdz0J28jQZR7cTMM=";
};
patches = [
# fix: Support FFmpeg 7.0
# https://github.com/OpenBoard-org/OpenBoard/pull/1017
(fetchpatch2 {
url = "https://github.com/OpenBoard-org/OpenBoard/commit/4f45b6c4016972cf5835f9188bda6197b1b4ed2f.patch?full_index=1";
hash = "sha256-MUJbHfOCMlRO4pg5scm+DrBsngZwB7UPuDJZss5x9Zs=";
})
# fix: Resolve FFmpeg 7.0 warnings
# https://github.com/OpenBoard-org/OpenBoard/pull/1017
(fetchpatch2 {
url = "https://github.com/OpenBoard-org/OpenBoard/commit/315bcac782e10cc6ceef1fc8b78fff40541ea38f.patch?full_index=1";
hash = "sha256-736eX+uXuZwHJxOXAgxs2/vjjD1JY9mMyj3rR45/7xk=";
})
];
postPatch = ''
substituteInPlace OpenBoard.pro \
--replace '/usr/include/quazip5' '${lib.getDev quazip}/include/QuaZip-Qt5-${quazip.version}/quazip' \
@@ -52,7 +68,7 @@ in stdenv.mkDerivation (finalAttrs: {
fontconfig
openssl
poppler
ffmpeg
ffmpeg_7
libva
alsa-lib
SDL
@@ -4,7 +4,6 @@
, pkg-config
, cmake
, libvorbis
, ffmpeg
, libeb
, hunspell
, opencc
@@ -61,7 +60,6 @@ stdenv.mkDerivation (finalAttrs: {
libiconv
opencc
libeb
ffmpeg
xapian
libzim
];
@@ -76,7 +74,7 @@ stdenv.mkDerivation (finalAttrs: {
cmakeFlags = [
"-DWITH_XAPIAN=ON"
"-DWITH_ZIM=ON"
"-DWITH_FFMPEG_PLAYER=ON"
"-DWITH_FFMPEG_PLAYER=OFF"
"-DWITH_EPWING_SUPPORT=ON"
"-DUSE_SYSTEM_FMT=ON"
"-DUSE_SYSTEM_TOML=ON"
@@ -485,6 +485,12 @@ stdenv.mkDerivation (finalAttrs: {
]
++ optionals (lib.versionAtLeast version "7.0") [
./0001-avfoundation.m-macOS-SDK-10.12-compatibility.patch
# Expose a private API for Chromium / Qt WebEngine.
(fetchpatch2 {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/ffmpeg/-/raw/a02c1a15706ea832c0d52a4d66be8fb29499801a/add-av_stream_get_first_dts-for-chromium.patch";
hash = "sha256-DbH6ieJwDwTjKOdQ04xvRcSLeeLP2Z2qEmqeo8HsPr4=";
})
];
configurePlatforms = [];
@@ -907,7 +913,7 @@ stdenv.mkDerivation (finalAttrs: {
platforms = platforms.all;
# See https://github.com/NixOS/nixpkgs/pull/295344#issuecomment-1992263658
broken = stdenv.hostPlatform.isMinGW && stdenv.hostPlatform.is64bit;
maintainers = with maintainers; [ atemu jopejoe1 ];
maintainers = with maintainers; [ atemu jopejoe1 emily ];
mainProgram = "ffmpeg";
};
} // lib.optionalAttrs withCudaLLVM {
@@ -1,54 +0,0 @@
{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, doxygen, graphviz
, glib, dbus, gst_all_1, alsa-lib, ffmpeg_4, libjack2, udev, libva, xorg
, sbc, SDL2, makeFontsConf
}:
let
fontsConf = makeFontsConf {
fontDirectories = [ ];
};
in stdenv.mkDerivation rec {
pname = "pipewire";
version = "0.2.7";
src = fetchFromGitHub {
owner = "PipeWire";
repo = "pipewire";
rev = version;
sha256 = "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc";
};
outputs = [ "out" "lib" "dev" "doc" ];
nativeBuildInputs = [
meson ninja pkg-config doxygen graphviz
];
buildInputs = [
glib dbus gst_all_1.gst-plugins-base gst_all_1.gstreamer
alsa-lib ffmpeg_4 libjack2 udev libva xorg.libX11 sbc SDL2
];
# Workaround build on gcc-10+ and clang11+:
# spa/plugins/bluez5/libspa-bluez5.so.p/bluez5-monitor.c.o:(.bss+0x0):
# multiple definition of `spa_a2dp_sink_factory'
env.NIX_CFLAGS_COMPILE = toString [ "-fcommon" ];
mesonFlags = [
"-Ddocs=true"
"-Dgstreamer=enabled"
];
PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
doCheck = true;
meta = with lib; {
description = "Server and user space API to deal with multimedia pipelines";
homepage = "https://pipewire.org/";
license = licenses.lgpl21;
platforms = platforms.linux;
maintainers = [ ];
};
}
@@ -1,6 +1,7 @@
{ qtModule
, qtdeclarative, qtquickcontrols, qtlocation, qtwebchannel
, fetchpatch
, fetchpatch2
, bison, flex, git, gperf, ninja, pkg-config, python, which
, nodejs, perl
@@ -24,12 +25,12 @@
, ImageCaptureCore, CoreBluetooth, IOBluetooth, CoreWLAN, Quartz, Cocoa, LocalAuthentication
, MediaPlayer, MediaAccessibility, SecurityInterface, Vision, CoreML, OpenDirectory, Accelerate
, cups, openbsm, xcbuild, writeScriptBin
, ffmpeg_4 ? null
, ffmpeg_7 ? null
, lib, stdenv
, version ? null
, qtCompatVersion
, pipewireSupport ? stdenv.isLinux
, pipewire_0_2
, pipewire
, postPatch ? ""
, nspr
, lndir
@@ -77,6 +78,32 @@ qtModule ({
# which cannot be set at the same time as -Wformat-security
hardeningDisable = [ "format" ];
patches = [
# Support FFmpeg 5
(fetchpatch2 {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/14074e4d789167bd776939037fe6df8d4d7dc0b3/qt5-webengine-ffmpeg5.patch";
hash = "sha256-jTbJFXBPwRMzr8IeTxrv9dtS+/xDS/zR4dysV/bRg3I=";
stripLen = 1;
extraPrefix = "src/3rdparty/";
})
# Support FFmpeg 7
(fetchpatch2 {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/e8fb4f86104243b90966b69cdfaa967273d834b6/qt5-webengine-ffmpeg7.patch";
hash = "sha256-YNeHmOVp0M5HB+b91AOxxJxl+ktBtLYVdHlq13F7xtY=";
stripLen = 1;
extraPrefix = "src/3rdparty/chromium/";
})
# Support PipeWire ≥ 0.3
(fetchpatch2 {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/c9db2cd9e144bd7a5e9246f5f7a01fe52fd089ba/qt5-webengine-pipewire-0.3.patch";
hash = "sha256-mGexRfVDF3yjNzSi9BjavhzPtsXI0BooSr/rZ1z/BDo=";
stripLen = 1;
extraPrefix = "src/3rdparty/";
})
];
postPatch = ''
# Patch Chromium build tools
(
@@ -201,7 +228,7 @@ qtModule ({
harfbuzz icu
libevent
ffmpeg_4
ffmpeg_7
] ++ lib.optionals (!stdenv.isDarwin) [
dbus zlib minizip snappy nss protobuf jsoncpp
@@ -221,7 +248,7 @@ qtModule ({
] ++ lib.optionals pipewireSupport [
# Pipewire
pipewire_0_2
pipewire
]
# FIXME These dependencies shouldn't be needed but can't find a way
@@ -13,7 +13,7 @@
, gst-plugins-good
, gst-libav
, gst-vaapi
, ffmpeg_6
, ffmpeg_7
, libva
, libpulseaudio
, wayland
@@ -28,7 +28,7 @@
qtModule {
pname = "qtmultimedia";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ffmpeg_6 ]
buildInputs = [ ffmpeg_7 ]
++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ libunwind orc ]
++ lib.optionals stdenv.hostPlatform.isLinux [ libpulseaudio alsa-lib wayland libXrandr libva ]
++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ elfutils ];
@@ -3,6 +3,7 @@
, qtwebchannel
, qtpositioning
, qtwebsockets
, fetchpatch2
, buildPackages
, bison
, coreutils
@@ -49,7 +50,7 @@
, systemd
, pipewire
, gn
, ffmpeg_4
, ffmpeg_7
, lib
, stdenv
, glib
@@ -131,6 +132,14 @@ qtModule {
# Override locales install path so they go to QtWebEngine's $out
../patches/qtwebengine-locales-path.patch
# Support FFmpeg 7
(fetchpatch2 {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt6-webengine/-/raw/6bee5464ac6340e925e08c7ed023026e727ae9d5/qtwebengine-ffmpeg-7.patch";
hash = "sha256-OdCIu1KMW3YcpCnfUP1uD7OJRl6Iwap9X4aJhGpoaNs=";
stripLen = 1;
extraPrefix = "src/3rdparty/chromium/";
})
];
postPatch = ''
@@ -228,7 +237,7 @@ qtModule {
lcms2
libevent
ffmpeg_4
ffmpeg_7
] ++ lib.optionals stdenv.hostPlatform.isLinux [
dbus
zlib
+1
View File
@@ -1123,6 +1123,7 @@ mapAliases ({
php80Packages = php80; # Added 2023-06-21
php80Extensions = php80; # Added 2023-06-21
pipewire_0_2 = throw "pipewire_0_2 has been removed as it is outdated and no longer used"; # Added 2024-07-28
pipewire-media-session = throw "pipewire-media-session is no longer maintained and has been removed. Please use Wireplumber instead.";
pkgconfig = throw "'pkgconfig' has been renamed to/replaced by 'pkg-config'"; # Converted to throw 2023-09-10
pleroma-otp = pleroma; # Added 2021-07-10
-1
View File
@@ -17178,7 +17178,6 @@ with pkgs;
ffmpeg = ffmpeg-headless;
};
pipewire_0_2 = callPackage ../development/libraries/pipewire/0.2.nix { };
wireplumber = callPackage ../development/libraries/pipewire/wireplumber.nix { };
pw-volume = callPackage ../tools/audio/pw-volume { };