Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] draft: ffmpeg5 split
@ 2023-03-22 22:39 zlice
  2023-03-22 22:54 ` [PR PATCH] [Updated] " zlice
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: zlice @ 2023-03-22 22:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2740 bytes --]

There is a new pull request by zlice against master on the void-packages repository

https://github.com/zlice/void-packages ffmpeg5-split
https://github.com/void-linux/void-packages/pull/42936

draft: ffmpeg5 split
[ci skip]

#### Testing the changes

- I tested the changes in this PR: **NO**

I have conflicting changes from [intel packages](https://github.com/void-linux/void-packages/pull/41132) and don't want to mess with my system. If it makes sense I'll move these changes here like I originally intended. ffmpeg5 makes Intel vaapi easier and only rely on oneVPL iirc.

I do not use 80%+ of these packages. I may be able to run Blender, and I use shotcut.


#### New package

- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**



#### Local build testing

- I built this PR locally for my native architecture, **x86_64**


#### Discussion

Continuation of https://github.com/void-linux/void-packages/pull/36315 - thx tibequadorian :)

It was suggested to make `ffmpeg` version 5 and 'copy' (create a new?) `ffmpeg4` package, and that seems to work well.

As stated, I haven't and probably won't test most of these packages, hoping for others to voice in on what's working. 

A few months back (and now) afaict everything has been compiling with ffmpeg5 except for the few problem packages still using ffmpeg4 (below). Can add to the ffmpeg4 list as a incompatible package is found.

##### Commit naming / misc

`ffpmeg4` isn't "new", not sure what the commit messages should be really for the 4 and 5 split.

Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?

I wouldn't mind moving the [intel packages](https://github.com/void-linux/void-packages/pull/41132) into here under another commit. That just got a potential fix that may allow merging but I imagine moving to ffmpeg5 will change and even remove some of those packages. (I won't really test these changes without Intel vaapi either way.)

Maintainer for previous ffmpeg(4) was orphaned, I can put my name in there if that matters, though I don't exactly see myself keeping up on ffmpeg.


##### still ffmpeg4

- `vlc` (vlc4 will support ffmpeg5, there's a patch to build 3.x with ffmpeg5 but it will lack vaapi)
- `osg` (OpenSceneGraph plus `xine-lib`)
- `ytmdl` ? not sure but it uses `python3-ffmpeg-python` which being 6-8yr old I imagine is ffmpeg4


A patch file from https://github.com/void-linux/void-packages/pull/42936.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ffmpeg5-split-42936.patch --]
[-- Type: text/x-diff, Size: 233839 bytes --]

From c5a8c096e2754e5184c83afeb25660963c3149b6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Tue, 21 Mar 2023 18:58:31 -0400
Subject: [PATCH 1/4] ffmpeg_split

---
 common/shlibs                                 |  26 +-
 srcpkgs/ffmpeg/template                       | 176 +++++----
 srcpkgs/ffmpeg4-devel                         |   1 +
 srcpkgs/ffmpeg4/ffmpeg4                       |   1 +
 .../{ffmpeg => ffmpeg4}/files/altivec.patch   |   0
 .../patches/armv5tel-floating-point.patch     |   0
 .../workaround-mesa-readeon-vaapi-bug.patch   |   0
 srcpkgs/ffmpeg4/template                      | 254 +++++++++++++
 ...Fix-infinite-loop-in-Menu-cycleitems.patch |  60 +++
 ...6c4d30f5b289c429c5ca88d800200db4fc4f.patch |  22 --
 .../MinOverlapPlacement.cc_improve.patch      |  29 ++
 srcpkgs/fluxbox/patches/center.patch          | 307 +++++++++++++++
 srcpkgs/fluxbox/patches/container_locks.patch | 325 ++++++++++++++++
 .../patches/container_relative_relative.patch |  15 +
 srcpkgs/fluxbox/patches/flux_improve.patch    | 205 ++++++++++
 srcpkgs/fluxbox/patches/flux_oversize.patch   |  24 ++
 .../fluxbox/patches/focus_close_menu.patch    |  17 +
 srcpkgs/fluxbox/patches/slit_raise.patch      |  16 +
 srcpkgs/fluxbox/patches/toolbar_redo.patch    | 228 ++++++++++++
 .../fluxbox/patches/tremor_graboid_hell.patch | 350 ++++++++++++++++++
 .../patches/unclutter_fix_workspacecmd.patch  |  65 ++++
 srcpkgs/fluxbox/patches/zor_loops.patch       |  87 +++++
 srcpkgs/fluxbox/template                      |  45 ++-
 srcpkgs/libavcodec4                           |   1 +
 srcpkgs/libavdevice4                          |   1 +
 srcpkgs/libavfilter4                          |   1 +
 srcpkgs/libavformat4                          |   1 +
 srcpkgs/libavresample                         |   2 +-
 srcpkgs/libavresample4                        |   1 +
 srcpkgs/libavutil4                            |   1 +
 srcpkgs/libpostproc4                          |   1 +
 srcpkgs/libswresample4                        |   1 +
 srcpkgs/libswscale4                           |   1 +
 srcpkgs/mesa/template                         |  35 +-
 34 files changed, 2167 insertions(+), 132 deletions(-)
 create mode 120000 srcpkgs/ffmpeg4-devel
 create mode 120000 srcpkgs/ffmpeg4/ffmpeg4
 rename srcpkgs/{ffmpeg => ffmpeg4}/files/altivec.patch (100%)
 rename srcpkgs/{ffmpeg => ffmpeg4}/patches/armv5tel-floating-point.patch (100%)
 rename srcpkgs/{ffmpeg => ffmpeg4}/patches/workaround-mesa-readeon-vaapi-bug.patch (100%)
 create mode 100644 srcpkgs/ffmpeg4/template
 create mode 100644 srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
 delete mode 100644 srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
 create mode 100644 srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
 create mode 100644 srcpkgs/fluxbox/patches/center.patch
 create mode 100644 srcpkgs/fluxbox/patches/container_locks.patch
 create mode 100644 srcpkgs/fluxbox/patches/container_relative_relative.patch
 create mode 100644 srcpkgs/fluxbox/patches/flux_improve.patch
 create mode 100644 srcpkgs/fluxbox/patches/flux_oversize.patch
 create mode 100644 srcpkgs/fluxbox/patches/focus_close_menu.patch
 create mode 100644 srcpkgs/fluxbox/patches/slit_raise.patch
 create mode 100644 srcpkgs/fluxbox/patches/toolbar_redo.patch
 create mode 100644 srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
 create mode 100644 srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
 create mode 100644 srcpkgs/fluxbox/patches/zor_loops.patch
 create mode 120000 srcpkgs/libavcodec4
 create mode 120000 srcpkgs/libavdevice4
 create mode 120000 srcpkgs/libavfilter4
 create mode 120000 srcpkgs/libavformat4
 create mode 120000 srcpkgs/libavresample4
 create mode 120000 srcpkgs/libavutil4
 create mode 120000 srcpkgs/libpostproc4
 create mode 120000 srcpkgs/libswresample4
 create mode 120000 srcpkgs/libswscale4

diff --git a/common/shlibs b/common/shlibs
index f972eebc4d3a..aab66c83f4b3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -389,15 +389,23 @@ libid3tag.so.0 libid3tag-0.15.1b_1
 libgif.so.7 giflib-5.1.0_1
 libImlib2.so.1 imlib2-1.4.2_1
 libmp3lame.so.0 lame-3.98.2_1
-libavdevice.so.58 libavdevice-4.0_1
-libavformat.so.58 libavformat-4.0_1
-libswscale.so.5 libswscale-4.0_1
-libswresample.so.3 libswresample-4.0_1
-libavresample.so.4 libavresample-4.0_1
-libpostproc.so.55 libpostproc-4.0_1
-libavcodec.so.58 libavcodec-4.0_1
-libavutil.so.56 libavutil-4.0_1
-libavfilter.so.7 libavfilter-4.0_1
+libavdevice.so.59 libavdevice-5.1.2_1
+libavformat.so.59 libavformat-5.1.2_1
+libswscale.so.6 libswscale-5.1.2_1
+libswresample.so.4 libswresample-5.1.2_1
+libpostproc.so.56 libpostproc-5.1.2_1
+libavcodec.so.59 libavcodec-5.1.2_1
+libavutil.so.57 libavutil-5.1.2_1
+libavfilter.so.8 libavfilter-5.1.2_1
+libavdevice.so.58 libavdevice4-4.0_1
+libavformat.so.58 libavformat4-4.0_1
+libswscale.so.5 libswscale4-4.0_1
+libswresample.so.3 libswresample4-4.0_1
+libavresample.so.4 libavresample4-4.0_1
+libpostproc.so.55 libpostproc4-4.0_1
+libavcodec.so.58 libavcodec4-4.0_1
+libavutil.so.56 libavutil4-4.0_1
+libavfilter.so.7 libavfilter4-4.0_1
 libSDL-1.2.so.0 SDL-1.2.14_1
 libSDL_image-1.2.so.0 SDL_image-1.2.10_1
 libx264.so.157 x264-20190507.2245_1
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 23a3d5c9967b..38978c5085a3 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -1,42 +1,36 @@
 # Template file for 'ffmpeg'
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg
-version=4.4.3
-revision=2
+version=5.1.2
+revision=1
 short_desc="Decoding, encoding and streaming software"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
 changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
 distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
-checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
-makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
- libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
- libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
- libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
- speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
- libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
- $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
- $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
- $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
- $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
- $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
- $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
- $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
- $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
- $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
- $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+makedepends="chromaprint-devel libgcrypt-devel ladspa-sdk lcms2-devel libaom-devel
+ alsa-lib-devel bzip2-devel libxcb-devel liblzma-devel SDL2-devel sndio-devel zlib-devel
+ frei0r-plugins libcdio-paranoia-devel rubberband-devel libvidstab-devel x264-devel x265-devel
+ xvidcore-devel fdk-aac-devel libtls-devel gmp-devel libass-devel libbluray-devel libcaca-devel
+ celt-devel codec2-devel libdav1d-devel libdrm-devel fontconfig-devel freetype-devel
+ fribidi-devel glslang-devel SPIRV-Tools-devel libgme-devel libgsm-devel jack-devel
+ libmodplug-devel lame-devel libopencv4-devel libopenjpeg2-devel libopenmpt-devel opus-devel
+ libplacebo-devel libpulseaudio rabbitmq-c-devel librist-devel librsvg-devel librtmp-devel
+ snappy-devel libsoxr-devel speex-devel srt-devel libssh-devel libtheora-devel twolame-devel
+ libvorbis-devel libvpx6-devel libwebp-devel libxml2-devel zimg-devel lilv-devel lv2
+ libopenal-devel mesa openssl-devel vapoursynth-devel ocl-icd-devel libmysofa-devel vulkan-loader
+ $(vopt_if vaapi libva-devel)
+ $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if nvenc nv-codec-headers)
+ $(vopt_if nvdec nv-codec-headers)
+ $(vopt_if svtav1 libsvt-av1-devel)
+"
 depends="ffplay>=${version}_${revision}"
-
-build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
- dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
-build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
-desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
-desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
-desc_option_sofa="Enable support for AES SOFA"
-desc_option_webp="Enable support for WebP"
+build_options="vaapi vdpau nvenc nvdec svtav1"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
@@ -52,22 +46,6 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-_apply_patch() {
-	local args="$1" pname="$(basename $2)"
-
-	if [ ! -f ".${pname}_done" ]; then
-		patch -N $args -i $2
-		touch .${pname}_done
-	fi
-}
-
-post_patch() {
-	case "$XBPS_TARGET_MACHINE" in
-		ppc64le*) ;;
-		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
-	esac
-}
-
 do_configure() {
 	# Fix gcc on x86_64-musl only
 	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
@@ -98,39 +76,47 @@ do_configure() {
 		_args+=" --extra-libs=-latomic"
 	fi
 
-	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+	./configure \
+		--prefix='/usr' \
+		--extra-cflags='-I/opt/cuda/include' \
+		--extra-ldflags='-L/opt/cuda/lib64' \
 		--disable-stripping \
-		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
-		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
-		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
-		--enable-shared --enable-static --enable-libxcb \
-		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
-		--enable-libspeex --enable-libcelt --enable-libass \
-		--enable-libopus --enable-librtmp --enable-libjack \
-		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
-		--disable-libopencore_amrnb --disable-libopencore_amrwb \
-		--disable-libopenjpeg \
-		--enable-postproc --enable-opencl ${_args} \
-		$(vopt_enable x265 libx265) \
-		$(vopt_enable v4l2 libv4l2) \
-		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
-		--enable-libbs2b --enable-avresample --enable-libvidstab \
-		$(vopt_enable dav1d libdav1d) \
-		$(vopt_enable zimg libzimg) \
-		$(vopt_enable webp libwebp) \
-		$(vopt_enable sofa libmysofa) \
-		$(vopt_enable vulkan) \
-		$(vopt_enable drm libdrm) \
-		$(vopt_enable svtav1 libsvtav1) \
-		$(vopt_enable srt libsrt) \
-		$(vopt_enable rist librist) \
+		--enable-shared --enable-static \
+		--enable-nonfree --enable-gpl \
+		--enable-version3 --enable-libxcb \
+		--enable-frei0r --enable-libcdio \
+		--enable-librubberband --enable-libvidstab \
+		--enable-libx264 --enable-libx265 --enable-libxvid \
+		--enable-libfdk-aac --enable-libtls --enable-gmp \
+		--enable-chromaprint --enable-gcrypt --enable-ladspa \
+		--enable-lcms2 --enable-libaom --enable-libass \
+		--enable-libbluray --enable-libcaca --enable-libcelt \
+		--enable-libcodec2 --enable-libdav1d --enable-libdrm \
+		--enable-libfontconfig --enable-libfreetype \
+		--enable-libfribidi --enable-libglslang \
+		--enable-libgme --enable-libgsm \
+		--enable-vapoursynth --enable-openssl --enable-opengl \
+		--enable-openal --enable-lv2 --enable-libzimg \
+		--enable-libxml2 --enable-libwebp --enable-libvorbis \
+		--enable-libtwolame --enable-libtheora --enable-libssh \
+		--enable-libsrt --enable-libspeex --enable-libsoxr \
+		--enable-librtmp --enable-librsvg --enable-librist \
+		--enable-librabbitmq --enable-libpulse --enable-libplacebo \
+		--enable-libopus --enable-libopenmpt --enable-libopenjpeg \
+		--enable-libmp3lame --enable-libmodplug --enable-libjack \
+		--enable-opencl --enable-libvpx --enable-libmysofa \
+		$(vopt_enable vaapi) \
+		$(vopt_enable vdpau) \
 		$(vopt_if nvenc '--enable-nvenc') \
-		$(vopt_if nvdec '--enable-nvdec')
+		$(vopt_if nvdec '--enable-nvdec') \
+		$(vopt_enable svtav1 libsvtav1)
 }
+
 do_build() {
 	make ${makejobs}
 	make doc/ff{mpeg,play}.1
 }
+
 do_install() {
 	make DESTDIR=${DESTDIR} install install-man
 }
@@ -147,12 +133,6 @@ libavdevice_package() {
 		vmove "usr/lib/libavdevice.so.*"
 	}
 }
-libavresample_package() {
-	short_desc="FFmpeg audio resampling library"
-	pkg_install() {
-		vmove "usr/lib/libavresample.so.*"
-	}
-}
 libavformat_package() {
 	short_desc="FFmpeg file format library"
 	pkg_install() {
@@ -198,9 +178,49 @@ ffmpeg-devel_package() {
 		libavfilter>=${version}_${revision}
 		libpostproc>=${version}_${revision}
 		libswscale>=${version}_${revision}
-		libswresample>=${version}_${revision}
-		libavresample>=${version}_${revision}"
+		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
+	alternatives="
+	 ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec5.3
+	 ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice5.3
+	 ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter5.3
+	 ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat5.3
+	 ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil5.3
+	 ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample5.3
+	 ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale5.3
+	 ffmpeg-devel:libavcodec:/usr/include/libavcodec5
+	 ffmpeg-devel:libavdevice:/usr/include/libavdevice5
+	 ffmpeg-devel:libavformat:/usr/include/libavformat5
+	 ffmpeg-devel:libavutil:/usr/include/libavutil5
+	 ffmpeg-devel:libavpostproc:/usr/include/libavpostproc5
+	 ffmpeg-devel:libswresample:/usr/include/libswresample5
+	 ffmpeg-devel:libswcaale:/usr/include/libswscale5
+	 ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec5.pc
+	 ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice5.pc
+	 ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter5.pc
+	 ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat5.pc
+	 ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil5.pc
+	 ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc5.pc
+	 ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample5.pc
+	 ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale5.pc
+	 ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec5.a
+	 ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec5.so
+	 ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice5.a
+	 ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice5.so
+	 ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter5.a
+	 ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter5.so
+	 ffmpeg-devel:libavformat.a:/usr/lib/libavformat5.a
+	 ffmpeg-devel:libavformat.so:/usr/lib/libavformat5.so
+	 ffmpeg-devel:libavutil.a:/usr/lib/libavutil5.a
+	 ffmpeg-devel:libavutil.so:/usr/lib/libavutil5.so
+	 ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc5.a
+	 ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc5.so
+	 ffmpeg-devel:libswresample.a:/usr/lib/libswresample5.a
+	 ffmpeg-devel:libswresample.so:/usr/lib/libswresample5.so
+	 ffmpeg-devel:libswscale.a:/usr/lib/libswscale5.a
+	 ffmpeg-devel:libswscale.so:/usr/lib/libswscale5.so
+	 ffmpeg-devel:ffmpeg:/usr/share/ffmpeg5
+	"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
@@ -211,7 +231,7 @@ ffmpeg-devel_package() {
 	}
 }
 ffplay_package() {
-	short_desc="Simple video player using FFmpeg and SDL2"
+	short_desc="Simple media player using FFmpeg and SDL2"
 	pkg_install() {
 		vmove usr/bin/ffplay
 		vmove "usr/share/man/man1/ffplay*"
diff --git a/srcpkgs/ffmpeg4-devel b/srcpkgs/ffmpeg4-devel
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4-devel
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg4/ffmpeg4 b/srcpkgs/ffmpeg4/ffmpeg4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4/ffmpeg4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg/files/altivec.patch b/srcpkgs/ffmpeg4/files/altivec.patch
similarity index 100%
rename from srcpkgs/ffmpeg/files/altivec.patch
rename to srcpkgs/ffmpeg4/files/altivec.patch
diff --git a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
similarity index 100%
rename from srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
rename to srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
diff --git a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
similarity index 100%
rename from srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
rename to srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
new file mode 100644
index 000000000000..cd9154978b3e
--- /dev/null
+++ b/srcpkgs/ffmpeg4/template
@@ -0,0 +1,254 @@
+# Template file for 'ffmpeg4'
+# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
+pkgname=ffmpeg4
+version=4.4.3
+revision=3
+short_desc="ffmpeg4 libraries only - Decoding, encoding and streaming software"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.ffmpeg.org"
+changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
+distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
+checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+
+hostmakedepends="pkg-config perl yasm"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
+
+case "$XBPS_TARGET_MACHINE" in
+	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
+	ppc64*) build_options_default+=" vaapi vdpau";;
+	mips*) CFLAGS="-mnan=legacy";;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" != "32" ]; then
+	build_options_default+=" svtav1"
+fi
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
+do_configure() {
+	# Fix gcc on x86_64-musl only
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
+		sed -i configure -e "s;_cflags_speed='-O3';_cflags_speed='-O2';"
+	fi
+
+	if [ "$CROSS_BUILD" ]; then
+		case "$XBPS_TARGET_MACHINE" in
+			arm*) _arch="arm";;
+			aarch64*) _arch="aarch64";;
+			mips*) _arch="mips";;
+			ppc64*) _arch="ppc64";;
+			ppc*) _arch="ppc";;
+			*) _arch="${XBPS_TARGET_MACHINE%%-musl}";;
+		esac
+
+		_args+=" --enable-cross-compile
+			--sysroot=$XBPS_CROSS_BASE
+			--cross-prefix=${XBPS_CROSS_TRIPLET}-
+			--target-os=linux --arch=${_arch}"
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc|ppc-musl) _args+=" --disable-altivec";;
+	esac
+
+	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+		_args+=" --extra-libs=-latomic"
+	fi
+
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+		--disable-stripping \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
+		$(vopt_if nvenc '--enable-nvenc') \
+		$(vopt_if nvdec '--enable-nvdec')
+}
+do_build() {
+	make ${makejobs}
+	make doc/ff{mpeg,play}.1
+}
+do_install() {
+	make DESTDIR=${DESTDIR} install install-man
+	rm -rf ${DESTDIR}/usr/bin
+}
+
+libavcodec4_package() {
+	short_desc="FFmpeg codec library"
+	pkg_install() {
+		vmove "usr/lib/libavcodec.so.*"
+	}
+}
+libavdevice4_package() {
+	short_desc="FFmpeg device handling library"
+	pkg_install() {
+		vmove "usr/lib/libavdevice.so.*"
+	}
+}
+libavresample4_package() {
+	short_desc="FFmpeg audio resampling library"
+	pkg_install() {
+		vmove "usr/lib/libavresample.so.*"
+	}
+}
+libavformat4_package() {
+	short_desc="FFmpeg file format library"
+	pkg_install() {
+		vmove "usr/lib/libavformat.so.*"
+	}
+}
+libavutil4_package() {
+	short_desc="FFmpeg utility library"
+	pkg_install() {
+		vmove "usr/lib/libavutil.so.*"
+	}
+}
+libavfilter4_package() {
+	short_desc="FFmpeg audio/video filter library"
+	pkg_install() {
+		vmove "usr/lib/libavfilter.so.*"
+	}
+}
+libpostproc4_package() {
+	short_desc="FFmpeg video postprocessing library"
+	pkg_install() {
+		vmove "usr/lib/libpostproc.so.*"
+	}
+}
+libswscale4_package() {
+	short_desc="FFmpeg video scaling library"
+	pkg_install() {
+		vmove "usr/lib/libswscale.so.*"
+	}
+}
+libswresample4_package() {
+	short_desc="FFmpeg video resampling library"
+	pkg_install() {
+		vmove "usr/lib/libswresample.so.*"
+	}
+}
+ffmpeg4-devel_package() {
+	depends="
+		libavcodec4>=${version}_${revision}
+		libavdevice4>=${version}_${revision}
+		libavformat4>=${version}_${revision}
+		libavutil4>=${version}_${revision}
+		libavfilter4>=${version}_${revision}
+		libpostproc4>=${version}_${revision}
+		libswscale4>=${version}_${revision}
+		libswresample4>=${version}_${revision}
+		libavresample4>=${version}_${revision}"
+	short_desc+=" - development files"
+	alternatives="
+		ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec4.3
+		ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice4.3
+		ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter4.3
+		ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat4.3
+		ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil4.3
+		ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample4.3
+		ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale4.3
+		ffmpeg-devel:libavcodec:/usr/include/libavcodec4
+		ffmpeg-devel:libavdevice:/usr/include/libavdevice4
+		ffmpeg-devel:libavformat:/usr/include/libavformat4
+		ffmpeg-devel:libavutil:/usr/include/libavutil4
+		ffmpeg-devel:libavpostproc:/usr/include/libavpostproc4
+		ffmpeg-devel:libswresample:/usr/include/libswresample4
+		ffmpeg-devel:libswcaale:/usr/include/libswscale4
+		ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec4.pc
+		ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice4.pc
+		ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter4.pc
+		ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat4.pc
+		ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil4.pc
+		ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc4.pc
+		ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample4.pc
+		ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale4.pc
+		ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec4.a
+		ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec4.so
+		ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice4.a
+		ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice4.so
+		ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter4.a
+		ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter4.so
+		ffmpeg-devel:libavformat.a:/usr/lib/libavformat4.a
+		ffmpeg-devel:libavformat.so:/usr/lib/libavformat4.so
+		ffmpeg-devel:libavutil.a:/usr/lib/libavutil4.a
+		ffmpeg-devel:libavutil.so:/usr/lib/libavutil4.so
+		ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc4.a
+		ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc4.so
+		ffmpeg-devel:libswresample.a:/usr/lib/libswresample4.a
+		ffmpeg-devel:libswresample.so:/usr/lib/libswresample4.so
+		ffmpeg-devel:libswscale.a:/usr/lib/libswscale4.a
+		ffmpeg-devel:libswscale.so:/usr/lib/libswscale4.so
+		ffmpeg-devel:ffmpeg:/usr/share/ffmpeg4
+	"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/*.a
+		vmove usr/lib/*.so
+		vmove usr/share/ffmpeg/examples
+		vmove usr/share/man/man3
+	}
+}
diff --git a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
new file mode 100644
index 000000000000..4c450fd45bfb
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
@@ -0,0 +1,60 @@
+From 9d8202f32338a3f08d3fa39057dc5eec5d97be4e Mon Sep 17 00:00:00 2001
+From: Mathias Gumz <akira@fluxbox.org>
+Date: Sat, 28 May 2022 11:13:43 +0200
+Subject: [PATCH] Fix infinite loop in Menu::cycleitems()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a menu contains no selectable item (example given: a "list" of user
+styles and the only available one is already selected), cycling through
+the menu will lead to an infinite loop and thus a disfunctional fluxbox.
+
+This commit addresses the issue by checking if there is any selectable
+item before entering the cycling stage.
+
+Discovered by Sébastien Ballet[1].
+
+[1]: https://sourceforge.net/p/fluxbox/bugs/1185/
+---
+ src/FbTk/Menu.cc | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
+index 6b2db3a4..ff040bae 100644
+--- a/src/FbTk/Menu.cc
++++ b/src/FbTk/Menu.cc
+@@ -320,15 +320,24 @@ void Menu::lower() {
+ 
+ void Menu::cycleItems(bool reverse) {
+ 
+-    if (m_items.empty())
+-        return;
+-
+-    int offset = reverse ? -1 : 1;
+     int l = m_items.size();
+-    int i = m_active_index;
++    int i;
++    int offset = reverse ? -1 : 1;
+     size_t ignore;
+ 
+-    for (i += offset; i != m_active_index; i += offset ) {
++    // check if there is _any_ selectable item
++    for (i = 0; i < l; i++) {
++        if (isItemSelectable(i)) {
++            break;
++        }
++    }
++
++    // no selectable item
++    if (i >= l) {
++        return;
++    }
++
++    for (i = m_active_index + offset; i != m_active_index; i += offset ) {
+         if (i < 0) {
+             i = l - 1;
+         } else if (i >= l) {
+-- 
+2.39.0
+
diff --git a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
deleted file mode 100644
index dc151643cb45..000000000000
--- a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 22866c4d30f5b289c429c5ca88d800200db4fc4f Mon Sep 17 00:00:00 2001
-From: John Sennesael <john@aminking.com>
-Date: Mon, 2 Nov 2015 15:14:32 -0600
-Subject: [PATCH] fixes bug #1138
-
----
- util/fluxbox-remote.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc
-index 59852e6a7..504015b50 100644
---- a/util/fluxbox-remote.cc
-+++ b/util/fluxbox-remote.cc
-@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
-     if (strcmp(cmd, "result") == 0) {
-         XTextProperty text_prop;
-         if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
--            && text_prop.value > 0
-+            && text_prop.value != 0
-             && text_prop.nitems > 0) {
- 
-             printf("%s", text_prop.value);
diff --git a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
new file mode 100644
index 000000000000..5b64b11ab2a8
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
@@ -0,0 +1,29 @@
+--- a/src/MinOverlapPlacement.cc  2015-02-08 05:44:34.000000000 -0500
++++ b/src/MinOverlapPlacement.cc  2022-07-18 15:14:41.012275200 -0400
+@@ -196,19 +196,21 @@
+     std::set<Area>::iterator min_reg = areas.end();
+
+     std::set<Area>::iterator ar_it = areas.begin();
++    int overlap = 0, min_right = 0, min_bottom = 0, max_left = 0, max_top = 0;
++
+     for (; ar_it != areas.end(); ++ar_it) {
+
+-        int overlap = 0;
++        overlap = 0;
+         it = const_windowlist.rbegin();
+         for (; it != it_end; ++it) {
+
+             getWindowDimensions(*(*it), left, top, right, bottom);
+
+             // get the coordinates of the overlap region
+-            int min_right = std::min(right, ar_it->x + win_w);
+-            int min_bottom = std::min(bottom, ar_it->y + win_h);
+-            int max_left = std::max(left, ar_it->x);
+-            int max_top = std::max(top, ar_it->y);
++            min_right = std::min(right, ar_it->x + win_w);
++            min_bottom = std::min(bottom, ar_it->y + win_h);
++            max_left = std::max(left, ar_it->x);
++            max_top = std::max(top, ar_it->y);
+
+             // now compute the overlap and add to running total
+             if (min_right > max_left && min_bottom > max_top)
diff --git a/srcpkgs/fluxbox/patches/center.patch b/srcpkgs/fluxbox/patches/center.patch
new file mode 100644
index 000000000000..39e3e4c7f37e
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/center.patch
@@ -0,0 +1,307 @@
+From ec83993c236de9c9442e2fcd31c08aae852a5a16 Mon Sep 17 00:00:00 2001
+From: zlice <zlice555@gmail.com>
+Date: Fri, 22 Jul 2022 21:21:33 -0400
+Subject: [PATCH 1/2] whitespace cleanup
+
+---
+ doc/asciidoc/fluxbox.txt |  8 ++++----
+ src/ScreenPlacement.cc   | 12 ++++++------
+ src/ScreenPlacement.hh   | 10 +++++-----
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
+index 95624842..0e3f27b9 100644
+--- a/doc/asciidoc/fluxbox.txt
++++ b/doc/asciidoc/fluxbox.txt
+@@ -4,7 +4,7 @@ Henrik Kinnunen <fluxgen@fluxbox.org>
+ v1.3.7, 08 February 2015
+ :man source:   fluxbox.txt
+ :man version:  {revision}
+-:man manual:   Fluxbox Manual  
++:man manual:   Fluxbox Manual
+ 
+ NAME
+ ----
+@@ -475,7 +475,7 @@ By default, this menu contains:
+ 
+ *Remember...*:::
+ Specify which window settings should be stored in the `apps' file and
+-resumed the next time this window is opened. 
++resumed the next time this window is opened.
+ +
+ Specifically the setting you may store are:
+ +
+@@ -740,7 +740,7 @@ There are three more settings in the ``Focus Model'' menu:
+ 
+ TAB OPTIONS
+ -----------
+-This section of fluxbox configuration menu lets you configure many features of 
++This section of fluxbox configuration menu lets you configure many features of
+ tabs. Inside of it there are three main options:
+ 
+ *Placement*:::
+@@ -1060,7 +1060,7 @@ whenever the mouse moves over them, but only when the mouse is moving. With
+ area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc.
+ +
+ Default: *ClickToFocus*
+-      
++
+ *session.screen0.autoRaise*: 'boolean'::
+ When True, this setting automatically raises any window that gains focus.
+ +
+diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
+index 19ddf78a..ca58d83f 100644
+--- a/src/ScreenPlacement.cc
++++ b/src/ScreenPlacement.cc
+@@ -43,14 +43,14 @@ using std::cerr;
+ using std::endl;
+ 
+ ScreenPlacement::ScreenPlacement(BScreen &screen):
+-    m_row_direction(screen.resourceManager(), LEFTRIGHT, 
+-                    screen.name()+".rowPlacementDirection", 
++    m_row_direction(screen.resourceManager(), LEFTRIGHT,
++                    screen.name()+".rowPlacementDirection",
+                     screen.altName()+".RowPlacementDirection"),
+-    m_col_direction(screen.resourceManager(), TOPBOTTOM, 
+-                    screen.name()+".colPlacementDirection", 
++    m_col_direction(screen.resourceManager(), TOPBOTTOM,
++                    screen.name()+".colPlacementDirection",
+                     screen.altName()+".ColPlacementDirection"),
+-    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT, 
+-                       screen.name()+".windowPlacement", 
++    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT,
++                       screen.name()+".windowPlacement",
+                        screen.altName()+".WindowPlacement"),
+     m_old_policy(ROWSMARTPLACEMENT),
+     m_screen(screen)
+diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
+index 0f210d94..f1234983 100644
+--- a/src/ScreenPlacement.hh
++++ b/src/ScreenPlacement.hh
+@@ -34,7 +34,7 @@ class BScreen;
+ 
+ /**
+  * Main class for strategy handling
+- * This is a bridge between screen and 
++ * This is a bridge between screen and
+  * the real placement strategy (rowcol, undermouse etc)
+  * The placeWindow function in this class is guaranteed to succeed.
+  * It holds a pointer to the real placement strategy which is
+@@ -42,8 +42,8 @@ class BScreen;
+  */
+ class ScreenPlacement: public PlacementStrategy {
+ public:
+-    enum PlacementPolicy { 
+-        ROWSMARTPLACEMENT, 
++    enum PlacementPolicy {
++        ROWSMARTPLACEMENT,
+         COLSMARTPLACEMENT,
+         COLMINOVERLAPPLACEMENT,
+         ROWMINOVERLAPPLACEMENT,
+@@ -52,11 +52,11 @@ public:
+         AUTOTABPLACEMENT
+     };
+ 
+-    enum RowDirection { 
++    enum RowDirection {
+         LEFTRIGHT, ///< from left to right
+         RIGHTLEFT  ///< from right to left
+     };
+-    enum ColumnDirection { 
++    enum ColumnDirection {
+         TOPBOTTOM,  ///< from top to bottom
+         BOTTOMTOP   ///< from bottom to top
+     };
+-- 
+2.37.1
+
+
+From 6e05f44c94fa4bfc0e44e8f42a9d24665a95840f Mon Sep 17 00:00:00 2001
+From: zlice <zlice555@gmail.com>
+Date: Fri, 22 Jul 2022 21:27:25 -0400
+Subject: [PATCH 2/2] new feature: CenterPlacement. Places new windows in
+ center of the current workspace
+
+---
+ doc/asciidoc/fluxbox.txt |  1 +
+ src/CenterPlacement.cc   | 43 ++++++++++++++++++++++++++++++++++++++++
+ src/CenterPlacement.hh   | 37 ++++++++++++++++++++++++++++++++++
+ src/Makemodule.am        |  2 ++
+ src/ScreenPlacement.cc   |  8 ++++++++
+ src/ScreenPlacement.hh   |  1 +
+ 6 files changed, 92 insertions(+)
+ create mode 100644 src/CenterPlacement.cc
+ create mode 100644 src/CenterPlacement.hh
+
+diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
+index 0e3f27b9..46ca2861 100644
+--- a/doc/asciidoc/fluxbox.txt
++++ b/doc/asciidoc/fluxbox.txt
+@@ -1141,6 +1141,7 @@ Available strategies:;;
+ - RowSmartPlacement: tries to place windows in rows without overlapping
+ - ColSmartPlacement: tries to place windows in columns without overlapping
+ - CascadePlacement: places windows below the titlebar of the previous one
++- CenterPlacement: places windows in the center of the current workspace
+ - UnderMousePlacement: places new windows underneath the mouse
+ - RowMinOverlapPlacement: place windows in rows with minimal overlapping
+ - ColMinOverlapPlacement: place windows in columns with minimal overlapping
+diff --git a/src/CenterPlacement.cc b/src/CenterPlacement.cc
+new file mode 100644
+index 00000000..efaf76b9
+--- /dev/null
++++ b/src/CenterPlacement.cc
+@@ -0,0 +1,43 @@
++// CenterPlacement.cc
++// Copyright (c) 2006 Fluxbox Team (fluxgen at fluxbox dot org)
++//
++// Permission is hereby granted, free of charge, to any person obtaining a
++// copy of this software and associated documentation files (the "Software"),
++// to deal in the Software without restriction, including without limitation
++// the rights to use, copy, modify, merge, publish, distribute, sublicense,
++// and/or sell copies of the Software, and to permit persons to whom the
++// Software is furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++
++#include "CenterPlacement.hh"
++
++#include "FbTk/App.hh"
++#include "Screen.hh"
++#include "Window.hh"
++
++bool CenterPlacement::placeWindow(const FluxboxWindow &win, int head,
++                                      int &place_x, int &place_y) {
++
++    int cent_x = (signed) win.screen().maxRight(head) - (signed) win.screen().maxLeft(head);
++    int cent_y = (signed) win.screen().maxBottom(head) - (signed) win.screen().maxTop(head);
++
++    // border on 1 side, dividing in half
++    // with rounding, this will probably favor top left
++    int win_half_w = (win.width() / 2) + win.fbWindow().borderWidth(),
++        win_half_h = (win.height() / 2) + win.fbWindow().borderWidth();
++
++    place_x = cent_x - win_half_w;
++    place_y = cent_y - win_half_h;
++
++    return true;
++}
+diff --git a/src/CenterPlacement.hh b/src/CenterPlacement.hh
+new file mode 100644
+index 00000000..9f70a6c8
+--- /dev/null
++++ b/src/CenterPlacement.hh
+@@ -0,0 +1,37 @@
++// CenterPlacement.hh
++// Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org)
++//
++// Permission is hereby granted, free of charge, to any person obtaining a
++// copy of this software and associated documentation files (the "Software"),
++// to deal in the Software without restriction, including without limitation
++// the rights to use, copy, modify, merge, publish, distribute, sublicense,
++// and/or sell copies of the Software, and to permit persons to whom the
++// Software is furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++
++#ifndef CENTERPLACEMENT_HH
++#define CENTERPLACEMENT_HH
++
++#include "ScreenPlacement.hh"
++
++class CenterPlacement: public PlacementStrategy {
++public:
++    CenterPlacement() { };
++
++    bool placeWindow(const FluxboxWindow &win, int head,
++                     int &place_x, int &place_y);
++
++private:
++};
++
++#endif // CENTERPLACEMENT_HH
+diff --git a/src/Makemodule.am b/src/Makemodule.am
+index 5be5692c..53d35e8e 100644
+--- a/src/Makemodule.am
++++ b/src/Makemodule.am
+@@ -165,6 +165,8 @@ fluxbox_SOURCES = \
+ 	src/AttentionNoticeHandler.hh \
+ 	src/CascadePlacement.cc \
+ 	src/CascadePlacement.hh \
++	src/CenterPlacement.cc \
++	src/CenterPlacement.hh \
+ 	src/ClientMenu.cc \
+ 	src/ClientMenu.hh \
+ 	src/ClientPattern.cc \
+diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
+index ca58d83f..ce47a910 100644
+--- a/src/ScreenPlacement.cc
++++ b/src/ScreenPlacement.cc
+@@ -24,6 +24,7 @@
+ #include "RowSmartPlacement.hh"
+ #include "MinOverlapPlacement.hh"
+ #include "UnderMousePlacement.hh"
++#include "CenterPlacement.hh"
+ #include "ColSmartPlacement.hh"
+ #include "CascadePlacement.hh"
+ 
+@@ -82,6 +83,9 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
+         case UNDERMOUSEPLACEMENT:
+             m_strategy.reset(new UnderMousePlacement());
+             break;
++        case CENTERPLACEMENT:
++            m_strategy.reset(new CenterPlacement());
++            break;
+         case AUTOTABPLACEMENT:
+             m_strategy.reset(0);
+             break;
+@@ -197,6 +201,8 @@ std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const
+         return "ColMinOverlapPlacement";
+     case ScreenPlacement::UNDERMOUSEPLACEMENT:
+         return "UnderMousePlacement";
++    case ScreenPlacement::CENTERPLACEMENT:
++        return "CenterPlacement";
+     case ScreenPlacement::CASCADEPLACEMENT:
+         return "CascadePlacement";
+     case ScreenPlacement::AUTOTABPLACEMENT:
+@@ -218,6 +224,8 @@ void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char
+         *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
+     else if (strcasecmp("UnderMousePlacement", str) == 0)
+         *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
++    else if (strcasecmp("CenterPlacement", str) == 0)
++        *(*this) = ScreenPlacement::CENTERPLACEMENT;
+     else if (strcasecmp("CascadePlacement", str) == 0)
+         *(*this) = ScreenPlacement::CASCADEPLACEMENT;
+     else if (strcasecmp("AutotabPlacement", str) == 0)
+diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
+index f1234983..a5c9b885 100644
+--- a/src/ScreenPlacement.hh
++++ b/src/ScreenPlacement.hh
+@@ -49,6 +49,7 @@ public:
+         ROWMINOVERLAPPLACEMENT,
+         CASCADEPLACEMENT,
+         UNDERMOUSEPLACEMENT,
++        CENTERPLACEMENT,
+         AUTOTABPLACEMENT
+     };
+ 
+-- 
+2.37.1
+
diff --git a/srcpkgs/fluxbox/patches/container_locks.patch b/srcpkgs/fluxbox/patches/container_locks.patch
new file mode 100644
index 000000000000..498ab44a23c6
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/container_locks.patch
@@ -0,0 +1,325 @@
+diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
+index 00bc1187..f8a4c475 100644
+--- a/src/FbWinFrame.cc
++++ b/src/FbWinFrame.cc
+@@ -148,6 +148,11 @@ FbWinFrame::FbWinFrame(BScreen &screen, unsigned int client_depth,
+     m_button_size(1),
+     m_shape(m_window, theme->shapePlace()) {
+ 
++    m_locker_timer.setTimeout(timerVal() ); // 10millisec
++    m_locker_timer.fireOnce(true);
++    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<FbWinFrame>(*this, &FbWinFrame::unlockSig));
++    m_locker_timer.setCommand(usig);
++
+     init();
+ }
+ 
+@@ -156,6 +161,27 @@ FbWinFrame::~FbWinFrame() {
+     removeAllButtons();
+ }
+ 
++// for incremental changes, back off for a bit
++// prevents slowdown from say, making 200 windows
++void FbWinFrame::resetLock() {
++    m_lock_gfx = true;
++    m_locker_timer.start();
++}
++
++void FbWinFrame::unlockSig() {
++    m_lock_gfx = false;
++    // this is what we wanted to do
++    FbTk::Container& tabs = tabcontainer();
++    tabs.setUpdateLock(m_lock_gfx);
++    renderTabContainer();
++    applyTabContainer();
++
++    tabs.clear();
++    tabs.raise();
++    tabs.show();
++}
++
++
+ bool FbWinFrame::setTabMode(TabMode tabmode) {
+     if (m_tabmode == tabmode)
+         return false;
+@@ -187,6 +213,7 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
+ 
+     } else {
+         tabs.setUpdateLock(true);
++        resetLock();
+ 
+         tabs.setAlignment(FbTk::Container::RELATIVE);
+         tabs.setOrientation(FbTk::ROT0);
+@@ -200,9 +227,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
+         }
+         tabs.setBorderWidth(0);
+         tabs.setMaxTotalSize(0);
+-        tabs.setUpdateLock(false);
++        tabs.setUpdateLock(m_lock_gfx);
+         tabs.setMaxSizePerClient(0);
+ 
++        if (m_lock_gfx)
++            return false;
++
+         renderTabContainer();
+         applyTabContainer();
+ 
+diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
+index 617b9b91..725c84a0 100644
+--- a/src/FbWinFrame.hh
++++ b/src/FbWinFrame.hh
+@@ -33,6 +33,7 @@
+ #include "FbTk/Container.hh"
+ #include "FbTk/Shape.hh"
+ #include "FbTk/Signal.hh"
++#include "FbTk/Timer.hh"
+ 
+ #include <vector>
+ #include <memory>
+@@ -176,6 +177,12 @@ public:
+     void setShapingClient(FbTk::FbWindow *win, bool always_update);
+     void updateShape() { m_shape.update(); }
+ 
++    void resetLock();
++    void unlockSig();
++    FbTk::Timer m_locker_timer;
++    static unsigned int timerVal() { return 10 * FbTk::FbTime::IN_MILLISECONDS; }
++    bool m_lock_gfx = false;
++
+     /**
+        @name accessors
+     */
+diff --git a/src/IconButton.cc b/src/IconButton.cc
+index 1290c2aa..2ea7af9e 100644
+--- a/src/IconButton.cc
++++ b/src/IconButton.cc
+@@ -71,8 +71,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent,
+ 
+     FbTk::EventManager::instance()->add(*this, m_icon_window);
+ 
+-    reconfigTheme();
+-    refreshEverything(false);
++    //reconfigTheme();
++    //refreshEverything(false);
+ }
+ 
+ IconButton::~IconButton() {
+@@ -163,12 +163,12 @@ void IconButton::reconfigTheme() {
+                            width(), height(), m_theme->texture(),
+                            orientation()));
+         setBackgroundPixmap(m_pm);
+-    } else{
++    } else {
+         m_pm.reset(0);
+         setBackgroundColor(m_theme->texture().color());
+     }
+ 
+-    updateBackground(false);
++    //updateBackground(false);
+ }
+ 
+ void IconButton::reconfigAndClear() {
+@@ -181,7 +181,8 @@ void IconButton::refreshEverything(bool setup) {
+     Display *display = FbTk::App::instance()->display();
+     int screen = m_win.screen().screenNumber();
+ 
+-    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None) {
++    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None &&
++                                     width() > m_icon_window.width() ) {
+         // setup icon window
+         m_icon_window.show();
+         unsigned int w = width();
+@@ -242,7 +243,6 @@ void IconButton::refreshEverything(bool setup) {
+         m_icon_window.clear();
+     }
+ 
+-
+ }
+ 
+ void IconButton::clientTitleChanged() {
+@@ -251,24 +251,30 @@ void IconButton::clientTitleChanged() {
+ 
+     if (m_has_tooltip)
+         showTooltip();
++
+ }
+ 
+ void IconButton::setupWindow() {
+     m_icon_window.clear();
++    //FbTk::FbString title = "wtf2";
+     FbTk::FbString title = m_win.title().logical();
+-    if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
+-        title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
++    //#if USE_TOOLBAR
++    //if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
++    //    title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
++    //#endif
+     setText(title);
+     FbTk::TextButton::clear();
+ }
+ 
+ void IconButton::drawText(int x, int y, FbTk::FbDrawable *drawable) {
+ 
+-    // offset text
+-    if (m_icon_pixmap.drawable() != 0)
+-        FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
+-    else
+-        FbTk::TextButton::drawText(1, y, drawable);
++    if (width() > m_icon_window.width() ) {
++      // offset text
++      if (m_icon_pixmap.drawable() != 0)
++          FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
++      else
++          FbTk::TextButton::drawText(1, y, drawable);
++    }
+ }
+ 
+ bool IconButton::setOrientation(FbTk::Orientation orient) {
+diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
+index 027ab1c6..f64a4cf6 100644
+--- a/src/IconbarTool.cc
++++ b/src/IconbarTool.cc
+@@ -300,6 +300,11 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
+     FbTk::RefCount<FbTk::Command<void> > ers(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::emitResizeSig));
+     m_resizeSig_timer.setCommand(ers);
+ 
++    m_locker_timer.setTimeout(IconButton::updateLaziness() / 10); // 10millisec
++    m_locker_timer.fireOnce(true);
++    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::unlockSig));
++    m_locker_timer.setCommand(usig);
++
+     themeReconfigured();
+ }
+ 
+@@ -325,7 +330,7 @@ void IconbarTool::updateMaxSizes(unsigned int width, unsigned int height) {
+ 
+ void IconbarTool::resize(unsigned int width, unsigned int height) {
+     m_icon_container.resize(width, height);
+-    updateMaxSizes(width, height);
++    //updateMaxSizes(width, height);
+     renderTheme();
+ }
+ 
+@@ -333,7 +338,7 @@ void IconbarTool::moveResize(int x, int y,
+                              unsigned int width, unsigned int height) {
+ 
+     m_icon_container.moveResize(x, y, width, height);
+-    updateMaxSizes(width, height);
++    //updateMaxSizes(width, height);
+     renderTheme();
+ }
+ 
+@@ -393,6 +398,25 @@ void IconbarTool::setMode(string mode) {
+     m_menu.reconfigure();
+ }
+ 
++// for incremental changes, back off for a bit
++// prevents slowdown from say, making 200 windows
++void IconbarTool::resetLock() {
++    m_lock_gfx = true;
++    m_locker_timer.start();
++}
++
++void IconbarTool::unlockSig() {
++    m_lock_gfx = false;
++    //resizeSig().emit();
++    // this is what we wanted to do
++    m_icon_container.setUpdateLock(false);
++    m_icon_container.update();
++    m_icon_container.showSubwindows();
++    renderTheme();
++    update(ALIGN, NULL);
++    m_resizeSig_timer.start();
++}
++
+ void IconbarTool::emitResizeSig() {
+     resizeSig().emit();
+ }
+@@ -441,9 +465,11 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
+     switch(reason) {
+         case LIST_ADD: case LIST_ORDER:
+             insertWindow(*win);
++            resetLock();
+             break;
+         case LIST_REMOVE:
+             removeWindow(*win);
++            resetLock();
+             break;
+         case LIST_RESET:
+             reset();
+@@ -455,6 +481,10 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
+     m_resizeSig_timer.start();
+ 
+     updateMaxSizes(width(), height());
++
++    if (m_lock_gfx)
++        return;
++
+     // unlock container and update graphics
+     m_icon_container.setUpdateLock(false);
+     m_icon_container.update();
+@@ -496,13 +526,13 @@ void IconbarTool::insertWindow(Focusable &win, int pos) {
+         button = makeButton(win);
+     if (!button) return;
+ 
+-    if (pos == -2) {
+-        pos = 0;
+-        list<Focusable *>::iterator it = m_winlist->clientList().begin(),
+-                                    it_end = m_winlist->clientList().end();
+-        for (; it != it_end && *it != &win; ++it)
+-            pos++;
+-    }
++    //if (pos == -2) {
++    //    pos = 0;
++    //    list<Focusable *>::iterator it = m_winlist->clientList().begin(),
++    //                                it_end = m_winlist->clientList().end();
++    //    for (; it != it_end && *it != &win; ++it)
++    //        pos++;
++    //}
+ 
+     m_icon_container.insertItem(button, pos);
+     m_tracker.join(button->titleChanged(), FbTk::MemFun(m_resizeSig_timer, &FbTk::Timer::start));
+@@ -517,9 +547,9 @@ void IconbarTool::updateSizing() {
+     m_icon_container.setBorderWidth(m_theme.border().width());
+     m_icon_container.setBorderColor(m_theme.border().color());
+ 
+-    FbTk::STLUtil::forAll(m_icons, 
+-            FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
+-                FbTk::Select2nd<IconMap::value_type>()));
++    //FbTk::STLUtil::forAll(m_icons, 
++    //        FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
++    //            FbTk::Select2nd<IconMap::value_type>()));
+ 
+ }
+ 
+@@ -560,7 +590,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear) {
+ 
+     button.setPixmap(*m_rc_use_pixmap);
+     button.setTextPadding(*m_rc_client_padding);
+-    button.reconfigTheme();
++    //button.reconfigTheme();
+     if (clear)
+         button.clear(); // the clear also updates transparent
+ }
+diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
+index df6d9a65..1c2101ac 100644
+--- a/src/IconbarTool.hh
++++ b/src/IconbarTool.hh
+@@ -106,6 +106,9 @@ private:
+ 
+     void themeReconfigured();
+ 
++    void resetLock();
++    void unlockSig();
++    FbTk::Timer m_locker_timer;
+     FbTk::Timer m_resizeSig_timer;
+     void emitResizeSig();
+ 
+@@ -128,6 +131,7 @@ private:
+     FbMenu m_menu;
+     int m_alpha;
+     static std::string s_iconifiedDecoration[2];
++    bool m_lock_gfx = false;
+ };
+ 
+ #endif // ICONBARTOOL_HH
diff --git a/srcpkgs/fluxbox/patches/container_relative_relative.patch b/srcpkgs/fluxbox/patches/container_relative_relative.patch
new file mode 100644
index 000000000000..dc3ddb5181b5
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/container_relative_relative.patch
@@ -0,0 +1,15 @@
+diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
+index cea761b3..0e050a0b 100644
+--- a/src/FbTk/Container.cc
++++ b/src/FbTk/Container.cc
+@@ -365,6 +365,9 @@ void Container::repositionItems() {
+     const ItemList::iterator it_end = end();
+
+     int rounding_error = 0;
++    if (align == RELATIVE || total_width == m_max_total_size) {
++        rounding_error = total_width - ((max_width_per_client + borderW)* num_items - borderW);
++    }
+
+     int next_x = -borderW; // zero so the border of the first shows
+     int extra = 0;
+
diff --git a/srcpkgs/fluxbox/patches/flux_improve.patch b/srcpkgs/fluxbox/patches/flux_improve.patch
new file mode 100644
index 000000000000..13a1aeba621c
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/flux_improve.patch
@@ -0,0 +1,205 @@
+diff --git a/src/Ewmh.cc b/src/Ewmh.cc
+index e12a7923..db1ddd45 100644
+--- a/src/Ewmh.cc
++++ b/src/Ewmh.cc
+@@ -1096,15 +1096,19 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
+         // ce.data.l[0] = the action (remove, add or toggle)
+         // ce.data.l[1] = the first property to alter
+         // ce.data.l[2] = second property to alter (can be zero)
+-        if (ce.data.l[0] == STATE_REMOVE) {
+-            setState(win, ce.data.l[1], false, *winclient);
+-            setState(win, ce.data.l[2], false, *winclient);
+-        } else if (ce.data.l[0] == STATE_ADD) {
+-            setState(win, ce.data.l[1], true, *winclient);
+-            setState(win, ce.data.l[2], true, *winclient);
+-        } else if (ce.data.l[0] == STATE_TOGGLE) {
+-            toggleState(win, ce.data.l[1]);
+-            toggleState(win, ce.data.l[2]);
++        bool addremove = false; // add true, remove false
++
++        switch (ce.data.l[0]) {
++          case STATE_TOGGLE:
++              toggleState(win, ce.data.l[1]);
++              toggleState(win, ce.data.l[2]);
++              break;
++          case STATE_ADD:
++              addremove = true;
++          case STATE_REMOVE:
++              setState(win, ce.data.l[1], addremove, *winclient);
++              setState(win, ce.data.l[2], addremove, *winclient);
++              break;
+         }
+         return true;
+     } else if (ce.message_type == m_net->number_of_desktops) {
+diff --git a/src/FbMenuParser.cc b/src/FbMenuParser.cc
+index 716ced29..5a56e6f5 100644
+--- a/src/FbMenuParser.cc
++++ b/src/FbMenuParser.cc
+@@ -33,9 +33,9 @@ bool FbMenuParser::open(const std::string &filename) {
+ }
+ 
+ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
+-    if (eof()) {        
++    if (eof()) {
+         out = FbTk::Parser::s_empty_item;
+-        return *this; 
++        return *this;
+     }
+ 
+     if (m_curr_line.empty())
+@@ -69,20 +69,26 @@ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
+         return (*this)>>out;
+         break;
+     }
+-    
++
+     std::string key;
+     int err = FbTk::StringUtil::
+         getStringBetween(key, m_curr_line.c_str() + m_curr_pos,
+                          first, second);
+-    if (err <= 0) {        
+-        if (m_curr_token == TYPE)
++    if (err <= 0) {
++        switch (m_curr_token) {
++          case TYPE:
+             m_curr_token = NAME;
+-        else if (m_curr_token == NAME)
++            break;
++          case NAME:
+             m_curr_token = ARGUMENT;
+-        else if (m_curr_token == ARGUMENT)
++            break;
++          case ARGUMENT:
+             m_curr_token = ICON;
+-        else if (m_curr_token == ICON)
++            break;
++          case ICON:
+             m_curr_token = DONE;
++            break;
++        }
+ 
+         out = FbTk::Parser::s_empty_item;
+         return *this;
+diff --git a/src/Remember.cc b/src/Remember.cc
+index 49e61062..4f0ba3db 100644
+--- a/src/Remember.cc
++++ b/src/Remember.cc
+@@ -802,39 +802,41 @@ void Remember::reload() {
+             int pos = getStringBetween(key, line.c_str(), '[', ']');
+             string lc_key = toLower(key);
+ 
+-            if (pos > 0 && (lc_key == "app" || lc_key == "transient")) {
+-                ClientPattern *pat = new ClientPattern(line.c_str() + pos);
+-                if (!in_group) {
+-                    if ((err = pat->error()) == 0) {
+-                        bool transient = (lc_key == "transient");
+-                        Application *app = findMatchingPatterns(pat,
+-                                               old_pats, transient, false);
+-                        if (app) {
+-                            app->reset();
+-                            reused_apps.insert(app);
++            if (pos > 0) {
++                if (lc_key == "app" || lc_key == "transient") {
++                    ClientPattern *pat = new ClientPattern(line.c_str() + pos);
++                    if (!in_group) {
++                        if ((err = pat->error()) == 0) {
++                            bool transient = (lc_key == "transient");
++                            Application *app = findMatchingPatterns(pat,
++                                                   old_pats, transient, false);
++                            if (app) {
++                                app->reset();
++                                reused_apps.insert(app);
++                            } else {
++                                app = new Application(transient, false);
++                            }
++
++                            m_pats->push_back(make_pair(pat, app));
++                            row += parseApp(apps_file, *app);
+                         } else {
+-                            app = new Application(transient, false);
++                            cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
++                            delete pat; // since it didn't work
+                         }
+-
+-                        m_pats->push_back(make_pair(pat, app));
+-                        row += parseApp(apps_file, *app);
+                     } else {
+-                        cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
+-                        delete pat; // since it didn't work
++                        grouped_pats.push_back(pat);
+                     }
+-                } else {
+-                    grouped_pats.push_back(pat);
+-                }
+-            } else if (pos > 0 && lc_key == "startup" && fb.isStartup()) {
+-                if (!handleStartupItem(line, pos)) {
+-                    cerr<<"Error reading apps file at line "<<row<<"."<<endl;
++                } else if (lc_key == "startup" && fb.isStartup()) {
++                    if (!handleStartupItem(line, pos)) {
++                        cerr<<"Error reading apps file at line "<<row<<"."<<endl;
++                    }
++                    // save the item even if it was bad (aren't we nice)
++                    m_startups.push_back(line.substr(pos));
++                } else if (lc_key == "group") {
++                    in_group = true;
++                    if (line.find('(') != string::npos)
++                        pat = new ClientPattern(line.c_str() + pos);
+                 }
+-                // save the item even if it was bad (aren't we nice)
+-                m_startups.push_back(line.substr(pos));
+-            } else if (pos > 0 && lc_key == "group") {
+-                in_group = true;
+-                if (line.find('(') != string::npos)
+-                    pat = new ClientPattern(line.c_str() + pos);
+             } else if (in_group) {
+                 // otherwise assume that it is the start of the attributes
+                 Application *app = 0;
+diff --git a/src/SystemTray.cc b/src/SystemTray.cc
+index 8c42877a..1fc2b0a8 100644
+--- a/src/SystemTray.cc
++++ b/src/SystemTray.cc
+@@ -550,10 +550,12 @@ void SystemTray::rearrangeClients() {
+     ClientList::iterator client_it = m_clients.begin();
+     ClientList::iterator client_it_end = m_clients.end();
+     int next_x = bw;
++    int x, y;
+     for (; client_it != client_it_end; ++client_it) {
+         if (!(*client_it)->isVisible())
+             continue;
+-        int x = next_x, y = bw;
++        x = next_x;
++        y = bw;
+         next_x += h_rot0+bw;
+         translateCoords(orientation(), x, y, w_rot0, h_rot0);
+         translatePosition(orientation(), x, y, h_rot0, h_rot0, 0);
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..713d1510 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -3267,14 +3267,18 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top, bool resize) {
+ FluxboxWindow::ReferenceCorner FluxboxWindow::getResizeDirection(int x, int y,
+         ResizeModel model, int corner_size_px, int corner_size_pc) const
+ {
+-    if (model == TOPLEFTRESIZE)     return LEFTTOP;
+-    if (model == TOPRESIZE)         return TOP;
+-    if (model == TOPRIGHTRESIZE)    return RIGHTTOP;
+-    if (model == LEFTRESIZE)        return LEFT;
+-    if (model == RIGHTRESIZE)       return RIGHT;
+-    if (model == BOTTOMLEFTRESIZE)  return LEFTBOTTOM;
+-    if (model == BOTTOMRESIZE)      return BOTTOM;
+-    if (model == CENTERRESIZE)      return CENTER;
++    switch (model) {
++    case TOPLEFTRESIZE:     return LEFTTOP;
++    case TOPRESIZE:         return TOP;
++    case TOPRIGHTRESIZE:    return RIGHTTOP;
++    case LEFTRESIZE:        return LEFT;
++    case RIGHTRESIZE:       return RIGHT;
++    case BOTTOMLEFTRESIZE:  return LEFTBOTTOM;
++    case BOTTOMRESIZE:      return BOTTOM;
++    case CENTERRESIZE:      return CENTER;
++    default:
++    break;
++    }
+ 
+     if (model == EDGEORCORNERRESIZE)
+     {
diff --git a/srcpkgs/fluxbox/patches/flux_oversize.patch b/srcpkgs/fluxbox/patches/flux_oversize.patch
new file mode 100644
index 000000000000..98d70d3b037e
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/flux_oversize.patch
@@ -0,0 +1,24 @@
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..02d10e90 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -532,19 +532,14 @@ void FluxboxWindow::init() {
+     if (!m_state.fullscreen) {
+         unsigned int new_width = 0, new_height = 0;
+         if (m_client->width() >= screen().width()) {
+-            m_state.maximized |= WindowState::MAX_HORZ;
+             new_width = 2 * screen().width() / 3;
+         }
+         if (m_client->height() >= screen().height()) {
+-            m_state.maximized |= WindowState::MAX_VERT;
+             new_height = 2 * screen().height() / 3;
+         }
+         if (new_width || new_height) {
+-            const int maximized = m_state.maximized;
+-            m_state.maximized = WindowState::MAX_NONE;
+             resize(new_width ? new_width : width(), new_height ? new_height : height());
+             m_placed = false;
+-            m_state.maximized = maximized;
+         }
+     }
+ 
diff --git a/srcpkgs/fluxbox/patches/focus_close_menu.patch b/srcpkgs/fluxbox/patches/focus_close_menu.patch
new file mode 100644
index 000000000000..01830cf53460
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/focus_close_menu.patch
@@ -0,0 +1,17 @@
+diff --git a/src/FocusControl.cc b/src/FocusControl.cc
+index 54c3d46c..7e49ff51 100644
+--- a/src/FocusControl.cc
++++ b/src/FocusControl.cc
+@@ -247,11 +247,7 @@ void FocusControl::stopCyclingFocus() {
+ 
+     // put currently focused window to top
+     if (s_focused_window) {
+-        // re-focus last window to give the client a chance to redistribute the
+-        // focus internally (client-side only modality)
+-        s_focused_window->focus();
+-        if (s_focused_window)
+-            setScreenFocusedWindow(*s_focused_window);
++        setScreenFocusedWindow(*s_focused_window);
+         if (s_focused_fbwindow)
+             s_focused_fbwindow->raise();
+     } else
diff --git a/srcpkgs/fluxbox/patches/slit_raise.patch b/srcpkgs/fluxbox/patches/slit_raise.patch
new file mode 100644
index 000000000000..a3bc01c7ac85
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/slit_raise.patch
@@ -0,0 +1,16 @@
+diff --git a/src/Slit.cc b/src/Slit.cc
+index 9baecf21..63ed8269 100644
+--- a/src/Slit.cc
++++ b/src/Slit.cc
+@@ -958,8 +958,8 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
+         return;
+     }
+
+-    if (be.button == 1)
+-        frame.window.raise();
++    //if (be.button == 1)
++    //    frame.window.raise();
+
+     if (be.button != Button3) {
+         XAllowEvents(dpy, ReplayPointer, CurrentTime);
+
diff --git a/srcpkgs/fluxbox/patches/toolbar_redo.patch b/srcpkgs/fluxbox/patches/toolbar_redo.patch
new file mode 100644
index 000000000000..ca95486583ce
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/toolbar_redo.patch
@@ -0,0 +1,228 @@
+diff --git a/src/Toolbar.cc b/src/Toolbar.cc
+index aa9bc121..ee8b8bfc 100644
+--- a/src/Toolbar.cc
++++ b/src/Toolbar.cc
+@@ -74,7 +74,7 @@ using FbTk::STLUtil::forAll;
+ 
+ namespace {
+ 
+-const struct { 
++const struct {
+     Toolbar::Placement placement;
+     const char* str;
+     FbTk::Orientation orient;
+@@ -362,13 +362,16 @@ void Toolbar::lower() {
+ }
+ 
+ void Toolbar::screenChanged(BScreen &screen) {
+-    reconfigure();
++    //reconfigure();
+ }
+ 
+ void Toolbar::relayout() {
+-    forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
+-    rearrangeItems();
+-    forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
++    //for (auto it : m_item_list)    (*item_it)->updateSizing();
++    //rearrangeItems();
++    //for (auto it : m_item_list)    (*item_it)->renderTheme(alpha());
++    //forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
++    //rearrangeItems();
++    //forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
+ }
+ 
+ void Toolbar::reconfigure() {
+@@ -557,12 +560,16 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
+ }
+ 
+ void Toolbar::updateCrossingState() {
+-    Window wr, wc;
+-    int rx, ry, x, y;
++    //Window wr, wc;
++    //int rx, ry, x, y;
++    //unsigned int mask;
++    Window wrc;
++    int rxy, x, y;
+     unsigned int mask;
+     const int bw = -theme()->border().width();
+     bool hovered = false;
+-    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
++    //if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
++    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wrc, &wrc, &rxy, &rxy, &x, &y, &mask))
+         hovered = x >= bw && y >= bw && x < int(width()) && y < int(height());
+     if (hovered) {
+         if (m_rc_auto_raise)
+@@ -910,25 +917,26 @@ void Toolbar::rearrangeItems() {
+     // lock this
+     m_resize_lock = true;
+     // calculate size for fixed items
+-    ItemList::iterator item_it = m_item_list.begin();
+-    ItemList::iterator item_it_end = m_item_list.end();
++    //ItemList::iterator item_it = m_item_list.begin();
++    //ItemList::iterator item_it_end = m_item_list.end();
+     int bevel_width = theme()->bevelWidth();
+     int fixed_width = bevel_width; // combined size of all fixed items
+     int relative_width = 0; // combined *desired* size of all relative items
+-    int stretch_items = 0;
+     int relative_items = 0;
+     int last_bw = 0; // we show the largest border of adjoining items
+     bool first = true;
++    int leftover_width = 0;
+ 
+     unsigned int width = this->width(), height = this->height();
+     unsigned int tmpw, tmph;
+     FbTk::translateSize(orient, width, height);
+ 
+-    for (; item_it != item_it_end; ++item_it) {
+-        if (!(*item_it)->active())
++    //for (; item_it != item_it_end; ++item_it) {
++    for (auto item_it : m_item_list) {
++        if (!(*item_it).active())
+             continue;
+ 
+-        int borderW = (*item_it)->borderWidth();
++        int borderW = (*item_it).borderWidth();
+ 
+         if (bevel_width > 0) {
+             // the bevel and border are fixed whether relative or not
+@@ -943,35 +951,35 @@ void Toolbar::rearrangeItems() {
+ 
+         last_bw = borderW;
+ 
+-        tmpw = (*item_it)->preferredWidth();
+-        tmph = (*item_it)->height();
++        tmpw = (*item_it).preferredWidth();
++        tmph = (*item_it).height();
+         FbTk::translateSize(orient, tmpw, tmph);
+ 
+-        if ((*item_it)->type() == ToolbarItem::FIXED) {
+-            fixed_width += tmpw;
+-        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
+-            fixed_width += height;
+-            if (bevel_width)
+-                fixed_width -= 2*(borderW + bevel_width);
+-        } else {
+-            ++relative_items;
+-            relative_width += tmpw;
+-            if (!tmpw)
+-                ++stretch_items;
++        switch ( (*item_it).type() ) {
++            case ToolbarItem::FIXED:
++                fixed_width += tmpw;
++                break;
++            case ToolbarItem::SQUARE:
++                fixed_width += height;
++                if (bevel_width)
++                    fixed_width -= 2*(borderW + bevel_width);
++                break;
++            case ToolbarItem::RELATIVE:
++                ++relative_items;
++                relative_width += tmpw;
++                break;
++            default:
++                break;
+         }
+     }
+ 
+     // calculate what's going to be left over to the relative sized items
+-    float stretch_factor = 1.0f;
+     if (relative_items) {
+-        if (relative_width <= width - fixed_width && stretch_items) {
+-            relative_width = int(width - fixed_width - relative_width)/stretch_items;
+-        } else if (relative_width) {
+-            stretch_factor = float(width - fixed_width)/relative_width;
+-            relative_width = 0;
+-        }
++        relative_width = (width - fixed_width) / relative_items;
++        leftover_width = width - fixed_width - relative_items * relative_width;
+     }
+ 
++
+     // now move and resize the items
+     // borderWidth added back on straight away
+     int next_x = -m_item_list.front()->borderWidth(); // list isn't empty
+@@ -979,19 +987,22 @@ void Toolbar::rearrangeItems() {
+         next_x = 0;
+ 
+     last_bw = 0;
+-    for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
+-        int borderW = (*item_it)->borderWidth();
+-        if (!(*item_it)->active()) {
+-            (*item_it)->hide();
++    int borderW, offset, size_offset, tmpx, tmpy;
++
++    //for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
++    for (auto item_it : m_item_list) {
++        borderW = (*item_it).borderWidth();
++        if (!(*item_it).active()) {
++            (*item_it).hide();
+             // make sure it still gets told the toolbar height
+             tmpw = 1; tmph = height - 2*(bevel_width+borderW);
+             if (tmph >= (1<<30)) tmph = 1;
+             FbTk::translateSize(orient, tmpw, tmph);
+-            (*item_it)->resize(tmpw, tmph);  // width of 0 changes to 1 anyway
++            (*item_it).resize(tmpw, tmph);  // width of 0 changes to 1 anyway
+             continue;
+         }
+-        int offset = bevel_width;
+-        int size_offset = 2*(borderW + bevel_width);
++        offset = bevel_width;
++        size_offset = 2*(borderW + bevel_width);
+ 
+         if (bevel_width == 0) {
+             offset = -borderW;
+@@ -1000,22 +1011,28 @@ void Toolbar::rearrangeItems() {
+         }
+         last_bw = borderW;
+ 
+-        int tmpx = next_x + offset,
+-            tmpy = offset;
+-
+-        if ((*item_it)->type() == ToolbarItem::RELATIVE) {
+-            unsigned int itemw = (*item_it)->preferredWidth(), itemh = (*item_it)->height();
+-            FbTk::translateSize(orient, itemw, itemh);
+-            tmpw = itemw ? std::floor(stretch_factor * itemw) : relative_width;
+-            tmph = height - size_offset;
+-        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
+-            tmpw = tmph = height - size_offset;
+-        } else { // fixed size
+-            unsigned int itemw = (*item_it)->width(), itemh = (*item_it)->height();
+-            FbTk::translateSize(orient, itemw, itemh);
+-            tmpw = itemw;
+-            tmph = height - size_offset;
++        tmpx = next_x + offset,
++        tmpy = offset;
++        tmph = height - size_offset;
++
++        switch ( (*item_it).type() ) {
++            case ToolbarItem::SQUARE:
++                tmpw = tmph;
++                break;
++            case ToolbarItem::RELATIVE:
++                tmpw = relative_width;
++                if (leftover_width) {
++                    --leftover_width;
++                    ++tmpw;
++                }
++                break;
++            case ToolbarItem::FIXED:
++                unsigned int itemw = (*item_it).width(), itemh = (*item_it).height();
++                FbTk::translateSize(orient, itemw, itemh);
++                tmpw = itemw;
++                break;
+         }
++
+         if (tmpw >= (1<<30)) tmpw = 1;
+         if (tmph >= (1<<30)) tmph = 1;
+         next_x += tmpw + bevel_width;
+@@ -1025,8 +1042,8 @@ void Toolbar::rearrangeItems() {
+         FbTk::translateCoords(orient, tmpx, tmpy, width, height);
+         FbTk::translatePosition(orient, tmpx, tmpy, tmpw, tmph, borderW);
+         FbTk::translateSize(orient, tmpw, tmph);
+-        (*item_it)->moveResize(tmpx, tmpy, tmpw, tmph);
+-        (*item_it)->show();
++        (*item_it).moveResize(tmpx, tmpy, tmpw, tmph);
++        //(*item_it).show();
+ 
+     }
+     // unlock
diff --git a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
new file mode 100644
index 000000000000..189a314607bd
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
@@ -0,0 +1,350 @@
+diff --git a/src/FbTk/EventManager.cc b/src/FbTk/EventManager.cc
+index 3df56de5..501766cc 100644
+--- a/src/FbTk/EventManager.cc
++++ b/src/FbTk/EventManager.cc
+@@ -194,23 +194,22 @@ void EventManager::dispatch(Window win, XEvent &ev, bool parent) {
+ 
+     // find out which window is the parent and
+     // dispatch event
+-    Window root, parent_win, *children = 0;
+-    unsigned int num_children;
+-    if (XQueryTree(FbTk::App::instance()->display(), win,
+-                   &root, &parent_win, &children, &num_children) != 0) {
+-        if (children != 0)
+-            XFree(children);
+-
+-        if (parent_win != 0 &&
+-            parent_win != root) {
+-            if (m_parent[parent_win] == 0)
+-                return;
+-
+-            // dispatch event to parent
+-            dispatch(parent_win, ev, true);
+-        }
+-    }
+-
++//    Window root, parent_win, *children = 0;
++//    unsigned int num_children;
++//    if (XQueryTree(FbTk::App::instance()->display(), win,
++//                   &root, &parent_win, &children, &num_children) != 0) {
++//        if (children != 0)
++//            XFree(children);
++//
++//        if (parent_win != 0 &&
++//            parent_win != root) {
++//            if (m_parent[parent_win] == 0)
++//                return;
++//
++//            // dispatch event to parent
++//            dispatch(parent_win, ev, true);
++//        }
++//    }
+ }
+ 
+ } // end namespace FbTk
+diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc
+index 73f2ea06..cf863021 100644
+--- a/src/FbTk/KeyUtil.cc
++++ b/src/FbTk/KeyUtil.cc
+@@ -141,13 +141,14 @@ void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win,
+     const unsigned int scrollmod = instance().scrolllock();
+ 
+     // Grab with numlock, capslock and scrlock
+-    for (int i = 0; i < 8; i++) {
+-        XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
+-                    (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
+-                    win, False, event_mask, GrabModeSync, GrabModeAsync,
+-                    None, cursor);
+-    }
+-
++    //for (int i = 0; i < 8; i++) {
++    //    XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
++    //                (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
++    //                win, True, event_mask, GrabModeSync, GrabModeAsync,
++    //                None, cursor);
++    //}
++    XGrabButton(display, button, mod, win, True, event_mask,
++                GrabModeSync, GrabModeAsync, None, cursor);
+ }
+ 
+ /**
+diff --git a/src/Keys.cc b/src/Keys.cc
+index 86591371..c27037e2 100644
+--- a/src/Keys.cc
++++ b/src/Keys.cc
+@@ -277,7 +277,7 @@ void Keys::grabWindow(Window win) {
+     if (win_it == m_window_map.end())
+         return;
+ 
+-    m_handler_map[win]->grabButtons();
++    //m_handler_map[win]->grabButtons();
+     t_key::keylist_t::iterator it = m_keylist->keylist.begin();
+     t_key::keylist_t::iterator it_end = m_keylist->keylist.end();
+     for (; it != it_end; ++it) {
+@@ -586,16 +586,16 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+         isdouble = double_click;
+     }
+ 
+-    auto resetKeyChain = [&]() {
+-        first_key_time = 0;
+-        next_key.reset();
+-        if (saved_keymode) {
+-            setKeyMode(saved_keymode);
+-            saved_keymode.reset();
+-        }
+-    };
+-    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
+-        resetKeyChain();
++//    auto resetKeyChain = [&]() {
++//        first_key_time = 0;
++//        next_key.reset();
++//        if (saved_keymode) {
++//            setKeyMode(saved_keymode);
++//            saved_keymode.reset();
++//        }
++//    };
++//    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
++//        resetKeyChain();
+ 
+     if (!next_key)
+         next_key = m_keylist;
+@@ -612,29 +612,29 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+         next_key->find(MotionNotify, mods, key, context, false))
+         return true; // if there's a motion action, prevent replay to the client (but do nothing)
+ 
+-    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
+-        if (!saved_keymode) {
+-            first_key_time = time;
+-            saved_keymode = m_keylist;
+-        }
+-        next_key = temp_key;
+-        setKeyMode(next_key);
+-        return true;
+-    }
++//    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
++//        if (!saved_keymode) {
++//            first_key_time = time;
++//            saved_keymode = m_keylist;
++//        }
++//        next_key = temp_key;
++//        setKeyMode(next_key);
++//        return true;
++//    }
++
+     if (!temp_key || temp_key->m_command == 0) {
+-        if (type == KeyPress &&
+-            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
+-            // if we're in the middle of an emacs-style keychain, exit it
+-            resetKeyChain();
+-        }
++//        if (type == KeyPress &&
++//            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
++//            // if we're in the middle of an emacs-style keychain, exit it
++//            resetKeyChain();
++//        }
+         return false;
+     }
+ 
+     // if focus changes, windows will get NotifyWhileGrabbed,
+     // which they tend to ignore
+-    if (type == KeyPress) {
++    if (type == KeyPress)
+         XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
+-    }
+ 
+     WinClient *old = WindowCmd<void>::client();
+     WindowCmd<void>::setClient(current);
+@@ -650,12 +650,13 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+     temp_key->m_command->execute();
+     WindowCmd<void>::setClient(old);
+ 
+-    if (saved_keymode) {
+-        if (next_key == m_keylist) // don't reset keymode if command changed it
+-            setKeyMode(saved_keymode);
+-        saved_keymode.reset();
+-    }
+-    next_key.reset();
++//    if (saved_keymode) {
++//        if (next_key == m_keylist) // don't reset keymode if command changed it
++//            setKeyMode(saved_keymode);
++//        saved_keymode.reset();
++//    }
++//    next_key.reset();
++
+     return true;
+ }
+ 
+@@ -685,15 +686,16 @@ void Keys::reconfigure() {
+ }
+ 
+ void Keys::regrab() {
+-    setKeyMode(m_keylist);
++    //setKeyMode(m_keylist);
+ }
+ 
+ void Keys::keyMode(const string& keyMode) {
+-    keyspace_t::iterator it = m_map.find(keyMode + ":");
+-    if (it == m_map.end())
++    //keyspace_t::iterator it = m_map.find(keyMode + ":");
++    //if (it == m_map.end())
++    //    setKeyMode(m_map["default:"]);
++    //else
++    //    setKeyMode(it->second);
+         setKeyMode(m_map["default:"]);
+-    else
+-        setKeyMode(it->second);
+ }
+ 
+ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
+@@ -701,10 +703,10 @@ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
+     ungrabButtons();
+ 
+     // notify handlers that their buttons have been ungrabbed
+-    HandlerMap::iterator h_it = m_handler_map.begin(),
+-                         h_it_end  = m_handler_map.end();
+-    for (; h_it != h_it_end; ++h_it)
+-        h_it->second->grabButtons();
++    //HandlerMap::iterator h_it = m_handler_map.begin(),
++    //                     h_it_end  = m_handler_map.end();
++    //for (; h_it != h_it_end; ++h_it)
++    //    h_it->second->grabButtons();
+ 
+     t_key::keylist_t::iterator it = keyMode->keylist.begin();
+     t_key::keylist_t::iterator it_end = keyMode->keylist.end();
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..457c30c6 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -1133,13 +1133,25 @@ void FluxboxWindow::updateSizeHints() {
+ }
+ 
+ void FluxboxWindow::grabButtons() {
+-
++//NOGRAB
++    //if (m_client->window() != frame().window().window() ) return;
+     // needed for click to focus
+-    XGrabButton(display, Button1, AnyModifier,
+-                frame().window().window(), True, ButtonPressMask,
+-                GrabModeSync, GrabModeSync, None, None);
+-    XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
+-                  frame().window().window());
++    // grabbing async here breaks mouse1
++    //XGrabButton(display, Button1, AnyModifier,
++    //            frame().window().window(), True, ButtonPressMask,
++    //            GrabModeSync, GrabModeSync, None, None);
++    //            //GrabModeAsync, GrabModeAsync, None, None);
++    //XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
++    //              frame().window().window());
++    //XGrabPointer(display,
++    //             frame().window().window(),
++    //             True,
++    //             ButtonPressMask,
++    //             GrabModeAsync, GrabModeAsync,
++    //             None,
++    //             None,
++    //             CurrentTime);
++    //XUngrabPointer(display, CurrentTime);
+ }
+ 
+ 
+@@ -2429,63 +2441,41 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
+     m_last_pressed_button = be.button;
+ 
+     FbTk::Menu::hideShownMenu();
+-
++//FIX ALLOW
+     Keys *k = Fluxbox::instance()->keys();
+     int context = 0;
+     context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);
+     if (!context && be.subwindow)
+         context = frame().getContext(be.window);
+ 
+-    if (k->doAction(be.type, be.state, be.button, context, &winClient(), be.time)) {
+-        XAllowEvents(display, SyncPointer, CurrentTime);
+-        return;
+-    }
+-
+-    WinClient *client = 0;
+-    if (!screen().focusControl().isMouseTabFocus()) {
+-        // determine if we're in a label button (tab)
+-        client = winClientOfLabelButtonWindow(be.window);
+-    }
+-
+-
+-    // - refeed the event into the queue so the app or titlebar subwindow gets it
+-    if (be.subwindow)
+-        XAllowEvents(display, ReplayPointer, CurrentTime);
+-    else
+-        XAllowEvents(display, SyncPointer, CurrentTime);
+-
+-    // if nothing was bound via keys-file then
+-    // - raise() if clickRaise is enabled
+-    // - hide open menues
+-    // - focus on clickFocus
+-    if (frame().window().window() == be.window) {
+-        if (screen().clickRaises())
+-            raise();
+-
+-        m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
+-        m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
+-    }
+-
+-    if (!m_focused && acceptsFocus() && m_click_focus)
+-        focus();
+-
+-    if (!screen().focusControl().isMouseTabFocus() &&
+-        client && client != m_client &&
+-        !screen().focusControl().isIgnored(be.x_root, be.y_root) ) {
+-        setCurrentClient(*client, isFocused());
+-    }
+-
+-
+-
++std::cout << "button window: " << be.window << "\nbutton subwindow: " << be.subwindow << "\n";
++k->doAction(be.type, be.state, be.button, context, &winClient(), CurrentTime); // w/o this, no mouse cmds
++XAllowEvents(display, ReplayPointer, CurrentTime); // w/o this, no mouse
++// ultimately none of the below matters
++    // infinite loop
++    //if (be.subwindow) {
++    //  //XEvent omfg = (XEvent *)&be;
++    //  //be.window = be.subwindow;
++    //  //be.subwindow = 0;
++    //  int huh = XSendEvent(display, be.window, False, ButtonPressMask, (XEvent*)&be);
++    //  std::cout << "xsendevent: " << huh << "\n";
++    //}
++    //XSync(display, 0);
++    //int wtf = XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
++    //std::cout << "xallowevents: " << wtf << "\n";
++    //XSync(display, 0);
++    //XAllowEvents(display, ReplayPointer, be.time); // time means squat - works but not for menus
++    //XAllowEvents(display, SyncPointer, CurrentTime); // sync will not doubleclick or act proper
++    //XAllowEvents(display, AsyncPointer, CurrentTime); // ^^ same
++    //if (be.subwindow)
++    //  XFlush(display);
++    //  //XSync(display, True);
+ }
+ 
+ const unsigned int DEADZONE = 4;
+ 
+ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
+ 
+-    if (m_last_pressed_button == static_cast<int>(re.button)) {
+-        m_last_pressed_button = 0;
+-    }
+ 
+     if (isMoving())
+         stopMoving();
+@@ -2502,6 +2492,13 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
+ 
+         Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button,
+                                               context, &winClient(), re.time);
++      // syncs dont make a difference?
++      //XSync(display, 0);
++      XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
++      //XSync(display, 0);
++    }
++    if (m_last_pressed_button == static_cast<int>(re.button)) {
++        m_last_pressed_button = 0;
+     }
+ }
+ 
diff --git a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
new file mode 100644
index 000000000000..36c572cea4ff
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
@@ -0,0 +1,65 @@
+diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
+index c2e49485..9b4058c8 100644
+--- a/src/WorkspaceCmd.cc
++++ b/src/WorkspaceCmd.cc
+@@ -521,22 +521,24 @@ void ArrangeWindowsCmd::execute() {
+     const unsigned int cal_width = max_width/cols; // width ratio (width of every window)
+     const unsigned int cal_height = max_height/rows; // height ratio (height of every window)
+
++    int cell_center_x = 0, cell_center_y = 0, win_center_x = 0, win_center_y = 0, x = 0, y = 0;
++    unsigned int closest_dist = ~0, dist = 0, w = 0, h = 0;
+     // Resizes and sets windows positions in columns and rows.
+     for (i = 0; i < rows; ++i) {
+         x_offs = orig_x_offs;
+         for (j = 0; j < cols && !normal_windows.empty(); ++j) {
+
+
+-            int cell_center_x = x_offs + (x_offs + cal_width) / 2;
+-            int cell_center_y = y_offs + (y_offs + cal_height) / 2;
+-            unsigned int closest_dist = ~0;
++            cell_center_x = x_offs + (x_offs + cal_width) / 2;
++            cell_center_y = y_offs + (y_offs + cal_height) / 2;
++            int closest_dist = ~0;
+
+             Workspace::Windows::iterator closest = normal_windows.end();
+             for (win = normal_windows.begin(); win != normal_windows.end(); ++win) {
+
+-                int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
+-                int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
+-                unsigned int dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
++                win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
++                win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
++                dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
+                                     (win_center_y - cell_center_y) * (win_center_y - cell_center_y);
+
+                 if (dist < closest_dist) {
+@@ -545,10 +547,10 @@ void ArrangeWindowsCmd::execute() {
+                 }
+             }
+
+-            int x = x_offs + (*closest)->xOffset();
+-            int y = y_offs + (*closest)->yOffset();
+-            unsigned int w = cal_width - (*closest)->widthOffset();
+-            unsigned int h = cal_height - (*closest)->heightOffset();
++            x = x_offs + (*closest)->xOffset();
++            y = y_offs + (*closest)->yOffset();
++            w = cal_width - (*closest)->widthOffset();
++            h = cal_height - (*closest)->heightOffset();
+
+             // the last window gets everything that is left.
+             if (normal_windows.size() == 1) {
+@@ -620,12 +622,9 @@ void UnclutterCmd::execute() {
+         return;
+
+     // place
+-    MinOverlapPlacement mopp;
+     int x, y;
+-    for (win = placed_windows.begin(); win != placed_windows.end(); ++win) {
+-        mopp.placeWindow(**win, head, x, y);
+-        (*win)->move(x, y);
+-    }
++    for (win = placed_windows.begin(); win != placed_windows.end(); ++win)
++        (*win)->placeWindow((*win)->getOnHead());
+ }
+
+ REGISTER_COMMAND(showdesktop, ShowDesktopCmd, void);
diff --git a/srcpkgs/fluxbox/patches/zor_loops.patch b/srcpkgs/fluxbox/patches/zor_loops.patch
new file mode 100644
index 000000000000..95d992f9071d
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/zor_loops.patch
@@ -0,0 +1,87 @@
+diff --git a/src/FbTk/STLUtil.hh b/src/FbTk/STLUtil.hh
+index abc54729..9c9c27f9 100644
+--- a/src/FbTk/STLUtil.hh
++++ b/src/FbTk/STLUtil.hh
+@@ -48,46 +48,63 @@ struct IfThenElse<false, Ta, Tb> {
+ /// calls delete on each item in the container and then clears the container
+ template <typename A>
+ void destroyAndClear(A &a) {
+-    typedef typename A::iterator iterator;
+-    iterator it = a.begin();
+-    iterator it_end = a.end();
+-    for (; it != it_end; ++it)
+-        delete (*it);
++    //typedef typename A::iterator iterator;
++    //iterator it = a.begin();
++    //iterator it_end = a.end();
++    //for (; it != it_end; ++it)
++    //    delete (*it);
+ 
++    //a.clear();
++    typedef typename A::iterator iterator;
++    for (auto it : a)
++        delete it;
+     a.clear();
+ }
+ 
+ /// calls delete on each item value in the map and then clears the map
+ template <typename A>
+ void destroyAndClearSecond(A &a) {
++    //typedef typename A::iterator iterator;
++    //iterator it = a.begin();
++    //iterator it_end = a.end();
++    //for (; it != it_end; ++it)
++    //    delete it->second;
++    //a.clear();
+     typedef typename A::iterator iterator;
+-    iterator it = a.begin();
+-    iterator it_end = a.end();
+-    for (; it != it_end; ++it)
+-        delete it->second;
++    for (auto it : a)
++        delete it.second;
+     a.clear();
+ }
+ 
+ 
+ template <typename C, typename F>
+ F forAll(C& c, F f) {
++    //typedef typename C::iterator iterator;
++    //iterator i = c.begin();
++    //iterator e = c.end();
++    //for (; i != e; i++) {
++    //    f(*i);
++    //}
+     typedef typename C::iterator iterator;
+-    iterator i = c.begin();
+-    iterator e = c.end();
+-    for (; i != e; i++) {
+-        f(*i);
+-    }
++    for (auto i : c)
++        f(i);
+     return f;
+ }
+ 
+ template <typename C, typename I, typename F>
+ F forAllIf(C& c, I i, F f) {
++    //typedef typename C::iterator iterator;
++    //iterator it = c.begin();
++    //iterator end = c.end();
++    //for (; it != end; ++it) {
++    //    if (i(*it))
++    //        f(*it);
++    //}
++    //return f;
+     typedef typename C::iterator iterator;
+-    iterator it = c.begin();
+-    iterator end = c.end();
+-    for (; it != end; ++it) {
+-        if (i(*it))
+-            f(*it);
++    for (auto it : c) {
++        if (i(it))
++            f(it);
+     }
+     return f;
+ }
diff --git a/srcpkgs/fluxbox/template b/srcpkgs/fluxbox/template
index e10b426c4924..6b0e4cd260cb 100644
--- a/srcpkgs/fluxbox/template
+++ b/srcpkgs/fluxbox/template
@@ -1,29 +1,56 @@
 # Template file for 'fluxbox'
 pkgname=fluxbox
-version=1.3.7
-revision=4
+version=1.3.8
+#nostrip=nostrip
+_commit=e2cbd179ecb2ef2d76e0ad1fde84b44325305799
+revision=0
+wrksrc=fluxbox-${_commit}
 build_style=gnu-configure
-configure_args="--enable-nls
+configure_args="--disable-nls --disable-xinerama --disable-shape --disable-xrender
+ --disable-fribidi --disable-slit
  ac_cv_lib_X11_XOpenDisplay=yes ac_cv_lib_Xft_XftFontOpen=yes
  ac_cv_lib_Xrender_XRenderCreatePicture=yes ac_cv_lib_Xpm_XpmReadFileToPixmap=yes
- ac_cv_lib_Xinerama_XineramaQueryScreens=yes ac_cv_lib_Xext_XShapeCombineShape=yes
+ ac_cv_lib_Xext_XShapeCombineShape=no
  ac_cv_lib_Xrandr_XRRQueryExtension=yes ac_cv_lib_fribidi_fribidi_version_info=yes"
-hostmakedepends="pkg-config automake libtool gettext gettext-devel"
+hostmakedepends="pkg-config automake libtool gettext gettext-devel clang llvm"
 makedepends="libSM-devel libXrender-devel libXft-devel libXpm-devel imlib2-devel
- libXext-devel libXinerama-devel libXrandr-devel fribidi-devel"
+ libXext-devel libXrandr-devel fribidi-devel"
 short_desc="Highly configurable and low resource X11 Window manager"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="http://www.fluxbox.org"
-distfiles="https://github.com/fluxbox/fluxbox/archive/refs/tags/Release-${version//./_}.tar.gz"
-checksum=990414ae342a35c5703e5025a8bf019b0b4dada55d57071c51d3d498abb5cd36
+distfiles="https://github.com/fluxbox/fluxbox/archive/${_commit}.tar.gz"
+checksum=6740d9cd4a3e631e0130cbcbc91ccac6af6335dc120f9adc5ebbc8dc9d3259a0
+
+nopie=yes
+X11_FLAGS="-Os -pipe"
+#FRIBIDI_CFLAGS="-Os -pipe"
+XRANDR_CFLAGS="-Os -pipe"
+AM_CPPFLAGS="-Os -pipe"
+CFLAGS="-Os -pipe"
+CXXFLAGS="-Os -pipe -std=c++11"
+CC="clang"
+CXX="clang++"
+HOST_CC=clang
+HOST_CXX=clang++
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) configure_args="${configure_args/enable-nls/disable-nls}" ;;
 esac
 
 pre_configure() {
-	./autogen.sh
+  export X11_FLAGS="-Os -pipe"
+  # export FRIBIDI_CFLAGS="-Os -pipe"
+  export XRANDR_CFLAGS="-Os -pipe"
+  export AM_CPPFLAGS="-Os -pipe"
+  export CFLAGS="-Os -pipe"
+  export CXXFLAGS="-Os -pipe -std=c++11"
+  export CC="clang"
+  export CXX="clang++"
+  export HOST_CC=clang
+  export HOST_CXX=clang++
+  export PREFIX=/usr
+  ./autogen.sh
 }
 
 post_install() {
diff --git a/srcpkgs/libavcodec4 b/srcpkgs/libavcodec4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavcodec4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavdevice4 b/srcpkgs/libavdevice4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavdevice4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavfilter4 b/srcpkgs/libavfilter4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavfilter4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavformat4 b/srcpkgs/libavformat4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavformat4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample b/srcpkgs/libavresample
index a9f1eea092d5..887f354e7c6b 120000
--- a/srcpkgs/libavresample
+++ b/srcpkgs/libavresample
@@ -1 +1 @@
-ffmpeg
\ No newline at end of file
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample4 b/srcpkgs/libavresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavutil4 b/srcpkgs/libavutil4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavutil4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libpostproc4 b/srcpkgs/libpostproc4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libpostproc4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswresample4 b/srcpkgs/libswresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswscale4 b/srcpkgs/libswscale4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswscale4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..bdeb22b13aaa 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,12 +1,13 @@
 # Template file for 'mesa'
 pkgname=mesa
-version=22.3.5
+version=23.0.0
 revision=1
+#wrksrc="Mesa-dg2-20230125"
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
  -Dlmsensors=enabled -Dplatforms=x11$(vopt_if wayland ,wayland)
- -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++14"
+ -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++17"
 hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
@@ -22,11 +23,23 @@ license="MIT, LGPL-2.1-or-later"
 homepage="https://www.mesa3d.org/"
 changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
-checksum=3eed2ecae2bc674494566faab9fcc9beb21cd804c7ba2b59a1694f3d7236e6a9
+checksum=01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4
+# intel dg2 jan 25
+#checksum=4ec8ec65dbdb1ee9444dba72970890128a19543a58cf05931bd6f54f124e117f
+#checksum=37a1ddaf03f41919ee3c89c97cff41e87de96e00e9d3247959cc8279d8294593
+#distfiles="https://github.com/intel-gpu/Mesa/archive/refs/tags/dg2-20230125.tar.gz"
+#checksum=22203186779222ec5244ecb74fbae706d3557588c82089b18c7bf77a54799a59
 
 build_options="wayland"
 build_options_default="wayland"
 
+export CC=clang
+export CXX=clang++
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -Duse-elf-tls=false"
+fi
+
 # only use llvmpipe on targets where it's supported and reliable
 # especially on big endian it's all kinds of broken, and e.g. on
 # 32-bit powerpc it does not work at all, so fall back to softpipe
@@ -91,7 +104,7 @@ fi
 if [ "$_have_intel" ]; then
 	_have_vulkan=yes
 	_gallium_drivers+=",crocus,iris,i915"
-	_vulkan_drivers+=",intel,intel_hasvk"
+	_vulkan_drivers+=",intel"
 	subpackages+=" mesa-vulkan-intel"
 	# transitional dummy packages
 	subpackages+=" mesa-intel-dri"
@@ -140,10 +153,10 @@ fi
 
 # enabled currently by amd drivers
 if [ "$_have_opencl" ]; then
-	hostmakedepends+=" clang rust rust-bindgen"
-	makedepends+=" clang libclc rust SPIRV-LLVM-Translator-devel SPIRV-Tools-devel"
+	hostmakedepends+=" clang"
+	makedepends+=" clang libclc"
 	subpackages+=" mesa-opencl"
-	configure_args+=" -Dgallium-opencl=icd -Dgallium-rusticl=true -Drust_std=2021"
+	configure_args+=" -Dgallium-opencl=icd"
 fi
 
 if [ "$_have_hwdec" ]; then
@@ -187,7 +200,6 @@ esac
 post_configure() {
 	if [ "$CROSS_BUILD" ]; then
 		find -iname "*.ninja" -exec sed -i "{}" \
-			-e "/rustc/s; --sysroot ${XBPS_CROSS_BASE}/usr;;g" \
 			-e "s; /usr/lib/; ${XBPS_CROSS_BASE}/usr/lib/;g" \
 			-e "s;-L/usr/lib;-L${XBPS_CROSS_BASE}/usr/lib;g" \
 			-e "s;-I/usr/include;-I${XBPS_CROSS_BASE}/usr/include;g" \
@@ -286,7 +298,6 @@ MesaLib-devel_package() {
 		fi
 		if [ "$_have_opencl" ]; then
 			vmove usr/lib/libMesaOpenCL.so
-			vmove usr/lib/libRusticlOpenCL.so
 		fi
 	}
 }
@@ -305,7 +316,6 @@ mesa-opencl_package() {
 		vmove etc/OpenCL
 		vmove usr/lib/gallium-pipe
 		vmove "usr/lib/libMesaOpenCL.so.*"
-		vmove "usr/lib/libRusticlOpenCL.so.*"
 	}
 }
 
@@ -336,15 +346,14 @@ mesa-vdpau_package() {
 mesa-vulkan-intel_package() {
 	short_desc="Mesa Intel Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/vulkan/icd.d/intel*.json"
-		vmove "usr/lib/libvulkan_intel*.so"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
 mesa-vulkan-radeon_package() {
 	short_desc="Mesa Radeon Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/drirc.d/00-radv-defaults.conf"
 		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
 		vmove "usr/lib/libvulkan_radeon.so"
 	}

From 67b2aefebf41e6c55d20094c6ed107ac3e6f64d8 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 17:41:38 -0400
Subject: [PATCH 2/4] opencv: update to 4.7.0.

---
 common/shlibs                            | 104 +++++++++++------------
 srcpkgs/actiona/template                 |   2 +-
 srcpkgs/digikam/template                 |   2 +-
 srcpkgs/gmic/template                    |   2 +-
 srcpkgs/goldendict/patches/ffmpeg4.patch |  21 -----
 srcpkgs/nomacs/template                  |   2 +-
 srcpkgs/opencv/template                  |   8 +-
 srcpkgs/qimgv/template                   |   2 +-
 srcpkgs/retroshare/template              |   2 +-
 srcpkgs/siril/template                   |   2 +-
 srcpkgs/waifu2x-converter-cpp/template   |   2 +-
 11 files changed, 64 insertions(+), 85 deletions(-)
 delete mode 100644 srcpkgs/goldendict/patches/ffmpeg4.patch

diff --git a/common/shlibs b/common/shlibs
index aab66c83f4b3..a9d1c6a16ec6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2128,58 +2128,58 @@ libcapstone.so.4 capstone-4.0_1
 libhavege.so.2 libhaveged-1.9.11_1
 libnih.so.1 libnih-1.0.3_1
 libnih-dbus.so.1 libnih-1.0.3_1
-libopencv_quality.so.406 libopencv-4.6.0_1
-libopencv_reg.so.406 libopencv-4.6.0_1
-libopencv_surface_matching.so.406 libopencv-4.6.0_1
-libopencv_xphoto.so.406 libopencv-4.6.0_1
-libopencv_freetype.so.406 libopencv-4.6.0_1
-libopencv_fuzzy.so.406 libopencv-4.6.0_1
-libopencv_hfs.so.406 libopencv-4.6.0_1
-libopencv_img_hash.so.406 libopencv-4.6.0_1
-libopencv_line_descriptor.so.406 libopencv-4.6.0_1
-libopencv_saliency.so.406 libopencv-4.6.0_1
-libopencv_structured_light.so.406 libopencv-4.6.0_1
-libopencv_aruco.so.406 libopencv-4.6.0_1
-libopencv_bgsegm.so.406 libopencv-4.6.0_1
-libopencv_bioinspired.so.406 libopencv-4.6.0_1
-libopencv_ccalib.so.406 libopencv-4.6.0_1
-libopencv_face.so.406 libopencv-4.6.0_1
-libopencv_tracking.so.406 libopencv-4.6.0_1
-libopencv_xfeatures2d.so.406 libopencv-4.6.0_1
-libopencv_optflow.so.406 libopencv-4.6.0_1
-libopencv_ximgproc.so.406 libopencv-4.6.0_1
-libopencv_plot.so.406 libopencv-4.6.0_1
-libopencv_text.so.406 libopencv-4.6.0_1
-libopencv_ml.so.406 libopencv-4.6.0_1
-libopencv_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn.so.406 libopencv-4.6.0_1
-libopencv_shape.so.406 libopencv-4.6.0_1
-libopencv_stitching.so.406 libopencv-4.6.0_1
-libopencv_photo.so.406 libopencv-4.6.0_1
-libopencv_video.so.406 libopencv-4.6.0_1
-libopencv_calib3d.so.406 libopencv-4.6.0_1
-libopencv_features2d.so.406 libopencv-4.6.0_1
-libopencv_flann.so.406 libopencv-4.6.0_1
-libopencv_highgui.so.406 libopencv-4.6.0_1
-libopencv_videoio.so.406 libopencv-4.6.0_1
-libopencv_imgcodecs.so.406 libopencv-4.6.0_1
-libopencv_imgproc.so.406 libopencv-4.6.0_1
-libopencv_core.so.406 libopencv-4.6.0_1
-libopencv_superres.so.406 libopencv-4.6.0_1
-libopencv_videostab.so.406 libopencv-4.6.0_1
-libopencv_gapi.so.406 libopencv-4.6.0_1
-libopencv_xobjdetect.so.406 libopencv-4.6.0_1
-libopencv_datasets.so.406 libopencv-4.6.0_1
-libopencv_dnn_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn_superres.so.406 libopencv-4.6.0_1
-libopencv_dpm.so.406 libopencv-4.6.0_1
-libopencv_phase_unwrapping.so.406 libopencv-4.6.0_1
-libopencv_stereo.so.406 libopencv-4.6.0_1
-libopencv_rapid.so.406 libopencv-4.6.0_1
-libopencv_intensity_transform.so.406 libopencv-4.6.0_1
-libopencv_alphamat.so.406 libopencv-4.6.0_1
-libopencv_barcode.so.406 libopencv-4.6.0_1
-libopencv_mcc.so.406 libopencv-4.6.0_1
+libopencv_quality.so.407 libopencv-4.7.0_1
+libopencv_reg.so.407 libopencv-4.7.0_1
+libopencv_surface_matching.so.407 libopencv-4.7.0_1
+libopencv_xphoto.so.407 libopencv-4.7.0_1
+libopencv_freetype.so.407 libopencv-4.7.0_1
+libopencv_fuzzy.so.407 libopencv-4.7.0_1
+libopencv_hfs.so.407 libopencv-4.7.0_1
+libopencv_img_hash.so.407 libopencv-4.7.0_1
+libopencv_line_descriptor.so.407 libopencv-4.7.0_1
+libopencv_saliency.so.407 libopencv-4.7.0_1
+libopencv_structured_light.so.407 libopencv-4.7.0_1
+libopencv_aruco.so.407 libopencv-4.7.0_1
+libopencv_bgsegm.so.407 libopencv-4.7.0_1
+libopencv_bioinspired.so.407 libopencv-4.7.0_1
+libopencv_ccalib.so.407 libopencv-4.7.0_1
+libopencv_face.so.407 libopencv-4.7.0_1
+libopencv_tracking.so.407 libopencv-4.7.0_1
+libopencv_xfeatures2d.so.407 libopencv-4.7.0_1
+libopencv_optflow.so.407 libopencv-4.7.0_1
+libopencv_ximgproc.so.407 libopencv-4.7.0_1
+libopencv_plot.so.407 libopencv-4.7.0_1
+libopencv_text.so.407 libopencv-4.7.0_1
+libopencv_ml.so.407 libopencv-4.7.0_1
+libopencv_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn.so.407 libopencv-4.7.0_1
+libopencv_shape.so.407 libopencv-4.7.0_1
+libopencv_stitching.so.407 libopencv-4.7.0_1
+libopencv_photo.so.407 libopencv-4.7.0_1
+libopencv_video.so.407 libopencv-4.7.0_1
+libopencv_calib3d.so.407 libopencv-4.7.0_1
+libopencv_features2d.so.407 libopencv-4.7.0_1
+libopencv_flann.so.407 libopencv-4.7.0_1
+libopencv_highgui.so.407 libopencv-4.7.0_1
+libopencv_videoio.so.407 libopencv-4.7.0_1
+libopencv_imgcodecs.so.407 libopencv-4.7.0_1
+libopencv_imgproc.so.407 libopencv-4.7.0_1
+libopencv_core.so.407 libopencv-4.7.0_1
+libopencv_superres.so.407 libopencv-4.7.0_1
+libopencv_videostab.so.407 libopencv-4.7.0_1
+libopencv_gapi.so.407 libopencv-4.7.0_1
+libopencv_xobjdetect.so.407 libopencv-4.7.0_1
+libopencv_datasets.so.407 libopencv-4.7.0_1
+libopencv_dnn_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn_superres.so.407 libopencv-4.7.0_1
+libopencv_dpm.so.407 libopencv-4.7.0_1
+libopencv_phase_unwrapping.so.407 libopencv-4.7.0_1
+libopencv_stereo.so.407 libopencv-4.7.0_1
+libopencv_rapid.so.407 libopencv-4.7.0_1
+libopencv_intensity_transform.so.407 libopencv-4.7.0_1
+libopencv_alphamat.so.407 libopencv-4.7.0_1
+libopencv_barcode.so.407 libopencv-4.7.0_1
+libopencv_mcc.so.407 libopencv-4.7.0_1
 libuniconf.so.4.6 wvstreams-4.6.1_20
 libwvbase.so.4.6 wvstreams-4.6.1_20
 libwvutils.so.4.6 wvstreams-4.6.1_20
diff --git a/srcpkgs/actiona/template b/srcpkgs/actiona/template
index cf5f0b7a2ae6..0d899311e6df 100644
--- a/srcpkgs/actiona/template
+++ b/srcpkgs/actiona/template
@@ -1,7 +1,7 @@
 # Template file for 'actiona'
 pkgname=actiona
 version=3.10.1
-revision=2
+revision=3
 build_style=qmake
 configure_args="PKGCONFIG_OPENCV=opencv4"
 hostmakedepends="pkg-config qt5-plugin-mysql qt5-qmake qt5-host-tools"
diff --git a/srcpkgs/digikam/template b/srcpkgs/digikam/template
index e8ec4961457b..0a8984db85bc 100644
--- a/srcpkgs/digikam/template
+++ b/srcpkgs/digikam/template
@@ -1,7 +1,7 @@
 # Template file for 'digikam'
 pkgname=digikam
 version=7.10.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext pkg-config bison flex qt5-qmake
diff --git a/srcpkgs/gmic/template b/srcpkgs/gmic/template
index 8e3b80047f26..43c6e0672a2b 100644
--- a/srcpkgs/gmic/template
+++ b/srcpkgs/gmic/template
@@ -1,7 +1,7 @@
 # Template file for 'gmic'
 pkgname=gmic
 version=3.1.6
-revision=1
+revision=2
 _zart_hash=34ebf6cce0bafb98abe57cec83c4a02cd1abeca0
 create_wrksrc=yes
 build_wrksrc="src"
diff --git a/srcpkgs/goldendict/patches/ffmpeg4.patch b/srcpkgs/goldendict/patches/ffmpeg4.patch
deleted file mode 100644
index f045fa27f54b..000000000000
--- a/srcpkgs/goldendict/patches/ffmpeg4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ffmpegaudio.cc.orig 2018-05-09 22:16:13.480659958 +0200
-+++ b/ffmpegaudio.cc      2018-05-09 22:16:50.748322790 +0200
-@@ -143,7 +143,7 @@
-     return false;
-   }
-
--  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
-+  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
-   if ( !avioBuffer )
-   {
-     errorString = QObject::tr( "av_malloc() failed." );
-@@ -380,7 +380,7 @@
-   }
-
-   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
--       codecContext_->codec->capabilities & CODEC_CAP_DELAY )
-+       codecContext_->codec->capabilities & AV_CODEC_CAP_DELAY )
-   {
-     av_init_packet( &packet );
-     int gotFrame = 0;
-
diff --git a/srcpkgs/nomacs/template b/srcpkgs/nomacs/template
index 895e83071a8a..ce4e7f7093da 100644
--- a/srcpkgs/nomacs/template
+++ b/srcpkgs/nomacs/template
@@ -1,7 +1,7 @@
 # Template file for 'nomacs'
 pkgname=nomacs
 version=3.16.224
-revision=3
+revision=4
 build_wrksrc=ImageLounge
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_TRANSLATIONS=1
diff --git a/srcpkgs/opencv/template b/srcpkgs/opencv/template
index a09b8dd0d449..41f3183f1582 100644
--- a/srcpkgs/opencv/template
+++ b/srcpkgs/opencv/template
@@ -1,7 +1,7 @@
 # Template file for 'opencv'
 pkgname=opencv
-version=4.6.0
-revision=3
+version=4.7.0
+revision=1
 create_wrksrc=yes
 build_wrksrc=${pkgname}-${version}
 build_style=cmake
@@ -24,8 +24,8 @@ homepage="https://opencv.org"
 changelog="https://github.com/opencv/opencv/wiki/ChangeLog"
 distfiles="https://github.com/opencv/opencv/archive/${version}.tar.gz
  https://github.com/opencv/opencv_contrib/archive/${version}.tar.gz>contrib.tar.gz"
-checksum="1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
- 1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7"
+checksum="8df0079cdbe179748a18d44731af62a245a45ebf5085223dc03133954c662973
+ 42df840cf9055e59d0e22c249cfb19f04743e1bdad113d31b1573d3934d62584"
 patch_args="-Np1 -d ${build_wrksrc}"
 # tests hang indenfinitely, even with test data included
 make_check=no
diff --git a/srcpkgs/qimgv/template b/srcpkgs/qimgv/template
index 7eb30db33992..dd341dfe1bfc 100644
--- a/srcpkgs/qimgv/template
+++ b/srcpkgs/qimgv/template
@@ -1,7 +1,7 @@
 # Template file for 'qimgv'
 pkgname=qimgv
 version=1.0.2
-revision=2
+revision=3
 build_style=cmake
 configure_args="$(vopt_if video -DVIDEO_SUPPORT=ON -DVIDEO_SUPPORT=OFF)
  $(vopt_if scale -DOPENCV_SUPPORT=ON -DOPENCV_SUPPORT=OFF)
diff --git a/srcpkgs/retroshare/template b/srcpkgs/retroshare/template
index 8a0786c21a08..72023fa98b75 100644
--- a/srcpkgs/retroshare/template
+++ b/srcpkgs/retroshare/template
@@ -1,7 +1,7 @@
 # Template file for 'retroshare'
 pkgname=retroshare
 version=0.6.6
-revision=2
+revision=4
 build_style=qmake
 #XXX broadcast feature requires an ancient udp-discovery-cpp which either needs
 # to be fetched+patched (FTBFS) here or packaged :/
diff --git a/srcpkgs/siril/template b/srcpkgs/siril/template
index e06aa5d0559c..84332f79d060 100644
--- a/srcpkgs/siril/template
+++ b/srcpkgs/siril/template
@@ -1,7 +1,7 @@
 # Template file for 'siril'
 pkgname=siril
 version=0.9.12
-revision=8
+revision=10
 build_style=gnu-configure
 hostmakedepends="pkg-config intltool autoconf automake gettext-devel"
 makedepends="fftw-devel libconfig-devel libopencv-devel libffms2-devel
diff --git a/srcpkgs/waifu2x-converter-cpp/template b/srcpkgs/waifu2x-converter-cpp/template
index 8c095d0d7bab..aa52d8c981a8 100644
--- a/srcpkgs/waifu2x-converter-cpp/template
+++ b/srcpkgs/waifu2x-converter-cpp/template
@@ -1,7 +1,7 @@
 # Template file for 'waifu2x-converter-cpp'
 pkgname=waifu2x-converter-cpp
 version=5.2.4
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DINSTALL_MODELS=ON"
 hostmakedepends="pkg-config"

From deb1b4d1f9786d58c3fad3807b9cb7a1a46b119c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 18:07:58 -0400
Subject: [PATCH 3/4] ffmpeg4 bumps

---
 srcpkgs/osg/template      | 4 ++--
 srcpkgs/vlc/template      | 4 ++--
 srcpkgs/xine-lib/template | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index 1a031448b3cf..755793f7e11b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,14 +1,14 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms
 configure_args="-DLIB_POSTFIX="
 hostmakedepends="pkg-config xrandr"
 makedepends="MesaLib-devel gtkglext-devel libcurl-devel giflib-devel librsvg-devel
- jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg-devel xine-lib-devel
+ jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg4-devel xine-lib-devel
  SDL2-devel gst-plugins-base1-devel
  $(vopt_if openexr libopenexr-devel)
  $(vopt_if poppler poppler-glib-devel)
diff --git a/srcpkgs/vlc/template b/srcpkgs/vlc/template
index 210762b0a7e2..855ca5238662 100644
--- a/srcpkgs/vlc/template
+++ b/srcpkgs/vlc/template
@@ -1,7 +1,7 @@
 # Template file for 'vlc'
 pkgname=vlc
 version=3.0.18
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-gme --disable-libtar --enable-jack
  --enable-live555 --disable-fluidsynth --enable-dvdread
@@ -25,7 +25,7 @@ lib32disabled=yes
 hostmakedepends="automake libtool pkg-config flex gettext libgcrypt-devel
  live555-devel gettext-devel $(vopt_if lua lua52) $(vopt_if chromecast protobuf)"
 makedepends="
- avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg-devel freefont-ttf
+ avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg4-devel freefont-ttf
  gnutls-devel jack-devel liba52-devel libass-devel libbluray-devel
  libcdio-devel libdca-devel libdvbpsi-devel libdvdnav-devel libmad-devel
  libmatroska-devel libmodplug-devel libmpcdec-devel libmpeg2-devel
diff --git a/srcpkgs/xine-lib/template b/srcpkgs/xine-lib/template
index f713eff49b07..ed6194c17d11 100644
--- a/srcpkgs/xine-lib/template
+++ b/srcpkgs/xine-lib/template
@@ -1,6 +1,6 @@
 # Template file for 'xine-lib'
 pkgname=xine-lib
-version=1.2.12
+version=1.2.13
 revision=1
 build_style=gnu-configure
 configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
@@ -8,7 +8,7 @@ configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
 hostmakedepends="automake gettext-devel libtool pkg-config perl"
 makedepends="
  zlib-devel alsa-lib-devel libxcb-devel libSM-devel libXext-devel libXv-devel
- libXvMC-devel liba52-devel libmad-devel ffmpeg-devel pulseaudio-devel
+ libXvMC-devel liba52-devel libmad-devel ffmpeg4-devel pulseaudio-devel
  jack-devel samba-devel libflac-devel libmodplug-devel libmpcdec-devel
  speex-devel libtheora-devel libvorbis-devel libdca-devel faad2-devel
  libcdio-devel libbluray-devel aalib-devel libcaca-devel libXinerama-devel
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="http://www.xine-project.org"
 changelog="https://sourceforge.net/projects/xine/files/xine-lib/${version}/README.txt/view"
 distfiles="${SOURCEFORGE_SITE}/xine/${pkgname}-${version}.tar.xz"
-checksum=d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098
+checksum=5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f
 
 case "$XBPS_TARGET_MACHINE" in
 	i686-musl)

From 93dd90829debdd1b032a8fcf8c2d59bc611d5dff Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 18:08:05 -0400
Subject: [PATCH 4/4] ffmpeg5 bumps

---
 srcpkgs/QMPlay2/template                      |   2 +-
 srcpkgs/alsa-plugins/template                 |   2 +-
 srcpkgs/arcan/template                        |   2 +-
 srcpkgs/attract/template                      |   2 +-
 srcpkgs/aubio/patches/ffmpeg5.patch           |  37 ++
 srcpkgs/aubio/template                        |   2 +-
 .../audacious-plugins/patches/ffmpeg5.patch   |  43 ++
 srcpkgs/audacious-plugins/template            |   2 +-
 srcpkgs/audacity/template                     |   2 +-
 srcpkgs/avidemux/template                     |   2 +-
 srcpkgs/baresip/template                      |   2 +-
 srcpkgs/blender/template                      |   2 +-
 srcpkgs/cantata/template                      |   2 +-
 srcpkgs/ccextractor/template                  |   2 +-
 srcpkgs/chromaprint/patches/ffmpeg5.patch     | 569 ++++++++++++++++++
 srcpkgs/chromaprint/template                  |   2 +-
 srcpkgs/chromium/template                     |   2 +-
 srcpkgs/cmus/template                         |   2 +-
 srcpkgs/cyanrip/template                      |   2 +-
 srcpkgs/deadbeef/template                     |   2 +-
 srcpkgs/dolphin-emu/template                  |   2 +-
 srcpkgs/droidcam-obs-plugin/template          |   2 +-
 srcpkgs/droidcam/template                     |   2 +-
 srcpkgs/electron19/template                   |   2 +-
 srcpkgs/ffmpeg/template                       | 166 +++--
 srcpkgs/ffmpeg4/template                      |  42 +-
 srcpkgs/ffmpegthumbnailer/template            |   2 +-
 srcpkgs/ffmpegthumbs/template                 |   2 +-
 srcpkgs/ffms2/patches/ffmpeg5.patch           | 419 +++++++++++++
 srcpkgs/ffms2/template                        |   2 +-
 srcpkgs/freerdp/template                      |   2 +-
 srcpkgs/gerbera/template                      |   2 +-
 srcpkgs/goldendict/patches/ffmpeg5-1.patch    | 232 +++++++
 srcpkgs/goldendict/patches/ffmpeg5-2.patch    |  33 +
 srcpkgs/goldendict/patches/ffmpeg5-3.patch    |  25 +
 srcpkgs/goldendict/template                   |   2 +-
 srcpkgs/gst-libav/template                    |   2 +-
 srcpkgs/gst-plugins-bad1/template             |   2 +-
 srcpkgs/gst-rtsp-server/template              |   2 +-
 srcpkgs/gtk4/template                         |   2 +-
 srcpkgs/guvcview/template                     |   2 +-
 srcpkgs/handbrake/template                    |   2 +-
 srcpkgs/hedgewars/template                    |   2 +-
 srcpkgs/idjc/template                         |   2 +-
 srcpkgs/kfilemetadata5/template               |   2 +-
 srcpkgs/kid3/template                         |   2 +-
 srcpkgs/kodi/template                         |   2 +-
 srcpkgs/kpipewire/template                    |   2 +-
 srcpkgs/libavresample                         |   2 +-
 srcpkgs/libextractor/template                 |   2 +-
 srcpkgs/libopenal/template                    |   2 +-
 srcpkgs/libopenshot/template                  |   2 +-
 srcpkgs/loudgain/template                     |   2 +-
 srcpkgs/mediastreamer/template                |   2 +-
 srcpkgs/mgba/patches/ffmpeg5.patch            | 117 ++++
 srcpkgs/mgba/template                         |   2 +-
 srcpkgs/minidlna/template                     |   2 +-
 srcpkgs/mixxx/template                        |   2 +-
 srcpkgs/mlt/template                          |   2 +-
 srcpkgs/mlt7/template                         |   2 +-
 srcpkgs/moc/template                          |   2 +-
 srcpkgs/motion/template                       |   2 +-
 srcpkgs/mpd/template                          |   2 +-
 srcpkgs/mpv/template                          |   2 +-
 srcpkgs/musikcube/template                    |   2 +-
 srcpkgs/notcurses/template                    |   2 +-
 srcpkgs/obs/template                          |   2 +-
 srcpkgs/olive/template                        |   2 +-
 srcpkgs/omxplayer/template                    |   2 +-
 srcpkgs/openimageio/template                  |   2 +-
 srcpkgs/openmw/template                       |   2 +-
 srcpkgs/openshot/template                     |   2 +-
 srcpkgs/opentoonz/template                    |   2 +-
 srcpkgs/pianobar/template                     |   2 +-
 srcpkgs/ppsspp/template                       |   2 +-
 srcpkgs/pqiv/template                         |   2 +-
 srcpkgs/qmmp/template                         |   2 +-
 srcpkgs/qt5-webengine/template                |   2 +-
 srcpkgs/qt5/template                          |   2 +-
 srcpkgs/qt6-multimedia/template               |   2 +-
 srcpkgs/qt6-webengine/template                |   2 +-
 srcpkgs/qtav/template                         |   2 +-
 srcpkgs/qtox/patches/ffmpeg5.patch            |  79 +++
 srcpkgs/qtox/template                         |   2 +-
 srcpkgs/retroarch/template                    |   2 +-
 srcpkgs/scrcpy/template                       |   2 +-
 srcpkgs/spek-alternative/template             |   2 +-
 srcpkgs/ssr/template                          |   2 +-
 srcpkgs/sumo/template                         |   2 +-
 srcpkgs/synfig/template                       |   2 +-
 srcpkgs/telegram-desktop/template             |   2 +-
 srcpkgs/tg_owt/template                       |   2 +-
 srcpkgs/timg/template                         |   2 +-
 srcpkgs/tracker-miners/template               |   2 +-
 srcpkgs/tvheadend/template                    |   2 +-
 srcpkgs/unpaper/template                      |   2 +-
 srcpkgs/vba-m/template                        |   2 +-
 srcpkgs/vice/template                         |   2 +-
 srcpkgs/waypipe/template                      |   2 +-
 srcpkgs/wf-recorder/template                  |   2 +-
 srcpkgs/xpra/template                         |   2 +-
 101 files changed, 1717 insertions(+), 225 deletions(-)
 create mode 100644 srcpkgs/aubio/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/audacious-plugins/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/chromaprint/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/ffms2/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-1.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-2.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-3.patch
 create mode 100644 srcpkgs/mgba/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/qtox/patches/ffmpeg5.patch

diff --git a/srcpkgs/QMPlay2/template b/srcpkgs/QMPlay2/template
index ad73cbb01bae..55284c051161 100644
--- a/srcpkgs/QMPlay2/template
+++ b/srcpkgs/QMPlay2/template
@@ -1,7 +1,7 @@
 # Template file for 'QMPlay2'
 pkgname=QMPlay2
 version=23.02.05
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="alsa-lib-devel ffmpeg-devel libass-devel libcdio-devel libgme-devel
diff --git a/srcpkgs/alsa-plugins/template b/srcpkgs/alsa-plugins/template
index 0bfa6d9fd264..a5708a7d82a8 100644
--- a/srcpkgs/alsa-plugins/template
+++ b/srcpkgs/alsa-plugins/template
@@ -1,7 +1,7 @@
 # Template file for 'alsa-plugins'
 pkgname=alsa-plugins
 version=1.2.7.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-maemo-plugin"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/arcan/template b/srcpkgs/arcan/template
index 7be9652eccf3..ccc7df11ceac 100644
--- a/srcpkgs/arcan/template
+++ b/srcpkgs/arcan/template
@@ -2,7 +2,7 @@
 # !! keep synced with: acfgfs aclip aloadimage
 pkgname=arcan
 version=0.6.2.1
-revision=1
+revision=2
 create_wrksrc=yes
 build_wrksrc=arcan/src
 build_style=cmake
diff --git a/srcpkgs/attract/template b/srcpkgs/attract/template
index 26144e931a3c..24017d2bacc2 100644
--- a/srcpkgs/attract/template
+++ b/srcpkgs/attract/template
@@ -1,7 +1,7 @@
 # Template file for 'attract'
 pkgname=attract
 version=2.6.2
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="VERBOSE=1"
 make_use_env=yes
diff --git a/srcpkgs/aubio/patches/ffmpeg5.patch b/srcpkgs/aubio/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a2c8e11ecff0
--- /dev/null
+++ b/srcpkgs/aubio/patches/ffmpeg5.patch
@@ -0,0 +1,37 @@
+commit 35eee003f034a1a2097cd4557deb773eacb18f7b
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:11 2022 +0100
+
+    aubio: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/aubio/patches/ffmpeg-5.0.patch b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..aace41a6e6
+--- /dev/null
++++ b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,25 @@
++From 8a05420e5dd8c7b8b2447f82dc919765876511b3 Mon Sep 17 00:00:00 2001
++From: Paul Brossier <piem@piem.org>
++Date: Tue, 25 Jan 2022 18:30:27 +0100
++Subject: [PATCH] [source_avcodec] define FF_API_LAVF_AVCTX for libavcodec >
++ 59, thx @berolinux (closes gh-353)
++
++---
++ src/io/source_avcodec.c | 4 ++++
++ 1 file changed, 4 insertions(+)
++
++diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c
++index e0ae93b5..1421bd9a 100644
++--- a/src/io/source_avcodec.c
+++++ b/src/io/source_avcodec.c
++@@ -68,6 +68,10 @@
++ #define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
++ #endif
++ 
+++#if LIBAVCODEC_VERSION_MAJOR >= 59
+++#define FF_API_LAVF_AVCTX 1
+++#endif
+++
++ struct _aubio_source_avcodec_t {
++   uint_t hop_size;
++   uint_t samplerate;
diff --git a/srcpkgs/aubio/template b/srcpkgs/aubio/template
index ad1c4b256991..7d875cc02541 100644
--- a/srcpkgs/aubio/template
+++ b/srcpkgs/aubio/template
@@ -1,7 +1,7 @@
 # Template file for 'aubio'
 pkgname=aubio
 version=0.4.9
-revision=1
+revision=2
 build_style=waf3
 # XXX lash, pure and swig support.
 hostmakedepends="pkg-config txt2man"
diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg5.patch b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..4e5e34099d71
--- /dev/null
+++ b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
@@ -0,0 +1,43 @@
+commit 298aa371c56c2f52c25a33d9bdec4918b11cebdc
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:12 2022 +0100
+
+    audacious-plugins: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..617c11215b
+--- /dev/null
++++ b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,31 @@
++From f60beb400eeb1e4778bbfd738bc4a4ccef3de539 Mon Sep 17 00:00:00 2001
++From: John Lindgren <john@jlindgren.net>
++Date: Sat, 5 Mar 2022 12:05:34 -0500
++Subject: [PATCH] Fix build with FFmpeg 5.0
++
++---
++ src/ffaudio/ffaudio-core.cc | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/src/ffaudio/ffaudio-core.cc b/src/ffaudio/ffaudio-core.cc
++index 16dc63e3a..a2b95fd6c 100644
++--- a/src/ffaudio/ffaudio-core.cc
+++++ b/src/ffaudio/ffaudio-core.cc
++@@ -274,7 +274,7 @@ static AVInputFormat * get_format_by_content (const char * name, VFSFile & file)
++         AVProbeData d = {name, buf, filled};
++         score = target;
++ 
++-        f = av_probe_input_format2 (& d, true, & score);
+++        f = (AVInputFormat *) av_probe_input_format2 (& d, true, & score);
++         if (f)
++             break;
++ 
++@@ -347,7 +347,7 @@ static bool find_codec (AVFormatContext * c, CodecInfo * cinfo)
++ #endif
++         if (stream && stream->codecpar && stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
++         {
++-            AVCodec * codec = avcodec_find_decoder (stream->codecpar->codec_id);
+++            AVCodec * codec = (AVCodec *) avcodec_find_decoder (stream->codecpar->codec_id);
++ 
++             if (codec)
++             {
diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template
index 910ec0d1891f..def0678bc611 100644
--- a/srcpkgs/audacious-plugins/template
+++ b/srcpkgs/audacious-plugins/template
@@ -2,7 +2,7 @@
 #Keep in sync with audacious!
 pkgname=audacious-plugins
 version=4.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="$(vopt_enable gtk) $(vopt_enable qt)"
 hostmakedepends="gettext pkg-config glib-devel"
diff --git a/srcpkgs/audacity/template b/srcpkgs/audacity/template
index d509c0a89407..395f43db8185 100644
--- a/srcpkgs/audacity/template
+++ b/srcpkgs/audacity/template
@@ -1,7 +1,7 @@
 # Template file for 'audacity'
 pkgname=audacity
 version=2.4.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--with-ffmpeg=system --with-libsndfile=system --with-expat=system
  --with-libsoxr=system --with-lame=system --with-lv2=system ac_cv_path_WX_CONFIG=wx-config-gtk3"
diff --git a/srcpkgs/avidemux/template b/srcpkgs/avidemux/template
index 253a0243e225..557285982d2b 100644
--- a/srcpkgs/avidemux/template
+++ b/srcpkgs/avidemux/template
@@ -1,7 +1,7 @@
 # Template file for 'avidemux'
 pkgname=avidemux
 version=2.8.0
-revision=2
+revision=3
 # Can't be compiled for aarch64, arm* or mips*
 archs="x86_64* i686*"
 hostmakedepends="cmake pkg-config qt5-host-tools qt5-devel tar yasm"
diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index f1bd1817048b..b21e22334316 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=2.10.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel
diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index a3255cddbc95..4ec73e05acf5 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
 # Template file for 'blender'
 pkgname=blender
 version=3.4.1
-revision=1
+revision=2
 archs="x86_64* ppc64*"
 build_style="cmake"
 pycompile_dirs="/usr/share/blender/${version%.*}/scripts"
diff --git a/srcpkgs/cantata/template b/srcpkgs/cantata/template
index 4b417d80d5c2..8a90aaa4c07a 100644
--- a/srcpkgs/cantata/template
+++ b/srcpkgs/cantata/template
@@ -1,7 +1,7 @@
 # Template file for 'cantata'
 pkgname=cantata
 version=2.5.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools qt5-tools"
 makedepends="qt5-devel qt5-tools-devel qt5-svg-devel qt5-xmlpatterns-devel
diff --git a/srcpkgs/ccextractor/template b/srcpkgs/ccextractor/template
index 9abcd82852b2..7fe2ba4f27b6 100644
--- a/srcpkgs/ccextractor/template
+++ b/srcpkgs/ccextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'ccextractor'
 pkgname=ccextractor
 version=0.93
-revision=1
+revision=2
 build_wrksrc="linux"
 build_style=gnu-configure
 configure_args="--enable-ocr --enable-hardsubx"
diff --git a/srcpkgs/chromaprint/patches/ffmpeg5.patch b/srcpkgs/chromaprint/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a9fd307a23c8
--- /dev/null
+++ b/srcpkgs/chromaprint/patches/ffmpeg5.patch
@@ -0,0 +1,569 @@
+From 8ccad6937177b1b92e40ab8f4447ea27bac009a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
+Date: Fri, 4 Nov 2022 21:47:38 +0100
+Subject: [PATCH] Use FFmpeg 5.x (#120)
+
+* Use FFmpeg 5.1.2 for CI builds
+
+* Build on Ubuntu 20.04
+
+* Upgrade code to FFmpeg 5.x APIs
+
+* Only set FFmpeg include dirs if building tools
+
+* No longer needed
+
+* Use ubuntu 20.04
+---
+ .github/workflows/build.yml                   |   6 +-
+ CMakeLists.txt                                |  16 --
+ package/build.sh                              |   4 +-
+ src/audio/ffmpeg_audio_processor.h            |   2 -
+ src/audio/ffmpeg_audio_processor_avresample.h |  72 -------
+ src/audio/ffmpeg_audio_processor_swresample.h |  18 +-
+ src/audio/ffmpeg_audio_reader.h               | 197 +++++++++---------
+ tests/CMakeLists.txt                          |   6 +
+ 8 files changed, 122 insertions(+), 199 deletions(-)
+ delete mode 100644 src/audio/ffmpeg_audio_processor_avresample.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8d6a32..4da2405 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -84,9 +84,6 @@ find_package(FFmpeg)
+ if(FFMPEG_LIBRARIES)
+ 	cmake_push_check_state(RESET)
+ 	set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lm)
+-	check_function_exists(av_packet_unref HAVE_AV_PACKET_UNREF)
+-	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
+-	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
+ 	cmake_pop_check_state()
+ endif()
+
+@@ -163,14 +160,11 @@ message(STATUS "Using ${FFT_LIB} for FFT calculations")
+ if(NOT AUDIO_PROCESSOR_LIB)
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+ 		set(AUDIO_PROCESSOR_LIB "swresample")
+-	elseif(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(AUDIO_PROCESSOR_LIB "avresample")
+ 	endif()
+ endif()
+
+ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE OFF)
+ 		set(USE_SWRESAMPLE ON)
+ 		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+ 		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS})
+@@ -178,16 +172,6 @@ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+ 	endif()
+ 	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+-elseif(AUDIO_PROCESSOR_LIB STREQUAL "avresample")
+-	if(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE ON)
+-		set(USE_SWRESAMPLE OFF)
+-		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBAVRESAMPLE_LIBRARIES})
+-		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS})
+-	else()
+-		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+-	endif()
+-	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+ else()
+ 	message(STATUS "Building without audio conversion support, please install FFmpeg with libswresample")
+ endif()
+diff --git a/package/build.sh b/package/build.sh
+index da631ae..b41d36e 100755
+--- a/package/build.sh
++++ b/package/build.sh
+@@ -7,8 +7,8 @@ set -eux
+
+ BASE_DIR=$(cd $(dirname $0)/.. && pwd)
+
+-FFMPEG_VERSION=4.4.1
+-FFMPEG_BUILD_TAG=v4.4.1-1
++FFMPEG_VERSION=5.1.2
++FFMPEG_BUILD_TAG=v${FFMPEG_VERSION}-1
+
+ TMP_BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX)
+ trap 'rm -rf $TMP_BUILD_DIR' EXIT
+diff --git a/src/audio/ffmpeg_audio_processor.h b/src/audio/ffmpeg_audio_processor.h
+index 7628fc7..39f4f6d 100644
+--- a/src/audio/ffmpeg_audio_processor.h
++++ b/src/audio/ffmpeg_audio_processor.h
+@@ -10,8 +10,6 @@
+
+ #if defined(USE_SWRESAMPLE)
+ #include "audio/ffmpeg_audio_processor_swresample.h"
+-#elif defined(USE_AVRESAMPLE)
+-#include "audio/ffmpeg_audio_processor_avresample.h"
+ #else
+ #error "no audio processing library"
+ #endif
+diff --git a/src/audio/ffmpeg_audio_processor_avresample.h b/src/audio/ffmpeg_audio_processor_avresample.h
+deleted file mode 100644
+index bd85f92..0000000
+--- a/src/audio/ffmpeg_audio_processor_avresample.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-// Copyright (C) 2016  Lukas Lalinsky
+-// Distributed under the MIT license, see the LICENSE file for details.
+-
+-#ifndef CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-#define CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-
+-extern "C" {
+-#include <libavresample/avresample.h>
+-}
+-
+-namespace chromaprint {
+-
+-class FFmpegAudioProcessor {
+-public:
+-	FFmpegAudioProcessor() {
+-		m_resample_ctx = avresample_alloc_context();
+-	}
+-
+-	~FFmpegAudioProcessor() {
+-		avresample_free(&m_resample_ctx);
+-	}
+-
+-	void SetCompatibleMode() {
+-		av_opt_set_int(m_resample_ctx, "filter_size", 16, 0);
+-		av_opt_set_int(m_resample_ctx, "phase_shift", 8, 0);
+-		av_opt_set_int(m_resample_ctx, "linear_interp", 1, 0);
+-		av_opt_set_double(m_resample_ctx, "cutoff", 0.8, 0);
+-	}
+-
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "in_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_rate", sample_rate, 0);
+-	}
+-
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "out_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_rate, 0);
+-	}
+-
+-	int Init() {
+-		return avresample_open(m_resample_ctx);
+-	}
+-
+-	int Convert(uint8_t **out, int out_count, const uint8_t **in, int in_count) {
+-		return avresample_convert(m_resample_ctx, out, 0, out_count, (uint8_t **) in, 0, in_count);
+-	}
+-
+-	int Flush(uint8_t **out, int out_count) {
+-		return avresample_read(m_resample_ctx, out, out_count);
+-	}
+-
+-private:
+-	AVAudioResampleContext *m_resample_ctx = nullptr;
+-};
+-
+-}; // namespace chromaprint
+-
+-#endif
+diff --git a/src/audio/ffmpeg_audio_processor_swresample.h b/src/audio/ffmpeg_audio_processor_swresample.h
+index b86266b..b1d4bea 100644
+--- a/src/audio/ffmpeg_audio_processor_swresample.h
++++ b/src/audio/ffmpeg_audio_processor_swresample.h
+@@ -28,30 +28,28 @@ public:
+ 		av_opt_set_double(m_swr_ctx, "cutoff", 0.8, 0);
+ 	}
+
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "icl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "ich", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetInputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "isf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "in_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "isr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "in_sample_rate", sample_rate, 0);
+ 	}
+
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "ocl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "och", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "osf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "out_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "osr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "out_sample_rate", sample_rate, 0);
+ 	}
+
+ 	int Init() {
+diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h
+index 5550164..1c6b346 100644
+--- a/src/audio/ffmpeg_audio_reader.h
++++ b/src/audio/ffmpeg_audio_reader.h
+@@ -62,7 +62,7 @@ public:
+ 	bool Read(const int16_t **data, size_t *size);
+
+ 	bool IsOpen() const { return m_opened; }
+-	bool IsFinished() const { return m_finished && !m_got_frame; }
++	bool IsFinished() const { return !m_has_more_packets && !m_has_more_frames; }
+
+ 	std::string GetError() const { return m_error; }
+ 	int GetErrorCode() const { return m_error_code; }
+@@ -74,20 +74,19 @@ private:
+ 	uint8_t *m_convert_buffer[1] = { nullptr };
+ 	int m_convert_buffer_nb_samples = 0;
+
+-	AVInputFormat *m_input_fmt = nullptr;
++	const AVInputFormat *m_input_fmt = nullptr;
+ 	AVDictionary *m_input_opts = nullptr;
+
+ 	AVFormatContext *m_format_ctx = nullptr;
+ 	AVCodecContext *m_codec_ctx = nullptr;
+-	AVFrame *m_frame = nullptr;
+ 	int m_stream_index = -1;
+ 	std::string m_error;
+ 	int m_error_code = 0;
+-	bool m_finished = false;
+ 	bool m_opened = false;
+-	int m_got_frame = 0;
+-	AVPacket m_packet;
+-	AVPacket m_packet0;
++	bool m_has_more_packets = true;
++	bool m_has_more_frames = true;
++	AVPacket *m_packet = nullptr;
++	AVFrame *m_frame = nullptr;
+
+ 	int m_output_sample_rate = 0;
+ 	int m_output_channels = 0;
+@@ -98,19 +97,12 @@ private:
+
+ inline FFmpegAudioReader::FFmpegAudioReader() {
+ 	av_log_set_level(AV_LOG_QUIET);
+-
+-	av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
+ }
+
+ inline FFmpegAudioReader::~FFmpegAudioReader() {
+ 	Close();
+ 	av_dict_free(&m_input_opts);
+ 	av_freep(&m_convert_buffer[0]);
+-	av_packet_unref(&m_packet0);
+ }
+
+ inline bool FFmpegAudioReader::SetInputFormat(const char *name) {
+@@ -135,11 +127,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ 	Close();
+
+-    av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
++	m_packet = av_packet_alloc();
++	if (!m_packet) {
++		return false;
++	}
+
+ 	ret = avformat_open_input(&m_format_ctx, file_name.c_str(), m_input_fmt, &m_input_opts);
+ 	if (ret < 0) {
+@@ -153,26 +144,31 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		return false;
+ 	}
+
+-	AVCodec *codec;
++	const AVCodec *codec;
+ 	ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
+ 	if (ret < 0) {
+ 		SetError("Could not find any audio stream in the file", ret);
+ 		return false;
+ 	}
+ 	m_stream_index = ret;
++	auto stream = m_format_ctx->streams[m_stream_index];
+
+-	m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec;
++	m_codec_ctx = avcodec_alloc_context3(codec);
+ 	m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
+
++	ret = avcodec_parameters_to_context(m_codec_ctx, stream->codecpar);
++	if (ret < 0) {
++		SetError("Could not copy the stream parameters", ret);
++		return false;
++	}
++
+ 	ret = avcodec_open2(m_codec_ctx, codec, nullptr);
+ 	if (ret < 0) {
+ 		SetError("Could not open the codec", ret);
+ 		return false;
+ 	}
+
+-	if (!m_codec_ctx->channel_layout) {
+-		m_codec_ctx->channel_layout = av_get_default_channel_layout(m_codec_ctx->channels);
+-	}
++	av_dump_format(m_format_ctx, 0, "foo", 0);
+
+ 	m_frame = av_frame_alloc();
+ 	if (!m_frame) {
+@@ -183,19 +179,23 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		m_output_sample_rate = m_codec_ctx->sample_rate;
+ 	}
+
+-	if (!m_output_channels) {
+-		m_output_channels = m_codec_ctx->channels;
++	AVChannelLayout output_channel_layout;
++	if (m_output_channels) {
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
++	} else {
++		m_output_channels = m_codec_ctx->ch_layout.nb_channels;
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
+ 	}
+
+-	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
++	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
+ 		m_converter.reset(new FFmpegAudioProcessor());
+ 		m_converter->SetCompatibleMode();
+ 		m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
+ 		m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
+-		m_converter->SetInputChannelLayout(m_codec_ctx->channel_layout);
++		m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
+ 		m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
+ 		m_converter->SetOutputSampleRate(m_output_sample_rate);
+-		m_converter->SetOutputChannelLayout(av_get_default_channel_layout(m_output_channels));
++		m_converter->SetOutputChannelLayout(&output_channel_layout);
+ 		auto ret = m_converter->Init();
+ 		if (ret != 0) {
+ 			SetError("Could not create an audio converter instance", ret);
+@@ -203,10 +203,11 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		}
+ 	}
+
++	av_channel_layout_uninit(&output_channel_layout);
++
+ 	m_opened = true;
+-	m_finished = false;
+-	m_got_frame = 0;
+-	m_nb_packets = 0;
++	m_has_more_packets = true;
++	m_has_more_frames = true;
+ 	m_decode_error = 0;
+
+ 	return true;
+@@ -214,6 +215,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ inline void FFmpegAudioReader::Close() {
+ 	av_frame_free(&m_frame);
++	av_packet_free(&m_packet);
+
+ 	m_stream_index = -1;
+
+@@ -252,91 +254,98 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
+ 		return false;
+ 	}
+
++	*data = nullptr;
++	*size = 0;
++
+ 	int ret;
++	bool needs_packet = false;
+ 	while (true) {
+-		while (m_packet.size <= 0) {
+-			av_packet_unref(&m_packet0);
+-			av_init_packet(&m_packet);
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			ret = av_read_frame(m_format_ctx, &m_packet);
++		while (needs_packet && m_packet->size == 0) {
++			ret = av_read_frame(m_format_ctx, m_packet);
+ 			if (ret < 0) {
+ 				if (ret == AVERROR_EOF) {
+-					m_finished = true;
++					needs_packet = false;
++					m_has_more_packets = false;
+ 					break;
+-				} else {
++				}
++				SetError("Error reading from the audio source", ret);
++				return false;
++			}
++			if (m_packet->stream_index == m_stream_index) {
++				needs_packet = false;
++			} else {
++				av_packet_unref(m_packet);
++			}
++		}
++
++		if (m_packet->size != 0) {
++			ret = avcodec_send_packet(m_codec_ctx, m_packet);
++			if (ret < 0) {
++				if (ret != AVERROR(EAGAIN)) {
+ 					SetError("Error reading from the audio source", ret);
+ 					return false;
+ 				}
+-			}
+-			m_packet0 = m_packet;
+-			if (m_packet.stream_index != m_stream_index) {
+-				m_packet.data = nullptr;
+-				m_packet.size = 0;
+ 			} else {
+-				m_nb_packets++;
++				av_packet_unref(m_packet);
+ 			}
+ 		}
+
+-		ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet);
++		ret = avcodec_receive_frame(m_codec_ctx, m_frame);
+ 		if (ret < 0) {
+-			if (m_decode_error) {
+-				SetError("Error decoding audio frame", m_decode_error);
+-				return false;
++			if (ret == AVERROR_EOF) {
++				m_has_more_frames = false;
++			} else if (ret == AVERROR(EAGAIN)) {
++				if (m_has_more_packets) {
++					needs_packet = true;
++					continue;
++				} else {
++					m_has_more_frames = false;
++				}
+ 			}
+-			m_decode_error = ret;
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			continue;
++			SetError("Error decoding the audio source", ret);
++			return false;
+ 		}
+
+-		break;
+-	}
+-
+-	m_decode_error = 0;
+-
+-	const int decoded = std::min(ret, m_packet.size);
+-	m_packet.data += decoded;
+-	m_packet.size -= decoded;
+-
+-	if (m_got_frame) {
+-		if (m_converter) {
+-			if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
+-				int linsize;
+-				av_freep(&m_convert_buffer[0]);
+-				m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
+-				ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
+-				if (ret < 0) {
+-					SetError("Couldn't allocate audio converter buffer", ret);
++		if (m_frame->nb_samples > 0) {
++			if (m_converter) {
++				if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
++					int linsize;
++					av_freep(&m_convert_buffer[0]);
++					m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
++					ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
++					if (ret < 0) {
++						SetError("Couldn't allocate audio converter buffer", ret);
++						return false;
++					}
++				}
++				auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
++				if (nb_samples < 0) {
++					SetError("Couldn't convert audio", ret);
+ 					return false;
+ 				}
+-			}
+-			auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			}
+-			*data = (const int16_t *) m_convert_buffer[0];
+-			*size = nb_samples;
+-		} else {
+-			*data = (const int16_t *) m_frame->data[0];
+-			*size = m_frame->nb_samples;
+-		}
+-	} else {
+-		if (m_finished && m_converter) {
+-			auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			} else if (nb_samples > 0) {
+-				m_got_frame = 1;
+ 				*data = (const int16_t *) m_convert_buffer[0];
+ 				*size = nb_samples;
++			} else {
++				*data = (const int16_t *) m_frame->data[0];
++				*size = m_frame->nb_samples;
++			}
++		} else {
++			if (m_converter) {
++				if (IsFinished()) {
++					auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
++					if (nb_samples < 0) {
++						SetError("Couldn't convert audio", ret);
++						return false;
++					} else if (nb_samples > 0) {
++						*data = (const int16_t *) m_convert_buffer[0];
++						*size = nb_samples;
++					}
++				}
+ 			}
+ 		}
+-	}
+
+-	return true;
++		return true;
++	}
+ }
+
+ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index a2b517b..123e643 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -38,6 +38,12 @@ set(SRCS
+
+ if(BUILD_TOOLS)
+ 	set(SRCS ${SRCS} ../src/audio/ffmpeg_audio_reader_test.cpp)
++    include_directories(
++        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
++        ${AUDIO_PROCESSOR_INCLUDE_DIRS}
++    )
+ 	link_libraries(fpcalc_libs)
+ endif()
+
+-- 
+2.38.1
+
+
diff --git a/srcpkgs/chromaprint/template b/srcpkgs/chromaprint/template
index 7ef7838949f3..1f7bbc70a22c 100644
--- a/srcpkgs/chromaprint/template
+++ b/srcpkgs/chromaprint/template
@@ -1,7 +1,7 @@
 # Template file for 'chromaprint'
 pkgname=chromaprint
 version=1.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TOOLS=ON"
 make_check_target="check"
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 3c1c1caf3765..1f28cde5d3c1 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,7 +2,7 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=111.0.5563.64
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
  $(vopt_if clang "clang lld llvm12")
diff --git a/srcpkgs/cmus/template b/srcpkgs/cmus/template
index 0fcb424ce336..05b77d0fecae 100644
--- a/srcpkgs/cmus/template
+++ b/srcpkgs/cmus/template
@@ -1,7 +1,7 @@
 # Template file for 'cmus'
 pkgname=cmus
 version=2.10.0
-revision=1
+revision=2
 build_style=configure
 configure_args="prefix=/usr LD=$CC"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/cyanrip/template b/srcpkgs/cyanrip/template
index 9796e3461601..5db30e020d17 100644
--- a/srcpkgs/cyanrip/template
+++ b/srcpkgs/cyanrip/template
@@ -1,7 +1,7 @@
 # Template file for 'cyanrip'
 pkgname=cyanrip
 version=0.9.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="ffmpeg-devel libcdio-devel libcdio-paranoia-devel libcurl-devel libmusicbrainz5-devel"
diff --git a/srcpkgs/deadbeef/template b/srcpkgs/deadbeef/template
index b664bb1b9bd9..f0fcced864be 100644
--- a/srcpkgs/deadbeef/template
+++ b/srcpkgs/deadbeef/template
@@ -1,7 +1,7 @@
 # Template file for 'deadbeef'
 pkgname=deadbeef
 version=1.8.8
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-oss --disable-lfm --disable-notify --disable-gtk2"
diff --git a/srcpkgs/dolphin-emu/template b/srcpkgs/dolphin-emu/template
index 7ea197ceb2a8..7aeb0a5b645e 100644
--- a/srcpkgs/dolphin-emu/template
+++ b/srcpkgs/dolphin-emu/template
@@ -1,7 +1,7 @@
 # Template file for 'dolphin-emu'
 pkgname=dolphin-emu
 version=5.0.16101
-revision=1
+revision=2
 _dolphin_commit=8ecfa537a242de74d2e372e30d9d79b14584b2fb
 _mgba_commit=40d4c430fc36caeb7ea32fd39624947ed487d2f2
 #Version/hash pair can be found at https://dolphin-emu.org/download/
diff --git a/srcpkgs/droidcam-obs-plugin/template b/srcpkgs/droidcam-obs-plugin/template
index fc9c9bf6b9d5..fb0480754df4 100644
--- a/srcpkgs/droidcam-obs-plugin/template
+++ b/srcpkgs/droidcam-obs-plugin/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam-obs-plugin'
 pkgname=droidcam-obs-plugin
 version=2.0.1
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=yes
 make_build_args="ALLOW_STATIC=no"
diff --git a/srcpkgs/droidcam/template b/srcpkgs/droidcam/template
index 1c3f1b8b1fc6..32a9220b79a4 100644
--- a/srcpkgs/droidcam/template
+++ b/srcpkgs/droidcam/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam'
 pkgname=droidcam
 version=1.8.2
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="USBMUXD=-lusbmuxd-2.0 JPEG=-lturbojpeg"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/electron19/template b/srcpkgs/electron19/template
index 068136be7623..32ce301e730c 100644
--- a/srcpkgs/electron19/template
+++ b/srcpkgs/electron19/template
@@ -1,7 +1,7 @@
 # Template file for 'electron19'
 pkgname=electron19
 version=19.0.8
-revision=2
+revision=3
 _nodever=16.14.2
 _chromiumver=102.0.5005.125
 archs="x86_64* aarch64* ppc64le*"
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 38978c5085a3..c2c7284bbdc0 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -12,25 +12,31 @@ distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
 checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
-makedepends="chromaprint-devel libgcrypt-devel ladspa-sdk lcms2-devel libaom-devel
- alsa-lib-devel bzip2-devel libxcb-devel liblzma-devel SDL2-devel sndio-devel zlib-devel
- frei0r-plugins libcdio-paranoia-devel rubberband-devel libvidstab-devel x264-devel x265-devel
- xvidcore-devel fdk-aac-devel libtls-devel gmp-devel libass-devel libbluray-devel libcaca-devel
- celt-devel codec2-devel libdav1d-devel libdrm-devel fontconfig-devel freetype-devel
- fribidi-devel glslang-devel SPIRV-Tools-devel libgme-devel libgsm-devel jack-devel
- libmodplug-devel lame-devel libopencv4-devel libopenjpeg2-devel libopenmpt-devel opus-devel
- libplacebo-devel libpulseaudio rabbitmq-c-devel librist-devel librsvg-devel librtmp-devel
- snappy-devel libsoxr-devel speex-devel srt-devel libssh-devel libtheora-devel twolame-devel
- libvorbis-devel libvpx6-devel libwebp-devel libxml2-devel zimg-devel lilv-devel lv2
- libopenal-devel mesa openssl-devel vapoursynth-devel ocl-icd-devel libmysofa-devel vulkan-loader
- $(vopt_if vaapi libva-devel)
- $(vopt_if vdpau libvdpau-devel)
- $(vopt_if nvenc nv-codec-headers)
- $(vopt_if nvdec nv-codec-headers)
- $(vopt_if svtav1 libsvt-av1-devel)
-"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
 depends="ffplay>=${version}_${revision}"
-build_options="vaapi vdpau nvenc nvdec svtav1"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
@@ -46,6 +52,22 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
 do_configure() {
 	# Fix gcc on x86_64-musl only
 	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
@@ -76,47 +98,39 @@ do_configure() {
 		_args+=" --extra-libs=-latomic"
 	fi
 
-	./configure \
-		--prefix='/usr' \
-		--extra-cflags='-I/opt/cuda/include' \
-		--extra-ldflags='-L/opt/cuda/lib64' \
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
 		--disable-stripping \
-		--enable-shared --enable-static \
-		--enable-nonfree --enable-gpl \
-		--enable-version3 --enable-libxcb \
-		--enable-frei0r --enable-libcdio \
-		--enable-librubberband --enable-libvidstab \
-		--enable-libx264 --enable-libx265 --enable-libxvid \
-		--enable-libfdk-aac --enable-libtls --enable-gmp \
-		--enable-chromaprint --enable-gcrypt --enable-ladspa \
-		--enable-lcms2 --enable-libaom --enable-libass \
-		--enable-libbluray --enable-libcaca --enable-libcelt \
-		--enable-libcodec2 --enable-libdav1d --enable-libdrm \
-		--enable-libfontconfig --enable-libfreetype \
-		--enable-libfribidi --enable-libglslang \
-		--enable-libgme --enable-libgsm \
-		--enable-vapoursynth --enable-openssl --enable-opengl \
-		--enable-openal --enable-lv2 --enable-libzimg \
-		--enable-libxml2 --enable-libwebp --enable-libvorbis \
-		--enable-libtwolame --enable-libtheora --enable-libssh \
-		--enable-libsrt --enable-libspeex --enable-libsoxr \
-		--enable-librtmp --enable-librsvg --enable-librist \
-		--enable-librabbitmq --enable-libpulse --enable-libplacebo \
-		--enable-libopus --enable-libopenmpt --enable-libopenjpeg \
-		--enable-libmp3lame --enable-libmodplug --enable-libjack \
-		--enable-opencl --enable-libvpx --enable-libmysofa \
-		$(vopt_enable vaapi) \
-		$(vopt_enable vdpau) \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
 		$(vopt_if nvenc '--enable-nvenc') \
-		$(vopt_if nvdec '--enable-nvdec') \
-		$(vopt_enable svtav1 libsvtav1)
+		$(vopt_if nvdec '--enable-nvdec')
 }
-
 do_build() {
 	make ${makejobs}
 	make doc/ff{mpeg,play}.1
 }
-
 do_install() {
 	make DESTDIR=${DESTDIR} install install-man
 }
@@ -133,6 +147,10 @@ libavdevice_package() {
 		vmove "usr/lib/libavdevice.so.*"
 	}
 }
+libavresample_package() {
+  short_desc="package deprecated, removal needed"
+  build_style=meta
+}
 libavformat_package() {
 	short_desc="FFmpeg file format library"
 	pkg_install() {
@@ -180,47 +198,7 @@ ffmpeg-devel_package() {
 		libswscale>=${version}_${revision}
 		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
-	alternatives="
-	 ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec5.3
-	 ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice5.3
-	 ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter5.3
-	 ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat5.3
-	 ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil5.3
-	 ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample5.3
-	 ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale5.3
-	 ffmpeg-devel:libavcodec:/usr/include/libavcodec5
-	 ffmpeg-devel:libavdevice:/usr/include/libavdevice5
-	 ffmpeg-devel:libavformat:/usr/include/libavformat5
-	 ffmpeg-devel:libavutil:/usr/include/libavutil5
-	 ffmpeg-devel:libavpostproc:/usr/include/libavpostproc5
-	 ffmpeg-devel:libswresample:/usr/include/libswresample5
-	 ffmpeg-devel:libswcaale:/usr/include/libswscale5
-	 ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec5.pc
-	 ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice5.pc
-	 ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter5.pc
-	 ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat5.pc
-	 ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil5.pc
-	 ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc5.pc
-	 ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample5.pc
-	 ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale5.pc
-	 ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec5.a
-	 ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec5.so
-	 ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice5.a
-	 ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice5.so
-	 ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter5.a
-	 ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter5.so
-	 ffmpeg-devel:libavformat.a:/usr/lib/libavformat5.a
-	 ffmpeg-devel:libavformat.so:/usr/lib/libavformat5.so
-	 ffmpeg-devel:libavutil.a:/usr/lib/libavutil5.a
-	 ffmpeg-devel:libavutil.so:/usr/lib/libavutil5.so
-	 ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc5.a
-	 ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc5.so
-	 ffmpeg-devel:libswresample.a:/usr/lib/libswresample5.a
-	 ffmpeg-devel:libswresample.so:/usr/lib/libswresample5.so
-	 ffmpeg-devel:libswscale.a:/usr/lib/libswscale5.a
-	 ffmpeg-devel:libswscale.so:/usr/lib/libswscale5.so
-	 ffmpeg-devel:ffmpeg:/usr/share/ffmpeg5
-	"
+	conflicts="ffmpeg4-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
@@ -231,7 +209,7 @@ ffmpeg-devel_package() {
 	}
 }
 ffplay_package() {
-	short_desc="Simple media player using FFmpeg and SDL2"
+	short_desc="Simple video player using FFmpeg and SDL2"
 	pkg_install() {
 		vmove usr/bin/ffplay
 		vmove "usr/share/man/man1/ffplay*"
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
index cd9154978b3e..d7d84eb59ed7 100644
--- a/srcpkgs/ffmpeg4/template
+++ b/srcpkgs/ffmpeg4/template
@@ -202,47 +202,7 @@ ffmpeg4-devel_package() {
 		libswresample4>=${version}_${revision}
 		libavresample4>=${version}_${revision}"
 	short_desc+=" - development files"
-	alternatives="
-		ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec4.3
-		ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice4.3
-		ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter4.3
-		ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat4.3
-		ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil4.3
-		ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample4.3
-		ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale4.3
-		ffmpeg-devel:libavcodec:/usr/include/libavcodec4
-		ffmpeg-devel:libavdevice:/usr/include/libavdevice4
-		ffmpeg-devel:libavformat:/usr/include/libavformat4
-		ffmpeg-devel:libavutil:/usr/include/libavutil4
-		ffmpeg-devel:libavpostproc:/usr/include/libavpostproc4
-		ffmpeg-devel:libswresample:/usr/include/libswresample4
-		ffmpeg-devel:libswcaale:/usr/include/libswscale4
-		ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec4.pc
-		ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice4.pc
-		ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter4.pc
-		ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat4.pc
-		ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil4.pc
-		ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc4.pc
-		ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample4.pc
-		ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale4.pc
-		ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec4.a
-		ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec4.so
-		ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice4.a
-		ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice4.so
-		ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter4.a
-		ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter4.so
-		ffmpeg-devel:libavformat.a:/usr/lib/libavformat4.a
-		ffmpeg-devel:libavformat.so:/usr/lib/libavformat4.so
-		ffmpeg-devel:libavutil.a:/usr/lib/libavutil4.a
-		ffmpeg-devel:libavutil.so:/usr/lib/libavutil4.so
-		ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc4.a
-		ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc4.so
-		ffmpeg-devel:libswresample.a:/usr/lib/libswresample4.a
-		ffmpeg-devel:libswresample.so:/usr/lib/libswresample4.so
-		ffmpeg-devel:libswscale.a:/usr/lib/libswscale4.a
-		ffmpeg-devel:libswscale.so:/usr/lib/libswscale4.so
-		ffmpeg-devel:ffmpeg:/usr/share/ffmpeg4
-	"
+	conflicts="ffmpeg-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
diff --git a/srcpkgs/ffmpegthumbnailer/template b/srcpkgs/ffmpegthumbnailer/template
index 039eea7622b3..27bba7e685a0 100644
--- a/srcpkgs/ffmpegthumbnailer/template
+++ b/srcpkgs/ffmpegthumbnailer/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbnailer'
 pkgname=ffmpegthumbnailer
 version=2.2.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libpng-devel libjpeg-turbo-devel ffmpeg-devel"
diff --git a/srcpkgs/ffmpegthumbs/template b/srcpkgs/ffmpegthumbs/template
index 5f0b9414dada..11b88193528f 100644
--- a/srcpkgs/ffmpegthumbs/template
+++ b/srcpkgs/ffmpegthumbs/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbs'
 pkgname=ffmpegthumbs
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules kcoreaddons kconfig-devel
  pkg-config qt5-host-tools qt5-qmake gettext"
diff --git a/srcpkgs/ffms2/patches/ffmpeg5.patch b/srcpkgs/ffms2/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..0766db172473
--- /dev/null
+++ b/srcpkgs/ffms2/patches/ffmpeg5.patch
@@ -0,0 +1,419 @@
+From 28fc493fda2fa2064afeeb0a5d85fdc42db05dcf Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:12:41 +0100
+Subject: [PATCH 1/3] all: Update AVPacket API usage
+
+AVPackets must all be on the heap now, since it is no longer
+part of the libav* ABI.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 16 ++++++----
+ src/core/indexing.cpp    | 63 ++++++++++++++++++++++------------------
+ src/core/indexing.h      |  4 +--
+ src/core/utils.cpp       |  6 ----
+ src/core/utils.h         |  1 -
+ src/core/videosource.cpp | 30 ++++++++++---------
+ 6 files changed, 64 insertions(+), 56 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index 37cf9aeef..e4ce97cdb 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -285,10 +285,15 @@ FFMS_AudioSource::AudioBlock *FFMS_AudioSource::CacheBlock(CacheIterator &pos) {
+ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     CurrentFrame = &Frames[PacketNumber];
+
+-    AVPacket Packet;
+-    if (!ReadPacket(&Packet))
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++    if (!ReadPacket(Packet)) {
++        av_packet_free(&Packet);
+         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_UNKNOWN,
+             "ReadPacket unexpectedly failed to read a packet");
++    }
+
+     // ReadPacket may have changed the packet number
+     CurrentFrame = &Frames[PacketNumber];
+@@ -297,8 +302,9 @@ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     int NumberOfSamples = 0;
+     AudioBlock *CachedBlock = nullptr;
+
+-    int Ret = avcodec_send_packet(CodecContext, &Packet);
+-    av_packet_unref(&Packet);
++    int Ret = avcodec_send_packet(CodecContext, Packet);
++    av_packet_unref(Packet);
++    av_packet_free(&Packet);
+
+     av_frame_unref(DecodeFrame);
+     Ret = avcodec_receive_frame(CodecContext, DecodeFrame);
+@@ -513,8 +519,6 @@ void FFMS_AudioSource::Seek() {
+ }
+
+ bool FFMS_AudioSource::ReadPacket(AVPacket *Packet) {
+-    InitNullPacket(*Packet);
+-
+     while (av_read_frame(FormatContext, Packet) >= 0) {
+         if (Packet->stream_index == TrackNumber) {
+             // Required because not all audio packets, especially in ogg, have a pts. Use the previous valid packet's pts instead.
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index 23fb95b12..e547c5abf 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -320,7 +320,7 @@ void FFMS_Indexer::CheckAudioProperties(int Track, AVCodecContext *Context) {
+     }
+ }
+
+-void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict,
++void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict,
+                                     int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct) {
+     if (VideoContext.Parser) {
+         uint8_t *OB;
+@@ -330,8 +330,8 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+         av_parser_parse2(VideoContext.Parser,
+             VideoContext.CodecContext,
+             &OB, &OBSize,
+-            pkt.data, pkt.size,
+-            pkt.pts, pkt.dts, pkt.pos);
++            pkt->data, pkt->size,
++            pkt->pts, pkt->dts, pkt->pos);
+
+         // H.264 (PAFF) and HEVC may have one field per packet, so we need to track
+         // when we have a full or half frame available, and mark one of them as
+@@ -351,15 +351,15 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+
+         *RepeatPict = VideoContext.Parser->repeat_pict;
+         *FrameType = VideoContext.Parser->pict_type;
+-        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt.flags & AV_PKT_FLAG_DISCARD));
++        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt->flags & AV_PKT_FLAG_DISCARD));
+     } else {
+-        *Invisible = !!(pkt.flags & AV_PKT_FLAG_DISCARD);
++        *Invisible = !!(pkt->flags & AV_PKT_FLAG_DISCARD);
+     }
+
+     if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP8)
+-        ParseVP8(pkt.data[0], Invisible, FrameType);
++        ParseVP8(pkt->data[0], Invisible, FrameType);
+     else if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP9)
+-        ParseVP9(pkt.data[0], Invisible, FrameType);
++        ParseVP9(pkt->data[0], Invisible, FrameType);
+ }
+
+ void FFMS_Indexer::Free() {
+@@ -458,32 +458,36 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+         }
+     }
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
+     std::vector<int64_t> LastValidTS(FormatContext->nb_streams, AV_NOPTS_VALUE);
+
+     int64_t filesize = avio_size(FormatContext->pb);
+     enum AVPictureStructure LastPicStruct = AV_PICTURE_STRUCTURE_UNKNOWN;
+-    while (av_read_frame(FormatContext, &Packet) >= 0) {
++    while (av_read_frame(FormatContext, Packet) >= 0) {
+         // Update progress
+         // FormatContext->pb can apparently be NULL when opening images.
+         if (IC && FormatContext->pb) {
+-            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate))
++            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate)) {
++                av_packet_free(&Packet);
+                 throw FFMS_Exception(FFMS_ERROR_CANCELLED, FFMS_ERROR_USER,
+                     "Cancelled by user");
++            }
+         }
+-        if (!IndexMask.count(Packet.stream_index)) {
+-            av_packet_unref(&Packet);
++        if (!IndexMask.count(Packet->stream_index)) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+-        int Track = Packet.stream_index;
++        int Track = Packet->stream_index;
+         FFMS_Track &TrackInfo = (*TrackIndices)[Track];
+-        bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
++        bool KeyFrame = !!(Packet->flags & AV_PKT_FLAG_KEY);
+         ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
+
+         if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            int64_t PTS = TrackInfo.UseDTS ? Packet.dts : Packet.pts;
++            int64_t PTS = TrackInfo.UseDTS ? Packet->dts : Packet->pts;
+             if (PTS == AV_NOPTS_VALUE) {
+                 // VPx alt-refs are output as packets which lack timestmps or durations, since
+                 // they are invisible. Currently, the timestamp mangling code in libavformat
+@@ -495,9 +499,11 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 // FFMS2 currently sorts packets by PTS, which will break decoding, otherwise.
+                 bool HasAltRefs = (FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP8 ||
+                                    FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP9);
+-                if (Packet.duration == 0 && !HasAltRefs)
++                if (Packet->duration == 0 && !HasAltRefs) {
++                    av_packet_free(&Packet);
+                     throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER,
+                         "Invalid packet pts, dts, and duration");
++                }
+
+                 if (TrackInfo.empty())
+                     PTS = 0;
+@@ -513,7 +519,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             ParseVideoPacket(AVContexts[Track], Packet, &RepeatPict, &FrameType, &Invisible, &LastPicStruct);
+
+             TrackInfo.AddVideoFrame(PTS, RepeatPict, KeyFrame,
+-                FrameType, Packet.pos, Invisible);
++                FrameType, Packet->pos, Invisible);
+         } else if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+             // For video seeking timestamps are used only if all packets have
+             // timestamps, while for audio they're used if any have timestamps,
+@@ -522,28 +528,29 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 TrackInfo.HasTS = true;
+
+             int64_t StartSample = AVContexts[Track].CurrentSample;
+-            uint32_t SampleCount = IndexAudioPacket(Track, &Packet, AVContexts[Track], *TrackIndices);
++            uint32_t SampleCount = IndexAudioPacket(Track, Packet, AVContexts[Track], *TrackIndices);
+             TrackInfo.SampleRate = AVContexts[Track].CodecContext->sample_rate;
+
+             TrackInfo.AddAudioFrame(LastValidTS[Track],
+-                StartSample, SampleCount, KeyFrame, Packet.pos, Packet.flags & AV_PKT_FLAG_DISCARD);
++                StartSample, SampleCount, KeyFrame, Packet->pos, Packet->flags & AV_PKT_FLAG_DISCARD);
+         }
+
+-        if (!(Packet.flags & AV_PKT_FLAG_DISCARD))
+-            TrackInfo.LastDuration = Packet.duration;
++        if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
++            TrackInfo.LastDuration = Packet->duration;
+
+-        av_packet_unref(&Packet);
++        av_packet_unref(Packet);
+     }
++    av_packet_free(&Packet);
+
+     TrackIndices->Finalize(AVContexts, FormatContext->iformat->name);
+     return TrackIndices.release();
+ }
+
+-void FFMS_Indexer::ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS) {
+-    if (!UseDTS && Packet.pts != AV_NOPTS_VALUE)
+-        TS = Packet.pts;
++void FFMS_Indexer::ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS) {
++    if (!UseDTS && Packet->pts != AV_NOPTS_VALUE)
++        TS = Packet->pts;
+     if (TS == AV_NOPTS_VALUE)
+         UseDTS = true;
+-    if (UseDTS && Packet.dts != AV_NOPTS_VALUE)
+-        TS = Packet.dts;
++    if (UseDTS && Packet->dts != AV_NOPTS_VALUE)
++        TS = Packet->dts;
+ }
+diff --git a/src/core/indexing.h b/src/core/indexing.h
+index 3cfc3c30b..5c0686889 100644
+--- a/src/core/indexing.h
++++ b/src/core/indexing.h
+@@ -80,10 +80,10 @@ struct FFMS_Indexer {
+     int64_t Filesize;
+     uint8_t Digest[20];
+
+-    void ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS);
++    void ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS);
+     void CheckAudioProperties(int Track, AVCodecContext *Context);
+     uint32_t IndexAudioPacket(int Track, AVPacket *Packet, SharedAVContext &Context, FFMS_Index &TrackIndices);
+-    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
++    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
+     void Free();
+ public:
+     FFMS_Indexer(const char *Filename);
+diff --git a/src/core/utils.cpp b/src/core/utils.cpp
+index ce67533fd..8a2e99710 100644
+--- a/src/core/utils.cpp
++++ b/src/core/utils.cpp
+@@ -62,12 +62,6 @@ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo) {
+     }
+ }
+
+-void InitNullPacket(AVPacket &pkt) {
+-    av_init_packet(&pkt);
+-    pkt.data = nullptr;
+-    pkt.size = 0;
+-}
+-
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames) {
+     AP.SampleFormat = static_cast<FFMS_SampleFormat>(av_get_packed_sample_fmt(CTX->sample_fmt));
+     AP.BitsPerSample = av_get_bytes_per_sample(CTX->sample_fmt) * 8;
+diff --git a/src/core/utils.h b/src/core/utils.h
+index 9819dc7c9..003ab794e 100644
+--- a/src/core/utils.h
++++ b/src/core/utils.h
+@@ -58,7 +58,6 @@ std::unique_ptr<T> make_unique(Args&&... args) {
+ }
+
+ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo);
+-void InitNullPacket(AVPacket &pkt);
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames);
+
+ void LAVFOpenFile(const char *SourceFile, AVFormatContext *&FormatContext, int Track);
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index 06bd1610e..b889970e2 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -673,30 +673,34 @@ void FFMS_VideoSource::DecodeNextFrame(int64_t &AStartTime, int64_t &Pos) {
+     if (HasPendingDelayedFrames())
+         return;
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
+-
+-    while (ReadFrame(&Packet) >= 0) {
+-        if (Packet.stream_index != VideoTrack) {
+-            av_packet_unref(&Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++
++    while (ReadFrame(Packet) >= 0) {
++        if (Packet->stream_index != VideoTrack) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+         if (AStartTime < 0)
+-            AStartTime = Frames.UseDTS ? Packet.dts : Packet.pts;
++            AStartTime = Frames.UseDTS ? Packet->dts : Packet->pts;
+
+         if (Pos < 0)
+-            Pos = Packet.pos;
++            Pos = Packet->pos;
+
+-        bool FrameFinished = DecodePacket(&Packet);
+-        av_packet_unref(&Packet);
+-        if (FrameFinished)
++        bool FrameFinished = DecodePacket(Packet);
++        av_packet_unref(Packet);
++        if (FrameFinished) {
++            av_packet_free(&Packet);
+             return;
++        }
+     }
+
+     // Flush final frames
+-    InitNullPacket(Packet);
+-    DecodePacket(&Packet);
++    DecodePacket(Packet);
++    av_packet_free(&Packet);
+ }
+
+ bool FFMS_VideoSource::SeekTo(int n, int SeekOffset) {
+
+From bf9e03e9e08534c024e5a744a6437c4aac160201 Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:20:47 +0100
+Subject: [PATCH 2/3] configure: Remove deprecated API use
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b35ef80bc..d19714d0f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,10 +102,10 @@ CFLAGS="$_CFLAGS $FFMPEG_CFLAGS"
+
+ AC_DEFUN([TEST_FFMPEG],
+          [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-            #include <libavcodec/avcodec.h>
++            #include <libavformat/avformat.h>
+             #include <libswscale/swscale.h>
+             ]],[[
+-                avcodec_register_all();
++                avformat_network_init();
+                 swscale_version();
+             ]])], [eval $1=yes], [eval $1=no])
+         ])
+
+From a18c8296687e267b20ec90ef81671b77d393a36e Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:41:21 +0100
+Subject: [PATCH 3/3] Use auto for AVCodec
+
+The geniuses over at FFmpeg decided to constify this API, so old
+versions of the library will return AVCodec *, while new versions
+of the libary will return const AVCodec *, which, in C++, are not
+OK to convert between.
+
+Rather than use some macro hell in ffmscompat.h, we can work around
+this by using auto.
+
+Gross.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 2 +-
+ src/core/indexing.cpp    | 6 +++---
+ src/core/videosource.cpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index e4ce97cdb..ac0966636 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -469,7 +469,7 @@ void FFMS_AudioSource::OpenFile() {
+
+     LAVFOpenFile(SourceFile.c_str(), FormatContext, TrackNumber);
+
+-    AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
++    auto *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
+     if (Codec == nullptr)
+         throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+             "Audio codec not found");
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index e547c5abf..59fb4e8ea 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -384,7 +384,7 @@ FFMS_TrackType FFMS_Indexer::GetTrackType(int Track) {
+ }
+
+ const char *FFMS_Indexer::GetTrackCodec(int Track) {
+-    AVCodec *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
++    auto *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
+     return codec ? codec->name : nullptr;
+ }
+
+@@ -402,7 +402,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             UseDTS);
+
+         if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (!VideoCodec) {
+                 FormatContext->streams[i]->discard = AVDISCARD_ALL;
+                 IndexMask.erase(i);
+@@ -433,7 +433,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 IndexMask.insert(i);
+             }
+         } else if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+-            AVCodec *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (AudioCodec == nullptr)
+                 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
+                     "Audio codec not found");
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index b889970e2..8956c2256 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -171,7 +171,7 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in
+
+         LAVFOpenFile(SourceFile, FormatContext, VideoTrack);
+
+-        AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
++        auto *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
+         if (Codec == nullptr)
+             throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+                 "Video codec not found");
diff --git a/srcpkgs/ffms2/template b/srcpkgs/ffms2/template
index 68e8a0c14bce..2acfadac44b3 100644
--- a/srcpkgs/ffms2/template
+++ b/srcpkgs/ffms2/template
@@ -1,7 +1,7 @@
 # Template file for 'ffms2'
 pkgname=ffms2
 version=2.40
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--enable-shared --disable-static"
 hostmakedepends="pkg-config autoconf automake libtool"
diff --git a/srcpkgs/freerdp/template b/srcpkgs/freerdp/template
index 53e67690f863..1b50e9a86bb2 100644
--- a/srcpkgs/freerdp/template
+++ b/srcpkgs/freerdp/template
@@ -1,7 +1,7 @@
 # Template file for 'freerdp'
 pkgname=freerdp
 version=2.9.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_ALSA=ON -DWITH_CUPS=OFF -DWITH_FFMPEG=ON
  -DWITH_GSTREAMER_0_10=OFF -DWITH_GSTREAMER_1_0=OFF -DWITH_JPEG=ON
diff --git a/srcpkgs/gerbera/template b/srcpkgs/gerbera/template
index ae14f35c767c..2dc0ac0ce03b 100644
--- a/srcpkgs/gerbera/template
+++ b/srcpkgs/gerbera/template
@@ -1,7 +1,7 @@
 # Template file for 'gerbera'
 pkgname=gerbera
 version=1.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_SYSTEMD=0 -DWITH_AVCODEC=1"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-1.patch b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
new file mode 100644
index 000000000000..7cfc98ada368
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
@@ -0,0 +1,232 @@
+From 03bbe01b79a1f07a6780cb60f23a087104c5d77b Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 30 Mar 2018 22:53:24 +0300
+Subject: [PATCH] Fix warnings while compile with FFMpeg 3.4.2 (issue #978)
+
+---
+ ffmpegaudio.cc | 68 +++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 62 insertions(+), 6 deletions(-)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index ed1172bdd..56e8f788e 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -91,6 +91,7 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++  AVCodec * codec_;
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
+@@ -114,6 +115,7 @@ DecoderContext::DecoderContext( QByteArray const & audioData, QAtomicInt & isCan
+   audioData_( audioData ),
+   audioDataStream_( audioData_ ),
+   formatContext_( NULL ),
++  codec_( NULL ),
+   codecContext_( NULL ),
+   avioContext_( NULL ),
+   audioStream_( NULL ),
+@@ -143,7 +145,11 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 56 || ( LIBAVCODEC_VERSION_MAJOR == 56 && LIBAVCODEC_VERSION_MINOR < 56 )
+   unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
++#else
++  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
++#endif
+   if ( !avioBuffer )
+   {
+     errorString = QObject::tr( "av_malloc() failed." );
+@@ -186,7 +192,11 @@ bool DecoderContext::openCodec( QString & errorString )
+   // Find audio stream, use the first audio stream if available
+   for ( unsigned i = 0; i < formatContext_->nb_streams; i++ )
+   {
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+     if ( formatContext_->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO )
++#else
++      if ( formatContext_->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO )
++#endif
+     {
+       audioStream_ = formatContext_->streams[i];
+       break;
+@@ -198,22 +208,38 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+   codecContext_ = audioStream_->codec;
+-  AVCodec * codec = avcodec_find_decoder( codecContext_->codec_id );
+-  if ( !codec )
++  codec_ = avcodec_find_decoder( codecContext_->codec_id );
++  if ( !codec_ )
+   {
+     errorString = QObject::tr( "Codec [id: %1] not found." ).arg( codecContext_->codec_id );
+     return false;
+   }
++#else
++  codec_ = avcodec_find_decoder( audioStream_->codecpar->codec_id );
++  if ( !codec_ )
++  {
++    errorString = QObject::tr( "Codec [id: %1] not found." ).arg( audioStream_->codecpar->codec_id );
++    return false;
++  }
++  codecContext_ = avcodec_alloc_context3( codec_ );
++  if ( !codecContext_ )
++  {
++    errorString = QObject::tr( "avcodec_alloc_context3() failed." );
++    return false;
++  }
++  avcodec_parameters_to_context( codecContext_, audioStream_->codecpar );
++#endif
+
+-  ret = avcodec_open2( codecContext_, codec, NULL );
++  ret = avcodec_open2( codecContext_, codec_, NULL );
+   if ( ret < 0 )
+   {
+     errorString = QObject::tr( "avcodec_open2() failed: %1." ).arg( avErrorString( ret ) );
+     return false;
+   }
+
+-  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec->long_name,
++  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec_->long_name,
+           codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
+   return true;
+ }
+@@ -252,10 +278,13 @@ void DecoderContext::closeCodec()
+
+   // Closing a codec context without prior avcodec_open2() will result in
+   // a crash in ffmpeg
+-  if ( audioStream_ && audioStream_->codec && audioStream_->codec->codec )
++  if ( audioStream_ && codecContext_ && codec_ )
+   {
+     audioStream_->discard = AVDISCARD_ALL;
+-    avcodec_close( audioStream_->codec );
++    avcodec_close( codecContext_ );
++#if LIBAVCODEC_VERSION_MAJOR > 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR >= 33 )
++    avcodec_free_context( &codecContext_ );
++#endif
+   }
+
+   avformat_close_input( &formatContext_ );
+@@ -356,6 +385,7 @@ bool DecoderContext::play( QString & errorString )
+     if ( packet.stream_index == audioStream_->index )
+     {
+       AVPacket pack = packet;
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+       int gotFrame = 0;
+       do
+       {
+@@ -370,6 +400,19 @@ bool DecoderContext::play( QString & errorString )
+         pack.data += len;
+       }
+       while( pack.size > 0 );
++#else
++      int ret = avcodec_send_packet( codecContext_, &pack );
++      /* read all the output frames (in general there may be any number of them) */
++      while( ret >= 0 )
++      {
++        ret = avcodec_receive_frame( codecContext_, frame);
++
++        if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++          break;
++
++        playFrame( frame );
++      }
++#endif
+     }
+     // av_free_packet() must be called after each call to av_read_frame()
+ #if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 )
+@@ -379,6 +422,7 @@ bool DecoderContext::play( QString & errorString )
+ #endif
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
+        codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+   {
+@@ -391,6 +435,18 @@ bool DecoderContext::play( QString & errorString )
+       playFrame( frame );
+     }
+   }
++#else
++  /* flush the decoder */
++  av_init_packet( &packet );
++  int ret = avcodec_send_packet(codecContext_, &packet );
++  while( ret >= 0 )
++  {
++    ret = avcodec_receive_frame(codecContext_, frame);
++    if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++      break;
++    playFrame( frame );
++  }
++#endif
+
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+   av_free( frame );
+32
+srcpkgs/goldendict/patches/ffmpeg5-2.patch
+Comment on this file
+@@ -0,0 +1,32 @@
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
+25
+srcpkgs/goldendict/patches/ffmpeg5-3.patch
+Comment on this file
+@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-2.patch b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
new file mode 100644
index 000000000000..9c477b0c1347
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
@@ -0,0 +1,33 @@
+
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-3.patch b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
new file mode 100644
index 000000000000..72101903d1d1
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/template b/srcpkgs/goldendict/template
index f41b5b2c6899..4544ae710ee6 100644
--- a/srcpkgs/goldendict/template
+++ b/srcpkgs/goldendict/template
@@ -1,7 +1,7 @@
 # Template file for 'goldendict'
 pkgname=goldendict
 version=1.5.0RC2
-revision=5
+revision=6
 build_style=qmake
 configure_args="CONFIG+=zim_support"
 hostmakedepends="qt5-qmake pkg-config qt5-host-tools"
diff --git a/srcpkgs/gst-libav/template b/srcpkgs/gst-libav/template
index e9a79dc650a5..f082bd211c65 100644
--- a/srcpkgs/gst-libav/template
+++ b/srcpkgs/gst-libav/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-libav'
 pkgname=gst-libav
 version=1.20.3
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config yasm"
 makedepends="orc-devel gst-plugins-base1-devel ffmpeg-devel"
diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index bb9c4d87f4c6..f55f82fd4c77 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.20.3
-revision=2
+revision=3
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled
diff --git a/srcpkgs/gst-rtsp-server/template b/srcpkgs/gst-rtsp-server/template
index 33cd64ceb95e..8ceea8d34b4b 100644
--- a/srcpkgs/gst-rtsp-server/template
+++ b/srcpkgs/gst-rtsp-server/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-rtsp-server'
 pkgname=gst-rtsp-server
 version=1.20.3
-revision=2
+revision=3
 build_style=meson
 hostmakedepends="pkg-config python3"
 makedepends="glib-devel gst-plugins-bad1-devel gobject-introspection
diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 6a50567f53a9..6976aee84817 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
 # Template file for 'gtk4'
 pkgname=gtk4
 version=4.10.1
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dman-pages=true -Dgtk_doc=true
diff --git a/srcpkgs/guvcview/template b/srcpkgs/guvcview/template
index 345cf6006f24..d42fd38fa4ad 100644
--- a/srcpkgs/guvcview/template
+++ b/srcpkgs/guvcview/template
@@ -1,7 +1,7 @@
 # Template file for 'guvcview'
 pkgname=guvcview
 version=2.0.7
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-static --disable-debian-menu"
diff --git a/srcpkgs/handbrake/template b/srcpkgs/handbrake/template
index ca5e4571e49c..188a79f2bf5c 100644
--- a/srcpkgs/handbrake/template
+++ b/srcpkgs/handbrake/template
@@ -1,7 +1,7 @@
 # Template file for 'handbrake'
 pkgname=handbrake
 version=1.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--force --disable-gtk-update-checks --disable-df-fetch --harden
  $(vopt_enable fdk_aac fdk-aac) $(vopt_enable nvenc)"
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index 419f29b98b44..a343b3172a72 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,7 +1,7 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
  -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
diff --git a/srcpkgs/idjc/template b/srcpkgs/idjc/template
index df60318b3db9..b205e74745fe 100644
--- a/srcpkgs/idjc/template
+++ b/srcpkgs/idjc/template
@@ -1,7 +1,7 @@
 # Template file for 'idjc'
 pkgname=idjc
 version=0.9.1
-revision=3
+revision=4
 build_style=gnu-configure
 hostmakedepends="pkg-config git python3 automake gettext-devel libtool"
 makedepends="libvorbis-devel libogg-devel jack-devel libsamplerate-devel
diff --git a/srcpkgs/kfilemetadata5/template b/srcpkgs/kfilemetadata5/template
index 83f4d583bcb7..b90ef056a196 100644
--- a/srcpkgs/kfilemetadata5/template
+++ b/srcpkgs/kfilemetadata5/template
@@ -1,7 +1,7 @@
 # Template file for 'kfilemetadata5'
 pkgname=kfilemetadata5
 version=5.103.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="kcoreaddons extra-cmake-modules pkg-config qt5-host-tools qt5-qmake
  gettext kcoreaddons python3"
diff --git a/srcpkgs/kid3/template b/srcpkgs/kid3/template
index 456206d90e16..f32f9decb0e7 100644
--- a/srcpkgs/kid3/template
+++ b/srcpkgs/kid3/template
@@ -1,7 +1,7 @@
 # Template file for 'kid3'
 pkgname=kid3
 version=3.9.1
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DWITH_APPS='CLI;$(vopt_if KDE KDE Qt)'
  -DWITH_DOCBOOKDIR=/usr/share/xsl/docbook -DWITH_FLAC=$(vopt_if flac ON OFF)
diff --git a/srcpkgs/kodi/template b/srcpkgs/kodi/template
index 8057964d78a3..991325f6c477 100644
--- a/srcpkgs/kodi/template
+++ b/srcpkgs/kodi/template
@@ -1,7 +1,7 @@
 # Template file for 'kodi'
 pkgname=kodi
 version=19.4
-revision=6
+revision=7
 _codename="Matrix"
 build_style=cmake
 configure_args="-DWITH_FFMPEG=/usr -DENABLE_LDGOLD=OFF
diff --git a/srcpkgs/kpipewire/template b/srcpkgs/kpipewire/template
index 1d1e963f296d..07cdc0c7384a 100644
--- a/srcpkgs/kpipewire/template
+++ b/srcpkgs/kpipewire/template
@@ -1,7 +1,7 @@
 # Template file for 'kpipewire'
 pkgname=kpipewire
 version=5.27.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules plasma-wayland-protocols gettext
  qt5-qmake qt5-host-tools pkg-config wayland-devel kcoreaddons
diff --git a/srcpkgs/libavresample b/srcpkgs/libavresample
index 887f354e7c6b..a9f1eea092d5 120000
--- a/srcpkgs/libavresample
+++ b/srcpkgs/libavresample
@@ -1 +1 @@
-ffmpeg4
\ No newline at end of file
+ffmpeg
\ No newline at end of file
diff --git a/srcpkgs/libextractor/template b/srcpkgs/libextractor/template
index 29d5b8df01f8..ddd4790f93e8 100644
--- a/srcpkgs/libextractor/template
+++ b/srcpkgs/libextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'libextractor'
 pkgname=libextractor
 version=1.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/libopenal/template b/srcpkgs/libopenal/template
index 77218f9e539d..3f49ed75a1fd 100644
--- a/srcpkgs/libopenal/template
+++ b/srcpkgs/libopenal/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenal'
 pkgname=libopenal
 version=1.22.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DALSOFT_EXAMPLES=OFF"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template
index db831f69b474..81aa0d7136d9 100644
--- a/srcpkgs/libopenshot/template
+++ b/srcpkgs/libopenshot/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenshot'
 pkgname=libopenshot
 version=0.3.0
-revision=1
+revision=2
 build_style=cmake
 # Builds fail with Ruby-2.4.1
 configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON"
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index da4f2d56e94c..4d6bf29efb4f 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
diff --git a/srcpkgs/mediastreamer/template b/srcpkgs/mediastreamer/template
index d0e97e858e29..d29210c1bf9c 100644
--- a/srcpkgs/mediastreamer/template
+++ b/srcpkgs/mediastreamer/template
@@ -1,7 +1,7 @@
 # Template file for 'mediastreamer'
 pkgname=mediastreamer
 version=5.2.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_STRICT=0 -DENABLE_UNIT_TESTS=0"
 hostmakedepends="python3"
diff --git a/srcpkgs/mgba/patches/ffmpeg5.patch b/srcpkgs/mgba/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..ad7049efcac3
--- /dev/null
+++ b/srcpkgs/mgba/patches/ffmpeg5.patch
@@ -0,0 +1,117 @@
+From cdc753516798882a805db1d2042dbce8313382bf Mon Sep 17 00:00:00 2001
+From: Ryan Tandy <ryan@nardis.ca>
+Date: Thu, 3 Feb 2022 19:02:52 -0800
+Subject: [PATCH] FFmpeg: Support FFmpeg 5.0
+
+---
+ src/feature/ffmpeg/ffmpeg-decoder.c |  3 ++-
+ src/feature/ffmpeg/ffmpeg-encoder.c | 25 ++++++++++++++-----------
+ 2 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/src/feature/ffmpeg/ffmpeg-decoder.c b/src/feature/ffmpeg/ffmpeg-decoder.c
+index c3bb6d1c5c..daa47fbf2c 100644
+--- a/src/feature/ffmpeg/ffmpeg-decoder.c
++++ b/src/feature/ffmpeg/ffmpeg-decoder.c
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ #include "ffmpeg-decoder.h"
+
++#include <libavcodec/avcodec.h>
+ #include <libswscale/swscale.h>
+
+ void FFmpegDecoderInit(struct FFmpegDecoder* decoder) {
+@@ -38,7 +39,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) {
+ #else
+ 		enum AVMediaType type = decoder->context->streams[i]->codec->codec_type;
+ #endif
+-		struct AVCodec* codec;
++		const struct AVCodec* codec;
+ 		struct AVCodecContext* context = NULL;
+ 		if (type == AVMEDIA_TYPE_VIDEO && decoder->videoStream < 0) {
+ 			decoder->video = avcodec_alloc_context3(NULL);
+diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c
+index ad76ca57b2..be6bd3af5e 100644
+--- a/src/feature/ffmpeg/ffmpeg-encoder.c
++++ b/src/feature/ffmpeg/ffmpeg-encoder.c
+@@ -12,6 +12,9 @@
+
+ #include <libavcodec/version.h>
+ #include <libavcodec/avcodec.h>
++#if LIBAVCODEC_VERSION_MAJOR >= 58
++#include <libavcodec/bsf.h>
++#endif
+
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+@@ -121,7 +124,7 @@ bool FFmpegEncoderSetAudio(struct FFmpegEncoder* encoder, const char* acodec, un
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(acodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(acodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -193,7 +196,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -213,7 +216,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 	if (encoder->pixFormat == AV_PIX_FMT_NONE) {
+ 		return false;
+ 	}
+-	if (vbr < 0 && !av_opt_find(&codec->priv_class, "crf", NULL, 0, 0)) {
++	if (vbr < 0 && !av_opt_find((void*) &codec->priv_class, "crf", NULL, 0, 0)) {
+ 		return false;
+ 	}
+ 	encoder->videoCodec = vcodec;
+@@ -223,7 +226,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ }
+
+ bool FFmpegEncoderSetContainer(struct FFmpegEncoder* encoder, const char* container) {
+-	AVOutputFormat* oformat = av_guess_format(container, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(container, 0, 0);
+ 	if (!oformat) {
+ 		return false;
+ 	}
+@@ -241,9 +244,9 @@ void FFmpegEncoderSetLooping(struct FFmpegEncoder* encoder, bool loop) {
+ }
+
+ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !oformat || (!acodec && !vcodec)) {
+ 		return false;
+ 	}
+@@ -257,8 +260,8 @@ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+ }
+
+ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !FFmpegEncoderVerifyContainer(encoder)) {
+ 		return false;
+ 	}
+@@ -272,9 +275,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+ 	encoder->currentVideoFrame = 0;
+ 	encoder->skipResidue = 0;
+
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+ #ifndef USE_LIBAV
+-	avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile);
++	avformat_alloc_output_context2(&encoder->context, (AVOutputFormat*) oformat, 0, outfile);
+ #else
+ 	encoder->context = avformat_alloc_context();
+ 	strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1);
diff --git a/srcpkgs/mgba/template b/srcpkgs/mgba/template
index 05bca15c1750..f5b6b8464428 100644
--- a/srcpkgs/mgba/template
+++ b/srcpkgs/mgba/template
@@ -1,7 +1,7 @@
 # Template file for 'mgba'
 pkgname=mgba
 version=0.10.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake desktop-file-utils"
 makedepends="SDL2-devel ffmpeg-devel libedit-devel libepoxy-devel libmagick-devel
diff --git a/srcpkgs/minidlna/template b/srcpkgs/minidlna/template
index e8081b1cbc67..9ee9714861fd 100644
--- a/srcpkgs/minidlna/template
+++ b/srcpkgs/minidlna/template
@@ -1,7 +1,7 @@
 # Template file for 'minidlna'
 pkgname=minidlna
 version=1.3.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --sbindir=/usr/bin
diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template
index 619ddca0d332..4b9ea00d3fb3 100644
--- a/srcpkgs/mixxx/template
+++ b/srcpkgs/mixxx/template
@@ -1,7 +1,7 @@
 # Template file for 'mixxx'
 pkgname=mixxx
 version=2.3.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="extra-cmake-modules pkg-config protobuf qt5-host-tools qt5-devel"
diff --git a/srcpkgs/mlt/template b/srcpkgs/mlt/template
index 8933eb4e7bb9..ed6b27503f9a 100644
--- a/srcpkgs/mlt/template
+++ b/srcpkgs/mlt/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt'
 pkgname=mlt
 version=6.26.1
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --libdir=/usr/lib$XBPS_TARGET_WORDSIZE
  --enable-gpl --enable-gpl3 --disable-swfdec --without-kde
diff --git a/srcpkgs/mlt7/template b/srcpkgs/mlt7/template
index e5972cc0411b..d0e9ec02e58a 100644
--- a/srcpkgs/mlt7/template
+++ b/srcpkgs/mlt7/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt7'
 pkgname=mlt7
 version=7.12.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSWIG_PYTHON=ON"
 hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which
diff --git a/srcpkgs/moc/template b/srcpkgs/moc/template
index c42be650a1d2..4b95426599bf 100644
--- a/srcpkgs/moc/template
+++ b/srcpkgs/moc/template
@@ -1,7 +1,7 @@
 # Template file for 'moc'
 pkgname=moc
 version=2.5.2
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg-devel
diff --git a/srcpkgs/motion/template b/srcpkgs/motion/template
index 3cf3c3035c5b..7dca12d851e3 100644
--- a/srcpkgs/motion/template
+++ b/srcpkgs/motion/template
@@ -1,7 +1,7 @@
 # Template file for 'motion'
 pkgname=motion
 version=4.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake pkg-config gettext-devel tar"
 makedepends="ffmpeg-devel libmicrohttpd-devel v4l-utils-devel gettext-devel"
diff --git a/srcpkgs/mpd/template b/srcpkgs/mpd/template
index 63701b7d56b1..df35e751ea60 100644
--- a/srcpkgs/mpd/template
+++ b/srcpkgs/mpd/template
@@ -1,7 +1,7 @@
 # Template file for 'mpd'
 pkgname=mpd
 version=0.23.12
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true
  -Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled
diff --git a/srcpkgs/mpv/template b/srcpkgs/mpv/template
index e163c496c6eb..d4fefbf5e3c7 100644
--- a/srcpkgs/mpv/template
+++ b/srcpkgs/mpv/template
@@ -1,7 +1,7 @@
 # Template file for 'mpv'
 pkgname=mpv
 version=0.35.1
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled
  -Dlibmpv=true -Dcplugins=enabled
diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template
index 4b7930041126..7cd65cf76b77 100644
--- a/srcpkgs/musikcube/template
+++ b/srcpkgs/musikcube/template
@@ -1,7 +1,7 @@
 # Template file for 'musikcube'
 pkgname=musikcube
 version=0.99.4
-revision=1
+revision=2
 build_style=cmake
 make_cmd=make
 configure_args="-DNO_NCURSESW=1"
diff --git a/srcpkgs/notcurses/template b/srcpkgs/notcurses/template
index 6dd8a091319f..3110c30c9aff 100644
--- a/srcpkgs/notcurses/template
+++ b/srcpkgs/notcurses/template
@@ -1,7 +1,7 @@
 # Template file for 'notcurses'
 pkgname=notcurses
 version=3.0.9
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_STATIC=ON $(vopt_bool man USE_PANDOC)"
 hostmakedepends="pkg-config $(vopt_if man pandoc)"
diff --git a/srcpkgs/obs/template b/srcpkgs/obs/template
index 1a7132ae832f..078feba62bbb 100644
--- a/srcpkgs/obs/template
+++ b/srcpkgs/obs/template
@@ -1,7 +1,7 @@
 # Template file for 'obs'
 pkgname=obs
 version=29.0.2
-revision=1
+revision=2
 archs="i686* x86_64* ppc64le* aarch64*"
 build_style=cmake
 configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON
diff --git a/srcpkgs/olive/template b/srcpkgs/olive/template
index 12a46936c990..5290d8e5aacd 100644
--- a/srcpkgs/olive/template
+++ b/srcpkgs/olive/template
@@ -1,7 +1,7 @@
 # Template file for 'olive'
 pkgname=olive
 version=0.1.2
-revision=2
+revision=3
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools pkg-config"
 makedepends="qt5-devel qt5-multimedia-devel qt5-svg-devel ffmpeg-devel frei0r-plugins"
diff --git a/srcpkgs/omxplayer/template b/srcpkgs/omxplayer/template
index e70bf7873d4d..80abdefe77b4 100644
--- a/srcpkgs/omxplayer/template
+++ b/srcpkgs/omxplayer/template
@@ -1,7 +1,7 @@
 # Template file for 'omxplayer'
 pkgname=omxplayer
 version=20190102
-revision=1
+revision=2
 short_desc="Commandline OMX player for the Raspberry Pi"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2"
diff --git a/srcpkgs/openimageio/template b/srcpkgs/openimageio/template
index cc9d7a33984e..ee988ae2ce07 100644
--- a/srcpkgs/openimageio/template
+++ b/srcpkgs/openimageio/template
@@ -1,7 +1,7 @@
 # Template file for 'openimageio'
 pkgname=openimageio
 version=2.3.18.0
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="-DUSE_OPENGL=0 -DUSE_QT=0 -DUSE_PYTHON=0 -DOIIO_BUILD_TESTS=1
diff --git a/srcpkgs/openmw/template b/srcpkgs/openmw/template
index 5251a0283dc1..e3771c7aaf1a 100644
--- a/srcpkgs/openmw/template
+++ b/srcpkgs/openmw/template
@@ -1,7 +1,7 @@
 # Template file for 'openmw'
 pkgname=openmw
 version=0.47.0
-revision=4
+revision=5
 build_style=cmake
 _recast_commit=e75adf86f91eb3082220085e42dda62679f9a3ea
 _bullet_tag=3.17
diff --git a/srcpkgs/openshot/template b/srcpkgs/openshot/template
index 322717d40abc..c074e0338773 100644
--- a/srcpkgs/openshot/template
+++ b/srcpkgs/openshot/template
@@ -1,7 +1,7 @@
 # Template file for 'openshot'
 pkgname=openshot
 version=3.0.0
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3 python3-setuptools"
 makedepends="ffmpeg-devel python3-PyQt5"
diff --git a/srcpkgs/opentoonz/template b/srcpkgs/opentoonz/template
index ee9f7603f55f..3e81834ca0ed 100644
--- a/srcpkgs/opentoonz/template
+++ b/srcpkgs/opentoonz/template
@@ -1,7 +1,7 @@
 # Template file for 'opentoonz'
 pkgname=opentoonz
 version=1.6.0
-revision=2
+revision=3
 build_wrksrc="toonz/sources"
 build_style=cmake
 make_cmd=make
diff --git a/srcpkgs/pianobar/template b/srcpkgs/pianobar/template
index a9b29e91993f..81efcd122c4d 100644
--- a/srcpkgs/pianobar/template
+++ b/srcpkgs/pianobar/template
@@ -1,7 +1,7 @@
 # Template file for 'pianobar'
 pkgname=pianobar
 version=2022.04.01
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="V=1"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/ppsspp/template b/srcpkgs/ppsspp/template
index 7984a733d4be..db9c95d0784c 100644
--- a/srcpkgs/ppsspp/template
+++ b/srcpkgs/ppsspp/template
@@ -1,7 +1,7 @@
 # Template file for 'ppsspp'
 pkgname=ppsspp
 version=1.14.4
-revision=1
+revision=2
 _glslang_commit=dc11adde23c455a24e13dd54de9b4ede8bdd7db8
 _SPIRV_Cross_commit=9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1
 _armips_commit=6719edebaae03330ee5441d9b28280672edf00d5
diff --git a/srcpkgs/pqiv/template b/srcpkgs/pqiv/template
index 542fc27a2d32..9308d949b6a1 100644
--- a/srcpkgs/pqiv/template
+++ b/srcpkgs/pqiv/template
@@ -1,7 +1,7 @@
 # Template file for 'pqiv'
 pkgname=pqiv
 version=2.12
-revision=1
+revision=2
 build_style=gnu-makefile
 hostmakedepends="pkg-config"
 makedepends="glib-devel gtk+3-devel $(vopt_if ffmpeg ffmpeg-devel)
diff --git a/srcpkgs/qmmp/template b/srcpkgs/qmmp/template
index 26c661ed16be..a150d7441c7a 100644
--- a/srcpkgs/qmmp/template
+++ b/srcpkgs/qmmp/template
@@ -1,7 +1,7 @@
 # Template file for 'qmmp'
 pkgname=qmmp
 version=1.6.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_HAL:BOOL=FALSE -DQMMP_DEFAULT_UI:STRING=simple"
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake"
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index f9d78eced929..0a71484208bc 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
 version=5.15.11
-revision=1
+revision=2
 _version="${version}-lts"
 _chromium_commit=be349eaf62e77955791d7bf29f893f1e8a37daf4
 archs="x86_64* i686* armv[67]* ppc64* aarch64*"
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"
diff --git a/srcpkgs/qt6-multimedia/template b/srcpkgs/qt6-multimedia/template
index d89e7d54eb5a..aae15e57ca7b 100644
--- a/srcpkgs/qt6-multimedia/template
+++ b/srcpkgs/qt6-multimedia/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-multimedia'
 pkgname=qt6-multimedia
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DQT_FEATURE_gstreamer=ON"
 hostmakedepends="perl qt6-declarative-host-tools pkg-config qt6-shadertools"
diff --git a/srcpkgs/qt6-webengine/template b/srcpkgs/qt6-webengine/template
index 99012732b53a..96846feaee83 100644
--- a/srcpkgs/qt6-webengine/template
+++ b/srcpkgs/qt6-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-webengine'
 pkgname=qt6-webengine
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DQT_FEATURE_webengine_system_ffmpeg=ON
diff --git a/srcpkgs/qtav/template b/srcpkgs/qtav/template
index 34c30b2c0c78..775d5a139a9e 100644
--- a/srcpkgs/qtav/template
+++ b/srcpkgs/qtav/template
@@ -1,7 +1,7 @@
 # Template file for 'qtav'
 pkgname=qtav
 version=1.13.0
-revision=1
+revision=2
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel libass-devel libopenal-devel
diff --git a/srcpkgs/qtox/patches/ffmpeg5.patch b/srcpkgs/qtox/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..3babe1c98447
--- /dev/null
+++ b/srcpkgs/qtox/patches/ffmpeg5.patch
@@ -0,0 +1,79 @@
+From 15673a52b6b4805d482b69281e21947fb7096e05 Mon Sep 17 00:00:00 2001
+From: Anthony Bilinski <me@abilinski.com>
+Date: Thu, 10 Feb 2022 17:24:38 -0800
+Subject: [PATCH] fix(macOS): Update video API usage for newer libavcodec
+
+Newer version of avformat_open_input, av_find_input_format,
+avcodec_find_decoder previously used non-const pointers that are now
+const. Support both version for compatibiltiy with other platforms.
+---
+ src/video/cameradevice.cpp | 9 ++++++---
+ src/video/cameradevice.h   | 1 -
+ src/video/camerasource.cpp | 3 +--
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/video/cameradevice.cpp b/src/video/cameradevice.cpp
+index 3b07968b32..a012a0f78d 100644
+--- a/src/video/cameradevice.cpp
++++ b/src/video/cameradevice.cpp
+@@ -31,6 +31,9 @@ extern "C" {
+ #include "cameradevice.h"
+ #include "src/persistence/settings.h"
+
++// no longer needed when avformat version < 59 is no longer supported
++using AvFindInputFormatRet = decltype(av_find_input_format(""));
++
+ #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
+ #define USING_V4L 1
+ #else
+@@ -71,8 +74,8 @@ extern "C" {
+
+ QHash<QString, CameraDevice*> CameraDevice::openDevices;
+ QMutex CameraDevice::openDeviceLock, CameraDevice::iformatLock;
+-AVInputFormat* CameraDevice::iformat{nullptr};
+-AVInputFormat* CameraDevice::idesktopFormat{nullptr};
++static AvFindInputFormatRet idesktopFormat{nullptr};
++static AvFindInputFormatRet iformat{nullptr};
+
+ CameraDevice::CameraDevice(const QString& devName, AVFormatContext* context)
+     : devName{devName}
+@@ -92,7 +95,7 @@ CameraDevice* CameraDevice::open(QString devName, AVDictionary** options)
+         goto out;
+     }
+
+-    AVInputFormat* format;
++    AvFindInputFormatRet format;
+     if (devName.startsWith("x11grab#")) {
+         devName = devName.mid(8);
+         format = idesktopFormat;
+diff --git a/src/video/cameradevice.h b/src/video/cameradevice.h
+index 910873325b..c05f1dbed4 100644
+--- a/src/video/cameradevice.h
++++ b/src/video/cameradevice.h
+@@ -64,5 +64,4 @@ class CameraDevice
+     std::atomic_int refcount;
+     static QHash<QString, CameraDevice*> openDevices;
+     static QMutex openDeviceLock, iformatLock;
+-    static AVInputFormat *iformat, *idesktopFormat;
+ };
+diff --git a/src/video/camerasource.cpp b/src/video/camerasource.cpp
+index 134bc49afc..3a899f11d0 100644
+--- a/src/video/camerasource.cpp
++++ b/src/video/camerasource.cpp
+@@ -278,7 +278,6 @@ void CameraSource::openDevice()
+     }
+
+     // We need to create a new CameraDevice
+-    AVCodec* codec;
+     device = CameraDevice::open(deviceName, mode);
+
+     if (!device) {
+@@ -322,7 +321,7 @@ void CameraSource::openDevice()
+     AVCodecParameters* cparams = device->context->streams[videoStreamIndex]->codecpar;
+     codecId = cparams->codec_id;
+ #endif
+-    codec = avcodec_find_decoder(codecId);
++    const AVCodec* codec = avcodec_find_decoder(codecId);
+     if (!codec) {
+         qWarning() << "Codec not found";
+         emit openFailed();
diff --git a/srcpkgs/qtox/template b/srcpkgs/qtox/template
index 16019d7eaec9..5cea0b11b697 100644
--- a/srcpkgs/qtox/template
+++ b/srcpkgs/qtox/template
@@ -1,7 +1,7 @@
 # Template file for 'qtox'
 pkgname=qtox
 version=1.17.6
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DUPDATE_CHECK=OFF
  -DGIT_DESCRIBE=${version}
diff --git a/srcpkgs/retroarch/template b/srcpkgs/retroarch/template
index 240d3df9db00..6d0b16ae2598 100644
--- a/srcpkgs/retroarch/template
+++ b/srcpkgs/retroarch/template
@@ -1,7 +1,7 @@
 # Template file for 'retroarch'
 pkgname=retroarch
 version=1.14.0
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking
  --enable-udev --disable-builtinflac --disable-builtinglslang
diff --git a/srcpkgs/scrcpy/template b/srcpkgs/scrcpy/template
index ee6e698e387f..8ada5ca4323f 100644
--- a/srcpkgs/scrcpy/template
+++ b/srcpkgs/scrcpy/template
@@ -1,7 +1,7 @@
 # Template file for 'scrcpy'
 pkgname=scrcpy
 version=2.0
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dcompile_server=false
  -Dprebuilt_server=/usr/share/scrcpy/scrcpy-server-v${version}"
diff --git a/srcpkgs/spek-alternative/template b/srcpkgs/spek-alternative/template
index d65086b8f008..72747cbb0a02 100644
--- a/srcpkgs/spek-alternative/template
+++ b/srcpkgs/spek-alternative/template
@@ -1,7 +1,7 @@
 # Template file for 'spek-alternative'
 pkgname=spek-alternative
 version=0.8.2.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake gettext-devel intltool libtool pkg-config wxWidgets-common"
 makedepends="ffmpeg-devel wxWidgets-gtk3-devel"
diff --git a/srcpkgs/ssr/template b/srcpkgs/ssr/template
index b055b9ec0774..842b2423aad1 100644
--- a/srcpkgs/ssr/template
+++ b/srcpkgs/ssr/template
@@ -1,7 +1,7 @@
 # Template file for 'ssr'
 pkgname=ssr
 version=0.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_QT5=ON"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template
index 0f9b9ec815f5..a3fe134aa5ac 100644
--- a/srcpkgs/sumo/template
+++ b/srcpkgs/sumo/template
@@ -1,7 +1,7 @@
 # Template file for 'sumo'
 pkgname=sumo
 version=1.12.0
-revision=5
+revision=6
 build_style=cmake
 hostmakedepends="libgdal-tools pkg-config swig python3-setuptools"
 makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel
diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template
index 182dc3cd280f..29afb3572e47 100644
--- a/srcpkgs/synfig/template
+++ b/srcpkgs/synfig/template
@@ -2,7 +2,7 @@
 # Should be kept in sync with 'synfigstudio' and 'ETL'
 pkgname=synfig
 version=1.4.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib"
 hostmakedepends="boost-build ImageMagick pkg-config intltool"
diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index aae9f3135100..7943b36f0b8a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=4.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 configure_args="-DTDESKTOP_API_ID=209235
diff --git a/srcpkgs/tg_owt/template b/srcpkgs/tg_owt/template
index 97d195ddb34a..551614b24956 100644
--- a/srcpkgs/tg_owt/template
+++ b/srcpkgs/tg_owt/template
@@ -1,7 +1,7 @@
 # Template file for 'tg_owt'
 pkgname=tg_owt
 version=0.0.0.20230107
-revision=1
+revision=2
 _commit=5098730b9eb6173f0b52068fe2555b7c1015123a
 _libyuv_commit=00950840d1c9bcbb3eb6ebc5aac5793e71166c8b
 _abseil_commit=8c0b94e793a66495e0b1f34a5eb26bd7dc672db0
diff --git a/srcpkgs/timg/template b/srcpkgs/timg/template
index 91f1516b2597..334443d3f9bb 100644
--- a/srcpkgs/timg/template
+++ b/srcpkgs/timg/template
@@ -1,7 +1,7 @@
 # Template file for 'timg'
 pkgname=timg
 version=1.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_OPENSLIDE_SUPPORT=off -Wno-dev"
 hostmakedepends="pkg-config git"
diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index 3e7966c2b4a9..285425ba1851 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.4.3
-revision=1
+revision=2
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss
diff --git a/srcpkgs/tvheadend/template b/srcpkgs/tvheadend/template
index e6b16d7ccf3b..a2004480332b 100644
--- a/srcpkgs/tvheadend/template
+++ b/srcpkgs/tvheadend/template
@@ -1,7 +1,7 @@
 # Template file for 'tvheadend'
 pkgname=tvheadend
 version=4.2.8
-revision=6
+revision=7
 build_style=gnu-configure
 configure_args="--enable-dvbscan --disable-ffmpeg_static
 --disable-hdhomerun_static --disable-bintray_cache --disable-libx264_static
diff --git a/srcpkgs/unpaper/template b/srcpkgs/unpaper/template
index 38ed47a58401..b05920d13101 100644
--- a/srcpkgs/unpaper/template
+++ b/srcpkgs/unpaper/template
@@ -1,7 +1,7 @@
 # Template file for 'unpaper'
 pkgname=unpaper
 version=6.1
-revision=3
+revision=4
 build_style=gnu-configure
 maintainer="Orphaned <orphan@voidlinux.org>"
 hostmakedepends="pkg-config libxslt"
diff --git a/srcpkgs/vba-m/template b/srcpkgs/vba-m/template
index ba153e0b58ca..aa6093645e97 100644
--- a/srcpkgs/vba-m/template
+++ b/srcpkgs/vba-m/template
@@ -2,7 +2,7 @@
 pkgname=vba-m
 reverts=1292_2
 version=2.1.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GTK=TRUE -DENABLE_FFMPEG=TRUE -DENABLE_LINK=TRUE -DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="gettext pkg-config unzip zip yasm wxWidgets-gtk3-devel"
diff --git a/srcpkgs/vice/template b/srcpkgs/vice/template
index 0924767cfcfb..ffa95384f64a 100644
--- a/srcpkgs/vice/template
+++ b/srcpkgs/vice/template
@@ -1,7 +1,7 @@
 # Template file for 'vice'
 pkgname=vice
 version=3.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
 	$(vopt_enable sdl2 sdlui2)
diff --git a/srcpkgs/waypipe/template b/srcpkgs/waypipe/template
index 5c4161900060..1a46fe27f7d8 100644
--- a/srcpkgs/waypipe/template
+++ b/srcpkgs/waypipe/template
@@ -1,7 +1,7 @@
 # Template file for 'waypipe'
 pkgname=waypipe
 version=0.8.4
-revision=1
+revision=2
 build_style=meson
 # lto is off because it causes linking errors in armv6l and armv7l (due to NEON)
 configure_args="-Dwerror=false -Dwith_dmabuf=enabled -Dwith_lz4=enabled
diff --git a/srcpkgs/wf-recorder/template b/srcpkgs/wf-recorder/template
index e278eb001600..5d014a5f28af 100644
--- a/srcpkgs/wf-recorder/template
+++ b/srcpkgs/wf-recorder/template
@@ -1,7 +1,7 @@
 # Template file for 'wf-recorder'
 pkgname=wf-recorder
 version=0.3.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config scdoc wayland-devel"
 makedepends="wayland-protocols wayland-devel ffmpeg-devel x264-devel
diff --git a/srcpkgs/xpra/template b/srcpkgs/xpra/template
index 38f83283b1e5..b6e01ff0a813 100644
--- a/srcpkgs/xpra/template
+++ b/srcpkgs/xpra/template
@@ -1,7 +1,7 @@
 # Template file for 'xpra'
 pkgname=xpra
 version=4.4.4
-revision=1
+revision=2
 build_style=python3-module
 make_build_args="--without-cuda_kernels --without-cuda_rebuild"
 make_install_args="$(vopt_with docs) ${make_build_args}"

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
@ 2023-03-22 22:54 ` zlice
  2023-03-22 22:59 ` zlice
                   ` (28 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-22 22:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2952 bytes --]

There is an updated pull request by zlice against master on the void-packages repository

https://github.com/zlice/void-packages ffmpeg5-split
https://github.com/void-linux/void-packages/pull/42936

draft: ffmpeg5 split
[ci skip]

#### Testing the changes

- I tested the changes in this PR: **NO**

I have conflicting changes from [intel packages](https://github.com/void-linux/void-packages/pull/41132) and don't want to mess with my system. If it makes sense I'll move these changes here like I originally intended. ffmpeg5 makes Intel vaapi easier and only rely on oneVPL iirc.

I do not use 80%+ of these packages. I may be able to run Blender, and I use shotcut.


#### New package

- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**



#### Local build testing

- I built this PR locally for my native architecture, **x86_64**


#### Discussion

Continuation of https://github.com/void-linux/void-packages/pull/36315 - thx tibequadorian :)

It was suggested to make `ffmpeg` version 5 and 'copy' (create a new?) `ffmpeg4` package, and that seems to work well.

As stated, I haven't and probably won't test most of these packages, hoping for others to voice in on what's working. 

A few months back (and now) afaict everything has been compiling with ffmpeg5 except for the few problem packages still using ffmpeg4 (below). Can add to the ffmpeg4 list as a incompatible package is found.

`libavresample` is deprecated, but marked as a dependency when trying to build other packages and install `ffmpeg`(5). I think the right way to handle this is make a meta package and the add to removals?

##### Commit naming / misc

`ffpmeg4` isn't "new", not sure what the commit messages should be really for the 4 and 5 split.

Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?

I wouldn't mind moving the [intel packages](https://github.com/void-linux/void-packages/pull/41132) into here under another commit. That just got a potential fix that may allow merging but I imagine moving to ffmpeg5 will change and even remove some of those packages. (I won't really test these changes without Intel vaapi either way.)

Maintainer for previous ffmpeg(4) was orphaned, I can put my name in there if that matters, though I don't exactly see myself keeping up on ffmpeg.


##### still ffmpeg4

- `vlc` (vlc4 will support ffmpeg5, there's a patch to build 3.x with ffmpeg5 but it will lack vaapi)
- `osg` (OpenSceneGraph plus `xine-lib`)
- `ytmdl` ? not sure but it uses `python3-ffmpeg-python` which being 6-8yr old I imagine is ffmpeg4


A patch file from https://github.com/void-linux/void-packages/pull/42936.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ffmpeg5-split-42936.patch --]
[-- Type: text/x-diff, Size: 305767 bytes --]

From c5a8c096e2754e5184c83afeb25660963c3149b6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Tue, 21 Mar 2023 18:58:31 -0400
Subject: [PATCH 1/4] ffmpeg_split

---
 common/shlibs                                 |  26 +-
 srcpkgs/ffmpeg/template                       | 176 +++++----
 srcpkgs/ffmpeg4-devel                         |   1 +
 srcpkgs/ffmpeg4/ffmpeg4                       |   1 +
 .../{ffmpeg => ffmpeg4}/files/altivec.patch   |   0
 .../patches/armv5tel-floating-point.patch     |   0
 .../workaround-mesa-readeon-vaapi-bug.patch   |   0
 srcpkgs/ffmpeg4/template                      | 254 +++++++++++++
 ...Fix-infinite-loop-in-Menu-cycleitems.patch |  60 +++
 ...6c4d30f5b289c429c5ca88d800200db4fc4f.patch |  22 --
 .../MinOverlapPlacement.cc_improve.patch      |  29 ++
 srcpkgs/fluxbox/patches/center.patch          | 307 +++++++++++++++
 srcpkgs/fluxbox/patches/container_locks.patch | 325 ++++++++++++++++
 .../patches/container_relative_relative.patch |  15 +
 srcpkgs/fluxbox/patches/flux_improve.patch    | 205 ++++++++++
 srcpkgs/fluxbox/patches/flux_oversize.patch   |  24 ++
 .../fluxbox/patches/focus_close_menu.patch    |  17 +
 srcpkgs/fluxbox/patches/slit_raise.patch      |  16 +
 srcpkgs/fluxbox/patches/toolbar_redo.patch    | 228 ++++++++++++
 .../fluxbox/patches/tremor_graboid_hell.patch | 350 ++++++++++++++++++
 .../patches/unclutter_fix_workspacecmd.patch  |  65 ++++
 srcpkgs/fluxbox/patches/zor_loops.patch       |  87 +++++
 srcpkgs/fluxbox/template                      |  45 ++-
 srcpkgs/libavcodec4                           |   1 +
 srcpkgs/libavdevice4                          |   1 +
 srcpkgs/libavfilter4                          |   1 +
 srcpkgs/libavformat4                          |   1 +
 srcpkgs/libavresample                         |   2 +-
 srcpkgs/libavresample4                        |   1 +
 srcpkgs/libavutil4                            |   1 +
 srcpkgs/libpostproc4                          |   1 +
 srcpkgs/libswresample4                        |   1 +
 srcpkgs/libswscale4                           |   1 +
 srcpkgs/mesa/template                         |  35 +-
 34 files changed, 2167 insertions(+), 132 deletions(-)
 create mode 120000 srcpkgs/ffmpeg4-devel
 create mode 120000 srcpkgs/ffmpeg4/ffmpeg4
 rename srcpkgs/{ffmpeg => ffmpeg4}/files/altivec.patch (100%)
 rename srcpkgs/{ffmpeg => ffmpeg4}/patches/armv5tel-floating-point.patch (100%)
 rename srcpkgs/{ffmpeg => ffmpeg4}/patches/workaround-mesa-readeon-vaapi-bug.patch (100%)
 create mode 100644 srcpkgs/ffmpeg4/template
 create mode 100644 srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
 delete mode 100644 srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
 create mode 100644 srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
 create mode 100644 srcpkgs/fluxbox/patches/center.patch
 create mode 100644 srcpkgs/fluxbox/patches/container_locks.patch
 create mode 100644 srcpkgs/fluxbox/patches/container_relative_relative.patch
 create mode 100644 srcpkgs/fluxbox/patches/flux_improve.patch
 create mode 100644 srcpkgs/fluxbox/patches/flux_oversize.patch
 create mode 100644 srcpkgs/fluxbox/patches/focus_close_menu.patch
 create mode 100644 srcpkgs/fluxbox/patches/slit_raise.patch
 create mode 100644 srcpkgs/fluxbox/patches/toolbar_redo.patch
 create mode 100644 srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
 create mode 100644 srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
 create mode 100644 srcpkgs/fluxbox/patches/zor_loops.patch
 create mode 120000 srcpkgs/libavcodec4
 create mode 120000 srcpkgs/libavdevice4
 create mode 120000 srcpkgs/libavfilter4
 create mode 120000 srcpkgs/libavformat4
 create mode 120000 srcpkgs/libavresample4
 create mode 120000 srcpkgs/libavutil4
 create mode 120000 srcpkgs/libpostproc4
 create mode 120000 srcpkgs/libswresample4
 create mode 120000 srcpkgs/libswscale4

diff --git a/common/shlibs b/common/shlibs
index f972eebc4d3a..aab66c83f4b3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -389,15 +389,23 @@ libid3tag.so.0 libid3tag-0.15.1b_1
 libgif.so.7 giflib-5.1.0_1
 libImlib2.so.1 imlib2-1.4.2_1
 libmp3lame.so.0 lame-3.98.2_1
-libavdevice.so.58 libavdevice-4.0_1
-libavformat.so.58 libavformat-4.0_1
-libswscale.so.5 libswscale-4.0_1
-libswresample.so.3 libswresample-4.0_1
-libavresample.so.4 libavresample-4.0_1
-libpostproc.so.55 libpostproc-4.0_1
-libavcodec.so.58 libavcodec-4.0_1
-libavutil.so.56 libavutil-4.0_1
-libavfilter.so.7 libavfilter-4.0_1
+libavdevice.so.59 libavdevice-5.1.2_1
+libavformat.so.59 libavformat-5.1.2_1
+libswscale.so.6 libswscale-5.1.2_1
+libswresample.so.4 libswresample-5.1.2_1
+libpostproc.so.56 libpostproc-5.1.2_1
+libavcodec.so.59 libavcodec-5.1.2_1
+libavutil.so.57 libavutil-5.1.2_1
+libavfilter.so.8 libavfilter-5.1.2_1
+libavdevice.so.58 libavdevice4-4.0_1
+libavformat.so.58 libavformat4-4.0_1
+libswscale.so.5 libswscale4-4.0_1
+libswresample.so.3 libswresample4-4.0_1
+libavresample.so.4 libavresample4-4.0_1
+libpostproc.so.55 libpostproc4-4.0_1
+libavcodec.so.58 libavcodec4-4.0_1
+libavutil.so.56 libavutil4-4.0_1
+libavfilter.so.7 libavfilter4-4.0_1
 libSDL-1.2.so.0 SDL-1.2.14_1
 libSDL_image-1.2.so.0 SDL_image-1.2.10_1
 libx264.so.157 x264-20190507.2245_1
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 23a3d5c9967b..38978c5085a3 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -1,42 +1,36 @@
 # Template file for 'ffmpeg'
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg
-version=4.4.3
-revision=2
+version=5.1.2
+revision=1
 short_desc="Decoding, encoding and streaming software"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
 changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
 distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
-checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
-makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
- libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
- libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
- libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
- speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
- libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
- $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
- $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
- $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
- $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
- $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
- $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
- $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
- $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
- $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
- $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+makedepends="chromaprint-devel libgcrypt-devel ladspa-sdk lcms2-devel libaom-devel
+ alsa-lib-devel bzip2-devel libxcb-devel liblzma-devel SDL2-devel sndio-devel zlib-devel
+ frei0r-plugins libcdio-paranoia-devel rubberband-devel libvidstab-devel x264-devel x265-devel
+ xvidcore-devel fdk-aac-devel libtls-devel gmp-devel libass-devel libbluray-devel libcaca-devel
+ celt-devel codec2-devel libdav1d-devel libdrm-devel fontconfig-devel freetype-devel
+ fribidi-devel glslang-devel SPIRV-Tools-devel libgme-devel libgsm-devel jack-devel
+ libmodplug-devel lame-devel libopencv4-devel libopenjpeg2-devel libopenmpt-devel opus-devel
+ libplacebo-devel libpulseaudio rabbitmq-c-devel librist-devel librsvg-devel librtmp-devel
+ snappy-devel libsoxr-devel speex-devel srt-devel libssh-devel libtheora-devel twolame-devel
+ libvorbis-devel libvpx6-devel libwebp-devel libxml2-devel zimg-devel lilv-devel lv2
+ libopenal-devel mesa openssl-devel vapoursynth-devel ocl-icd-devel libmysofa-devel vulkan-loader
+ $(vopt_if vaapi libva-devel)
+ $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if nvenc nv-codec-headers)
+ $(vopt_if nvdec nv-codec-headers)
+ $(vopt_if svtav1 libsvt-av1-devel)
+"
 depends="ffplay>=${version}_${revision}"
-
-build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
- dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
-build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
-desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
-desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
-desc_option_sofa="Enable support for AES SOFA"
-desc_option_webp="Enable support for WebP"
+build_options="vaapi vdpau nvenc nvdec svtav1"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
@@ -52,22 +46,6 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-_apply_patch() {
-	local args="$1" pname="$(basename $2)"
-
-	if [ ! -f ".${pname}_done" ]; then
-		patch -N $args -i $2
-		touch .${pname}_done
-	fi
-}
-
-post_patch() {
-	case "$XBPS_TARGET_MACHINE" in
-		ppc64le*) ;;
-		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
-	esac
-}
-
 do_configure() {
 	# Fix gcc on x86_64-musl only
 	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
@@ -98,39 +76,47 @@ do_configure() {
 		_args+=" --extra-libs=-latomic"
 	fi
 
-	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+	./configure \
+		--prefix='/usr' \
+		--extra-cflags='-I/opt/cuda/include' \
+		--extra-ldflags='-L/opt/cuda/lib64' \
 		--disable-stripping \
-		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
-		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
-		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
-		--enable-shared --enable-static --enable-libxcb \
-		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
-		--enable-libspeex --enable-libcelt --enable-libass \
-		--enable-libopus --enable-librtmp --enable-libjack \
-		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
-		--disable-libopencore_amrnb --disable-libopencore_amrwb \
-		--disable-libopenjpeg \
-		--enable-postproc --enable-opencl ${_args} \
-		$(vopt_enable x265 libx265) \
-		$(vopt_enable v4l2 libv4l2) \
-		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
-		--enable-libbs2b --enable-avresample --enable-libvidstab \
-		$(vopt_enable dav1d libdav1d) \
-		$(vopt_enable zimg libzimg) \
-		$(vopt_enable webp libwebp) \
-		$(vopt_enable sofa libmysofa) \
-		$(vopt_enable vulkan) \
-		$(vopt_enable drm libdrm) \
-		$(vopt_enable svtav1 libsvtav1) \
-		$(vopt_enable srt libsrt) \
-		$(vopt_enable rist librist) \
+		--enable-shared --enable-static \
+		--enable-nonfree --enable-gpl \
+		--enable-version3 --enable-libxcb \
+		--enable-frei0r --enable-libcdio \
+		--enable-librubberband --enable-libvidstab \
+		--enable-libx264 --enable-libx265 --enable-libxvid \
+		--enable-libfdk-aac --enable-libtls --enable-gmp \
+		--enable-chromaprint --enable-gcrypt --enable-ladspa \
+		--enable-lcms2 --enable-libaom --enable-libass \
+		--enable-libbluray --enable-libcaca --enable-libcelt \
+		--enable-libcodec2 --enable-libdav1d --enable-libdrm \
+		--enable-libfontconfig --enable-libfreetype \
+		--enable-libfribidi --enable-libglslang \
+		--enable-libgme --enable-libgsm \
+		--enable-vapoursynth --enable-openssl --enable-opengl \
+		--enable-openal --enable-lv2 --enable-libzimg \
+		--enable-libxml2 --enable-libwebp --enable-libvorbis \
+		--enable-libtwolame --enable-libtheora --enable-libssh \
+		--enable-libsrt --enable-libspeex --enable-libsoxr \
+		--enable-librtmp --enable-librsvg --enable-librist \
+		--enable-librabbitmq --enable-libpulse --enable-libplacebo \
+		--enable-libopus --enable-libopenmpt --enable-libopenjpeg \
+		--enable-libmp3lame --enable-libmodplug --enable-libjack \
+		--enable-opencl --enable-libvpx --enable-libmysofa \
+		$(vopt_enable vaapi) \
+		$(vopt_enable vdpau) \
 		$(vopt_if nvenc '--enable-nvenc') \
-		$(vopt_if nvdec '--enable-nvdec')
+		$(vopt_if nvdec '--enable-nvdec') \
+		$(vopt_enable svtav1 libsvtav1)
 }
+
 do_build() {
 	make ${makejobs}
 	make doc/ff{mpeg,play}.1
 }
+
 do_install() {
 	make DESTDIR=${DESTDIR} install install-man
 }
@@ -147,12 +133,6 @@ libavdevice_package() {
 		vmove "usr/lib/libavdevice.so.*"
 	}
 }
-libavresample_package() {
-	short_desc="FFmpeg audio resampling library"
-	pkg_install() {
-		vmove "usr/lib/libavresample.so.*"
-	}
-}
 libavformat_package() {
 	short_desc="FFmpeg file format library"
 	pkg_install() {
@@ -198,9 +178,49 @@ ffmpeg-devel_package() {
 		libavfilter>=${version}_${revision}
 		libpostproc>=${version}_${revision}
 		libswscale>=${version}_${revision}
-		libswresample>=${version}_${revision}
-		libavresample>=${version}_${revision}"
+		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
+	alternatives="
+	 ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec5.3
+	 ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice5.3
+	 ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter5.3
+	 ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat5.3
+	 ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil5.3
+	 ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample5.3
+	 ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale5.3
+	 ffmpeg-devel:libavcodec:/usr/include/libavcodec5
+	 ffmpeg-devel:libavdevice:/usr/include/libavdevice5
+	 ffmpeg-devel:libavformat:/usr/include/libavformat5
+	 ffmpeg-devel:libavutil:/usr/include/libavutil5
+	 ffmpeg-devel:libavpostproc:/usr/include/libavpostproc5
+	 ffmpeg-devel:libswresample:/usr/include/libswresample5
+	 ffmpeg-devel:libswcaale:/usr/include/libswscale5
+	 ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec5.pc
+	 ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice5.pc
+	 ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter5.pc
+	 ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat5.pc
+	 ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil5.pc
+	 ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc5.pc
+	 ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample5.pc
+	 ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale5.pc
+	 ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec5.a
+	 ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec5.so
+	 ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice5.a
+	 ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice5.so
+	 ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter5.a
+	 ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter5.so
+	 ffmpeg-devel:libavformat.a:/usr/lib/libavformat5.a
+	 ffmpeg-devel:libavformat.so:/usr/lib/libavformat5.so
+	 ffmpeg-devel:libavutil.a:/usr/lib/libavutil5.a
+	 ffmpeg-devel:libavutil.so:/usr/lib/libavutil5.so
+	 ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc5.a
+	 ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc5.so
+	 ffmpeg-devel:libswresample.a:/usr/lib/libswresample5.a
+	 ffmpeg-devel:libswresample.so:/usr/lib/libswresample5.so
+	 ffmpeg-devel:libswscale.a:/usr/lib/libswscale5.a
+	 ffmpeg-devel:libswscale.so:/usr/lib/libswscale5.so
+	 ffmpeg-devel:ffmpeg:/usr/share/ffmpeg5
+	"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
@@ -211,7 +231,7 @@ ffmpeg-devel_package() {
 	}
 }
 ffplay_package() {
-	short_desc="Simple video player using FFmpeg and SDL2"
+	short_desc="Simple media player using FFmpeg and SDL2"
 	pkg_install() {
 		vmove usr/bin/ffplay
 		vmove "usr/share/man/man1/ffplay*"
diff --git a/srcpkgs/ffmpeg4-devel b/srcpkgs/ffmpeg4-devel
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4-devel
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg4/ffmpeg4 b/srcpkgs/ffmpeg4/ffmpeg4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4/ffmpeg4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg/files/altivec.patch b/srcpkgs/ffmpeg4/files/altivec.patch
similarity index 100%
rename from srcpkgs/ffmpeg/files/altivec.patch
rename to srcpkgs/ffmpeg4/files/altivec.patch
diff --git a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
similarity index 100%
rename from srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
rename to srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
diff --git a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
similarity index 100%
rename from srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
rename to srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
new file mode 100644
index 000000000000..cd9154978b3e
--- /dev/null
+++ b/srcpkgs/ffmpeg4/template
@@ -0,0 +1,254 @@
+# Template file for 'ffmpeg4'
+# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
+pkgname=ffmpeg4
+version=4.4.3
+revision=3
+short_desc="ffmpeg4 libraries only - Decoding, encoding and streaming software"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.ffmpeg.org"
+changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
+distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
+checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+
+hostmakedepends="pkg-config perl yasm"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
+
+case "$XBPS_TARGET_MACHINE" in
+	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
+	ppc64*) build_options_default+=" vaapi vdpau";;
+	mips*) CFLAGS="-mnan=legacy";;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" != "32" ]; then
+	build_options_default+=" svtav1"
+fi
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
+do_configure() {
+	# Fix gcc on x86_64-musl only
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
+		sed -i configure -e "s;_cflags_speed='-O3';_cflags_speed='-O2';"
+	fi
+
+	if [ "$CROSS_BUILD" ]; then
+		case "$XBPS_TARGET_MACHINE" in
+			arm*) _arch="arm";;
+			aarch64*) _arch="aarch64";;
+			mips*) _arch="mips";;
+			ppc64*) _arch="ppc64";;
+			ppc*) _arch="ppc";;
+			*) _arch="${XBPS_TARGET_MACHINE%%-musl}";;
+		esac
+
+		_args+=" --enable-cross-compile
+			--sysroot=$XBPS_CROSS_BASE
+			--cross-prefix=${XBPS_CROSS_TRIPLET}-
+			--target-os=linux --arch=${_arch}"
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc|ppc-musl) _args+=" --disable-altivec";;
+	esac
+
+	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+		_args+=" --extra-libs=-latomic"
+	fi
+
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+		--disable-stripping \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
+		$(vopt_if nvenc '--enable-nvenc') \
+		$(vopt_if nvdec '--enable-nvdec')
+}
+do_build() {
+	make ${makejobs}
+	make doc/ff{mpeg,play}.1
+}
+do_install() {
+	make DESTDIR=${DESTDIR} install install-man
+	rm -rf ${DESTDIR}/usr/bin
+}
+
+libavcodec4_package() {
+	short_desc="FFmpeg codec library"
+	pkg_install() {
+		vmove "usr/lib/libavcodec.so.*"
+	}
+}
+libavdevice4_package() {
+	short_desc="FFmpeg device handling library"
+	pkg_install() {
+		vmove "usr/lib/libavdevice.so.*"
+	}
+}
+libavresample4_package() {
+	short_desc="FFmpeg audio resampling library"
+	pkg_install() {
+		vmove "usr/lib/libavresample.so.*"
+	}
+}
+libavformat4_package() {
+	short_desc="FFmpeg file format library"
+	pkg_install() {
+		vmove "usr/lib/libavformat.so.*"
+	}
+}
+libavutil4_package() {
+	short_desc="FFmpeg utility library"
+	pkg_install() {
+		vmove "usr/lib/libavutil.so.*"
+	}
+}
+libavfilter4_package() {
+	short_desc="FFmpeg audio/video filter library"
+	pkg_install() {
+		vmove "usr/lib/libavfilter.so.*"
+	}
+}
+libpostproc4_package() {
+	short_desc="FFmpeg video postprocessing library"
+	pkg_install() {
+		vmove "usr/lib/libpostproc.so.*"
+	}
+}
+libswscale4_package() {
+	short_desc="FFmpeg video scaling library"
+	pkg_install() {
+		vmove "usr/lib/libswscale.so.*"
+	}
+}
+libswresample4_package() {
+	short_desc="FFmpeg video resampling library"
+	pkg_install() {
+		vmove "usr/lib/libswresample.so.*"
+	}
+}
+ffmpeg4-devel_package() {
+	depends="
+		libavcodec4>=${version}_${revision}
+		libavdevice4>=${version}_${revision}
+		libavformat4>=${version}_${revision}
+		libavutil4>=${version}_${revision}
+		libavfilter4>=${version}_${revision}
+		libpostproc4>=${version}_${revision}
+		libswscale4>=${version}_${revision}
+		libswresample4>=${version}_${revision}
+		libavresample4>=${version}_${revision}"
+	short_desc+=" - development files"
+	alternatives="
+		ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec4.3
+		ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice4.3
+		ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter4.3
+		ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat4.3
+		ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil4.3
+		ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample4.3
+		ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale4.3
+		ffmpeg-devel:libavcodec:/usr/include/libavcodec4
+		ffmpeg-devel:libavdevice:/usr/include/libavdevice4
+		ffmpeg-devel:libavformat:/usr/include/libavformat4
+		ffmpeg-devel:libavutil:/usr/include/libavutil4
+		ffmpeg-devel:libavpostproc:/usr/include/libavpostproc4
+		ffmpeg-devel:libswresample:/usr/include/libswresample4
+		ffmpeg-devel:libswcaale:/usr/include/libswscale4
+		ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec4.pc
+		ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice4.pc
+		ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter4.pc
+		ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat4.pc
+		ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil4.pc
+		ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc4.pc
+		ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample4.pc
+		ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale4.pc
+		ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec4.a
+		ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec4.so
+		ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice4.a
+		ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice4.so
+		ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter4.a
+		ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter4.so
+		ffmpeg-devel:libavformat.a:/usr/lib/libavformat4.a
+		ffmpeg-devel:libavformat.so:/usr/lib/libavformat4.so
+		ffmpeg-devel:libavutil.a:/usr/lib/libavutil4.a
+		ffmpeg-devel:libavutil.so:/usr/lib/libavutil4.so
+		ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc4.a
+		ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc4.so
+		ffmpeg-devel:libswresample.a:/usr/lib/libswresample4.a
+		ffmpeg-devel:libswresample.so:/usr/lib/libswresample4.so
+		ffmpeg-devel:libswscale.a:/usr/lib/libswscale4.a
+		ffmpeg-devel:libswscale.so:/usr/lib/libswscale4.so
+		ffmpeg-devel:ffmpeg:/usr/share/ffmpeg4
+	"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/*.a
+		vmove usr/lib/*.so
+		vmove usr/share/ffmpeg/examples
+		vmove usr/share/man/man3
+	}
+}
diff --git a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
new file mode 100644
index 000000000000..4c450fd45bfb
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
@@ -0,0 +1,60 @@
+From 9d8202f32338a3f08d3fa39057dc5eec5d97be4e Mon Sep 17 00:00:00 2001
+From: Mathias Gumz <akira@fluxbox.org>
+Date: Sat, 28 May 2022 11:13:43 +0200
+Subject: [PATCH] Fix infinite loop in Menu::cycleitems()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a menu contains no selectable item (example given: a "list" of user
+styles and the only available one is already selected), cycling through
+the menu will lead to an infinite loop and thus a disfunctional fluxbox.
+
+This commit addresses the issue by checking if there is any selectable
+item before entering the cycling stage.
+
+Discovered by Sébastien Ballet[1].
+
+[1]: https://sourceforge.net/p/fluxbox/bugs/1185/
+---
+ src/FbTk/Menu.cc | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
+index 6b2db3a4..ff040bae 100644
+--- a/src/FbTk/Menu.cc
++++ b/src/FbTk/Menu.cc
+@@ -320,15 +320,24 @@ void Menu::lower() {
+ 
+ void Menu::cycleItems(bool reverse) {
+ 
+-    if (m_items.empty())
+-        return;
+-
+-    int offset = reverse ? -1 : 1;
+     int l = m_items.size();
+-    int i = m_active_index;
++    int i;
++    int offset = reverse ? -1 : 1;
+     size_t ignore;
+ 
+-    for (i += offset; i != m_active_index; i += offset ) {
++    // check if there is _any_ selectable item
++    for (i = 0; i < l; i++) {
++        if (isItemSelectable(i)) {
++            break;
++        }
++    }
++
++    // no selectable item
++    if (i >= l) {
++        return;
++    }
++
++    for (i = m_active_index + offset; i != m_active_index; i += offset ) {
+         if (i < 0) {
+             i = l - 1;
+         } else if (i >= l) {
+-- 
+2.39.0
+
diff --git a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
deleted file mode 100644
index dc151643cb45..000000000000
--- a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 22866c4d30f5b289c429c5ca88d800200db4fc4f Mon Sep 17 00:00:00 2001
-From: John Sennesael <john@aminking.com>
-Date: Mon, 2 Nov 2015 15:14:32 -0600
-Subject: [PATCH] fixes bug #1138
-
----
- util/fluxbox-remote.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc
-index 59852e6a7..504015b50 100644
---- a/util/fluxbox-remote.cc
-+++ b/util/fluxbox-remote.cc
-@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
-     if (strcmp(cmd, "result") == 0) {
-         XTextProperty text_prop;
-         if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
--            && text_prop.value > 0
-+            && text_prop.value != 0
-             && text_prop.nitems > 0) {
- 
-             printf("%s", text_prop.value);
diff --git a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
new file mode 100644
index 000000000000..5b64b11ab2a8
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
@@ -0,0 +1,29 @@
+--- a/src/MinOverlapPlacement.cc  2015-02-08 05:44:34.000000000 -0500
++++ b/src/MinOverlapPlacement.cc  2022-07-18 15:14:41.012275200 -0400
+@@ -196,19 +196,21 @@
+     std::set<Area>::iterator min_reg = areas.end();
+
+     std::set<Area>::iterator ar_it = areas.begin();
++    int overlap = 0, min_right = 0, min_bottom = 0, max_left = 0, max_top = 0;
++
+     for (; ar_it != areas.end(); ++ar_it) {
+
+-        int overlap = 0;
++        overlap = 0;
+         it = const_windowlist.rbegin();
+         for (; it != it_end; ++it) {
+
+             getWindowDimensions(*(*it), left, top, right, bottom);
+
+             // get the coordinates of the overlap region
+-            int min_right = std::min(right, ar_it->x + win_w);
+-            int min_bottom = std::min(bottom, ar_it->y + win_h);
+-            int max_left = std::max(left, ar_it->x);
+-            int max_top = std::max(top, ar_it->y);
++            min_right = std::min(right, ar_it->x + win_w);
++            min_bottom = std::min(bottom, ar_it->y + win_h);
++            max_left = std::max(left, ar_it->x);
++            max_top = std::max(top, ar_it->y);
+
+             // now compute the overlap and add to running total
+             if (min_right > max_left && min_bottom > max_top)
diff --git a/srcpkgs/fluxbox/patches/center.patch b/srcpkgs/fluxbox/patches/center.patch
new file mode 100644
index 000000000000..39e3e4c7f37e
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/center.patch
@@ -0,0 +1,307 @@
+From ec83993c236de9c9442e2fcd31c08aae852a5a16 Mon Sep 17 00:00:00 2001
+From: zlice <zlice555@gmail.com>
+Date: Fri, 22 Jul 2022 21:21:33 -0400
+Subject: [PATCH 1/2] whitespace cleanup
+
+---
+ doc/asciidoc/fluxbox.txt |  8 ++++----
+ src/ScreenPlacement.cc   | 12 ++++++------
+ src/ScreenPlacement.hh   | 10 +++++-----
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
+index 95624842..0e3f27b9 100644
+--- a/doc/asciidoc/fluxbox.txt
++++ b/doc/asciidoc/fluxbox.txt
+@@ -4,7 +4,7 @@ Henrik Kinnunen <fluxgen@fluxbox.org>
+ v1.3.7, 08 February 2015
+ :man source:   fluxbox.txt
+ :man version:  {revision}
+-:man manual:   Fluxbox Manual  
++:man manual:   Fluxbox Manual
+ 
+ NAME
+ ----
+@@ -475,7 +475,7 @@ By default, this menu contains:
+ 
+ *Remember...*:::
+ Specify which window settings should be stored in the `apps' file and
+-resumed the next time this window is opened. 
++resumed the next time this window is opened.
+ +
+ Specifically the setting you may store are:
+ +
+@@ -740,7 +740,7 @@ There are three more settings in the ``Focus Model'' menu:
+ 
+ TAB OPTIONS
+ -----------
+-This section of fluxbox configuration menu lets you configure many features of 
++This section of fluxbox configuration menu lets you configure many features of
+ tabs. Inside of it there are three main options:
+ 
+ *Placement*:::
+@@ -1060,7 +1060,7 @@ whenever the mouse moves over them, but only when the mouse is moving. With
+ area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc.
+ +
+ Default: *ClickToFocus*
+-      
++
+ *session.screen0.autoRaise*: 'boolean'::
+ When True, this setting automatically raises any window that gains focus.
+ +
+diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
+index 19ddf78a..ca58d83f 100644
+--- a/src/ScreenPlacement.cc
++++ b/src/ScreenPlacement.cc
+@@ -43,14 +43,14 @@ using std::cerr;
+ using std::endl;
+ 
+ ScreenPlacement::ScreenPlacement(BScreen &screen):
+-    m_row_direction(screen.resourceManager(), LEFTRIGHT, 
+-                    screen.name()+".rowPlacementDirection", 
++    m_row_direction(screen.resourceManager(), LEFTRIGHT,
++                    screen.name()+".rowPlacementDirection",
+                     screen.altName()+".RowPlacementDirection"),
+-    m_col_direction(screen.resourceManager(), TOPBOTTOM, 
+-                    screen.name()+".colPlacementDirection", 
++    m_col_direction(screen.resourceManager(), TOPBOTTOM,
++                    screen.name()+".colPlacementDirection",
+                     screen.altName()+".ColPlacementDirection"),
+-    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT, 
+-                       screen.name()+".windowPlacement", 
++    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT,
++                       screen.name()+".windowPlacement",
+                        screen.altName()+".WindowPlacement"),
+     m_old_policy(ROWSMARTPLACEMENT),
+     m_screen(screen)
+diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
+index 0f210d94..f1234983 100644
+--- a/src/ScreenPlacement.hh
++++ b/src/ScreenPlacement.hh
+@@ -34,7 +34,7 @@ class BScreen;
+ 
+ /**
+  * Main class for strategy handling
+- * This is a bridge between screen and 
++ * This is a bridge between screen and
+  * the real placement strategy (rowcol, undermouse etc)
+  * The placeWindow function in this class is guaranteed to succeed.
+  * It holds a pointer to the real placement strategy which is
+@@ -42,8 +42,8 @@ class BScreen;
+  */
+ class ScreenPlacement: public PlacementStrategy {
+ public:
+-    enum PlacementPolicy { 
+-        ROWSMARTPLACEMENT, 
++    enum PlacementPolicy {
++        ROWSMARTPLACEMENT,
+         COLSMARTPLACEMENT,
+         COLMINOVERLAPPLACEMENT,
+         ROWMINOVERLAPPLACEMENT,
+@@ -52,11 +52,11 @@ public:
+         AUTOTABPLACEMENT
+     };
+ 
+-    enum RowDirection { 
++    enum RowDirection {
+         LEFTRIGHT, ///< from left to right
+         RIGHTLEFT  ///< from right to left
+     };
+-    enum ColumnDirection { 
++    enum ColumnDirection {
+         TOPBOTTOM,  ///< from top to bottom
+         BOTTOMTOP   ///< from bottom to top
+     };
+-- 
+2.37.1
+
+
+From 6e05f44c94fa4bfc0e44e8f42a9d24665a95840f Mon Sep 17 00:00:00 2001
+From: zlice <zlice555@gmail.com>
+Date: Fri, 22 Jul 2022 21:27:25 -0400
+Subject: [PATCH 2/2] new feature: CenterPlacement. Places new windows in
+ center of the current workspace
+
+---
+ doc/asciidoc/fluxbox.txt |  1 +
+ src/CenterPlacement.cc   | 43 ++++++++++++++++++++++++++++++++++++++++
+ src/CenterPlacement.hh   | 37 ++++++++++++++++++++++++++++++++++
+ src/Makemodule.am        |  2 ++
+ src/ScreenPlacement.cc   |  8 ++++++++
+ src/ScreenPlacement.hh   |  1 +
+ 6 files changed, 92 insertions(+)
+ create mode 100644 src/CenterPlacement.cc
+ create mode 100644 src/CenterPlacement.hh
+
+diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
+index 0e3f27b9..46ca2861 100644
+--- a/doc/asciidoc/fluxbox.txt
++++ b/doc/asciidoc/fluxbox.txt
+@@ -1141,6 +1141,7 @@ Available strategies:;;
+ - RowSmartPlacement: tries to place windows in rows without overlapping
+ - ColSmartPlacement: tries to place windows in columns without overlapping
+ - CascadePlacement: places windows below the titlebar of the previous one
++- CenterPlacement: places windows in the center of the current workspace
+ - UnderMousePlacement: places new windows underneath the mouse
+ - RowMinOverlapPlacement: place windows in rows with minimal overlapping
+ - ColMinOverlapPlacement: place windows in columns with minimal overlapping
+diff --git a/src/CenterPlacement.cc b/src/CenterPlacement.cc
+new file mode 100644
+index 00000000..efaf76b9
+--- /dev/null
++++ b/src/CenterPlacement.cc
+@@ -0,0 +1,43 @@
++// CenterPlacement.cc
++// Copyright (c) 2006 Fluxbox Team (fluxgen at fluxbox dot org)
++//
++// Permission is hereby granted, free of charge, to any person obtaining a
++// copy of this software and associated documentation files (the "Software"),
++// to deal in the Software without restriction, including without limitation
++// the rights to use, copy, modify, merge, publish, distribute, sublicense,
++// and/or sell copies of the Software, and to permit persons to whom the
++// Software is furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++
++#include "CenterPlacement.hh"
++
++#include "FbTk/App.hh"
++#include "Screen.hh"
++#include "Window.hh"
++
++bool CenterPlacement::placeWindow(const FluxboxWindow &win, int head,
++                                      int &place_x, int &place_y) {
++
++    int cent_x = (signed) win.screen().maxRight(head) - (signed) win.screen().maxLeft(head);
++    int cent_y = (signed) win.screen().maxBottom(head) - (signed) win.screen().maxTop(head);
++
++    // border on 1 side, dividing in half
++    // with rounding, this will probably favor top left
++    int win_half_w = (win.width() / 2) + win.fbWindow().borderWidth(),
++        win_half_h = (win.height() / 2) + win.fbWindow().borderWidth();
++
++    place_x = cent_x - win_half_w;
++    place_y = cent_y - win_half_h;
++
++    return true;
++}
+diff --git a/src/CenterPlacement.hh b/src/CenterPlacement.hh
+new file mode 100644
+index 00000000..9f70a6c8
+--- /dev/null
++++ b/src/CenterPlacement.hh
+@@ -0,0 +1,37 @@
++// CenterPlacement.hh
++// Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org)
++//
++// Permission is hereby granted, free of charge, to any person obtaining a
++// copy of this software and associated documentation files (the "Software"),
++// to deal in the Software without restriction, including without limitation
++// the rights to use, copy, modify, merge, publish, distribute, sublicense,
++// and/or sell copies of the Software, and to permit persons to whom the
++// Software is furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++
++#ifndef CENTERPLACEMENT_HH
++#define CENTERPLACEMENT_HH
++
++#include "ScreenPlacement.hh"
++
++class CenterPlacement: public PlacementStrategy {
++public:
++    CenterPlacement() { };
++
++    bool placeWindow(const FluxboxWindow &win, int head,
++                     int &place_x, int &place_y);
++
++private:
++};
++
++#endif // CENTERPLACEMENT_HH
+diff --git a/src/Makemodule.am b/src/Makemodule.am
+index 5be5692c..53d35e8e 100644
+--- a/src/Makemodule.am
++++ b/src/Makemodule.am
+@@ -165,6 +165,8 @@ fluxbox_SOURCES = \
+ 	src/AttentionNoticeHandler.hh \
+ 	src/CascadePlacement.cc \
+ 	src/CascadePlacement.hh \
++	src/CenterPlacement.cc \
++	src/CenterPlacement.hh \
+ 	src/ClientMenu.cc \
+ 	src/ClientMenu.hh \
+ 	src/ClientPattern.cc \
+diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
+index ca58d83f..ce47a910 100644
+--- a/src/ScreenPlacement.cc
++++ b/src/ScreenPlacement.cc
+@@ -24,6 +24,7 @@
+ #include "RowSmartPlacement.hh"
+ #include "MinOverlapPlacement.hh"
+ #include "UnderMousePlacement.hh"
++#include "CenterPlacement.hh"
+ #include "ColSmartPlacement.hh"
+ #include "CascadePlacement.hh"
+ 
+@@ -82,6 +83,9 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
+         case UNDERMOUSEPLACEMENT:
+             m_strategy.reset(new UnderMousePlacement());
+             break;
++        case CENTERPLACEMENT:
++            m_strategy.reset(new CenterPlacement());
++            break;
+         case AUTOTABPLACEMENT:
+             m_strategy.reset(0);
+             break;
+@@ -197,6 +201,8 @@ std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const
+         return "ColMinOverlapPlacement";
+     case ScreenPlacement::UNDERMOUSEPLACEMENT:
+         return "UnderMousePlacement";
++    case ScreenPlacement::CENTERPLACEMENT:
++        return "CenterPlacement";
+     case ScreenPlacement::CASCADEPLACEMENT:
+         return "CascadePlacement";
+     case ScreenPlacement::AUTOTABPLACEMENT:
+@@ -218,6 +224,8 @@ void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char
+         *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
+     else if (strcasecmp("UnderMousePlacement", str) == 0)
+         *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
++    else if (strcasecmp("CenterPlacement", str) == 0)
++        *(*this) = ScreenPlacement::CENTERPLACEMENT;
+     else if (strcasecmp("CascadePlacement", str) == 0)
+         *(*this) = ScreenPlacement::CASCADEPLACEMENT;
+     else if (strcasecmp("AutotabPlacement", str) == 0)
+diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
+index f1234983..a5c9b885 100644
+--- a/src/ScreenPlacement.hh
++++ b/src/ScreenPlacement.hh
+@@ -49,6 +49,7 @@ public:
+         ROWMINOVERLAPPLACEMENT,
+         CASCADEPLACEMENT,
+         UNDERMOUSEPLACEMENT,
++        CENTERPLACEMENT,
+         AUTOTABPLACEMENT
+     };
+ 
+-- 
+2.37.1
+
diff --git a/srcpkgs/fluxbox/patches/container_locks.patch b/srcpkgs/fluxbox/patches/container_locks.patch
new file mode 100644
index 000000000000..498ab44a23c6
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/container_locks.patch
@@ -0,0 +1,325 @@
+diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
+index 00bc1187..f8a4c475 100644
+--- a/src/FbWinFrame.cc
++++ b/src/FbWinFrame.cc
+@@ -148,6 +148,11 @@ FbWinFrame::FbWinFrame(BScreen &screen, unsigned int client_depth,
+     m_button_size(1),
+     m_shape(m_window, theme->shapePlace()) {
+ 
++    m_locker_timer.setTimeout(timerVal() ); // 10millisec
++    m_locker_timer.fireOnce(true);
++    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<FbWinFrame>(*this, &FbWinFrame::unlockSig));
++    m_locker_timer.setCommand(usig);
++
+     init();
+ }
+ 
+@@ -156,6 +161,27 @@ FbWinFrame::~FbWinFrame() {
+     removeAllButtons();
+ }
+ 
++// for incremental changes, back off for a bit
++// prevents slowdown from say, making 200 windows
++void FbWinFrame::resetLock() {
++    m_lock_gfx = true;
++    m_locker_timer.start();
++}
++
++void FbWinFrame::unlockSig() {
++    m_lock_gfx = false;
++    // this is what we wanted to do
++    FbTk::Container& tabs = tabcontainer();
++    tabs.setUpdateLock(m_lock_gfx);
++    renderTabContainer();
++    applyTabContainer();
++
++    tabs.clear();
++    tabs.raise();
++    tabs.show();
++}
++
++
+ bool FbWinFrame::setTabMode(TabMode tabmode) {
+     if (m_tabmode == tabmode)
+         return false;
+@@ -187,6 +213,7 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
+ 
+     } else {
+         tabs.setUpdateLock(true);
++        resetLock();
+ 
+         tabs.setAlignment(FbTk::Container::RELATIVE);
+         tabs.setOrientation(FbTk::ROT0);
+@@ -200,9 +227,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
+         }
+         tabs.setBorderWidth(0);
+         tabs.setMaxTotalSize(0);
+-        tabs.setUpdateLock(false);
++        tabs.setUpdateLock(m_lock_gfx);
+         tabs.setMaxSizePerClient(0);
+ 
++        if (m_lock_gfx)
++            return false;
++
+         renderTabContainer();
+         applyTabContainer();
+ 
+diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
+index 617b9b91..725c84a0 100644
+--- a/src/FbWinFrame.hh
++++ b/src/FbWinFrame.hh
+@@ -33,6 +33,7 @@
+ #include "FbTk/Container.hh"
+ #include "FbTk/Shape.hh"
+ #include "FbTk/Signal.hh"
++#include "FbTk/Timer.hh"
+ 
+ #include <vector>
+ #include <memory>
+@@ -176,6 +177,12 @@ public:
+     void setShapingClient(FbTk::FbWindow *win, bool always_update);
+     void updateShape() { m_shape.update(); }
+ 
++    void resetLock();
++    void unlockSig();
++    FbTk::Timer m_locker_timer;
++    static unsigned int timerVal() { return 10 * FbTk::FbTime::IN_MILLISECONDS; }
++    bool m_lock_gfx = false;
++
+     /**
+        @name accessors
+     */
+diff --git a/src/IconButton.cc b/src/IconButton.cc
+index 1290c2aa..2ea7af9e 100644
+--- a/src/IconButton.cc
++++ b/src/IconButton.cc
+@@ -71,8 +71,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent,
+ 
+     FbTk::EventManager::instance()->add(*this, m_icon_window);
+ 
+-    reconfigTheme();
+-    refreshEverything(false);
++    //reconfigTheme();
++    //refreshEverything(false);
+ }
+ 
+ IconButton::~IconButton() {
+@@ -163,12 +163,12 @@ void IconButton::reconfigTheme() {
+                            width(), height(), m_theme->texture(),
+                            orientation()));
+         setBackgroundPixmap(m_pm);
+-    } else{
++    } else {
+         m_pm.reset(0);
+         setBackgroundColor(m_theme->texture().color());
+     }
+ 
+-    updateBackground(false);
++    //updateBackground(false);
+ }
+ 
+ void IconButton::reconfigAndClear() {
+@@ -181,7 +181,8 @@ void IconButton::refreshEverything(bool setup) {
+     Display *display = FbTk::App::instance()->display();
+     int screen = m_win.screen().screenNumber();
+ 
+-    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None) {
++    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None &&
++                                     width() > m_icon_window.width() ) {
+         // setup icon window
+         m_icon_window.show();
+         unsigned int w = width();
+@@ -242,7 +243,6 @@ void IconButton::refreshEverything(bool setup) {
+         m_icon_window.clear();
+     }
+ 
+-
+ }
+ 
+ void IconButton::clientTitleChanged() {
+@@ -251,24 +251,30 @@ void IconButton::clientTitleChanged() {
+ 
+     if (m_has_tooltip)
+         showTooltip();
++
+ }
+ 
+ void IconButton::setupWindow() {
+     m_icon_window.clear();
++    //FbTk::FbString title = "wtf2";
+     FbTk::FbString title = m_win.title().logical();
+-    if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
+-        title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
++    //#if USE_TOOLBAR
++    //if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
++    //    title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
++    //#endif
+     setText(title);
+     FbTk::TextButton::clear();
+ }
+ 
+ void IconButton::drawText(int x, int y, FbTk::FbDrawable *drawable) {
+ 
+-    // offset text
+-    if (m_icon_pixmap.drawable() != 0)
+-        FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
+-    else
+-        FbTk::TextButton::drawText(1, y, drawable);
++    if (width() > m_icon_window.width() ) {
++      // offset text
++      if (m_icon_pixmap.drawable() != 0)
++          FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
++      else
++          FbTk::TextButton::drawText(1, y, drawable);
++    }
+ }
+ 
+ bool IconButton::setOrientation(FbTk::Orientation orient) {
+diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
+index 027ab1c6..f64a4cf6 100644
+--- a/src/IconbarTool.cc
++++ b/src/IconbarTool.cc
+@@ -300,6 +300,11 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
+     FbTk::RefCount<FbTk::Command<void> > ers(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::emitResizeSig));
+     m_resizeSig_timer.setCommand(ers);
+ 
++    m_locker_timer.setTimeout(IconButton::updateLaziness() / 10); // 10millisec
++    m_locker_timer.fireOnce(true);
++    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::unlockSig));
++    m_locker_timer.setCommand(usig);
++
+     themeReconfigured();
+ }
+ 
+@@ -325,7 +330,7 @@ void IconbarTool::updateMaxSizes(unsigned int width, unsigned int height) {
+ 
+ void IconbarTool::resize(unsigned int width, unsigned int height) {
+     m_icon_container.resize(width, height);
+-    updateMaxSizes(width, height);
++    //updateMaxSizes(width, height);
+     renderTheme();
+ }
+ 
+@@ -333,7 +338,7 @@ void IconbarTool::moveResize(int x, int y,
+                              unsigned int width, unsigned int height) {
+ 
+     m_icon_container.moveResize(x, y, width, height);
+-    updateMaxSizes(width, height);
++    //updateMaxSizes(width, height);
+     renderTheme();
+ }
+ 
+@@ -393,6 +398,25 @@ void IconbarTool::setMode(string mode) {
+     m_menu.reconfigure();
+ }
+ 
++// for incremental changes, back off for a bit
++// prevents slowdown from say, making 200 windows
++void IconbarTool::resetLock() {
++    m_lock_gfx = true;
++    m_locker_timer.start();
++}
++
++void IconbarTool::unlockSig() {
++    m_lock_gfx = false;
++    //resizeSig().emit();
++    // this is what we wanted to do
++    m_icon_container.setUpdateLock(false);
++    m_icon_container.update();
++    m_icon_container.showSubwindows();
++    renderTheme();
++    update(ALIGN, NULL);
++    m_resizeSig_timer.start();
++}
++
+ void IconbarTool::emitResizeSig() {
+     resizeSig().emit();
+ }
+@@ -441,9 +465,11 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
+     switch(reason) {
+         case LIST_ADD: case LIST_ORDER:
+             insertWindow(*win);
++            resetLock();
+             break;
+         case LIST_REMOVE:
+             removeWindow(*win);
++            resetLock();
+             break;
+         case LIST_RESET:
+             reset();
+@@ -455,6 +481,10 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
+     m_resizeSig_timer.start();
+ 
+     updateMaxSizes(width(), height());
++
++    if (m_lock_gfx)
++        return;
++
+     // unlock container and update graphics
+     m_icon_container.setUpdateLock(false);
+     m_icon_container.update();
+@@ -496,13 +526,13 @@ void IconbarTool::insertWindow(Focusable &win, int pos) {
+         button = makeButton(win);
+     if (!button) return;
+ 
+-    if (pos == -2) {
+-        pos = 0;
+-        list<Focusable *>::iterator it = m_winlist->clientList().begin(),
+-                                    it_end = m_winlist->clientList().end();
+-        for (; it != it_end && *it != &win; ++it)
+-            pos++;
+-    }
++    //if (pos == -2) {
++    //    pos = 0;
++    //    list<Focusable *>::iterator it = m_winlist->clientList().begin(),
++    //                                it_end = m_winlist->clientList().end();
++    //    for (; it != it_end && *it != &win; ++it)
++    //        pos++;
++    //}
+ 
+     m_icon_container.insertItem(button, pos);
+     m_tracker.join(button->titleChanged(), FbTk::MemFun(m_resizeSig_timer, &FbTk::Timer::start));
+@@ -517,9 +547,9 @@ void IconbarTool::updateSizing() {
+     m_icon_container.setBorderWidth(m_theme.border().width());
+     m_icon_container.setBorderColor(m_theme.border().color());
+ 
+-    FbTk::STLUtil::forAll(m_icons, 
+-            FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
+-                FbTk::Select2nd<IconMap::value_type>()));
++    //FbTk::STLUtil::forAll(m_icons, 
++    //        FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
++    //            FbTk::Select2nd<IconMap::value_type>()));
+ 
+ }
+ 
+@@ -560,7 +590,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear) {
+ 
+     button.setPixmap(*m_rc_use_pixmap);
+     button.setTextPadding(*m_rc_client_padding);
+-    button.reconfigTheme();
++    //button.reconfigTheme();
+     if (clear)
+         button.clear(); // the clear also updates transparent
+ }
+diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
+index df6d9a65..1c2101ac 100644
+--- a/src/IconbarTool.hh
++++ b/src/IconbarTool.hh
+@@ -106,6 +106,9 @@ private:
+ 
+     void themeReconfigured();
+ 
++    void resetLock();
++    void unlockSig();
++    FbTk::Timer m_locker_timer;
+     FbTk::Timer m_resizeSig_timer;
+     void emitResizeSig();
+ 
+@@ -128,6 +131,7 @@ private:
+     FbMenu m_menu;
+     int m_alpha;
+     static std::string s_iconifiedDecoration[2];
++    bool m_lock_gfx = false;
+ };
+ 
+ #endif // ICONBARTOOL_HH
diff --git a/srcpkgs/fluxbox/patches/container_relative_relative.patch b/srcpkgs/fluxbox/patches/container_relative_relative.patch
new file mode 100644
index 000000000000..dc3ddb5181b5
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/container_relative_relative.patch
@@ -0,0 +1,15 @@
+diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
+index cea761b3..0e050a0b 100644
+--- a/src/FbTk/Container.cc
++++ b/src/FbTk/Container.cc
+@@ -365,6 +365,9 @@ void Container::repositionItems() {
+     const ItemList::iterator it_end = end();
+
+     int rounding_error = 0;
++    if (align == RELATIVE || total_width == m_max_total_size) {
++        rounding_error = total_width - ((max_width_per_client + borderW)* num_items - borderW);
++    }
+
+     int next_x = -borderW; // zero so the border of the first shows
+     int extra = 0;
+
diff --git a/srcpkgs/fluxbox/patches/flux_improve.patch b/srcpkgs/fluxbox/patches/flux_improve.patch
new file mode 100644
index 000000000000..13a1aeba621c
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/flux_improve.patch
@@ -0,0 +1,205 @@
+diff --git a/src/Ewmh.cc b/src/Ewmh.cc
+index e12a7923..db1ddd45 100644
+--- a/src/Ewmh.cc
++++ b/src/Ewmh.cc
+@@ -1096,15 +1096,19 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
+         // ce.data.l[0] = the action (remove, add or toggle)
+         // ce.data.l[1] = the first property to alter
+         // ce.data.l[2] = second property to alter (can be zero)
+-        if (ce.data.l[0] == STATE_REMOVE) {
+-            setState(win, ce.data.l[1], false, *winclient);
+-            setState(win, ce.data.l[2], false, *winclient);
+-        } else if (ce.data.l[0] == STATE_ADD) {
+-            setState(win, ce.data.l[1], true, *winclient);
+-            setState(win, ce.data.l[2], true, *winclient);
+-        } else if (ce.data.l[0] == STATE_TOGGLE) {
+-            toggleState(win, ce.data.l[1]);
+-            toggleState(win, ce.data.l[2]);
++        bool addremove = false; // add true, remove false
++
++        switch (ce.data.l[0]) {
++          case STATE_TOGGLE:
++              toggleState(win, ce.data.l[1]);
++              toggleState(win, ce.data.l[2]);
++              break;
++          case STATE_ADD:
++              addremove = true;
++          case STATE_REMOVE:
++              setState(win, ce.data.l[1], addremove, *winclient);
++              setState(win, ce.data.l[2], addremove, *winclient);
++              break;
+         }
+         return true;
+     } else if (ce.message_type == m_net->number_of_desktops) {
+diff --git a/src/FbMenuParser.cc b/src/FbMenuParser.cc
+index 716ced29..5a56e6f5 100644
+--- a/src/FbMenuParser.cc
++++ b/src/FbMenuParser.cc
+@@ -33,9 +33,9 @@ bool FbMenuParser::open(const std::string &filename) {
+ }
+ 
+ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
+-    if (eof()) {        
++    if (eof()) {
+         out = FbTk::Parser::s_empty_item;
+-        return *this; 
++        return *this;
+     }
+ 
+     if (m_curr_line.empty())
+@@ -69,20 +69,26 @@ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
+         return (*this)>>out;
+         break;
+     }
+-    
++
+     std::string key;
+     int err = FbTk::StringUtil::
+         getStringBetween(key, m_curr_line.c_str() + m_curr_pos,
+                          first, second);
+-    if (err <= 0) {        
+-        if (m_curr_token == TYPE)
++    if (err <= 0) {
++        switch (m_curr_token) {
++          case TYPE:
+             m_curr_token = NAME;
+-        else if (m_curr_token == NAME)
++            break;
++          case NAME:
+             m_curr_token = ARGUMENT;
+-        else if (m_curr_token == ARGUMENT)
++            break;
++          case ARGUMENT:
+             m_curr_token = ICON;
+-        else if (m_curr_token == ICON)
++            break;
++          case ICON:
+             m_curr_token = DONE;
++            break;
++        }
+ 
+         out = FbTk::Parser::s_empty_item;
+         return *this;
+diff --git a/src/Remember.cc b/src/Remember.cc
+index 49e61062..4f0ba3db 100644
+--- a/src/Remember.cc
++++ b/src/Remember.cc
+@@ -802,39 +802,41 @@ void Remember::reload() {
+             int pos = getStringBetween(key, line.c_str(), '[', ']');
+             string lc_key = toLower(key);
+ 
+-            if (pos > 0 && (lc_key == "app" || lc_key == "transient")) {
+-                ClientPattern *pat = new ClientPattern(line.c_str() + pos);
+-                if (!in_group) {
+-                    if ((err = pat->error()) == 0) {
+-                        bool transient = (lc_key == "transient");
+-                        Application *app = findMatchingPatterns(pat,
+-                                               old_pats, transient, false);
+-                        if (app) {
+-                            app->reset();
+-                            reused_apps.insert(app);
++            if (pos > 0) {
++                if (lc_key == "app" || lc_key == "transient") {
++                    ClientPattern *pat = new ClientPattern(line.c_str() + pos);
++                    if (!in_group) {
++                        if ((err = pat->error()) == 0) {
++                            bool transient = (lc_key == "transient");
++                            Application *app = findMatchingPatterns(pat,
++                                                   old_pats, transient, false);
++                            if (app) {
++                                app->reset();
++                                reused_apps.insert(app);
++                            } else {
++                                app = new Application(transient, false);
++                            }
++
++                            m_pats->push_back(make_pair(pat, app));
++                            row += parseApp(apps_file, *app);
+                         } else {
+-                            app = new Application(transient, false);
++                            cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
++                            delete pat; // since it didn't work
+                         }
+-
+-                        m_pats->push_back(make_pair(pat, app));
+-                        row += parseApp(apps_file, *app);
+                     } else {
+-                        cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
+-                        delete pat; // since it didn't work
++                        grouped_pats.push_back(pat);
+                     }
+-                } else {
+-                    grouped_pats.push_back(pat);
+-                }
+-            } else if (pos > 0 && lc_key == "startup" && fb.isStartup()) {
+-                if (!handleStartupItem(line, pos)) {
+-                    cerr<<"Error reading apps file at line "<<row<<"."<<endl;
++                } else if (lc_key == "startup" && fb.isStartup()) {
++                    if (!handleStartupItem(line, pos)) {
++                        cerr<<"Error reading apps file at line "<<row<<"."<<endl;
++                    }
++                    // save the item even if it was bad (aren't we nice)
++                    m_startups.push_back(line.substr(pos));
++                } else if (lc_key == "group") {
++                    in_group = true;
++                    if (line.find('(') != string::npos)
++                        pat = new ClientPattern(line.c_str() + pos);
+                 }
+-                // save the item even if it was bad (aren't we nice)
+-                m_startups.push_back(line.substr(pos));
+-            } else if (pos > 0 && lc_key == "group") {
+-                in_group = true;
+-                if (line.find('(') != string::npos)
+-                    pat = new ClientPattern(line.c_str() + pos);
+             } else if (in_group) {
+                 // otherwise assume that it is the start of the attributes
+                 Application *app = 0;
+diff --git a/src/SystemTray.cc b/src/SystemTray.cc
+index 8c42877a..1fc2b0a8 100644
+--- a/src/SystemTray.cc
++++ b/src/SystemTray.cc
+@@ -550,10 +550,12 @@ void SystemTray::rearrangeClients() {
+     ClientList::iterator client_it = m_clients.begin();
+     ClientList::iterator client_it_end = m_clients.end();
+     int next_x = bw;
++    int x, y;
+     for (; client_it != client_it_end; ++client_it) {
+         if (!(*client_it)->isVisible())
+             continue;
+-        int x = next_x, y = bw;
++        x = next_x;
++        y = bw;
+         next_x += h_rot0+bw;
+         translateCoords(orientation(), x, y, w_rot0, h_rot0);
+         translatePosition(orientation(), x, y, h_rot0, h_rot0, 0);
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..713d1510 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -3267,14 +3267,18 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top, bool resize) {
+ FluxboxWindow::ReferenceCorner FluxboxWindow::getResizeDirection(int x, int y,
+         ResizeModel model, int corner_size_px, int corner_size_pc) const
+ {
+-    if (model == TOPLEFTRESIZE)     return LEFTTOP;
+-    if (model == TOPRESIZE)         return TOP;
+-    if (model == TOPRIGHTRESIZE)    return RIGHTTOP;
+-    if (model == LEFTRESIZE)        return LEFT;
+-    if (model == RIGHTRESIZE)       return RIGHT;
+-    if (model == BOTTOMLEFTRESIZE)  return LEFTBOTTOM;
+-    if (model == BOTTOMRESIZE)      return BOTTOM;
+-    if (model == CENTERRESIZE)      return CENTER;
++    switch (model) {
++    case TOPLEFTRESIZE:     return LEFTTOP;
++    case TOPRESIZE:         return TOP;
++    case TOPRIGHTRESIZE:    return RIGHTTOP;
++    case LEFTRESIZE:        return LEFT;
++    case RIGHTRESIZE:       return RIGHT;
++    case BOTTOMLEFTRESIZE:  return LEFTBOTTOM;
++    case BOTTOMRESIZE:      return BOTTOM;
++    case CENTERRESIZE:      return CENTER;
++    default:
++    break;
++    }
+ 
+     if (model == EDGEORCORNERRESIZE)
+     {
diff --git a/srcpkgs/fluxbox/patches/flux_oversize.patch b/srcpkgs/fluxbox/patches/flux_oversize.patch
new file mode 100644
index 000000000000..98d70d3b037e
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/flux_oversize.patch
@@ -0,0 +1,24 @@
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..02d10e90 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -532,19 +532,14 @@ void FluxboxWindow::init() {
+     if (!m_state.fullscreen) {
+         unsigned int new_width = 0, new_height = 0;
+         if (m_client->width() >= screen().width()) {
+-            m_state.maximized |= WindowState::MAX_HORZ;
+             new_width = 2 * screen().width() / 3;
+         }
+         if (m_client->height() >= screen().height()) {
+-            m_state.maximized |= WindowState::MAX_VERT;
+             new_height = 2 * screen().height() / 3;
+         }
+         if (new_width || new_height) {
+-            const int maximized = m_state.maximized;
+-            m_state.maximized = WindowState::MAX_NONE;
+             resize(new_width ? new_width : width(), new_height ? new_height : height());
+             m_placed = false;
+-            m_state.maximized = maximized;
+         }
+     }
+ 
diff --git a/srcpkgs/fluxbox/patches/focus_close_menu.patch b/srcpkgs/fluxbox/patches/focus_close_menu.patch
new file mode 100644
index 000000000000..01830cf53460
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/focus_close_menu.patch
@@ -0,0 +1,17 @@
+diff --git a/src/FocusControl.cc b/src/FocusControl.cc
+index 54c3d46c..7e49ff51 100644
+--- a/src/FocusControl.cc
++++ b/src/FocusControl.cc
+@@ -247,11 +247,7 @@ void FocusControl::stopCyclingFocus() {
+ 
+     // put currently focused window to top
+     if (s_focused_window) {
+-        // re-focus last window to give the client a chance to redistribute the
+-        // focus internally (client-side only modality)
+-        s_focused_window->focus();
+-        if (s_focused_window)
+-            setScreenFocusedWindow(*s_focused_window);
++        setScreenFocusedWindow(*s_focused_window);
+         if (s_focused_fbwindow)
+             s_focused_fbwindow->raise();
+     } else
diff --git a/srcpkgs/fluxbox/patches/slit_raise.patch b/srcpkgs/fluxbox/patches/slit_raise.patch
new file mode 100644
index 000000000000..a3bc01c7ac85
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/slit_raise.patch
@@ -0,0 +1,16 @@
+diff --git a/src/Slit.cc b/src/Slit.cc
+index 9baecf21..63ed8269 100644
+--- a/src/Slit.cc
++++ b/src/Slit.cc
+@@ -958,8 +958,8 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
+         return;
+     }
+
+-    if (be.button == 1)
+-        frame.window.raise();
++    //if (be.button == 1)
++    //    frame.window.raise();
+
+     if (be.button != Button3) {
+         XAllowEvents(dpy, ReplayPointer, CurrentTime);
+
diff --git a/srcpkgs/fluxbox/patches/toolbar_redo.patch b/srcpkgs/fluxbox/patches/toolbar_redo.patch
new file mode 100644
index 000000000000..ca95486583ce
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/toolbar_redo.patch
@@ -0,0 +1,228 @@
+diff --git a/src/Toolbar.cc b/src/Toolbar.cc
+index aa9bc121..ee8b8bfc 100644
+--- a/src/Toolbar.cc
++++ b/src/Toolbar.cc
+@@ -74,7 +74,7 @@ using FbTk::STLUtil::forAll;
+ 
+ namespace {
+ 
+-const struct { 
++const struct {
+     Toolbar::Placement placement;
+     const char* str;
+     FbTk::Orientation orient;
+@@ -362,13 +362,16 @@ void Toolbar::lower() {
+ }
+ 
+ void Toolbar::screenChanged(BScreen &screen) {
+-    reconfigure();
++    //reconfigure();
+ }
+ 
+ void Toolbar::relayout() {
+-    forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
+-    rearrangeItems();
+-    forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
++    //for (auto it : m_item_list)    (*item_it)->updateSizing();
++    //rearrangeItems();
++    //for (auto it : m_item_list)    (*item_it)->renderTheme(alpha());
++    //forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
++    //rearrangeItems();
++    //forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
+ }
+ 
+ void Toolbar::reconfigure() {
+@@ -557,12 +560,16 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
+ }
+ 
+ void Toolbar::updateCrossingState() {
+-    Window wr, wc;
+-    int rx, ry, x, y;
++    //Window wr, wc;
++    //int rx, ry, x, y;
++    //unsigned int mask;
++    Window wrc;
++    int rxy, x, y;
+     unsigned int mask;
+     const int bw = -theme()->border().width();
+     bool hovered = false;
+-    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
++    //if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
++    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wrc, &wrc, &rxy, &rxy, &x, &y, &mask))
+         hovered = x >= bw && y >= bw && x < int(width()) && y < int(height());
+     if (hovered) {
+         if (m_rc_auto_raise)
+@@ -910,25 +917,26 @@ void Toolbar::rearrangeItems() {
+     // lock this
+     m_resize_lock = true;
+     // calculate size for fixed items
+-    ItemList::iterator item_it = m_item_list.begin();
+-    ItemList::iterator item_it_end = m_item_list.end();
++    //ItemList::iterator item_it = m_item_list.begin();
++    //ItemList::iterator item_it_end = m_item_list.end();
+     int bevel_width = theme()->bevelWidth();
+     int fixed_width = bevel_width; // combined size of all fixed items
+     int relative_width = 0; // combined *desired* size of all relative items
+-    int stretch_items = 0;
+     int relative_items = 0;
+     int last_bw = 0; // we show the largest border of adjoining items
+     bool first = true;
++    int leftover_width = 0;
+ 
+     unsigned int width = this->width(), height = this->height();
+     unsigned int tmpw, tmph;
+     FbTk::translateSize(orient, width, height);
+ 
+-    for (; item_it != item_it_end; ++item_it) {
+-        if (!(*item_it)->active())
++    //for (; item_it != item_it_end; ++item_it) {
++    for (auto item_it : m_item_list) {
++        if (!(*item_it).active())
+             continue;
+ 
+-        int borderW = (*item_it)->borderWidth();
++        int borderW = (*item_it).borderWidth();
+ 
+         if (bevel_width > 0) {
+             // the bevel and border are fixed whether relative or not
+@@ -943,35 +951,35 @@ void Toolbar::rearrangeItems() {
+ 
+         last_bw = borderW;
+ 
+-        tmpw = (*item_it)->preferredWidth();
+-        tmph = (*item_it)->height();
++        tmpw = (*item_it).preferredWidth();
++        tmph = (*item_it).height();
+         FbTk::translateSize(orient, tmpw, tmph);
+ 
+-        if ((*item_it)->type() == ToolbarItem::FIXED) {
+-            fixed_width += tmpw;
+-        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
+-            fixed_width += height;
+-            if (bevel_width)
+-                fixed_width -= 2*(borderW + bevel_width);
+-        } else {
+-            ++relative_items;
+-            relative_width += tmpw;
+-            if (!tmpw)
+-                ++stretch_items;
++        switch ( (*item_it).type() ) {
++            case ToolbarItem::FIXED:
++                fixed_width += tmpw;
++                break;
++            case ToolbarItem::SQUARE:
++                fixed_width += height;
++                if (bevel_width)
++                    fixed_width -= 2*(borderW + bevel_width);
++                break;
++            case ToolbarItem::RELATIVE:
++                ++relative_items;
++                relative_width += tmpw;
++                break;
++            default:
++                break;
+         }
+     }
+ 
+     // calculate what's going to be left over to the relative sized items
+-    float stretch_factor = 1.0f;
+     if (relative_items) {
+-        if (relative_width <= width - fixed_width && stretch_items) {
+-            relative_width = int(width - fixed_width - relative_width)/stretch_items;
+-        } else if (relative_width) {
+-            stretch_factor = float(width - fixed_width)/relative_width;
+-            relative_width = 0;
+-        }
++        relative_width = (width - fixed_width) / relative_items;
++        leftover_width = width - fixed_width - relative_items * relative_width;
+     }
+ 
++
+     // now move and resize the items
+     // borderWidth added back on straight away
+     int next_x = -m_item_list.front()->borderWidth(); // list isn't empty
+@@ -979,19 +987,22 @@ void Toolbar::rearrangeItems() {
+         next_x = 0;
+ 
+     last_bw = 0;
+-    for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
+-        int borderW = (*item_it)->borderWidth();
+-        if (!(*item_it)->active()) {
+-            (*item_it)->hide();
++    int borderW, offset, size_offset, tmpx, tmpy;
++
++    //for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
++    for (auto item_it : m_item_list) {
++        borderW = (*item_it).borderWidth();
++        if (!(*item_it).active()) {
++            (*item_it).hide();
+             // make sure it still gets told the toolbar height
+             tmpw = 1; tmph = height - 2*(bevel_width+borderW);
+             if (tmph >= (1<<30)) tmph = 1;
+             FbTk::translateSize(orient, tmpw, tmph);
+-            (*item_it)->resize(tmpw, tmph);  // width of 0 changes to 1 anyway
++            (*item_it).resize(tmpw, tmph);  // width of 0 changes to 1 anyway
+             continue;
+         }
+-        int offset = bevel_width;
+-        int size_offset = 2*(borderW + bevel_width);
++        offset = bevel_width;
++        size_offset = 2*(borderW + bevel_width);
+ 
+         if (bevel_width == 0) {
+             offset = -borderW;
+@@ -1000,22 +1011,28 @@ void Toolbar::rearrangeItems() {
+         }
+         last_bw = borderW;
+ 
+-        int tmpx = next_x + offset,
+-            tmpy = offset;
+-
+-        if ((*item_it)->type() == ToolbarItem::RELATIVE) {
+-            unsigned int itemw = (*item_it)->preferredWidth(), itemh = (*item_it)->height();
+-            FbTk::translateSize(orient, itemw, itemh);
+-            tmpw = itemw ? std::floor(stretch_factor * itemw) : relative_width;
+-            tmph = height - size_offset;
+-        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
+-            tmpw = tmph = height - size_offset;
+-        } else { // fixed size
+-            unsigned int itemw = (*item_it)->width(), itemh = (*item_it)->height();
+-            FbTk::translateSize(orient, itemw, itemh);
+-            tmpw = itemw;
+-            tmph = height - size_offset;
++        tmpx = next_x + offset,
++        tmpy = offset;
++        tmph = height - size_offset;
++
++        switch ( (*item_it).type() ) {
++            case ToolbarItem::SQUARE:
++                tmpw = tmph;
++                break;
++            case ToolbarItem::RELATIVE:
++                tmpw = relative_width;
++                if (leftover_width) {
++                    --leftover_width;
++                    ++tmpw;
++                }
++                break;
++            case ToolbarItem::FIXED:
++                unsigned int itemw = (*item_it).width(), itemh = (*item_it).height();
++                FbTk::translateSize(orient, itemw, itemh);
++                tmpw = itemw;
++                break;
+         }
++
+         if (tmpw >= (1<<30)) tmpw = 1;
+         if (tmph >= (1<<30)) tmph = 1;
+         next_x += tmpw + bevel_width;
+@@ -1025,8 +1042,8 @@ void Toolbar::rearrangeItems() {
+         FbTk::translateCoords(orient, tmpx, tmpy, width, height);
+         FbTk::translatePosition(orient, tmpx, tmpy, tmpw, tmph, borderW);
+         FbTk::translateSize(orient, tmpw, tmph);
+-        (*item_it)->moveResize(tmpx, tmpy, tmpw, tmph);
+-        (*item_it)->show();
++        (*item_it).moveResize(tmpx, tmpy, tmpw, tmph);
++        //(*item_it).show();
+ 
+     }
+     // unlock
diff --git a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
new file mode 100644
index 000000000000..189a314607bd
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
@@ -0,0 +1,350 @@
+diff --git a/src/FbTk/EventManager.cc b/src/FbTk/EventManager.cc
+index 3df56de5..501766cc 100644
+--- a/src/FbTk/EventManager.cc
++++ b/src/FbTk/EventManager.cc
+@@ -194,23 +194,22 @@ void EventManager::dispatch(Window win, XEvent &ev, bool parent) {
+ 
+     // find out which window is the parent and
+     // dispatch event
+-    Window root, parent_win, *children = 0;
+-    unsigned int num_children;
+-    if (XQueryTree(FbTk::App::instance()->display(), win,
+-                   &root, &parent_win, &children, &num_children) != 0) {
+-        if (children != 0)
+-            XFree(children);
+-
+-        if (parent_win != 0 &&
+-            parent_win != root) {
+-            if (m_parent[parent_win] == 0)
+-                return;
+-
+-            // dispatch event to parent
+-            dispatch(parent_win, ev, true);
+-        }
+-    }
+-
++//    Window root, parent_win, *children = 0;
++//    unsigned int num_children;
++//    if (XQueryTree(FbTk::App::instance()->display(), win,
++//                   &root, &parent_win, &children, &num_children) != 0) {
++//        if (children != 0)
++//            XFree(children);
++//
++//        if (parent_win != 0 &&
++//            parent_win != root) {
++//            if (m_parent[parent_win] == 0)
++//                return;
++//
++//            // dispatch event to parent
++//            dispatch(parent_win, ev, true);
++//        }
++//    }
+ }
+ 
+ } // end namespace FbTk
+diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc
+index 73f2ea06..cf863021 100644
+--- a/src/FbTk/KeyUtil.cc
++++ b/src/FbTk/KeyUtil.cc
+@@ -141,13 +141,14 @@ void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win,
+     const unsigned int scrollmod = instance().scrolllock();
+ 
+     // Grab with numlock, capslock and scrlock
+-    for (int i = 0; i < 8; i++) {
+-        XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
+-                    (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
+-                    win, False, event_mask, GrabModeSync, GrabModeAsync,
+-                    None, cursor);
+-    }
+-
++    //for (int i = 0; i < 8; i++) {
++    //    XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
++    //                (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
++    //                win, True, event_mask, GrabModeSync, GrabModeAsync,
++    //                None, cursor);
++    //}
++    XGrabButton(display, button, mod, win, True, event_mask,
++                GrabModeSync, GrabModeAsync, None, cursor);
+ }
+ 
+ /**
+diff --git a/src/Keys.cc b/src/Keys.cc
+index 86591371..c27037e2 100644
+--- a/src/Keys.cc
++++ b/src/Keys.cc
+@@ -277,7 +277,7 @@ void Keys::grabWindow(Window win) {
+     if (win_it == m_window_map.end())
+         return;
+ 
+-    m_handler_map[win]->grabButtons();
++    //m_handler_map[win]->grabButtons();
+     t_key::keylist_t::iterator it = m_keylist->keylist.begin();
+     t_key::keylist_t::iterator it_end = m_keylist->keylist.end();
+     for (; it != it_end; ++it) {
+@@ -586,16 +586,16 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+         isdouble = double_click;
+     }
+ 
+-    auto resetKeyChain = [&]() {
+-        first_key_time = 0;
+-        next_key.reset();
+-        if (saved_keymode) {
+-            setKeyMode(saved_keymode);
+-            saved_keymode.reset();
+-        }
+-    };
+-    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
+-        resetKeyChain();
++//    auto resetKeyChain = [&]() {
++//        first_key_time = 0;
++//        next_key.reset();
++//        if (saved_keymode) {
++//            setKeyMode(saved_keymode);
++//            saved_keymode.reset();
++//        }
++//    };
++//    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
++//        resetKeyChain();
+ 
+     if (!next_key)
+         next_key = m_keylist;
+@@ -612,29 +612,29 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+         next_key->find(MotionNotify, mods, key, context, false))
+         return true; // if there's a motion action, prevent replay to the client (but do nothing)
+ 
+-    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
+-        if (!saved_keymode) {
+-            first_key_time = time;
+-            saved_keymode = m_keylist;
+-        }
+-        next_key = temp_key;
+-        setKeyMode(next_key);
+-        return true;
+-    }
++//    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
++//        if (!saved_keymode) {
++//            first_key_time = time;
++//            saved_keymode = m_keylist;
++//        }
++//        next_key = temp_key;
++//        setKeyMode(next_key);
++//        return true;
++//    }
++
+     if (!temp_key || temp_key->m_command == 0) {
+-        if (type == KeyPress &&
+-            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
+-            // if we're in the middle of an emacs-style keychain, exit it
+-            resetKeyChain();
+-        }
++//        if (type == KeyPress &&
++//            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
++//            // if we're in the middle of an emacs-style keychain, exit it
++//            resetKeyChain();
++//        }
+         return false;
+     }
+ 
+     // if focus changes, windows will get NotifyWhileGrabbed,
+     // which they tend to ignore
+-    if (type == KeyPress) {
++    if (type == KeyPress)
+         XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
+-    }
+ 
+     WinClient *old = WindowCmd<void>::client();
+     WindowCmd<void>::setClient(current);
+@@ -650,12 +650,13 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+     temp_key->m_command->execute();
+     WindowCmd<void>::setClient(old);
+ 
+-    if (saved_keymode) {
+-        if (next_key == m_keylist) // don't reset keymode if command changed it
+-            setKeyMode(saved_keymode);
+-        saved_keymode.reset();
+-    }
+-    next_key.reset();
++//    if (saved_keymode) {
++//        if (next_key == m_keylist) // don't reset keymode if command changed it
++//            setKeyMode(saved_keymode);
++//        saved_keymode.reset();
++//    }
++//    next_key.reset();
++
+     return true;
+ }
+ 
+@@ -685,15 +686,16 @@ void Keys::reconfigure() {
+ }
+ 
+ void Keys::regrab() {
+-    setKeyMode(m_keylist);
++    //setKeyMode(m_keylist);
+ }
+ 
+ void Keys::keyMode(const string& keyMode) {
+-    keyspace_t::iterator it = m_map.find(keyMode + ":");
+-    if (it == m_map.end())
++    //keyspace_t::iterator it = m_map.find(keyMode + ":");
++    //if (it == m_map.end())
++    //    setKeyMode(m_map["default:"]);
++    //else
++    //    setKeyMode(it->second);
+         setKeyMode(m_map["default:"]);
+-    else
+-        setKeyMode(it->second);
+ }
+ 
+ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
+@@ -701,10 +703,10 @@ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
+     ungrabButtons();
+ 
+     // notify handlers that their buttons have been ungrabbed
+-    HandlerMap::iterator h_it = m_handler_map.begin(),
+-                         h_it_end  = m_handler_map.end();
+-    for (; h_it != h_it_end; ++h_it)
+-        h_it->second->grabButtons();
++    //HandlerMap::iterator h_it = m_handler_map.begin(),
++    //                     h_it_end  = m_handler_map.end();
++    //for (; h_it != h_it_end; ++h_it)
++    //    h_it->second->grabButtons();
+ 
+     t_key::keylist_t::iterator it = keyMode->keylist.begin();
+     t_key::keylist_t::iterator it_end = keyMode->keylist.end();
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..457c30c6 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -1133,13 +1133,25 @@ void FluxboxWindow::updateSizeHints() {
+ }
+ 
+ void FluxboxWindow::grabButtons() {
+-
++//NOGRAB
++    //if (m_client->window() != frame().window().window() ) return;
+     // needed for click to focus
+-    XGrabButton(display, Button1, AnyModifier,
+-                frame().window().window(), True, ButtonPressMask,
+-                GrabModeSync, GrabModeSync, None, None);
+-    XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
+-                  frame().window().window());
++    // grabbing async here breaks mouse1
++    //XGrabButton(display, Button1, AnyModifier,
++    //            frame().window().window(), True, ButtonPressMask,
++    //            GrabModeSync, GrabModeSync, None, None);
++    //            //GrabModeAsync, GrabModeAsync, None, None);
++    //XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
++    //              frame().window().window());
++    //XGrabPointer(display,
++    //             frame().window().window(),
++    //             True,
++    //             ButtonPressMask,
++    //             GrabModeAsync, GrabModeAsync,
++    //             None,
++    //             None,
++    //             CurrentTime);
++    //XUngrabPointer(display, CurrentTime);
+ }
+ 
+ 
+@@ -2429,63 +2441,41 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
+     m_last_pressed_button = be.button;
+ 
+     FbTk::Menu::hideShownMenu();
+-
++//FIX ALLOW
+     Keys *k = Fluxbox::instance()->keys();
+     int context = 0;
+     context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);
+     if (!context && be.subwindow)
+         context = frame().getContext(be.window);
+ 
+-    if (k->doAction(be.type, be.state, be.button, context, &winClient(), be.time)) {
+-        XAllowEvents(display, SyncPointer, CurrentTime);
+-        return;
+-    }
+-
+-    WinClient *client = 0;
+-    if (!screen().focusControl().isMouseTabFocus()) {
+-        // determine if we're in a label button (tab)
+-        client = winClientOfLabelButtonWindow(be.window);
+-    }
+-
+-
+-    // - refeed the event into the queue so the app or titlebar subwindow gets it
+-    if (be.subwindow)
+-        XAllowEvents(display, ReplayPointer, CurrentTime);
+-    else
+-        XAllowEvents(display, SyncPointer, CurrentTime);
+-
+-    // if nothing was bound via keys-file then
+-    // - raise() if clickRaise is enabled
+-    // - hide open menues
+-    // - focus on clickFocus
+-    if (frame().window().window() == be.window) {
+-        if (screen().clickRaises())
+-            raise();
+-
+-        m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
+-        m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
+-    }
+-
+-    if (!m_focused && acceptsFocus() && m_click_focus)
+-        focus();
+-
+-    if (!screen().focusControl().isMouseTabFocus() &&
+-        client && client != m_client &&
+-        !screen().focusControl().isIgnored(be.x_root, be.y_root) ) {
+-        setCurrentClient(*client, isFocused());
+-    }
+-
+-
+-
++std::cout << "button window: " << be.window << "\nbutton subwindow: " << be.subwindow << "\n";
++k->doAction(be.type, be.state, be.button, context, &winClient(), CurrentTime); // w/o this, no mouse cmds
++XAllowEvents(display, ReplayPointer, CurrentTime); // w/o this, no mouse
++// ultimately none of the below matters
++    // infinite loop
++    //if (be.subwindow) {
++    //  //XEvent omfg = (XEvent *)&be;
++    //  //be.window = be.subwindow;
++    //  //be.subwindow = 0;
++    //  int huh = XSendEvent(display, be.window, False, ButtonPressMask, (XEvent*)&be);
++    //  std::cout << "xsendevent: " << huh << "\n";
++    //}
++    //XSync(display, 0);
++    //int wtf = XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
++    //std::cout << "xallowevents: " << wtf << "\n";
++    //XSync(display, 0);
++    //XAllowEvents(display, ReplayPointer, be.time); // time means squat - works but not for menus
++    //XAllowEvents(display, SyncPointer, CurrentTime); // sync will not doubleclick or act proper
++    //XAllowEvents(display, AsyncPointer, CurrentTime); // ^^ same
++    //if (be.subwindow)
++    //  XFlush(display);
++    //  //XSync(display, True);
+ }
+ 
+ const unsigned int DEADZONE = 4;
+ 
+ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
+ 
+-    if (m_last_pressed_button == static_cast<int>(re.button)) {
+-        m_last_pressed_button = 0;
+-    }
+ 
+     if (isMoving())
+         stopMoving();
+@@ -2502,6 +2492,13 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
+ 
+         Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button,
+                                               context, &winClient(), re.time);
++      // syncs dont make a difference?
++      //XSync(display, 0);
++      XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
++      //XSync(display, 0);
++    }
++    if (m_last_pressed_button == static_cast<int>(re.button)) {
++        m_last_pressed_button = 0;
+     }
+ }
+ 
diff --git a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
new file mode 100644
index 000000000000..36c572cea4ff
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
@@ -0,0 +1,65 @@
+diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
+index c2e49485..9b4058c8 100644
+--- a/src/WorkspaceCmd.cc
++++ b/src/WorkspaceCmd.cc
+@@ -521,22 +521,24 @@ void ArrangeWindowsCmd::execute() {
+     const unsigned int cal_width = max_width/cols; // width ratio (width of every window)
+     const unsigned int cal_height = max_height/rows; // height ratio (height of every window)
+
++    int cell_center_x = 0, cell_center_y = 0, win_center_x = 0, win_center_y = 0, x = 0, y = 0;
++    unsigned int closest_dist = ~0, dist = 0, w = 0, h = 0;
+     // Resizes and sets windows positions in columns and rows.
+     for (i = 0; i < rows; ++i) {
+         x_offs = orig_x_offs;
+         for (j = 0; j < cols && !normal_windows.empty(); ++j) {
+
+
+-            int cell_center_x = x_offs + (x_offs + cal_width) / 2;
+-            int cell_center_y = y_offs + (y_offs + cal_height) / 2;
+-            unsigned int closest_dist = ~0;
++            cell_center_x = x_offs + (x_offs + cal_width) / 2;
++            cell_center_y = y_offs + (y_offs + cal_height) / 2;
++            int closest_dist = ~0;
+
+             Workspace::Windows::iterator closest = normal_windows.end();
+             for (win = normal_windows.begin(); win != normal_windows.end(); ++win) {
+
+-                int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
+-                int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
+-                unsigned int dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
++                win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
++                win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
++                dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
+                                     (win_center_y - cell_center_y) * (win_center_y - cell_center_y);
+
+                 if (dist < closest_dist) {
+@@ -545,10 +547,10 @@ void ArrangeWindowsCmd::execute() {
+                 }
+             }
+
+-            int x = x_offs + (*closest)->xOffset();
+-            int y = y_offs + (*closest)->yOffset();
+-            unsigned int w = cal_width - (*closest)->widthOffset();
+-            unsigned int h = cal_height - (*closest)->heightOffset();
++            x = x_offs + (*closest)->xOffset();
++            y = y_offs + (*closest)->yOffset();
++            w = cal_width - (*closest)->widthOffset();
++            h = cal_height - (*closest)->heightOffset();
+
+             // the last window gets everything that is left.
+             if (normal_windows.size() == 1) {
+@@ -620,12 +622,9 @@ void UnclutterCmd::execute() {
+         return;
+
+     // place
+-    MinOverlapPlacement mopp;
+     int x, y;
+-    for (win = placed_windows.begin(); win != placed_windows.end(); ++win) {
+-        mopp.placeWindow(**win, head, x, y);
+-        (*win)->move(x, y);
+-    }
++    for (win = placed_windows.begin(); win != placed_windows.end(); ++win)
++        (*win)->placeWindow((*win)->getOnHead());
+ }
+
+ REGISTER_COMMAND(showdesktop, ShowDesktopCmd, void);
diff --git a/srcpkgs/fluxbox/patches/zor_loops.patch b/srcpkgs/fluxbox/patches/zor_loops.patch
new file mode 100644
index 000000000000..95d992f9071d
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/zor_loops.patch
@@ -0,0 +1,87 @@
+diff --git a/src/FbTk/STLUtil.hh b/src/FbTk/STLUtil.hh
+index abc54729..9c9c27f9 100644
+--- a/src/FbTk/STLUtil.hh
++++ b/src/FbTk/STLUtil.hh
+@@ -48,46 +48,63 @@ struct IfThenElse<false, Ta, Tb> {
+ /// calls delete on each item in the container and then clears the container
+ template <typename A>
+ void destroyAndClear(A &a) {
+-    typedef typename A::iterator iterator;
+-    iterator it = a.begin();
+-    iterator it_end = a.end();
+-    for (; it != it_end; ++it)
+-        delete (*it);
++    //typedef typename A::iterator iterator;
++    //iterator it = a.begin();
++    //iterator it_end = a.end();
++    //for (; it != it_end; ++it)
++    //    delete (*it);
+ 
++    //a.clear();
++    typedef typename A::iterator iterator;
++    for (auto it : a)
++        delete it;
+     a.clear();
+ }
+ 
+ /// calls delete on each item value in the map and then clears the map
+ template <typename A>
+ void destroyAndClearSecond(A &a) {
++    //typedef typename A::iterator iterator;
++    //iterator it = a.begin();
++    //iterator it_end = a.end();
++    //for (; it != it_end; ++it)
++    //    delete it->second;
++    //a.clear();
+     typedef typename A::iterator iterator;
+-    iterator it = a.begin();
+-    iterator it_end = a.end();
+-    for (; it != it_end; ++it)
+-        delete it->second;
++    for (auto it : a)
++        delete it.second;
+     a.clear();
+ }
+ 
+ 
+ template <typename C, typename F>
+ F forAll(C& c, F f) {
++    //typedef typename C::iterator iterator;
++    //iterator i = c.begin();
++    //iterator e = c.end();
++    //for (; i != e; i++) {
++    //    f(*i);
++    //}
+     typedef typename C::iterator iterator;
+-    iterator i = c.begin();
+-    iterator e = c.end();
+-    for (; i != e; i++) {
+-        f(*i);
+-    }
++    for (auto i : c)
++        f(i);
+     return f;
+ }
+ 
+ template <typename C, typename I, typename F>
+ F forAllIf(C& c, I i, F f) {
++    //typedef typename C::iterator iterator;
++    //iterator it = c.begin();
++    //iterator end = c.end();
++    //for (; it != end; ++it) {
++    //    if (i(*it))
++    //        f(*it);
++    //}
++    //return f;
+     typedef typename C::iterator iterator;
+-    iterator it = c.begin();
+-    iterator end = c.end();
+-    for (; it != end; ++it) {
+-        if (i(*it))
+-            f(*it);
++    for (auto it : c) {
++        if (i(it))
++            f(it);
+     }
+     return f;
+ }
diff --git a/srcpkgs/fluxbox/template b/srcpkgs/fluxbox/template
index e10b426c4924..6b0e4cd260cb 100644
--- a/srcpkgs/fluxbox/template
+++ b/srcpkgs/fluxbox/template
@@ -1,29 +1,56 @@
 # Template file for 'fluxbox'
 pkgname=fluxbox
-version=1.3.7
-revision=4
+version=1.3.8
+#nostrip=nostrip
+_commit=e2cbd179ecb2ef2d76e0ad1fde84b44325305799
+revision=0
+wrksrc=fluxbox-${_commit}
 build_style=gnu-configure
-configure_args="--enable-nls
+configure_args="--disable-nls --disable-xinerama --disable-shape --disable-xrender
+ --disable-fribidi --disable-slit
  ac_cv_lib_X11_XOpenDisplay=yes ac_cv_lib_Xft_XftFontOpen=yes
  ac_cv_lib_Xrender_XRenderCreatePicture=yes ac_cv_lib_Xpm_XpmReadFileToPixmap=yes
- ac_cv_lib_Xinerama_XineramaQueryScreens=yes ac_cv_lib_Xext_XShapeCombineShape=yes
+ ac_cv_lib_Xext_XShapeCombineShape=no
  ac_cv_lib_Xrandr_XRRQueryExtension=yes ac_cv_lib_fribidi_fribidi_version_info=yes"
-hostmakedepends="pkg-config automake libtool gettext gettext-devel"
+hostmakedepends="pkg-config automake libtool gettext gettext-devel clang llvm"
 makedepends="libSM-devel libXrender-devel libXft-devel libXpm-devel imlib2-devel
- libXext-devel libXinerama-devel libXrandr-devel fribidi-devel"
+ libXext-devel libXrandr-devel fribidi-devel"
 short_desc="Highly configurable and low resource X11 Window manager"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="http://www.fluxbox.org"
-distfiles="https://github.com/fluxbox/fluxbox/archive/refs/tags/Release-${version//./_}.tar.gz"
-checksum=990414ae342a35c5703e5025a8bf019b0b4dada55d57071c51d3d498abb5cd36
+distfiles="https://github.com/fluxbox/fluxbox/archive/${_commit}.tar.gz"
+checksum=6740d9cd4a3e631e0130cbcbc91ccac6af6335dc120f9adc5ebbc8dc9d3259a0
+
+nopie=yes
+X11_FLAGS="-Os -pipe"
+#FRIBIDI_CFLAGS="-Os -pipe"
+XRANDR_CFLAGS="-Os -pipe"
+AM_CPPFLAGS="-Os -pipe"
+CFLAGS="-Os -pipe"
+CXXFLAGS="-Os -pipe -std=c++11"
+CC="clang"
+CXX="clang++"
+HOST_CC=clang
+HOST_CXX=clang++
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) configure_args="${configure_args/enable-nls/disable-nls}" ;;
 esac
 
 pre_configure() {
-	./autogen.sh
+  export X11_FLAGS="-Os -pipe"
+  # export FRIBIDI_CFLAGS="-Os -pipe"
+  export XRANDR_CFLAGS="-Os -pipe"
+  export AM_CPPFLAGS="-Os -pipe"
+  export CFLAGS="-Os -pipe"
+  export CXXFLAGS="-Os -pipe -std=c++11"
+  export CC="clang"
+  export CXX="clang++"
+  export HOST_CC=clang
+  export HOST_CXX=clang++
+  export PREFIX=/usr
+  ./autogen.sh
 }
 
 post_install() {
diff --git a/srcpkgs/libavcodec4 b/srcpkgs/libavcodec4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavcodec4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavdevice4 b/srcpkgs/libavdevice4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavdevice4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavfilter4 b/srcpkgs/libavfilter4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavfilter4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavformat4 b/srcpkgs/libavformat4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavformat4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample b/srcpkgs/libavresample
index a9f1eea092d5..887f354e7c6b 120000
--- a/srcpkgs/libavresample
+++ b/srcpkgs/libavresample
@@ -1 +1 @@
-ffmpeg
\ No newline at end of file
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample4 b/srcpkgs/libavresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavutil4 b/srcpkgs/libavutil4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavutil4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libpostproc4 b/srcpkgs/libpostproc4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libpostproc4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswresample4 b/srcpkgs/libswresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswscale4 b/srcpkgs/libswscale4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswscale4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..bdeb22b13aaa 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,12 +1,13 @@
 # Template file for 'mesa'
 pkgname=mesa
-version=22.3.5
+version=23.0.0
 revision=1
+#wrksrc="Mesa-dg2-20230125"
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
  -Dlmsensors=enabled -Dplatforms=x11$(vopt_if wayland ,wayland)
- -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++14"
+ -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++17"
 hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
@@ -22,11 +23,23 @@ license="MIT, LGPL-2.1-or-later"
 homepage="https://www.mesa3d.org/"
 changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
-checksum=3eed2ecae2bc674494566faab9fcc9beb21cd804c7ba2b59a1694f3d7236e6a9
+checksum=01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4
+# intel dg2 jan 25
+#checksum=4ec8ec65dbdb1ee9444dba72970890128a19543a58cf05931bd6f54f124e117f
+#checksum=37a1ddaf03f41919ee3c89c97cff41e87de96e00e9d3247959cc8279d8294593
+#distfiles="https://github.com/intel-gpu/Mesa/archive/refs/tags/dg2-20230125.tar.gz"
+#checksum=22203186779222ec5244ecb74fbae706d3557588c82089b18c7bf77a54799a59
 
 build_options="wayland"
 build_options_default="wayland"
 
+export CC=clang
+export CXX=clang++
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -Duse-elf-tls=false"
+fi
+
 # only use llvmpipe on targets where it's supported and reliable
 # especially on big endian it's all kinds of broken, and e.g. on
 # 32-bit powerpc it does not work at all, so fall back to softpipe
@@ -91,7 +104,7 @@ fi
 if [ "$_have_intel" ]; then
 	_have_vulkan=yes
 	_gallium_drivers+=",crocus,iris,i915"
-	_vulkan_drivers+=",intel,intel_hasvk"
+	_vulkan_drivers+=",intel"
 	subpackages+=" mesa-vulkan-intel"
 	# transitional dummy packages
 	subpackages+=" mesa-intel-dri"
@@ -140,10 +153,10 @@ fi
 
 # enabled currently by amd drivers
 if [ "$_have_opencl" ]; then
-	hostmakedepends+=" clang rust rust-bindgen"
-	makedepends+=" clang libclc rust SPIRV-LLVM-Translator-devel SPIRV-Tools-devel"
+	hostmakedepends+=" clang"
+	makedepends+=" clang libclc"
 	subpackages+=" mesa-opencl"
-	configure_args+=" -Dgallium-opencl=icd -Dgallium-rusticl=true -Drust_std=2021"
+	configure_args+=" -Dgallium-opencl=icd"
 fi
 
 if [ "$_have_hwdec" ]; then
@@ -187,7 +200,6 @@ esac
 post_configure() {
 	if [ "$CROSS_BUILD" ]; then
 		find -iname "*.ninja" -exec sed -i "{}" \
-			-e "/rustc/s; --sysroot ${XBPS_CROSS_BASE}/usr;;g" \
 			-e "s; /usr/lib/; ${XBPS_CROSS_BASE}/usr/lib/;g" \
 			-e "s;-L/usr/lib;-L${XBPS_CROSS_BASE}/usr/lib;g" \
 			-e "s;-I/usr/include;-I${XBPS_CROSS_BASE}/usr/include;g" \
@@ -286,7 +298,6 @@ MesaLib-devel_package() {
 		fi
 		if [ "$_have_opencl" ]; then
 			vmove usr/lib/libMesaOpenCL.so
-			vmove usr/lib/libRusticlOpenCL.so
 		fi
 	}
 }
@@ -305,7 +316,6 @@ mesa-opencl_package() {
 		vmove etc/OpenCL
 		vmove usr/lib/gallium-pipe
 		vmove "usr/lib/libMesaOpenCL.so.*"
-		vmove "usr/lib/libRusticlOpenCL.so.*"
 	}
 }
 
@@ -336,15 +346,14 @@ mesa-vdpau_package() {
 mesa-vulkan-intel_package() {
 	short_desc="Mesa Intel Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/vulkan/icd.d/intel*.json"
-		vmove "usr/lib/libvulkan_intel*.so"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
 mesa-vulkan-radeon_package() {
 	short_desc="Mesa Radeon Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/drirc.d/00-radv-defaults.conf"
 		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
 		vmove "usr/lib/libvulkan_radeon.so"
 	}

From 67b2aefebf41e6c55d20094c6ed107ac3e6f64d8 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 17:41:38 -0400
Subject: [PATCH 2/4] opencv: update to 4.7.0.

---
 common/shlibs                            | 104 +++++++++++------------
 srcpkgs/actiona/template                 |   2 +-
 srcpkgs/digikam/template                 |   2 +-
 srcpkgs/gmic/template                    |   2 +-
 srcpkgs/goldendict/patches/ffmpeg4.patch |  21 -----
 srcpkgs/nomacs/template                  |   2 +-
 srcpkgs/opencv/template                  |   8 +-
 srcpkgs/qimgv/template                   |   2 +-
 srcpkgs/retroshare/template              |   2 +-
 srcpkgs/siril/template                   |   2 +-
 srcpkgs/waifu2x-converter-cpp/template   |   2 +-
 11 files changed, 64 insertions(+), 85 deletions(-)
 delete mode 100644 srcpkgs/goldendict/patches/ffmpeg4.patch

diff --git a/common/shlibs b/common/shlibs
index aab66c83f4b3..a9d1c6a16ec6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2128,58 +2128,58 @@ libcapstone.so.4 capstone-4.0_1
 libhavege.so.2 libhaveged-1.9.11_1
 libnih.so.1 libnih-1.0.3_1
 libnih-dbus.so.1 libnih-1.0.3_1
-libopencv_quality.so.406 libopencv-4.6.0_1
-libopencv_reg.so.406 libopencv-4.6.0_1
-libopencv_surface_matching.so.406 libopencv-4.6.0_1
-libopencv_xphoto.so.406 libopencv-4.6.0_1
-libopencv_freetype.so.406 libopencv-4.6.0_1
-libopencv_fuzzy.so.406 libopencv-4.6.0_1
-libopencv_hfs.so.406 libopencv-4.6.0_1
-libopencv_img_hash.so.406 libopencv-4.6.0_1
-libopencv_line_descriptor.so.406 libopencv-4.6.0_1
-libopencv_saliency.so.406 libopencv-4.6.0_1
-libopencv_structured_light.so.406 libopencv-4.6.0_1
-libopencv_aruco.so.406 libopencv-4.6.0_1
-libopencv_bgsegm.so.406 libopencv-4.6.0_1
-libopencv_bioinspired.so.406 libopencv-4.6.0_1
-libopencv_ccalib.so.406 libopencv-4.6.0_1
-libopencv_face.so.406 libopencv-4.6.0_1
-libopencv_tracking.so.406 libopencv-4.6.0_1
-libopencv_xfeatures2d.so.406 libopencv-4.6.0_1
-libopencv_optflow.so.406 libopencv-4.6.0_1
-libopencv_ximgproc.so.406 libopencv-4.6.0_1
-libopencv_plot.so.406 libopencv-4.6.0_1
-libopencv_text.so.406 libopencv-4.6.0_1
-libopencv_ml.so.406 libopencv-4.6.0_1
-libopencv_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn.so.406 libopencv-4.6.0_1
-libopencv_shape.so.406 libopencv-4.6.0_1
-libopencv_stitching.so.406 libopencv-4.6.0_1
-libopencv_photo.so.406 libopencv-4.6.0_1
-libopencv_video.so.406 libopencv-4.6.0_1
-libopencv_calib3d.so.406 libopencv-4.6.0_1
-libopencv_features2d.so.406 libopencv-4.6.0_1
-libopencv_flann.so.406 libopencv-4.6.0_1
-libopencv_highgui.so.406 libopencv-4.6.0_1
-libopencv_videoio.so.406 libopencv-4.6.0_1
-libopencv_imgcodecs.so.406 libopencv-4.6.0_1
-libopencv_imgproc.so.406 libopencv-4.6.0_1
-libopencv_core.so.406 libopencv-4.6.0_1
-libopencv_superres.so.406 libopencv-4.6.0_1
-libopencv_videostab.so.406 libopencv-4.6.0_1
-libopencv_gapi.so.406 libopencv-4.6.0_1
-libopencv_xobjdetect.so.406 libopencv-4.6.0_1
-libopencv_datasets.so.406 libopencv-4.6.0_1
-libopencv_dnn_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn_superres.so.406 libopencv-4.6.0_1
-libopencv_dpm.so.406 libopencv-4.6.0_1
-libopencv_phase_unwrapping.so.406 libopencv-4.6.0_1
-libopencv_stereo.so.406 libopencv-4.6.0_1
-libopencv_rapid.so.406 libopencv-4.6.0_1
-libopencv_intensity_transform.so.406 libopencv-4.6.0_1
-libopencv_alphamat.so.406 libopencv-4.6.0_1
-libopencv_barcode.so.406 libopencv-4.6.0_1
-libopencv_mcc.so.406 libopencv-4.6.0_1
+libopencv_quality.so.407 libopencv-4.7.0_1
+libopencv_reg.so.407 libopencv-4.7.0_1
+libopencv_surface_matching.so.407 libopencv-4.7.0_1
+libopencv_xphoto.so.407 libopencv-4.7.0_1
+libopencv_freetype.so.407 libopencv-4.7.0_1
+libopencv_fuzzy.so.407 libopencv-4.7.0_1
+libopencv_hfs.so.407 libopencv-4.7.0_1
+libopencv_img_hash.so.407 libopencv-4.7.0_1
+libopencv_line_descriptor.so.407 libopencv-4.7.0_1
+libopencv_saliency.so.407 libopencv-4.7.0_1
+libopencv_structured_light.so.407 libopencv-4.7.0_1
+libopencv_aruco.so.407 libopencv-4.7.0_1
+libopencv_bgsegm.so.407 libopencv-4.7.0_1
+libopencv_bioinspired.so.407 libopencv-4.7.0_1
+libopencv_ccalib.so.407 libopencv-4.7.0_1
+libopencv_face.so.407 libopencv-4.7.0_1
+libopencv_tracking.so.407 libopencv-4.7.0_1
+libopencv_xfeatures2d.so.407 libopencv-4.7.0_1
+libopencv_optflow.so.407 libopencv-4.7.0_1
+libopencv_ximgproc.so.407 libopencv-4.7.0_1
+libopencv_plot.so.407 libopencv-4.7.0_1
+libopencv_text.so.407 libopencv-4.7.0_1
+libopencv_ml.so.407 libopencv-4.7.0_1
+libopencv_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn.so.407 libopencv-4.7.0_1
+libopencv_shape.so.407 libopencv-4.7.0_1
+libopencv_stitching.so.407 libopencv-4.7.0_1
+libopencv_photo.so.407 libopencv-4.7.0_1
+libopencv_video.so.407 libopencv-4.7.0_1
+libopencv_calib3d.so.407 libopencv-4.7.0_1
+libopencv_features2d.so.407 libopencv-4.7.0_1
+libopencv_flann.so.407 libopencv-4.7.0_1
+libopencv_highgui.so.407 libopencv-4.7.0_1
+libopencv_videoio.so.407 libopencv-4.7.0_1
+libopencv_imgcodecs.so.407 libopencv-4.7.0_1
+libopencv_imgproc.so.407 libopencv-4.7.0_1
+libopencv_core.so.407 libopencv-4.7.0_1
+libopencv_superres.so.407 libopencv-4.7.0_1
+libopencv_videostab.so.407 libopencv-4.7.0_1
+libopencv_gapi.so.407 libopencv-4.7.0_1
+libopencv_xobjdetect.so.407 libopencv-4.7.0_1
+libopencv_datasets.so.407 libopencv-4.7.0_1
+libopencv_dnn_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn_superres.so.407 libopencv-4.7.0_1
+libopencv_dpm.so.407 libopencv-4.7.0_1
+libopencv_phase_unwrapping.so.407 libopencv-4.7.0_1
+libopencv_stereo.so.407 libopencv-4.7.0_1
+libopencv_rapid.so.407 libopencv-4.7.0_1
+libopencv_intensity_transform.so.407 libopencv-4.7.0_1
+libopencv_alphamat.so.407 libopencv-4.7.0_1
+libopencv_barcode.so.407 libopencv-4.7.0_1
+libopencv_mcc.so.407 libopencv-4.7.0_1
 libuniconf.so.4.6 wvstreams-4.6.1_20
 libwvbase.so.4.6 wvstreams-4.6.1_20
 libwvutils.so.4.6 wvstreams-4.6.1_20
diff --git a/srcpkgs/actiona/template b/srcpkgs/actiona/template
index cf5f0b7a2ae6..0d899311e6df 100644
--- a/srcpkgs/actiona/template
+++ b/srcpkgs/actiona/template
@@ -1,7 +1,7 @@
 # Template file for 'actiona'
 pkgname=actiona
 version=3.10.1
-revision=2
+revision=3
 build_style=qmake
 configure_args="PKGCONFIG_OPENCV=opencv4"
 hostmakedepends="pkg-config qt5-plugin-mysql qt5-qmake qt5-host-tools"
diff --git a/srcpkgs/digikam/template b/srcpkgs/digikam/template
index e8ec4961457b..0a8984db85bc 100644
--- a/srcpkgs/digikam/template
+++ b/srcpkgs/digikam/template
@@ -1,7 +1,7 @@
 # Template file for 'digikam'
 pkgname=digikam
 version=7.10.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext pkg-config bison flex qt5-qmake
diff --git a/srcpkgs/gmic/template b/srcpkgs/gmic/template
index 8e3b80047f26..43c6e0672a2b 100644
--- a/srcpkgs/gmic/template
+++ b/srcpkgs/gmic/template
@@ -1,7 +1,7 @@
 # Template file for 'gmic'
 pkgname=gmic
 version=3.1.6
-revision=1
+revision=2
 _zart_hash=34ebf6cce0bafb98abe57cec83c4a02cd1abeca0
 create_wrksrc=yes
 build_wrksrc="src"
diff --git a/srcpkgs/goldendict/patches/ffmpeg4.patch b/srcpkgs/goldendict/patches/ffmpeg4.patch
deleted file mode 100644
index f045fa27f54b..000000000000
--- a/srcpkgs/goldendict/patches/ffmpeg4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ffmpegaudio.cc.orig 2018-05-09 22:16:13.480659958 +0200
-+++ b/ffmpegaudio.cc      2018-05-09 22:16:50.748322790 +0200
-@@ -143,7 +143,7 @@
-     return false;
-   }
-
--  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
-+  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
-   if ( !avioBuffer )
-   {
-     errorString = QObject::tr( "av_malloc() failed." );
-@@ -380,7 +380,7 @@
-   }
-
-   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
--       codecContext_->codec->capabilities & CODEC_CAP_DELAY )
-+       codecContext_->codec->capabilities & AV_CODEC_CAP_DELAY )
-   {
-     av_init_packet( &packet );
-     int gotFrame = 0;
-
diff --git a/srcpkgs/nomacs/template b/srcpkgs/nomacs/template
index 895e83071a8a..ce4e7f7093da 100644
--- a/srcpkgs/nomacs/template
+++ b/srcpkgs/nomacs/template
@@ -1,7 +1,7 @@
 # Template file for 'nomacs'
 pkgname=nomacs
 version=3.16.224
-revision=3
+revision=4
 build_wrksrc=ImageLounge
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_TRANSLATIONS=1
diff --git a/srcpkgs/opencv/template b/srcpkgs/opencv/template
index a09b8dd0d449..41f3183f1582 100644
--- a/srcpkgs/opencv/template
+++ b/srcpkgs/opencv/template
@@ -1,7 +1,7 @@
 # Template file for 'opencv'
 pkgname=opencv
-version=4.6.0
-revision=3
+version=4.7.0
+revision=1
 create_wrksrc=yes
 build_wrksrc=${pkgname}-${version}
 build_style=cmake
@@ -24,8 +24,8 @@ homepage="https://opencv.org"
 changelog="https://github.com/opencv/opencv/wiki/ChangeLog"
 distfiles="https://github.com/opencv/opencv/archive/${version}.tar.gz
  https://github.com/opencv/opencv_contrib/archive/${version}.tar.gz>contrib.tar.gz"
-checksum="1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
- 1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7"
+checksum="8df0079cdbe179748a18d44731af62a245a45ebf5085223dc03133954c662973
+ 42df840cf9055e59d0e22c249cfb19f04743e1bdad113d31b1573d3934d62584"
 patch_args="-Np1 -d ${build_wrksrc}"
 # tests hang indenfinitely, even with test data included
 make_check=no
diff --git a/srcpkgs/qimgv/template b/srcpkgs/qimgv/template
index 7eb30db33992..dd341dfe1bfc 100644
--- a/srcpkgs/qimgv/template
+++ b/srcpkgs/qimgv/template
@@ -1,7 +1,7 @@
 # Template file for 'qimgv'
 pkgname=qimgv
 version=1.0.2
-revision=2
+revision=3
 build_style=cmake
 configure_args="$(vopt_if video -DVIDEO_SUPPORT=ON -DVIDEO_SUPPORT=OFF)
  $(vopt_if scale -DOPENCV_SUPPORT=ON -DOPENCV_SUPPORT=OFF)
diff --git a/srcpkgs/retroshare/template b/srcpkgs/retroshare/template
index 8a0786c21a08..72023fa98b75 100644
--- a/srcpkgs/retroshare/template
+++ b/srcpkgs/retroshare/template
@@ -1,7 +1,7 @@
 # Template file for 'retroshare'
 pkgname=retroshare
 version=0.6.6
-revision=2
+revision=4
 build_style=qmake
 #XXX broadcast feature requires an ancient udp-discovery-cpp which either needs
 # to be fetched+patched (FTBFS) here or packaged :/
diff --git a/srcpkgs/siril/template b/srcpkgs/siril/template
index e06aa5d0559c..84332f79d060 100644
--- a/srcpkgs/siril/template
+++ b/srcpkgs/siril/template
@@ -1,7 +1,7 @@
 # Template file for 'siril'
 pkgname=siril
 version=0.9.12
-revision=8
+revision=10
 build_style=gnu-configure
 hostmakedepends="pkg-config intltool autoconf automake gettext-devel"
 makedepends="fftw-devel libconfig-devel libopencv-devel libffms2-devel
diff --git a/srcpkgs/waifu2x-converter-cpp/template b/srcpkgs/waifu2x-converter-cpp/template
index 8c095d0d7bab..aa52d8c981a8 100644
--- a/srcpkgs/waifu2x-converter-cpp/template
+++ b/srcpkgs/waifu2x-converter-cpp/template
@@ -1,7 +1,7 @@
 # Template file for 'waifu2x-converter-cpp'
 pkgname=waifu2x-converter-cpp
 version=5.2.4
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DINSTALL_MODELS=ON"
 hostmakedepends="pkg-config"

From deb1b4d1f9786d58c3fad3807b9cb7a1a46b119c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 18:07:58 -0400
Subject: [PATCH 3/4] ffmpeg4 bumps

---
 srcpkgs/osg/template      | 4 ++--
 srcpkgs/vlc/template      | 4 ++--
 srcpkgs/xine-lib/template | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index 1a031448b3cf..755793f7e11b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,14 +1,14 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms
 configure_args="-DLIB_POSTFIX="
 hostmakedepends="pkg-config xrandr"
 makedepends="MesaLib-devel gtkglext-devel libcurl-devel giflib-devel librsvg-devel
- jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg-devel xine-lib-devel
+ jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg4-devel xine-lib-devel
  SDL2-devel gst-plugins-base1-devel
  $(vopt_if openexr libopenexr-devel)
  $(vopt_if poppler poppler-glib-devel)
diff --git a/srcpkgs/vlc/template b/srcpkgs/vlc/template
index 210762b0a7e2..855ca5238662 100644
--- a/srcpkgs/vlc/template
+++ b/srcpkgs/vlc/template
@@ -1,7 +1,7 @@
 # Template file for 'vlc'
 pkgname=vlc
 version=3.0.18
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-gme --disable-libtar --enable-jack
  --enable-live555 --disable-fluidsynth --enable-dvdread
@@ -25,7 +25,7 @@ lib32disabled=yes
 hostmakedepends="automake libtool pkg-config flex gettext libgcrypt-devel
  live555-devel gettext-devel $(vopt_if lua lua52) $(vopt_if chromecast protobuf)"
 makedepends="
- avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg-devel freefont-ttf
+ avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg4-devel freefont-ttf
  gnutls-devel jack-devel liba52-devel libass-devel libbluray-devel
  libcdio-devel libdca-devel libdvbpsi-devel libdvdnav-devel libmad-devel
  libmatroska-devel libmodplug-devel libmpcdec-devel libmpeg2-devel
diff --git a/srcpkgs/xine-lib/template b/srcpkgs/xine-lib/template
index f713eff49b07..ed6194c17d11 100644
--- a/srcpkgs/xine-lib/template
+++ b/srcpkgs/xine-lib/template
@@ -1,6 +1,6 @@
 # Template file for 'xine-lib'
 pkgname=xine-lib
-version=1.2.12
+version=1.2.13
 revision=1
 build_style=gnu-configure
 configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
@@ -8,7 +8,7 @@ configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
 hostmakedepends="automake gettext-devel libtool pkg-config perl"
 makedepends="
  zlib-devel alsa-lib-devel libxcb-devel libSM-devel libXext-devel libXv-devel
- libXvMC-devel liba52-devel libmad-devel ffmpeg-devel pulseaudio-devel
+ libXvMC-devel liba52-devel libmad-devel ffmpeg4-devel pulseaudio-devel
  jack-devel samba-devel libflac-devel libmodplug-devel libmpcdec-devel
  speex-devel libtheora-devel libvorbis-devel libdca-devel faad2-devel
  libcdio-devel libbluray-devel aalib-devel libcaca-devel libXinerama-devel
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="http://www.xine-project.org"
 changelog="https://sourceforge.net/projects/xine/files/xine-lib/${version}/README.txt/view"
 distfiles="${SOURCEFORGE_SITE}/xine/${pkgname}-${version}.tar.xz"
-checksum=d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098
+checksum=5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f
 
 case "$XBPS_TARGET_MACHINE" in
 	i686-musl)

From 8d3425ba90ce82dc103eb8ddbb355c7a53f0968c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 18:08:05 -0400
Subject: [PATCH 4/4] ffmpeg5 bumps

---
 srcpkgs/QMPlay2/template                      |   2 +-
 srcpkgs/alsa-plugins/template                 |   2 +-
 srcpkgs/arcan/template                        |   2 +-
 srcpkgs/attract/template                      |   2 +-
 srcpkgs/aubio/patches/ffmpeg5.patch           |  37 ++
 srcpkgs/aubio/template                        |   2 +-
 .../audacious-plugins/patches/ffmpeg5.patch   |  43 ++
 srcpkgs/audacious-plugins/template            |   2 +-
 srcpkgs/audacity/template                     |   3 +-
 srcpkgs/avidemux/template                     |   2 +-
 srcpkgs/baresip/template                      |   2 +-
 srcpkgs/blender/template                      |   2 +-
 srcpkgs/cantata/template                      |   2 +-
 srcpkgs/ccextractor/template                  |   2 +-
 srcpkgs/chromaprint/patches/ffmpeg5.patch     | 569 ++++++++++++++++++
 srcpkgs/chromaprint/template                  |   2 +-
 srcpkgs/chromium/template                     |   2 +-
 srcpkgs/cmus/template                         |   2 +-
 srcpkgs/cyanrip/template                      |   2 +-
 srcpkgs/deadbeef/template                     |   2 +-
 srcpkgs/dolphin-emu/template                  |   2 +-
 srcpkgs/droidcam-obs-plugin/template          |   2 +-
 srcpkgs/droidcam/template                     |   2 +-
 srcpkgs/electron19/template                   |   2 +-
 srcpkgs/ffmpeg/template                       | 166 +++--
 srcpkgs/ffmpeg4/template                      |  46 +-
 srcpkgs/ffmpegthumbnailer/template            |   6 +-
 srcpkgs/ffmpegthumbs/template                 |   2 +-
 srcpkgs/ffms2/patches/ffmpeg5.patch           | 419 +++++++++++++
 srcpkgs/ffms2/template                        |   2 +-
 ...Fix-infinite-loop-in-Menu-cycleitems.patch |  60 --
 ...6c4d30f5b289c429c5ca88d800200db4fc4f.patch |  23 +
 .../MinOverlapPlacement.cc_improve.patch      |  29 -
 srcpkgs/fluxbox/patches/center.patch          | 307 ----------
 srcpkgs/fluxbox/patches/container_locks.patch | 325 ----------
 .../patches/container_relative_relative.patch |  15 -
 srcpkgs/fluxbox/patches/flux_improve.patch    | 205 -------
 srcpkgs/fluxbox/patches/flux_oversize.patch   |  24 -
 .../fluxbox/patches/focus_close_menu.patch    |  17 -
 srcpkgs/fluxbox/patches/slit_raise.patch      |  16 -
 srcpkgs/fluxbox/patches/toolbar_redo.patch    | 228 -------
 .../fluxbox/patches/tremor_graboid_hell.patch | 350 -----------
 .../patches/unclutter_fix_workspacecmd.patch  |  65 --
 srcpkgs/fluxbox/patches/zor_loops.patch       |  87 ---
 srcpkgs/freerdp/template                      |   2 +-
 srcpkgs/gerbera/template                      |   2 +-
 srcpkgs/goldendict/patches/ffmpeg5-1.patch    | 232 +++++++
 srcpkgs/goldendict/patches/ffmpeg5-2.patch    |  33 +
 srcpkgs/goldendict/patches/ffmpeg5-3.patch    |  25 +
 srcpkgs/goldendict/template                   |   2 +-
 srcpkgs/gst-libav/template                    |   2 +-
 srcpkgs/gst-plugins-bad1/template             |   2 +-
 srcpkgs/gst-rtsp-server/template              |   2 +-
 srcpkgs/gtk4/template                         |   2 +-
 srcpkgs/guvcview/template                     |   2 +-
 srcpkgs/handbrake/template                    |   2 +-
 srcpkgs/hedgewars/template                    |   2 +-
 srcpkgs/idjc/template                         |   2 +-
 srcpkgs/kfilemetadata5/template               |   2 +-
 srcpkgs/kid3/template                         |   2 +-
 srcpkgs/kodi/template                         |   2 +-
 srcpkgs/kpipewire/template                    |   2 +-
 srcpkgs/libavresample                         |   2 +-
 srcpkgs/libextractor/template                 |   2 +-
 srcpkgs/libopenal/template                    |   2 +-
 srcpkgs/libopenshot/template                  |   2 +-
 srcpkgs/loudgain/template                     |   2 +-
 srcpkgs/mediastreamer/template                |   2 +-
 srcpkgs/mgba/patches/ffmpeg5.patch            | 117 ++++
 srcpkgs/mgba/template                         |   2 +-
 srcpkgs/minidlna/template                     |   2 +-
 srcpkgs/mixxx/template                        |   2 +-
 srcpkgs/mlt/template                          |   2 +-
 srcpkgs/mlt7/template                         |   2 +-
 srcpkgs/moc/template                          |   2 +-
 srcpkgs/motion/template                       |   2 +-
 srcpkgs/mpd/template                          |   2 +-
 srcpkgs/mpv/template                          |   2 +-
 srcpkgs/musikcube/template                    |   2 +-
 srcpkgs/notcurses/template                    |   2 +-
 srcpkgs/obs/template                          |   2 +-
 srcpkgs/olive/template                        |   2 +-
 srcpkgs/omxplayer/template                    |   2 +-
 srcpkgs/openimageio/template                  |   2 +-
 srcpkgs/openmw/template                       |   2 +-
 srcpkgs/openshot/template                     |   2 +-
 srcpkgs/opentoonz/template                    |   2 +-
 srcpkgs/pianobar/template                     |   2 +-
 srcpkgs/ppsspp/template                       |   2 +-
 srcpkgs/pqiv/template                         |   2 +-
 srcpkgs/qmmp/template                         |   2 +-
 srcpkgs/qt5-webengine/template                |   2 +-
 srcpkgs/qt5/template                          |   2 +-
 srcpkgs/qt6-multimedia/template               |   2 +-
 srcpkgs/qt6-webengine/template                |   2 +-
 srcpkgs/qtav/template                         |   2 +-
 srcpkgs/qtox/patches/ffmpeg5.patch            |  79 +++
 srcpkgs/qtox/template                         |   2 +-
 srcpkgs/retroarch/template                    |   2 +-
 srcpkgs/scrcpy/template                       |   2 +-
 srcpkgs/spek-alternative/template             |   2 +-
 srcpkgs/ssr/template                          |   2 +-
 srcpkgs/sumo/template                         |   2 +-
 srcpkgs/synfig/template                       |   2 +-
 srcpkgs/telegram-desktop/template             |   2 +-
 srcpkgs/tg_owt/template                       |   2 +-
 srcpkgs/timg/template                         |   2 +-
 srcpkgs/tracker-miners/template               |   2 +-
 srcpkgs/tvheadend/template                    |   2 +-
 srcpkgs/unpaper/template                      |   2 +-
 srcpkgs/vba-m/template                        |   2 +-
 srcpkgs/vice/template                         |   2 +-
 srcpkgs/waypipe/template                      |   2 +-
 srcpkgs/wf-recorder/template                  |   2 +-
 srcpkgs/xpra/template                         |   2 +-
 115 files changed, 1744 insertions(+), 1958 deletions(-)
 create mode 100644 srcpkgs/aubio/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/audacious-plugins/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/chromaprint/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/ffms2/patches/ffmpeg5.patch
 delete mode 100644 srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
 create mode 100644 srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
 delete mode 100644 srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
 delete mode 100644 srcpkgs/fluxbox/patches/center.patch
 delete mode 100644 srcpkgs/fluxbox/patches/container_locks.patch
 delete mode 100644 srcpkgs/fluxbox/patches/container_relative_relative.patch
 delete mode 100644 srcpkgs/fluxbox/patches/flux_improve.patch
 delete mode 100644 srcpkgs/fluxbox/patches/flux_oversize.patch
 delete mode 100644 srcpkgs/fluxbox/patches/focus_close_menu.patch
 delete mode 100644 srcpkgs/fluxbox/patches/slit_raise.patch
 delete mode 100644 srcpkgs/fluxbox/patches/toolbar_redo.patch
 delete mode 100644 srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
 delete mode 100644 srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
 delete mode 100644 srcpkgs/fluxbox/patches/zor_loops.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-1.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-2.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-3.patch
 create mode 100644 srcpkgs/mgba/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/qtox/patches/ffmpeg5.patch

diff --git a/srcpkgs/QMPlay2/template b/srcpkgs/QMPlay2/template
index ad73cbb01bae..55284c051161 100644
--- a/srcpkgs/QMPlay2/template
+++ b/srcpkgs/QMPlay2/template
@@ -1,7 +1,7 @@
 # Template file for 'QMPlay2'
 pkgname=QMPlay2
 version=23.02.05
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="alsa-lib-devel ffmpeg-devel libass-devel libcdio-devel libgme-devel
diff --git a/srcpkgs/alsa-plugins/template b/srcpkgs/alsa-plugins/template
index 0bfa6d9fd264..a5708a7d82a8 100644
--- a/srcpkgs/alsa-plugins/template
+++ b/srcpkgs/alsa-plugins/template
@@ -1,7 +1,7 @@
 # Template file for 'alsa-plugins'
 pkgname=alsa-plugins
 version=1.2.7.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-maemo-plugin"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/arcan/template b/srcpkgs/arcan/template
index 7be9652eccf3..ccc7df11ceac 100644
--- a/srcpkgs/arcan/template
+++ b/srcpkgs/arcan/template
@@ -2,7 +2,7 @@
 # !! keep synced with: acfgfs aclip aloadimage
 pkgname=arcan
 version=0.6.2.1
-revision=1
+revision=2
 create_wrksrc=yes
 build_wrksrc=arcan/src
 build_style=cmake
diff --git a/srcpkgs/attract/template b/srcpkgs/attract/template
index 26144e931a3c..24017d2bacc2 100644
--- a/srcpkgs/attract/template
+++ b/srcpkgs/attract/template
@@ -1,7 +1,7 @@
 # Template file for 'attract'
 pkgname=attract
 version=2.6.2
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="VERBOSE=1"
 make_use_env=yes
diff --git a/srcpkgs/aubio/patches/ffmpeg5.patch b/srcpkgs/aubio/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a2c8e11ecff0
--- /dev/null
+++ b/srcpkgs/aubio/patches/ffmpeg5.patch
@@ -0,0 +1,37 @@
+commit 35eee003f034a1a2097cd4557deb773eacb18f7b
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:11 2022 +0100
+
+    aubio: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/aubio/patches/ffmpeg-5.0.patch b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..aace41a6e6
+--- /dev/null
++++ b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,25 @@
++From 8a05420e5dd8c7b8b2447f82dc919765876511b3 Mon Sep 17 00:00:00 2001
++From: Paul Brossier <piem@piem.org>
++Date: Tue, 25 Jan 2022 18:30:27 +0100
++Subject: [PATCH] [source_avcodec] define FF_API_LAVF_AVCTX for libavcodec >
++ 59, thx @berolinux (closes gh-353)
++
++---
++ src/io/source_avcodec.c | 4 ++++
++ 1 file changed, 4 insertions(+)
++
++diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c
++index e0ae93b5..1421bd9a 100644
++--- a/src/io/source_avcodec.c
+++++ b/src/io/source_avcodec.c
++@@ -68,6 +68,10 @@
++ #define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
++ #endif
++ 
+++#if LIBAVCODEC_VERSION_MAJOR >= 59
+++#define FF_API_LAVF_AVCTX 1
+++#endif
+++
++ struct _aubio_source_avcodec_t {
++   uint_t hop_size;
++   uint_t samplerate;
diff --git a/srcpkgs/aubio/template b/srcpkgs/aubio/template
index ad1c4b256991..7d875cc02541 100644
--- a/srcpkgs/aubio/template
+++ b/srcpkgs/aubio/template
@@ -1,7 +1,7 @@
 # Template file for 'aubio'
 pkgname=aubio
 version=0.4.9
-revision=1
+revision=2
 build_style=waf3
 # XXX lash, pure and swig support.
 hostmakedepends="pkg-config txt2man"
diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg5.patch b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..4e5e34099d71
--- /dev/null
+++ b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
@@ -0,0 +1,43 @@
+commit 298aa371c56c2f52c25a33d9bdec4918b11cebdc
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:12 2022 +0100
+
+    audacious-plugins: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..617c11215b
+--- /dev/null
++++ b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,31 @@
++From f60beb400eeb1e4778bbfd738bc4a4ccef3de539 Mon Sep 17 00:00:00 2001
++From: John Lindgren <john@jlindgren.net>
++Date: Sat, 5 Mar 2022 12:05:34 -0500
++Subject: [PATCH] Fix build with FFmpeg 5.0
++
++---
++ src/ffaudio/ffaudio-core.cc | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/src/ffaudio/ffaudio-core.cc b/src/ffaudio/ffaudio-core.cc
++index 16dc63e3a..a2b95fd6c 100644
++--- a/src/ffaudio/ffaudio-core.cc
+++++ b/src/ffaudio/ffaudio-core.cc
++@@ -274,7 +274,7 @@ static AVInputFormat * get_format_by_content (const char * name, VFSFile & file)
++         AVProbeData d = {name, buf, filled};
++         score = target;
++ 
++-        f = av_probe_input_format2 (& d, true, & score);
+++        f = (AVInputFormat *) av_probe_input_format2 (& d, true, & score);
++         if (f)
++             break;
++ 
++@@ -347,7 +347,7 @@ static bool find_codec (AVFormatContext * c, CodecInfo * cinfo)
++ #endif
++         if (stream && stream->codecpar && stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
++         {
++-            AVCodec * codec = avcodec_find_decoder (stream->codecpar->codec_id);
+++            AVCodec * codec = (AVCodec *) avcodec_find_decoder (stream->codecpar->codec_id);
++ 
++             if (codec)
++             {
diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template
index 910ec0d1891f..def0678bc611 100644
--- a/srcpkgs/audacious-plugins/template
+++ b/srcpkgs/audacious-plugins/template
@@ -2,7 +2,7 @@
 #Keep in sync with audacious!
 pkgname=audacious-plugins
 version=4.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="$(vopt_enable gtk) $(vopt_enable qt)"
 hostmakedepends="gettext pkg-config glib-devel"
diff --git a/srcpkgs/audacity/template b/srcpkgs/audacity/template
index d509c0a89407..c18a4eeb0a73 100644
--- a/srcpkgs/audacity/template
+++ b/srcpkgs/audacity/template
@@ -1,7 +1,7 @@
 # Template file for 'audacity'
 pkgname=audacity
 version=2.4.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--with-ffmpeg=system --with-libsndfile=system --with-expat=system
  --with-libsoxr=system --with-lame=system --with-lv2=system ac_cv_path_WX_CONFIG=wx-config-gtk3"
@@ -33,5 +33,4 @@ post_install() {
 	vcopy plug-ins /usr/share/audacity
 
 	rm ${DESTDIR}/usr/share/doc/audacity/LICENSE.txt
-	vlicense LICENSE.txt LICENSE
 }
diff --git a/srcpkgs/avidemux/template b/srcpkgs/avidemux/template
index 253a0243e225..557285982d2b 100644
--- a/srcpkgs/avidemux/template
+++ b/srcpkgs/avidemux/template
@@ -1,7 +1,7 @@
 # Template file for 'avidemux'
 pkgname=avidemux
 version=2.8.0
-revision=2
+revision=3
 # Can't be compiled for aarch64, arm* or mips*
 archs="x86_64* i686*"
 hostmakedepends="cmake pkg-config qt5-host-tools qt5-devel tar yasm"
diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index f1bd1817048b..b21e22334316 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=2.10.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel
diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index a3255cddbc95..4ec73e05acf5 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
 # Template file for 'blender'
 pkgname=blender
 version=3.4.1
-revision=1
+revision=2
 archs="x86_64* ppc64*"
 build_style="cmake"
 pycompile_dirs="/usr/share/blender/${version%.*}/scripts"
diff --git a/srcpkgs/cantata/template b/srcpkgs/cantata/template
index 4b417d80d5c2..8a90aaa4c07a 100644
--- a/srcpkgs/cantata/template
+++ b/srcpkgs/cantata/template
@@ -1,7 +1,7 @@
 # Template file for 'cantata'
 pkgname=cantata
 version=2.5.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools qt5-tools"
 makedepends="qt5-devel qt5-tools-devel qt5-svg-devel qt5-xmlpatterns-devel
diff --git a/srcpkgs/ccextractor/template b/srcpkgs/ccextractor/template
index 9abcd82852b2..7fe2ba4f27b6 100644
--- a/srcpkgs/ccextractor/template
+++ b/srcpkgs/ccextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'ccextractor'
 pkgname=ccextractor
 version=0.93
-revision=1
+revision=2
 build_wrksrc="linux"
 build_style=gnu-configure
 configure_args="--enable-ocr --enable-hardsubx"
diff --git a/srcpkgs/chromaprint/patches/ffmpeg5.patch b/srcpkgs/chromaprint/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a9fd307a23c8
--- /dev/null
+++ b/srcpkgs/chromaprint/patches/ffmpeg5.patch
@@ -0,0 +1,569 @@
+From 8ccad6937177b1b92e40ab8f4447ea27bac009a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
+Date: Fri, 4 Nov 2022 21:47:38 +0100
+Subject: [PATCH] Use FFmpeg 5.x (#120)
+
+* Use FFmpeg 5.1.2 for CI builds
+
+* Build on Ubuntu 20.04
+
+* Upgrade code to FFmpeg 5.x APIs
+
+* Only set FFmpeg include dirs if building tools
+
+* No longer needed
+
+* Use ubuntu 20.04
+---
+ .github/workflows/build.yml                   |   6 +-
+ CMakeLists.txt                                |  16 --
+ package/build.sh                              |   4 +-
+ src/audio/ffmpeg_audio_processor.h            |   2 -
+ src/audio/ffmpeg_audio_processor_avresample.h |  72 -------
+ src/audio/ffmpeg_audio_processor_swresample.h |  18 +-
+ src/audio/ffmpeg_audio_reader.h               | 197 +++++++++---------
+ tests/CMakeLists.txt                          |   6 +
+ 8 files changed, 122 insertions(+), 199 deletions(-)
+ delete mode 100644 src/audio/ffmpeg_audio_processor_avresample.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8d6a32..4da2405 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -84,9 +84,6 @@ find_package(FFmpeg)
+ if(FFMPEG_LIBRARIES)
+ 	cmake_push_check_state(RESET)
+ 	set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lm)
+-	check_function_exists(av_packet_unref HAVE_AV_PACKET_UNREF)
+-	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
+-	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
+ 	cmake_pop_check_state()
+ endif()
+
+@@ -163,14 +160,11 @@ message(STATUS "Using ${FFT_LIB} for FFT calculations")
+ if(NOT AUDIO_PROCESSOR_LIB)
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+ 		set(AUDIO_PROCESSOR_LIB "swresample")
+-	elseif(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(AUDIO_PROCESSOR_LIB "avresample")
+ 	endif()
+ endif()
+
+ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE OFF)
+ 		set(USE_SWRESAMPLE ON)
+ 		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+ 		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS})
+@@ -178,16 +172,6 @@ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+ 	endif()
+ 	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+-elseif(AUDIO_PROCESSOR_LIB STREQUAL "avresample")
+-	if(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE ON)
+-		set(USE_SWRESAMPLE OFF)
+-		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBAVRESAMPLE_LIBRARIES})
+-		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS})
+-	else()
+-		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+-	endif()
+-	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+ else()
+ 	message(STATUS "Building without audio conversion support, please install FFmpeg with libswresample")
+ endif()
+diff --git a/package/build.sh b/package/build.sh
+index da631ae..b41d36e 100755
+--- a/package/build.sh
++++ b/package/build.sh
+@@ -7,8 +7,8 @@ set -eux
+
+ BASE_DIR=$(cd $(dirname $0)/.. && pwd)
+
+-FFMPEG_VERSION=4.4.1
+-FFMPEG_BUILD_TAG=v4.4.1-1
++FFMPEG_VERSION=5.1.2
++FFMPEG_BUILD_TAG=v${FFMPEG_VERSION}-1
+
+ TMP_BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX)
+ trap 'rm -rf $TMP_BUILD_DIR' EXIT
+diff --git a/src/audio/ffmpeg_audio_processor.h b/src/audio/ffmpeg_audio_processor.h
+index 7628fc7..39f4f6d 100644
+--- a/src/audio/ffmpeg_audio_processor.h
++++ b/src/audio/ffmpeg_audio_processor.h
+@@ -10,8 +10,6 @@
+
+ #if defined(USE_SWRESAMPLE)
+ #include "audio/ffmpeg_audio_processor_swresample.h"
+-#elif defined(USE_AVRESAMPLE)
+-#include "audio/ffmpeg_audio_processor_avresample.h"
+ #else
+ #error "no audio processing library"
+ #endif
+diff --git a/src/audio/ffmpeg_audio_processor_avresample.h b/src/audio/ffmpeg_audio_processor_avresample.h
+deleted file mode 100644
+index bd85f92..0000000
+--- a/src/audio/ffmpeg_audio_processor_avresample.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-// Copyright (C) 2016  Lukas Lalinsky
+-// Distributed under the MIT license, see the LICENSE file for details.
+-
+-#ifndef CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-#define CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-
+-extern "C" {
+-#include <libavresample/avresample.h>
+-}
+-
+-namespace chromaprint {
+-
+-class FFmpegAudioProcessor {
+-public:
+-	FFmpegAudioProcessor() {
+-		m_resample_ctx = avresample_alloc_context();
+-	}
+-
+-	~FFmpegAudioProcessor() {
+-		avresample_free(&m_resample_ctx);
+-	}
+-
+-	void SetCompatibleMode() {
+-		av_opt_set_int(m_resample_ctx, "filter_size", 16, 0);
+-		av_opt_set_int(m_resample_ctx, "phase_shift", 8, 0);
+-		av_opt_set_int(m_resample_ctx, "linear_interp", 1, 0);
+-		av_opt_set_double(m_resample_ctx, "cutoff", 0.8, 0);
+-	}
+-
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "in_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_rate", sample_rate, 0);
+-	}
+-
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "out_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_rate, 0);
+-	}
+-
+-	int Init() {
+-		return avresample_open(m_resample_ctx);
+-	}
+-
+-	int Convert(uint8_t **out, int out_count, const uint8_t **in, int in_count) {
+-		return avresample_convert(m_resample_ctx, out, 0, out_count, (uint8_t **) in, 0, in_count);
+-	}
+-
+-	int Flush(uint8_t **out, int out_count) {
+-		return avresample_read(m_resample_ctx, out, out_count);
+-	}
+-
+-private:
+-	AVAudioResampleContext *m_resample_ctx = nullptr;
+-};
+-
+-}; // namespace chromaprint
+-
+-#endif
+diff --git a/src/audio/ffmpeg_audio_processor_swresample.h b/src/audio/ffmpeg_audio_processor_swresample.h
+index b86266b..b1d4bea 100644
+--- a/src/audio/ffmpeg_audio_processor_swresample.h
++++ b/src/audio/ffmpeg_audio_processor_swresample.h
+@@ -28,30 +28,28 @@ public:
+ 		av_opt_set_double(m_swr_ctx, "cutoff", 0.8, 0);
+ 	}
+
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "icl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "ich", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetInputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "isf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "in_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "isr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "in_sample_rate", sample_rate, 0);
+ 	}
+
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "ocl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "och", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "osf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "out_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "osr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "out_sample_rate", sample_rate, 0);
+ 	}
+
+ 	int Init() {
+diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h
+index 5550164..1c6b346 100644
+--- a/src/audio/ffmpeg_audio_reader.h
++++ b/src/audio/ffmpeg_audio_reader.h
+@@ -62,7 +62,7 @@ public:
+ 	bool Read(const int16_t **data, size_t *size);
+
+ 	bool IsOpen() const { return m_opened; }
+-	bool IsFinished() const { return m_finished && !m_got_frame; }
++	bool IsFinished() const { return !m_has_more_packets && !m_has_more_frames; }
+
+ 	std::string GetError() const { return m_error; }
+ 	int GetErrorCode() const { return m_error_code; }
+@@ -74,20 +74,19 @@ private:
+ 	uint8_t *m_convert_buffer[1] = { nullptr };
+ 	int m_convert_buffer_nb_samples = 0;
+
+-	AVInputFormat *m_input_fmt = nullptr;
++	const AVInputFormat *m_input_fmt = nullptr;
+ 	AVDictionary *m_input_opts = nullptr;
+
+ 	AVFormatContext *m_format_ctx = nullptr;
+ 	AVCodecContext *m_codec_ctx = nullptr;
+-	AVFrame *m_frame = nullptr;
+ 	int m_stream_index = -1;
+ 	std::string m_error;
+ 	int m_error_code = 0;
+-	bool m_finished = false;
+ 	bool m_opened = false;
+-	int m_got_frame = 0;
+-	AVPacket m_packet;
+-	AVPacket m_packet0;
++	bool m_has_more_packets = true;
++	bool m_has_more_frames = true;
++	AVPacket *m_packet = nullptr;
++	AVFrame *m_frame = nullptr;
+
+ 	int m_output_sample_rate = 0;
+ 	int m_output_channels = 0;
+@@ -98,19 +97,12 @@ private:
+
+ inline FFmpegAudioReader::FFmpegAudioReader() {
+ 	av_log_set_level(AV_LOG_QUIET);
+-
+-	av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
+ }
+
+ inline FFmpegAudioReader::~FFmpegAudioReader() {
+ 	Close();
+ 	av_dict_free(&m_input_opts);
+ 	av_freep(&m_convert_buffer[0]);
+-	av_packet_unref(&m_packet0);
+ }
+
+ inline bool FFmpegAudioReader::SetInputFormat(const char *name) {
+@@ -135,11 +127,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ 	Close();
+
+-    av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
++	m_packet = av_packet_alloc();
++	if (!m_packet) {
++		return false;
++	}
+
+ 	ret = avformat_open_input(&m_format_ctx, file_name.c_str(), m_input_fmt, &m_input_opts);
+ 	if (ret < 0) {
+@@ -153,26 +144,31 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		return false;
+ 	}
+
+-	AVCodec *codec;
++	const AVCodec *codec;
+ 	ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
+ 	if (ret < 0) {
+ 		SetError("Could not find any audio stream in the file", ret);
+ 		return false;
+ 	}
+ 	m_stream_index = ret;
++	auto stream = m_format_ctx->streams[m_stream_index];
+
+-	m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec;
++	m_codec_ctx = avcodec_alloc_context3(codec);
+ 	m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
+
++	ret = avcodec_parameters_to_context(m_codec_ctx, stream->codecpar);
++	if (ret < 0) {
++		SetError("Could not copy the stream parameters", ret);
++		return false;
++	}
++
+ 	ret = avcodec_open2(m_codec_ctx, codec, nullptr);
+ 	if (ret < 0) {
+ 		SetError("Could not open the codec", ret);
+ 		return false;
+ 	}
+
+-	if (!m_codec_ctx->channel_layout) {
+-		m_codec_ctx->channel_layout = av_get_default_channel_layout(m_codec_ctx->channels);
+-	}
++	av_dump_format(m_format_ctx, 0, "foo", 0);
+
+ 	m_frame = av_frame_alloc();
+ 	if (!m_frame) {
+@@ -183,19 +179,23 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		m_output_sample_rate = m_codec_ctx->sample_rate;
+ 	}
+
+-	if (!m_output_channels) {
+-		m_output_channels = m_codec_ctx->channels;
++	AVChannelLayout output_channel_layout;
++	if (m_output_channels) {
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
++	} else {
++		m_output_channels = m_codec_ctx->ch_layout.nb_channels;
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
+ 	}
+
+-	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
++	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
+ 		m_converter.reset(new FFmpegAudioProcessor());
+ 		m_converter->SetCompatibleMode();
+ 		m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
+ 		m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
+-		m_converter->SetInputChannelLayout(m_codec_ctx->channel_layout);
++		m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
+ 		m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
+ 		m_converter->SetOutputSampleRate(m_output_sample_rate);
+-		m_converter->SetOutputChannelLayout(av_get_default_channel_layout(m_output_channels));
++		m_converter->SetOutputChannelLayout(&output_channel_layout);
+ 		auto ret = m_converter->Init();
+ 		if (ret != 0) {
+ 			SetError("Could not create an audio converter instance", ret);
+@@ -203,10 +203,11 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		}
+ 	}
+
++	av_channel_layout_uninit(&output_channel_layout);
++
+ 	m_opened = true;
+-	m_finished = false;
+-	m_got_frame = 0;
+-	m_nb_packets = 0;
++	m_has_more_packets = true;
++	m_has_more_frames = true;
+ 	m_decode_error = 0;
+
+ 	return true;
+@@ -214,6 +215,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ inline void FFmpegAudioReader::Close() {
+ 	av_frame_free(&m_frame);
++	av_packet_free(&m_packet);
+
+ 	m_stream_index = -1;
+
+@@ -252,91 +254,98 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
+ 		return false;
+ 	}
+
++	*data = nullptr;
++	*size = 0;
++
+ 	int ret;
++	bool needs_packet = false;
+ 	while (true) {
+-		while (m_packet.size <= 0) {
+-			av_packet_unref(&m_packet0);
+-			av_init_packet(&m_packet);
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			ret = av_read_frame(m_format_ctx, &m_packet);
++		while (needs_packet && m_packet->size == 0) {
++			ret = av_read_frame(m_format_ctx, m_packet);
+ 			if (ret < 0) {
+ 				if (ret == AVERROR_EOF) {
+-					m_finished = true;
++					needs_packet = false;
++					m_has_more_packets = false;
+ 					break;
+-				} else {
++				}
++				SetError("Error reading from the audio source", ret);
++				return false;
++			}
++			if (m_packet->stream_index == m_stream_index) {
++				needs_packet = false;
++			} else {
++				av_packet_unref(m_packet);
++			}
++		}
++
++		if (m_packet->size != 0) {
++			ret = avcodec_send_packet(m_codec_ctx, m_packet);
++			if (ret < 0) {
++				if (ret != AVERROR(EAGAIN)) {
+ 					SetError("Error reading from the audio source", ret);
+ 					return false;
+ 				}
+-			}
+-			m_packet0 = m_packet;
+-			if (m_packet.stream_index != m_stream_index) {
+-				m_packet.data = nullptr;
+-				m_packet.size = 0;
+ 			} else {
+-				m_nb_packets++;
++				av_packet_unref(m_packet);
+ 			}
+ 		}
+
+-		ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet);
++		ret = avcodec_receive_frame(m_codec_ctx, m_frame);
+ 		if (ret < 0) {
+-			if (m_decode_error) {
+-				SetError("Error decoding audio frame", m_decode_error);
+-				return false;
++			if (ret == AVERROR_EOF) {
++				m_has_more_frames = false;
++			} else if (ret == AVERROR(EAGAIN)) {
++				if (m_has_more_packets) {
++					needs_packet = true;
++					continue;
++				} else {
++					m_has_more_frames = false;
++				}
+ 			}
+-			m_decode_error = ret;
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			continue;
++			SetError("Error decoding the audio source", ret);
++			return false;
+ 		}
+
+-		break;
+-	}
+-
+-	m_decode_error = 0;
+-
+-	const int decoded = std::min(ret, m_packet.size);
+-	m_packet.data += decoded;
+-	m_packet.size -= decoded;
+-
+-	if (m_got_frame) {
+-		if (m_converter) {
+-			if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
+-				int linsize;
+-				av_freep(&m_convert_buffer[0]);
+-				m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
+-				ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
+-				if (ret < 0) {
+-					SetError("Couldn't allocate audio converter buffer", ret);
++		if (m_frame->nb_samples > 0) {
++			if (m_converter) {
++				if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
++					int linsize;
++					av_freep(&m_convert_buffer[0]);
++					m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
++					ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
++					if (ret < 0) {
++						SetError("Couldn't allocate audio converter buffer", ret);
++						return false;
++					}
++				}
++				auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
++				if (nb_samples < 0) {
++					SetError("Couldn't convert audio", ret);
+ 					return false;
+ 				}
+-			}
+-			auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			}
+-			*data = (const int16_t *) m_convert_buffer[0];
+-			*size = nb_samples;
+-		} else {
+-			*data = (const int16_t *) m_frame->data[0];
+-			*size = m_frame->nb_samples;
+-		}
+-	} else {
+-		if (m_finished && m_converter) {
+-			auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			} else if (nb_samples > 0) {
+-				m_got_frame = 1;
+ 				*data = (const int16_t *) m_convert_buffer[0];
+ 				*size = nb_samples;
++			} else {
++				*data = (const int16_t *) m_frame->data[0];
++				*size = m_frame->nb_samples;
++			}
++		} else {
++			if (m_converter) {
++				if (IsFinished()) {
++					auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
++					if (nb_samples < 0) {
++						SetError("Couldn't convert audio", ret);
++						return false;
++					} else if (nb_samples > 0) {
++						*data = (const int16_t *) m_convert_buffer[0];
++						*size = nb_samples;
++					}
++				}
+ 			}
+ 		}
+-	}
+
+-	return true;
++		return true;
++	}
+ }
+
+ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index a2b517b..123e643 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -38,6 +38,12 @@ set(SRCS
+
+ if(BUILD_TOOLS)
+ 	set(SRCS ${SRCS} ../src/audio/ffmpeg_audio_reader_test.cpp)
++    include_directories(
++        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
++        ${AUDIO_PROCESSOR_INCLUDE_DIRS}
++    )
+ 	link_libraries(fpcalc_libs)
+ endif()
+
+-- 
+2.38.1
+
+
diff --git a/srcpkgs/chromaprint/template b/srcpkgs/chromaprint/template
index 7ef7838949f3..1f7bbc70a22c 100644
--- a/srcpkgs/chromaprint/template
+++ b/srcpkgs/chromaprint/template
@@ -1,7 +1,7 @@
 # Template file for 'chromaprint'
 pkgname=chromaprint
 version=1.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TOOLS=ON"
 make_check_target="check"
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 3c1c1caf3765..1f28cde5d3c1 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,7 +2,7 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=111.0.5563.64
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
  $(vopt_if clang "clang lld llvm12")
diff --git a/srcpkgs/cmus/template b/srcpkgs/cmus/template
index 0fcb424ce336..05b77d0fecae 100644
--- a/srcpkgs/cmus/template
+++ b/srcpkgs/cmus/template
@@ -1,7 +1,7 @@
 # Template file for 'cmus'
 pkgname=cmus
 version=2.10.0
-revision=1
+revision=2
 build_style=configure
 configure_args="prefix=/usr LD=$CC"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/cyanrip/template b/srcpkgs/cyanrip/template
index 9796e3461601..5db30e020d17 100644
--- a/srcpkgs/cyanrip/template
+++ b/srcpkgs/cyanrip/template
@@ -1,7 +1,7 @@
 # Template file for 'cyanrip'
 pkgname=cyanrip
 version=0.9.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="ffmpeg-devel libcdio-devel libcdio-paranoia-devel libcurl-devel libmusicbrainz5-devel"
diff --git a/srcpkgs/deadbeef/template b/srcpkgs/deadbeef/template
index b664bb1b9bd9..f0fcced864be 100644
--- a/srcpkgs/deadbeef/template
+++ b/srcpkgs/deadbeef/template
@@ -1,7 +1,7 @@
 # Template file for 'deadbeef'
 pkgname=deadbeef
 version=1.8.8
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-oss --disable-lfm --disable-notify --disable-gtk2"
diff --git a/srcpkgs/dolphin-emu/template b/srcpkgs/dolphin-emu/template
index 7ea197ceb2a8..7aeb0a5b645e 100644
--- a/srcpkgs/dolphin-emu/template
+++ b/srcpkgs/dolphin-emu/template
@@ -1,7 +1,7 @@
 # Template file for 'dolphin-emu'
 pkgname=dolphin-emu
 version=5.0.16101
-revision=1
+revision=2
 _dolphin_commit=8ecfa537a242de74d2e372e30d9d79b14584b2fb
 _mgba_commit=40d4c430fc36caeb7ea32fd39624947ed487d2f2
 #Version/hash pair can be found at https://dolphin-emu.org/download/
diff --git a/srcpkgs/droidcam-obs-plugin/template b/srcpkgs/droidcam-obs-plugin/template
index fc9c9bf6b9d5..fb0480754df4 100644
--- a/srcpkgs/droidcam-obs-plugin/template
+++ b/srcpkgs/droidcam-obs-plugin/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam-obs-plugin'
 pkgname=droidcam-obs-plugin
 version=2.0.1
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=yes
 make_build_args="ALLOW_STATIC=no"
diff --git a/srcpkgs/droidcam/template b/srcpkgs/droidcam/template
index 1c3f1b8b1fc6..32a9220b79a4 100644
--- a/srcpkgs/droidcam/template
+++ b/srcpkgs/droidcam/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam'
 pkgname=droidcam
 version=1.8.2
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="USBMUXD=-lusbmuxd-2.0 JPEG=-lturbojpeg"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/electron19/template b/srcpkgs/electron19/template
index 068136be7623..32ce301e730c 100644
--- a/srcpkgs/electron19/template
+++ b/srcpkgs/electron19/template
@@ -1,7 +1,7 @@
 # Template file for 'electron19'
 pkgname=electron19
 version=19.0.8
-revision=2
+revision=3
 _nodever=16.14.2
 _chromiumver=102.0.5005.125
 archs="x86_64* aarch64* ppc64le*"
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 38978c5085a3..1ac1e4b8df49 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -12,25 +12,31 @@ distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
 checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
-makedepends="chromaprint-devel libgcrypt-devel ladspa-sdk lcms2-devel libaom-devel
- alsa-lib-devel bzip2-devel libxcb-devel liblzma-devel SDL2-devel sndio-devel zlib-devel
- frei0r-plugins libcdio-paranoia-devel rubberband-devel libvidstab-devel x264-devel x265-devel
- xvidcore-devel fdk-aac-devel libtls-devel gmp-devel libass-devel libbluray-devel libcaca-devel
- celt-devel codec2-devel libdav1d-devel libdrm-devel fontconfig-devel freetype-devel
- fribidi-devel glslang-devel SPIRV-Tools-devel libgme-devel libgsm-devel jack-devel
- libmodplug-devel lame-devel libopencv4-devel libopenjpeg2-devel libopenmpt-devel opus-devel
- libplacebo-devel libpulseaudio rabbitmq-c-devel librist-devel librsvg-devel librtmp-devel
- snappy-devel libsoxr-devel speex-devel srt-devel libssh-devel libtheora-devel twolame-devel
- libvorbis-devel libvpx6-devel libwebp-devel libxml2-devel zimg-devel lilv-devel lv2
- libopenal-devel mesa openssl-devel vapoursynth-devel ocl-icd-devel libmysofa-devel vulkan-loader
- $(vopt_if vaapi libva-devel)
- $(vopt_if vdpau libvdpau-devel)
- $(vopt_if nvenc nv-codec-headers)
- $(vopt_if nvdec nv-codec-headers)
- $(vopt_if svtav1 libsvt-av1-devel)
-"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
 depends="ffplay>=${version}_${revision}"
-build_options="vaapi vdpau nvenc nvdec svtav1"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
@@ -46,6 +52,22 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
 do_configure() {
 	# Fix gcc on x86_64-musl only
 	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
@@ -76,47 +98,39 @@ do_configure() {
 		_args+=" --extra-libs=-latomic"
 	fi
 
-	./configure \
-		--prefix='/usr' \
-		--extra-cflags='-I/opt/cuda/include' \
-		--extra-ldflags='-L/opt/cuda/lib64' \
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
 		--disable-stripping \
-		--enable-shared --enable-static \
-		--enable-nonfree --enable-gpl \
-		--enable-version3 --enable-libxcb \
-		--enable-frei0r --enable-libcdio \
-		--enable-librubberband --enable-libvidstab \
-		--enable-libx264 --enable-libx265 --enable-libxvid \
-		--enable-libfdk-aac --enable-libtls --enable-gmp \
-		--enable-chromaprint --enable-gcrypt --enable-ladspa \
-		--enable-lcms2 --enable-libaom --enable-libass \
-		--enable-libbluray --enable-libcaca --enable-libcelt \
-		--enable-libcodec2 --enable-libdav1d --enable-libdrm \
-		--enable-libfontconfig --enable-libfreetype \
-		--enable-libfribidi --enable-libglslang \
-		--enable-libgme --enable-libgsm \
-		--enable-vapoursynth --enable-openssl --enable-opengl \
-		--enable-openal --enable-lv2 --enable-libzimg \
-		--enable-libxml2 --enable-libwebp --enable-libvorbis \
-		--enable-libtwolame --enable-libtheora --enable-libssh \
-		--enable-libsrt --enable-libspeex --enable-libsoxr \
-		--enable-librtmp --enable-librsvg --enable-librist \
-		--enable-librabbitmq --enable-libpulse --enable-libplacebo \
-		--enable-libopus --enable-libopenmpt --enable-libopenjpeg \
-		--enable-libmp3lame --enable-libmodplug --enable-libjack \
-		--enable-opencl --enable-libvpx --enable-libmysofa \
-		$(vopt_enable vaapi) \
-		$(vopt_enable vdpau) \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
 		$(vopt_if nvenc '--enable-nvenc') \
-		$(vopt_if nvdec '--enable-nvdec') \
-		$(vopt_enable svtav1 libsvtav1)
+		$(vopt_if nvdec '--enable-nvdec')
 }
-
 do_build() {
 	make ${makejobs}
 	make doc/ff{mpeg,play}.1
 }
-
 do_install() {
 	make DESTDIR=${DESTDIR} install install-man
 }
@@ -133,6 +147,10 @@ libavdevice_package() {
 		vmove "usr/lib/libavdevice.so.*"
 	}
 }
+libavresample_package() {
+	short_desc="Package deprecated, removal needed"
+	build_style=meta
+}
 libavformat_package() {
 	short_desc="FFmpeg file format library"
 	pkg_install() {
@@ -180,47 +198,7 @@ ffmpeg-devel_package() {
 		libswscale>=${version}_${revision}
 		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
-	alternatives="
-	 ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec5.3
-	 ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice5.3
-	 ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter5.3
-	 ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat5.3
-	 ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil5.3
-	 ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample5.3
-	 ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale5.3
-	 ffmpeg-devel:libavcodec:/usr/include/libavcodec5
-	 ffmpeg-devel:libavdevice:/usr/include/libavdevice5
-	 ffmpeg-devel:libavformat:/usr/include/libavformat5
-	 ffmpeg-devel:libavutil:/usr/include/libavutil5
-	 ffmpeg-devel:libavpostproc:/usr/include/libavpostproc5
-	 ffmpeg-devel:libswresample:/usr/include/libswresample5
-	 ffmpeg-devel:libswcaale:/usr/include/libswscale5
-	 ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec5.pc
-	 ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice5.pc
-	 ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter5.pc
-	 ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat5.pc
-	 ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil5.pc
-	 ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc5.pc
-	 ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample5.pc
-	 ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale5.pc
-	 ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec5.a
-	 ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec5.so
-	 ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice5.a
-	 ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice5.so
-	 ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter5.a
-	 ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter5.so
-	 ffmpeg-devel:libavformat.a:/usr/lib/libavformat5.a
-	 ffmpeg-devel:libavformat.so:/usr/lib/libavformat5.so
-	 ffmpeg-devel:libavutil.a:/usr/lib/libavutil5.a
-	 ffmpeg-devel:libavutil.so:/usr/lib/libavutil5.so
-	 ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc5.a
-	 ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc5.so
-	 ffmpeg-devel:libswresample.a:/usr/lib/libswresample5.a
-	 ffmpeg-devel:libswresample.so:/usr/lib/libswresample5.so
-	 ffmpeg-devel:libswscale.a:/usr/lib/libswscale5.a
-	 ffmpeg-devel:libswscale.so:/usr/lib/libswscale5.so
-	 ffmpeg-devel:ffmpeg:/usr/share/ffmpeg5
-	"
+	conflicts="ffmpeg4-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
@@ -231,7 +209,7 @@ ffmpeg-devel_package() {
 	}
 }
 ffplay_package() {
-	short_desc="Simple media player using FFmpeg and SDL2"
+	short_desc="Simple video player using FFmpeg and SDL2"
 	pkg_install() {
 		vmove usr/bin/ffplay
 		vmove "usr/share/man/man1/ffplay*"
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
index cd9154978b3e..7bc64bb39f41 100644
--- a/srcpkgs/ffmpeg4/template
+++ b/srcpkgs/ffmpeg4/template
@@ -2,8 +2,8 @@
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg4
 version=4.4.3
-revision=3
-short_desc="ffmpeg4 libraries only - Decoding, encoding and streaming software"
+revision=1
+short_desc="Decoding, encoding and streaming software - ffmpeg4 libraries only"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
@@ -202,47 +202,7 @@ ffmpeg4-devel_package() {
 		libswresample4>=${version}_${revision}
 		libavresample4>=${version}_${revision}"
 	short_desc+=" - development files"
-	alternatives="
-		ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec4.3
-		ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice4.3
-		ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter4.3
-		ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat4.3
-		ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil4.3
-		ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample4.3
-		ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale4.3
-		ffmpeg-devel:libavcodec:/usr/include/libavcodec4
-		ffmpeg-devel:libavdevice:/usr/include/libavdevice4
-		ffmpeg-devel:libavformat:/usr/include/libavformat4
-		ffmpeg-devel:libavutil:/usr/include/libavutil4
-		ffmpeg-devel:libavpostproc:/usr/include/libavpostproc4
-		ffmpeg-devel:libswresample:/usr/include/libswresample4
-		ffmpeg-devel:libswcaale:/usr/include/libswscale4
-		ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec4.pc
-		ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice4.pc
-		ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter4.pc
-		ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat4.pc
-		ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil4.pc
-		ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc4.pc
-		ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample4.pc
-		ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale4.pc
-		ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec4.a
-		ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec4.so
-		ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice4.a
-		ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice4.so
-		ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter4.a
-		ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter4.so
-		ffmpeg-devel:libavformat.a:/usr/lib/libavformat4.a
-		ffmpeg-devel:libavformat.so:/usr/lib/libavformat4.so
-		ffmpeg-devel:libavutil.a:/usr/lib/libavutil4.a
-		ffmpeg-devel:libavutil.so:/usr/lib/libavutil4.so
-		ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc4.a
-		ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc4.so
-		ffmpeg-devel:libswresample.a:/usr/lib/libswresample4.a
-		ffmpeg-devel:libswresample.so:/usr/lib/libswresample4.so
-		ffmpeg-devel:libswscale.a:/usr/lib/libswscale4.a
-		ffmpeg-devel:libswscale.so:/usr/lib/libswscale4.so
-		ffmpeg-devel:ffmpeg:/usr/share/ffmpeg4
-	"
+	conflicts="ffmpeg-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
diff --git a/srcpkgs/ffmpegthumbnailer/template b/srcpkgs/ffmpegthumbnailer/template
index 039eea7622b3..35d546018d12 100644
--- a/srcpkgs/ffmpegthumbnailer/template
+++ b/srcpkgs/ffmpegthumbnailer/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbnailer'
 pkgname=ffmpegthumbnailer
 version=2.2.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libpng-devel libjpeg-turbo-devel ffmpeg-devel"
@@ -9,8 +9,8 @@ depends="ffmpeg"
 short_desc="Lightweight video thumbnailer"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
-homepage="https://github.com/dirkvdb/${pkgname}"
-distfiles="${homepage}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
+homepage="https://github.com/dirkvdb"
+distfiles="${homepage}/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
 checksum=1cb24059c38223f657b300c84dd80491b7040d4b69471c4fea69be862bc99b5b
 
 post_install() {
diff --git a/srcpkgs/ffmpegthumbs/template b/srcpkgs/ffmpegthumbs/template
index 5f0b9414dada..11b88193528f 100644
--- a/srcpkgs/ffmpegthumbs/template
+++ b/srcpkgs/ffmpegthumbs/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbs'
 pkgname=ffmpegthumbs
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules kcoreaddons kconfig-devel
  pkg-config qt5-host-tools qt5-qmake gettext"
diff --git a/srcpkgs/ffms2/patches/ffmpeg5.patch b/srcpkgs/ffms2/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..0766db172473
--- /dev/null
+++ b/srcpkgs/ffms2/patches/ffmpeg5.patch
@@ -0,0 +1,419 @@
+From 28fc493fda2fa2064afeeb0a5d85fdc42db05dcf Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:12:41 +0100
+Subject: [PATCH 1/3] all: Update AVPacket API usage
+
+AVPackets must all be on the heap now, since it is no longer
+part of the libav* ABI.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 16 ++++++----
+ src/core/indexing.cpp    | 63 ++++++++++++++++++++++------------------
+ src/core/indexing.h      |  4 +--
+ src/core/utils.cpp       |  6 ----
+ src/core/utils.h         |  1 -
+ src/core/videosource.cpp | 30 ++++++++++---------
+ 6 files changed, 64 insertions(+), 56 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index 37cf9aeef..e4ce97cdb 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -285,10 +285,15 @@ FFMS_AudioSource::AudioBlock *FFMS_AudioSource::CacheBlock(CacheIterator &pos) {
+ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     CurrentFrame = &Frames[PacketNumber];
+
+-    AVPacket Packet;
+-    if (!ReadPacket(&Packet))
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++    if (!ReadPacket(Packet)) {
++        av_packet_free(&Packet);
+         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_UNKNOWN,
+             "ReadPacket unexpectedly failed to read a packet");
++    }
+
+     // ReadPacket may have changed the packet number
+     CurrentFrame = &Frames[PacketNumber];
+@@ -297,8 +302,9 @@ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     int NumberOfSamples = 0;
+     AudioBlock *CachedBlock = nullptr;
+
+-    int Ret = avcodec_send_packet(CodecContext, &Packet);
+-    av_packet_unref(&Packet);
++    int Ret = avcodec_send_packet(CodecContext, Packet);
++    av_packet_unref(Packet);
++    av_packet_free(&Packet);
+
+     av_frame_unref(DecodeFrame);
+     Ret = avcodec_receive_frame(CodecContext, DecodeFrame);
+@@ -513,8 +519,6 @@ void FFMS_AudioSource::Seek() {
+ }
+
+ bool FFMS_AudioSource::ReadPacket(AVPacket *Packet) {
+-    InitNullPacket(*Packet);
+-
+     while (av_read_frame(FormatContext, Packet) >= 0) {
+         if (Packet->stream_index == TrackNumber) {
+             // Required because not all audio packets, especially in ogg, have a pts. Use the previous valid packet's pts instead.
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index 23fb95b12..e547c5abf 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -320,7 +320,7 @@ void FFMS_Indexer::CheckAudioProperties(int Track, AVCodecContext *Context) {
+     }
+ }
+
+-void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict,
++void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict,
+                                     int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct) {
+     if (VideoContext.Parser) {
+         uint8_t *OB;
+@@ -330,8 +330,8 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+         av_parser_parse2(VideoContext.Parser,
+             VideoContext.CodecContext,
+             &OB, &OBSize,
+-            pkt.data, pkt.size,
+-            pkt.pts, pkt.dts, pkt.pos);
++            pkt->data, pkt->size,
++            pkt->pts, pkt->dts, pkt->pos);
+
+         // H.264 (PAFF) and HEVC may have one field per packet, so we need to track
+         // when we have a full or half frame available, and mark one of them as
+@@ -351,15 +351,15 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+
+         *RepeatPict = VideoContext.Parser->repeat_pict;
+         *FrameType = VideoContext.Parser->pict_type;
+-        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt.flags & AV_PKT_FLAG_DISCARD));
++        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt->flags & AV_PKT_FLAG_DISCARD));
+     } else {
+-        *Invisible = !!(pkt.flags & AV_PKT_FLAG_DISCARD);
++        *Invisible = !!(pkt->flags & AV_PKT_FLAG_DISCARD);
+     }
+
+     if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP8)
+-        ParseVP8(pkt.data[0], Invisible, FrameType);
++        ParseVP8(pkt->data[0], Invisible, FrameType);
+     else if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP9)
+-        ParseVP9(pkt.data[0], Invisible, FrameType);
++        ParseVP9(pkt->data[0], Invisible, FrameType);
+ }
+
+ void FFMS_Indexer::Free() {
+@@ -458,32 +458,36 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+         }
+     }
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
+     std::vector<int64_t> LastValidTS(FormatContext->nb_streams, AV_NOPTS_VALUE);
+
+     int64_t filesize = avio_size(FormatContext->pb);
+     enum AVPictureStructure LastPicStruct = AV_PICTURE_STRUCTURE_UNKNOWN;
+-    while (av_read_frame(FormatContext, &Packet) >= 0) {
++    while (av_read_frame(FormatContext, Packet) >= 0) {
+         // Update progress
+         // FormatContext->pb can apparently be NULL when opening images.
+         if (IC && FormatContext->pb) {
+-            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate))
++            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate)) {
++                av_packet_free(&Packet);
+                 throw FFMS_Exception(FFMS_ERROR_CANCELLED, FFMS_ERROR_USER,
+                     "Cancelled by user");
++            }
+         }
+-        if (!IndexMask.count(Packet.stream_index)) {
+-            av_packet_unref(&Packet);
++        if (!IndexMask.count(Packet->stream_index)) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+-        int Track = Packet.stream_index;
++        int Track = Packet->stream_index;
+         FFMS_Track &TrackInfo = (*TrackIndices)[Track];
+-        bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
++        bool KeyFrame = !!(Packet->flags & AV_PKT_FLAG_KEY);
+         ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
+
+         if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            int64_t PTS = TrackInfo.UseDTS ? Packet.dts : Packet.pts;
++            int64_t PTS = TrackInfo.UseDTS ? Packet->dts : Packet->pts;
+             if (PTS == AV_NOPTS_VALUE) {
+                 // VPx alt-refs are output as packets which lack timestmps or durations, since
+                 // they are invisible. Currently, the timestamp mangling code in libavformat
+@@ -495,9 +499,11 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 // FFMS2 currently sorts packets by PTS, which will break decoding, otherwise.
+                 bool HasAltRefs = (FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP8 ||
+                                    FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP9);
+-                if (Packet.duration == 0 && !HasAltRefs)
++                if (Packet->duration == 0 && !HasAltRefs) {
++                    av_packet_free(&Packet);
+                     throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER,
+                         "Invalid packet pts, dts, and duration");
++                }
+
+                 if (TrackInfo.empty())
+                     PTS = 0;
+@@ -513,7 +519,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             ParseVideoPacket(AVContexts[Track], Packet, &RepeatPict, &FrameType, &Invisible, &LastPicStruct);
+
+             TrackInfo.AddVideoFrame(PTS, RepeatPict, KeyFrame,
+-                FrameType, Packet.pos, Invisible);
++                FrameType, Packet->pos, Invisible);
+         } else if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+             // For video seeking timestamps are used only if all packets have
+             // timestamps, while for audio they're used if any have timestamps,
+@@ -522,28 +528,29 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 TrackInfo.HasTS = true;
+
+             int64_t StartSample = AVContexts[Track].CurrentSample;
+-            uint32_t SampleCount = IndexAudioPacket(Track, &Packet, AVContexts[Track], *TrackIndices);
++            uint32_t SampleCount = IndexAudioPacket(Track, Packet, AVContexts[Track], *TrackIndices);
+             TrackInfo.SampleRate = AVContexts[Track].CodecContext->sample_rate;
+
+             TrackInfo.AddAudioFrame(LastValidTS[Track],
+-                StartSample, SampleCount, KeyFrame, Packet.pos, Packet.flags & AV_PKT_FLAG_DISCARD);
++                StartSample, SampleCount, KeyFrame, Packet->pos, Packet->flags & AV_PKT_FLAG_DISCARD);
+         }
+
+-        if (!(Packet.flags & AV_PKT_FLAG_DISCARD))
+-            TrackInfo.LastDuration = Packet.duration;
++        if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
++            TrackInfo.LastDuration = Packet->duration;
+
+-        av_packet_unref(&Packet);
++        av_packet_unref(Packet);
+     }
++    av_packet_free(&Packet);
+
+     TrackIndices->Finalize(AVContexts, FormatContext->iformat->name);
+     return TrackIndices.release();
+ }
+
+-void FFMS_Indexer::ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS) {
+-    if (!UseDTS && Packet.pts != AV_NOPTS_VALUE)
+-        TS = Packet.pts;
++void FFMS_Indexer::ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS) {
++    if (!UseDTS && Packet->pts != AV_NOPTS_VALUE)
++        TS = Packet->pts;
+     if (TS == AV_NOPTS_VALUE)
+         UseDTS = true;
+-    if (UseDTS && Packet.dts != AV_NOPTS_VALUE)
+-        TS = Packet.dts;
++    if (UseDTS && Packet->dts != AV_NOPTS_VALUE)
++        TS = Packet->dts;
+ }
+diff --git a/src/core/indexing.h b/src/core/indexing.h
+index 3cfc3c30b..5c0686889 100644
+--- a/src/core/indexing.h
++++ b/src/core/indexing.h
+@@ -80,10 +80,10 @@ struct FFMS_Indexer {
+     int64_t Filesize;
+     uint8_t Digest[20];
+
+-    void ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS);
++    void ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS);
+     void CheckAudioProperties(int Track, AVCodecContext *Context);
+     uint32_t IndexAudioPacket(int Track, AVPacket *Packet, SharedAVContext &Context, FFMS_Index &TrackIndices);
+-    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
++    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
+     void Free();
+ public:
+     FFMS_Indexer(const char *Filename);
+diff --git a/src/core/utils.cpp b/src/core/utils.cpp
+index ce67533fd..8a2e99710 100644
+--- a/src/core/utils.cpp
++++ b/src/core/utils.cpp
+@@ -62,12 +62,6 @@ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo) {
+     }
+ }
+
+-void InitNullPacket(AVPacket &pkt) {
+-    av_init_packet(&pkt);
+-    pkt.data = nullptr;
+-    pkt.size = 0;
+-}
+-
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames) {
+     AP.SampleFormat = static_cast<FFMS_SampleFormat>(av_get_packed_sample_fmt(CTX->sample_fmt));
+     AP.BitsPerSample = av_get_bytes_per_sample(CTX->sample_fmt) * 8;
+diff --git a/src/core/utils.h b/src/core/utils.h
+index 9819dc7c9..003ab794e 100644
+--- a/src/core/utils.h
++++ b/src/core/utils.h
+@@ -58,7 +58,6 @@ std::unique_ptr<T> make_unique(Args&&... args) {
+ }
+
+ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo);
+-void InitNullPacket(AVPacket &pkt);
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames);
+
+ void LAVFOpenFile(const char *SourceFile, AVFormatContext *&FormatContext, int Track);
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index 06bd1610e..b889970e2 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -673,30 +673,34 @@ void FFMS_VideoSource::DecodeNextFrame(int64_t &AStartTime, int64_t &Pos) {
+     if (HasPendingDelayedFrames())
+         return;
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
+-
+-    while (ReadFrame(&Packet) >= 0) {
+-        if (Packet.stream_index != VideoTrack) {
+-            av_packet_unref(&Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++
++    while (ReadFrame(Packet) >= 0) {
++        if (Packet->stream_index != VideoTrack) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+         if (AStartTime < 0)
+-            AStartTime = Frames.UseDTS ? Packet.dts : Packet.pts;
++            AStartTime = Frames.UseDTS ? Packet->dts : Packet->pts;
+
+         if (Pos < 0)
+-            Pos = Packet.pos;
++            Pos = Packet->pos;
+
+-        bool FrameFinished = DecodePacket(&Packet);
+-        av_packet_unref(&Packet);
+-        if (FrameFinished)
++        bool FrameFinished = DecodePacket(Packet);
++        av_packet_unref(Packet);
++        if (FrameFinished) {
++            av_packet_free(&Packet);
+             return;
++        }
+     }
+
+     // Flush final frames
+-    InitNullPacket(Packet);
+-    DecodePacket(&Packet);
++    DecodePacket(Packet);
++    av_packet_free(&Packet);
+ }
+
+ bool FFMS_VideoSource::SeekTo(int n, int SeekOffset) {
+
+From bf9e03e9e08534c024e5a744a6437c4aac160201 Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:20:47 +0100
+Subject: [PATCH 2/3] configure: Remove deprecated API use
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b35ef80bc..d19714d0f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,10 +102,10 @@ CFLAGS="$_CFLAGS $FFMPEG_CFLAGS"
+
+ AC_DEFUN([TEST_FFMPEG],
+          [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-            #include <libavcodec/avcodec.h>
++            #include <libavformat/avformat.h>
+             #include <libswscale/swscale.h>
+             ]],[[
+-                avcodec_register_all();
++                avformat_network_init();
+                 swscale_version();
+             ]])], [eval $1=yes], [eval $1=no])
+         ])
+
+From a18c8296687e267b20ec90ef81671b77d393a36e Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:41:21 +0100
+Subject: [PATCH 3/3] Use auto for AVCodec
+
+The geniuses over at FFmpeg decided to constify this API, so old
+versions of the library will return AVCodec *, while new versions
+of the libary will return const AVCodec *, which, in C++, are not
+OK to convert between.
+
+Rather than use some macro hell in ffmscompat.h, we can work around
+this by using auto.
+
+Gross.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 2 +-
+ src/core/indexing.cpp    | 6 +++---
+ src/core/videosource.cpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index e4ce97cdb..ac0966636 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -469,7 +469,7 @@ void FFMS_AudioSource::OpenFile() {
+
+     LAVFOpenFile(SourceFile.c_str(), FormatContext, TrackNumber);
+
+-    AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
++    auto *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
+     if (Codec == nullptr)
+         throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+             "Audio codec not found");
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index e547c5abf..59fb4e8ea 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -384,7 +384,7 @@ FFMS_TrackType FFMS_Indexer::GetTrackType(int Track) {
+ }
+
+ const char *FFMS_Indexer::GetTrackCodec(int Track) {
+-    AVCodec *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
++    auto *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
+     return codec ? codec->name : nullptr;
+ }
+
+@@ -402,7 +402,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             UseDTS);
+
+         if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (!VideoCodec) {
+                 FormatContext->streams[i]->discard = AVDISCARD_ALL;
+                 IndexMask.erase(i);
+@@ -433,7 +433,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 IndexMask.insert(i);
+             }
+         } else if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+-            AVCodec *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (AudioCodec == nullptr)
+                 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
+                     "Audio codec not found");
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index b889970e2..8956c2256 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -171,7 +171,7 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in
+
+         LAVFOpenFile(SourceFile, FormatContext, VideoTrack);
+
+-        AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
++        auto *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
+         if (Codec == nullptr)
+             throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+                 "Video codec not found");
diff --git a/srcpkgs/ffms2/template b/srcpkgs/ffms2/template
index 68e8a0c14bce..2acfadac44b3 100644
--- a/srcpkgs/ffms2/template
+++ b/srcpkgs/ffms2/template
@@ -1,7 +1,7 @@
 # Template file for 'ffms2'
 pkgname=ffms2
 version=2.40
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--enable-shared --disable-static"
 hostmakedepends="pkg-config autoconf automake libtool"
diff --git a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
deleted file mode 100644
index 4c450fd45bfb..000000000000
--- a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 9d8202f32338a3f08d3fa39057dc5eec5d97be4e Mon Sep 17 00:00:00 2001
-From: Mathias Gumz <akira@fluxbox.org>
-Date: Sat, 28 May 2022 11:13:43 +0200
-Subject: [PATCH] Fix infinite loop in Menu::cycleitems()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When a menu contains no selectable item (example given: a "list" of user
-styles and the only available one is already selected), cycling through
-the menu will lead to an infinite loop and thus a disfunctional fluxbox.
-
-This commit addresses the issue by checking if there is any selectable
-item before entering the cycling stage.
-
-Discovered by Sébastien Ballet[1].
-
-[1]: https://sourceforge.net/p/fluxbox/bugs/1185/
----
- src/FbTk/Menu.cc | 21 +++++++++++++++------
- 1 file changed, 15 insertions(+), 6 deletions(-)
-
-diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
-index 6b2db3a4..ff040bae 100644
---- a/src/FbTk/Menu.cc
-+++ b/src/FbTk/Menu.cc
-@@ -320,15 +320,24 @@ void Menu::lower() {
- 
- void Menu::cycleItems(bool reverse) {
- 
--    if (m_items.empty())
--        return;
--
--    int offset = reverse ? -1 : 1;
-     int l = m_items.size();
--    int i = m_active_index;
-+    int i;
-+    int offset = reverse ? -1 : 1;
-     size_t ignore;
- 
--    for (i += offset; i != m_active_index; i += offset ) {
-+    // check if there is _any_ selectable item
-+    for (i = 0; i < l; i++) {
-+        if (isItemSelectable(i)) {
-+            break;
-+        }
-+    }
-+
-+    // no selectable item
-+    if (i >= l) {
-+        return;
-+    }
-+
-+    for (i = m_active_index + offset; i != m_active_index; i += offset ) {
-         if (i < 0) {
-             i = l - 1;
-         } else if (i >= l) {
--- 
-2.39.0
-
diff --git a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
new file mode 100644
index 000000000000..8dd44e538ce8
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
@@ -0,0 +1,23 @@
+
+From 22866c4d30f5b289c429c5ca88d800200db4fc4f Mon Sep 17 00:00:00 2001
+From: John Sennesael <john@aminking.com>
+Date: Mon, 2 Nov 2015 15:14:32 -0600
+Subject: [PATCH] fixes bug #1138
+
+---
+ util/fluxbox-remote.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc
+index 59852e6a7..504015b50 100644
+--- a/util/fluxbox-remote.cc
++++ b/util/fluxbox-remote.cc
+@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
+     if (strcmp(cmd, "result") == 0) {
+         XTextProperty text_prop;
+         if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
+-            && text_prop.value > 0
++            && text_prop.value != 0
+             && text_prop.nitems > 0) {
+ 
+             printf("%s", text_prop.value);
diff --git a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
deleted file mode 100644
index 5b64b11ab2a8..000000000000
--- a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/src/MinOverlapPlacement.cc  2015-02-08 05:44:34.000000000 -0500
-+++ b/src/MinOverlapPlacement.cc  2022-07-18 15:14:41.012275200 -0400
-@@ -196,19 +196,21 @@
-     std::set<Area>::iterator min_reg = areas.end();
-
-     std::set<Area>::iterator ar_it = areas.begin();
-+    int overlap = 0, min_right = 0, min_bottom = 0, max_left = 0, max_top = 0;
-+
-     for (; ar_it != areas.end(); ++ar_it) {
-
--        int overlap = 0;
-+        overlap = 0;
-         it = const_windowlist.rbegin();
-         for (; it != it_end; ++it) {
-
-             getWindowDimensions(*(*it), left, top, right, bottom);
-
-             // get the coordinates of the overlap region
--            int min_right = std::min(right, ar_it->x + win_w);
--            int min_bottom = std::min(bottom, ar_it->y + win_h);
--            int max_left = std::max(left, ar_it->x);
--            int max_top = std::max(top, ar_it->y);
-+            min_right = std::min(right, ar_it->x + win_w);
-+            min_bottom = std::min(bottom, ar_it->y + win_h);
-+            max_left = std::max(left, ar_it->x);
-+            max_top = std::max(top, ar_it->y);
-
-             // now compute the overlap and add to running total
-             if (min_right > max_left && min_bottom > max_top)
diff --git a/srcpkgs/fluxbox/patches/center.patch b/srcpkgs/fluxbox/patches/center.patch
deleted file mode 100644
index 39e3e4c7f37e..000000000000
--- a/srcpkgs/fluxbox/patches/center.patch
+++ /dev/null
@@ -1,307 +0,0 @@
-From ec83993c236de9c9442e2fcd31c08aae852a5a16 Mon Sep 17 00:00:00 2001
-From: zlice <zlice555@gmail.com>
-Date: Fri, 22 Jul 2022 21:21:33 -0400
-Subject: [PATCH 1/2] whitespace cleanup
-
----
- doc/asciidoc/fluxbox.txt |  8 ++++----
- src/ScreenPlacement.cc   | 12 ++++++------
- src/ScreenPlacement.hh   | 10 +++++-----
- 3 files changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
-index 95624842..0e3f27b9 100644
---- a/doc/asciidoc/fluxbox.txt
-+++ b/doc/asciidoc/fluxbox.txt
-@@ -4,7 +4,7 @@ Henrik Kinnunen <fluxgen@fluxbox.org>
- v1.3.7, 08 February 2015
- :man source:   fluxbox.txt
- :man version:  {revision}
--:man manual:   Fluxbox Manual  
-+:man manual:   Fluxbox Manual
- 
- NAME
- ----
-@@ -475,7 +475,7 @@ By default, this menu contains:
- 
- *Remember...*:::
- Specify which window settings should be stored in the `apps' file and
--resumed the next time this window is opened. 
-+resumed the next time this window is opened.
- +
- Specifically the setting you may store are:
- +
-@@ -740,7 +740,7 @@ There are three more settings in the ``Focus Model'' menu:
- 
- TAB OPTIONS
- -----------
--This section of fluxbox configuration menu lets you configure many features of 
-+This section of fluxbox configuration menu lets you configure many features of
- tabs. Inside of it there are three main options:
- 
- *Placement*:::
-@@ -1060,7 +1060,7 @@ whenever the mouse moves over them, but only when the mouse is moving. With
- area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc.
- +
- Default: *ClickToFocus*
--      
-+
- *session.screen0.autoRaise*: 'boolean'::
- When True, this setting automatically raises any window that gains focus.
- +
-diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
-index 19ddf78a..ca58d83f 100644
---- a/src/ScreenPlacement.cc
-+++ b/src/ScreenPlacement.cc
-@@ -43,14 +43,14 @@ using std::cerr;
- using std::endl;
- 
- ScreenPlacement::ScreenPlacement(BScreen &screen):
--    m_row_direction(screen.resourceManager(), LEFTRIGHT, 
--                    screen.name()+".rowPlacementDirection", 
-+    m_row_direction(screen.resourceManager(), LEFTRIGHT,
-+                    screen.name()+".rowPlacementDirection",
-                     screen.altName()+".RowPlacementDirection"),
--    m_col_direction(screen.resourceManager(), TOPBOTTOM, 
--                    screen.name()+".colPlacementDirection", 
-+    m_col_direction(screen.resourceManager(), TOPBOTTOM,
-+                    screen.name()+".colPlacementDirection",
-                     screen.altName()+".ColPlacementDirection"),
--    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT, 
--                       screen.name()+".windowPlacement", 
-+    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT,
-+                       screen.name()+".windowPlacement",
-                        screen.altName()+".WindowPlacement"),
-     m_old_policy(ROWSMARTPLACEMENT),
-     m_screen(screen)
-diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
-index 0f210d94..f1234983 100644
---- a/src/ScreenPlacement.hh
-+++ b/src/ScreenPlacement.hh
-@@ -34,7 +34,7 @@ class BScreen;
- 
- /**
-  * Main class for strategy handling
-- * This is a bridge between screen and 
-+ * This is a bridge between screen and
-  * the real placement strategy (rowcol, undermouse etc)
-  * The placeWindow function in this class is guaranteed to succeed.
-  * It holds a pointer to the real placement strategy which is
-@@ -42,8 +42,8 @@ class BScreen;
-  */
- class ScreenPlacement: public PlacementStrategy {
- public:
--    enum PlacementPolicy { 
--        ROWSMARTPLACEMENT, 
-+    enum PlacementPolicy {
-+        ROWSMARTPLACEMENT,
-         COLSMARTPLACEMENT,
-         COLMINOVERLAPPLACEMENT,
-         ROWMINOVERLAPPLACEMENT,
-@@ -52,11 +52,11 @@ public:
-         AUTOTABPLACEMENT
-     };
- 
--    enum RowDirection { 
-+    enum RowDirection {
-         LEFTRIGHT, ///< from left to right
-         RIGHTLEFT  ///< from right to left
-     };
--    enum ColumnDirection { 
-+    enum ColumnDirection {
-         TOPBOTTOM,  ///< from top to bottom
-         BOTTOMTOP   ///< from bottom to top
-     };
--- 
-2.37.1
-
-
-From 6e05f44c94fa4bfc0e44e8f42a9d24665a95840f Mon Sep 17 00:00:00 2001
-From: zlice <zlice555@gmail.com>
-Date: Fri, 22 Jul 2022 21:27:25 -0400
-Subject: [PATCH 2/2] new feature: CenterPlacement. Places new windows in
- center of the current workspace
-
----
- doc/asciidoc/fluxbox.txt |  1 +
- src/CenterPlacement.cc   | 43 ++++++++++++++++++++++++++++++++++++++++
- src/CenterPlacement.hh   | 37 ++++++++++++++++++++++++++++++++++
- src/Makemodule.am        |  2 ++
- src/ScreenPlacement.cc   |  8 ++++++++
- src/ScreenPlacement.hh   |  1 +
- 6 files changed, 92 insertions(+)
- create mode 100644 src/CenterPlacement.cc
- create mode 100644 src/CenterPlacement.hh
-
-diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
-index 0e3f27b9..46ca2861 100644
---- a/doc/asciidoc/fluxbox.txt
-+++ b/doc/asciidoc/fluxbox.txt
-@@ -1141,6 +1141,7 @@ Available strategies:;;
- - RowSmartPlacement: tries to place windows in rows without overlapping
- - ColSmartPlacement: tries to place windows in columns without overlapping
- - CascadePlacement: places windows below the titlebar of the previous one
-+- CenterPlacement: places windows in the center of the current workspace
- - UnderMousePlacement: places new windows underneath the mouse
- - RowMinOverlapPlacement: place windows in rows with minimal overlapping
- - ColMinOverlapPlacement: place windows in columns with minimal overlapping
-diff --git a/src/CenterPlacement.cc b/src/CenterPlacement.cc
-new file mode 100644
-index 00000000..efaf76b9
---- /dev/null
-+++ b/src/CenterPlacement.cc
-@@ -0,0 +1,43 @@
-+// CenterPlacement.cc
-+// Copyright (c) 2006 Fluxbox Team (fluxgen at fluxbox dot org)
-+//
-+// Permission is hereby granted, free of charge, to any person obtaining a
-+// copy of this software and associated documentation files (the "Software"),
-+// to deal in the Software without restriction, including without limitation
-+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+// and/or sell copies of the Software, and to permit persons to whom the
-+// Software is furnished to do so, subject to the following conditions:
-+//
-+// The above copyright notice and this permission notice shall be included in
-+// all copies or substantial portions of the Software.
-+//
-+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+// DEALINGS IN THE SOFTWARE.
-+
-+#include "CenterPlacement.hh"
-+
-+#include "FbTk/App.hh"
-+#include "Screen.hh"
-+#include "Window.hh"
-+
-+bool CenterPlacement::placeWindow(const FluxboxWindow &win, int head,
-+                                      int &place_x, int &place_y) {
-+
-+    int cent_x = (signed) win.screen().maxRight(head) - (signed) win.screen().maxLeft(head);
-+    int cent_y = (signed) win.screen().maxBottom(head) - (signed) win.screen().maxTop(head);
-+
-+    // border on 1 side, dividing in half
-+    // with rounding, this will probably favor top left
-+    int win_half_w = (win.width() / 2) + win.fbWindow().borderWidth(),
-+        win_half_h = (win.height() / 2) + win.fbWindow().borderWidth();
-+
-+    place_x = cent_x - win_half_w;
-+    place_y = cent_y - win_half_h;
-+
-+    return true;
-+}
-diff --git a/src/CenterPlacement.hh b/src/CenterPlacement.hh
-new file mode 100644
-index 00000000..9f70a6c8
---- /dev/null
-+++ b/src/CenterPlacement.hh
-@@ -0,0 +1,37 @@
-+// CenterPlacement.hh
-+// Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org)
-+//
-+// Permission is hereby granted, free of charge, to any person obtaining a
-+// copy of this software and associated documentation files (the "Software"),
-+// to deal in the Software without restriction, including without limitation
-+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+// and/or sell copies of the Software, and to permit persons to whom the
-+// Software is furnished to do so, subject to the following conditions:
-+//
-+// The above copyright notice and this permission notice shall be included in
-+// all copies or substantial portions of the Software.
-+//
-+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+// DEALINGS IN THE SOFTWARE.
-+
-+#ifndef CENTERPLACEMENT_HH
-+#define CENTERPLACEMENT_HH
-+
-+#include "ScreenPlacement.hh"
-+
-+class CenterPlacement: public PlacementStrategy {
-+public:
-+    CenterPlacement() { };
-+
-+    bool placeWindow(const FluxboxWindow &win, int head,
-+                     int &place_x, int &place_y);
-+
-+private:
-+};
-+
-+#endif // CENTERPLACEMENT_HH
-diff --git a/src/Makemodule.am b/src/Makemodule.am
-index 5be5692c..53d35e8e 100644
---- a/src/Makemodule.am
-+++ b/src/Makemodule.am
-@@ -165,6 +165,8 @@ fluxbox_SOURCES = \
- 	src/AttentionNoticeHandler.hh \
- 	src/CascadePlacement.cc \
- 	src/CascadePlacement.hh \
-+	src/CenterPlacement.cc \
-+	src/CenterPlacement.hh \
- 	src/ClientMenu.cc \
- 	src/ClientMenu.hh \
- 	src/ClientPattern.cc \
-diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
-index ca58d83f..ce47a910 100644
---- a/src/ScreenPlacement.cc
-+++ b/src/ScreenPlacement.cc
-@@ -24,6 +24,7 @@
- #include "RowSmartPlacement.hh"
- #include "MinOverlapPlacement.hh"
- #include "UnderMousePlacement.hh"
-+#include "CenterPlacement.hh"
- #include "ColSmartPlacement.hh"
- #include "CascadePlacement.hh"
- 
-@@ -82,6 +83,9 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
-         case UNDERMOUSEPLACEMENT:
-             m_strategy.reset(new UnderMousePlacement());
-             break;
-+        case CENTERPLACEMENT:
-+            m_strategy.reset(new CenterPlacement());
-+            break;
-         case AUTOTABPLACEMENT:
-             m_strategy.reset(0);
-             break;
-@@ -197,6 +201,8 @@ std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const
-         return "ColMinOverlapPlacement";
-     case ScreenPlacement::UNDERMOUSEPLACEMENT:
-         return "UnderMousePlacement";
-+    case ScreenPlacement::CENTERPLACEMENT:
-+        return "CenterPlacement";
-     case ScreenPlacement::CASCADEPLACEMENT:
-         return "CascadePlacement";
-     case ScreenPlacement::AUTOTABPLACEMENT:
-@@ -218,6 +224,8 @@ void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char
-         *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
-     else if (strcasecmp("UnderMousePlacement", str) == 0)
-         *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
-+    else if (strcasecmp("CenterPlacement", str) == 0)
-+        *(*this) = ScreenPlacement::CENTERPLACEMENT;
-     else if (strcasecmp("CascadePlacement", str) == 0)
-         *(*this) = ScreenPlacement::CASCADEPLACEMENT;
-     else if (strcasecmp("AutotabPlacement", str) == 0)
-diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
-index f1234983..a5c9b885 100644
---- a/src/ScreenPlacement.hh
-+++ b/src/ScreenPlacement.hh
-@@ -49,6 +49,7 @@ public:
-         ROWMINOVERLAPPLACEMENT,
-         CASCADEPLACEMENT,
-         UNDERMOUSEPLACEMENT,
-+        CENTERPLACEMENT,
-         AUTOTABPLACEMENT
-     };
- 
--- 
-2.37.1
-
diff --git a/srcpkgs/fluxbox/patches/container_locks.patch b/srcpkgs/fluxbox/patches/container_locks.patch
deleted file mode 100644
index 498ab44a23c6..000000000000
--- a/srcpkgs/fluxbox/patches/container_locks.patch
+++ /dev/null
@@ -1,325 +0,0 @@
-diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
-index 00bc1187..f8a4c475 100644
---- a/src/FbWinFrame.cc
-+++ b/src/FbWinFrame.cc
-@@ -148,6 +148,11 @@ FbWinFrame::FbWinFrame(BScreen &screen, unsigned int client_depth,
-     m_button_size(1),
-     m_shape(m_window, theme->shapePlace()) {
- 
-+    m_locker_timer.setTimeout(timerVal() ); // 10millisec
-+    m_locker_timer.fireOnce(true);
-+    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<FbWinFrame>(*this, &FbWinFrame::unlockSig));
-+    m_locker_timer.setCommand(usig);
-+
-     init();
- }
- 
-@@ -156,6 +161,27 @@ FbWinFrame::~FbWinFrame() {
-     removeAllButtons();
- }
- 
-+// for incremental changes, back off for a bit
-+// prevents slowdown from say, making 200 windows
-+void FbWinFrame::resetLock() {
-+    m_lock_gfx = true;
-+    m_locker_timer.start();
-+}
-+
-+void FbWinFrame::unlockSig() {
-+    m_lock_gfx = false;
-+    // this is what we wanted to do
-+    FbTk::Container& tabs = tabcontainer();
-+    tabs.setUpdateLock(m_lock_gfx);
-+    renderTabContainer();
-+    applyTabContainer();
-+
-+    tabs.clear();
-+    tabs.raise();
-+    tabs.show();
-+}
-+
-+
- bool FbWinFrame::setTabMode(TabMode tabmode) {
-     if (m_tabmode == tabmode)
-         return false;
-@@ -187,6 +213,7 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
- 
-     } else {
-         tabs.setUpdateLock(true);
-+        resetLock();
- 
-         tabs.setAlignment(FbTk::Container::RELATIVE);
-         tabs.setOrientation(FbTk::ROT0);
-@@ -200,9 +227,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
-         }
-         tabs.setBorderWidth(0);
-         tabs.setMaxTotalSize(0);
--        tabs.setUpdateLock(false);
-+        tabs.setUpdateLock(m_lock_gfx);
-         tabs.setMaxSizePerClient(0);
- 
-+        if (m_lock_gfx)
-+            return false;
-+
-         renderTabContainer();
-         applyTabContainer();
- 
-diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
-index 617b9b91..725c84a0 100644
---- a/src/FbWinFrame.hh
-+++ b/src/FbWinFrame.hh
-@@ -33,6 +33,7 @@
- #include "FbTk/Container.hh"
- #include "FbTk/Shape.hh"
- #include "FbTk/Signal.hh"
-+#include "FbTk/Timer.hh"
- 
- #include <vector>
- #include <memory>
-@@ -176,6 +177,12 @@ public:
-     void setShapingClient(FbTk::FbWindow *win, bool always_update);
-     void updateShape() { m_shape.update(); }
- 
-+    void resetLock();
-+    void unlockSig();
-+    FbTk::Timer m_locker_timer;
-+    static unsigned int timerVal() { return 10 * FbTk::FbTime::IN_MILLISECONDS; }
-+    bool m_lock_gfx = false;
-+
-     /**
-        @name accessors
-     */
-diff --git a/src/IconButton.cc b/src/IconButton.cc
-index 1290c2aa..2ea7af9e 100644
---- a/src/IconButton.cc
-+++ b/src/IconButton.cc
-@@ -71,8 +71,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent,
- 
-     FbTk::EventManager::instance()->add(*this, m_icon_window);
- 
--    reconfigTheme();
--    refreshEverything(false);
-+    //reconfigTheme();
-+    //refreshEverything(false);
- }
- 
- IconButton::~IconButton() {
-@@ -163,12 +163,12 @@ void IconButton::reconfigTheme() {
-                            width(), height(), m_theme->texture(),
-                            orientation()));
-         setBackgroundPixmap(m_pm);
--    } else{
-+    } else {
-         m_pm.reset(0);
-         setBackgroundColor(m_theme->texture().color());
-     }
- 
--    updateBackground(false);
-+    //updateBackground(false);
- }
- 
- void IconButton::reconfigAndClear() {
-@@ -181,7 +181,8 @@ void IconButton::refreshEverything(bool setup) {
-     Display *display = FbTk::App::instance()->display();
-     int screen = m_win.screen().screenNumber();
- 
--    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None) {
-+    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None &&
-+                                     width() > m_icon_window.width() ) {
-         // setup icon window
-         m_icon_window.show();
-         unsigned int w = width();
-@@ -242,7 +243,6 @@ void IconButton::refreshEverything(bool setup) {
-         m_icon_window.clear();
-     }
- 
--
- }
- 
- void IconButton::clientTitleChanged() {
-@@ -251,24 +251,30 @@ void IconButton::clientTitleChanged() {
- 
-     if (m_has_tooltip)
-         showTooltip();
-+
- }
- 
- void IconButton::setupWindow() {
-     m_icon_window.clear();
-+    //FbTk::FbString title = "wtf2";
-     FbTk::FbString title = m_win.title().logical();
--    if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
--        title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
-+    //#if USE_TOOLBAR
-+    //if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
-+    //    title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
-+    //#endif
-     setText(title);
-     FbTk::TextButton::clear();
- }
- 
- void IconButton::drawText(int x, int y, FbTk::FbDrawable *drawable) {
- 
--    // offset text
--    if (m_icon_pixmap.drawable() != 0)
--        FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
--    else
--        FbTk::TextButton::drawText(1, y, drawable);
-+    if (width() > m_icon_window.width() ) {
-+      // offset text
-+      if (m_icon_pixmap.drawable() != 0)
-+          FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
-+      else
-+          FbTk::TextButton::drawText(1, y, drawable);
-+    }
- }
- 
- bool IconButton::setOrientation(FbTk::Orientation orient) {
-diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
-index 027ab1c6..f64a4cf6 100644
---- a/src/IconbarTool.cc
-+++ b/src/IconbarTool.cc
-@@ -300,6 +300,11 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
-     FbTk::RefCount<FbTk::Command<void> > ers(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::emitResizeSig));
-     m_resizeSig_timer.setCommand(ers);
- 
-+    m_locker_timer.setTimeout(IconButton::updateLaziness() / 10); // 10millisec
-+    m_locker_timer.fireOnce(true);
-+    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::unlockSig));
-+    m_locker_timer.setCommand(usig);
-+
-     themeReconfigured();
- }
- 
-@@ -325,7 +330,7 @@ void IconbarTool::updateMaxSizes(unsigned int width, unsigned int height) {
- 
- void IconbarTool::resize(unsigned int width, unsigned int height) {
-     m_icon_container.resize(width, height);
--    updateMaxSizes(width, height);
-+    //updateMaxSizes(width, height);
-     renderTheme();
- }
- 
-@@ -333,7 +338,7 @@ void IconbarTool::moveResize(int x, int y,
-                              unsigned int width, unsigned int height) {
- 
-     m_icon_container.moveResize(x, y, width, height);
--    updateMaxSizes(width, height);
-+    //updateMaxSizes(width, height);
-     renderTheme();
- }
- 
-@@ -393,6 +398,25 @@ void IconbarTool::setMode(string mode) {
-     m_menu.reconfigure();
- }
- 
-+// for incremental changes, back off for a bit
-+// prevents slowdown from say, making 200 windows
-+void IconbarTool::resetLock() {
-+    m_lock_gfx = true;
-+    m_locker_timer.start();
-+}
-+
-+void IconbarTool::unlockSig() {
-+    m_lock_gfx = false;
-+    //resizeSig().emit();
-+    // this is what we wanted to do
-+    m_icon_container.setUpdateLock(false);
-+    m_icon_container.update();
-+    m_icon_container.showSubwindows();
-+    renderTheme();
-+    update(ALIGN, NULL);
-+    m_resizeSig_timer.start();
-+}
-+
- void IconbarTool::emitResizeSig() {
-     resizeSig().emit();
- }
-@@ -441,9 +465,11 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
-     switch(reason) {
-         case LIST_ADD: case LIST_ORDER:
-             insertWindow(*win);
-+            resetLock();
-             break;
-         case LIST_REMOVE:
-             removeWindow(*win);
-+            resetLock();
-             break;
-         case LIST_RESET:
-             reset();
-@@ -455,6 +481,10 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
-     m_resizeSig_timer.start();
- 
-     updateMaxSizes(width(), height());
-+
-+    if (m_lock_gfx)
-+        return;
-+
-     // unlock container and update graphics
-     m_icon_container.setUpdateLock(false);
-     m_icon_container.update();
-@@ -496,13 +526,13 @@ void IconbarTool::insertWindow(Focusable &win, int pos) {
-         button = makeButton(win);
-     if (!button) return;
- 
--    if (pos == -2) {
--        pos = 0;
--        list<Focusable *>::iterator it = m_winlist->clientList().begin(),
--                                    it_end = m_winlist->clientList().end();
--        for (; it != it_end && *it != &win; ++it)
--            pos++;
--    }
-+    //if (pos == -2) {
-+    //    pos = 0;
-+    //    list<Focusable *>::iterator it = m_winlist->clientList().begin(),
-+    //                                it_end = m_winlist->clientList().end();
-+    //    for (; it != it_end && *it != &win; ++it)
-+    //        pos++;
-+    //}
- 
-     m_icon_container.insertItem(button, pos);
-     m_tracker.join(button->titleChanged(), FbTk::MemFun(m_resizeSig_timer, &FbTk::Timer::start));
-@@ -517,9 +547,9 @@ void IconbarTool::updateSizing() {
-     m_icon_container.setBorderWidth(m_theme.border().width());
-     m_icon_container.setBorderColor(m_theme.border().color());
- 
--    FbTk::STLUtil::forAll(m_icons, 
--            FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
--                FbTk::Select2nd<IconMap::value_type>()));
-+    //FbTk::STLUtil::forAll(m_icons, 
-+    //        FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
-+    //            FbTk::Select2nd<IconMap::value_type>()));
- 
- }
- 
-@@ -560,7 +590,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear) {
- 
-     button.setPixmap(*m_rc_use_pixmap);
-     button.setTextPadding(*m_rc_client_padding);
--    button.reconfigTheme();
-+    //button.reconfigTheme();
-     if (clear)
-         button.clear(); // the clear also updates transparent
- }
-diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
-index df6d9a65..1c2101ac 100644
---- a/src/IconbarTool.hh
-+++ b/src/IconbarTool.hh
-@@ -106,6 +106,9 @@ private:
- 
-     void themeReconfigured();
- 
-+    void resetLock();
-+    void unlockSig();
-+    FbTk::Timer m_locker_timer;
-     FbTk::Timer m_resizeSig_timer;
-     void emitResizeSig();
- 
-@@ -128,6 +131,7 @@ private:
-     FbMenu m_menu;
-     int m_alpha;
-     static std::string s_iconifiedDecoration[2];
-+    bool m_lock_gfx = false;
- };
- 
- #endif // ICONBARTOOL_HH
diff --git a/srcpkgs/fluxbox/patches/container_relative_relative.patch b/srcpkgs/fluxbox/patches/container_relative_relative.patch
deleted file mode 100644
index dc3ddb5181b5..000000000000
--- a/srcpkgs/fluxbox/patches/container_relative_relative.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
-index cea761b3..0e050a0b 100644
---- a/src/FbTk/Container.cc
-+++ b/src/FbTk/Container.cc
-@@ -365,6 +365,9 @@ void Container::repositionItems() {
-     const ItemList::iterator it_end = end();
-
-     int rounding_error = 0;
-+    if (align == RELATIVE || total_width == m_max_total_size) {
-+        rounding_error = total_width - ((max_width_per_client + borderW)* num_items - borderW);
-+    }
-
-     int next_x = -borderW; // zero so the border of the first shows
-     int extra = 0;
-
diff --git a/srcpkgs/fluxbox/patches/flux_improve.patch b/srcpkgs/fluxbox/patches/flux_improve.patch
deleted file mode 100644
index 13a1aeba621c..000000000000
--- a/srcpkgs/fluxbox/patches/flux_improve.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/src/Ewmh.cc b/src/Ewmh.cc
-index e12a7923..db1ddd45 100644
---- a/src/Ewmh.cc
-+++ b/src/Ewmh.cc
-@@ -1096,15 +1096,19 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
-         // ce.data.l[0] = the action (remove, add or toggle)
-         // ce.data.l[1] = the first property to alter
-         // ce.data.l[2] = second property to alter (can be zero)
--        if (ce.data.l[0] == STATE_REMOVE) {
--            setState(win, ce.data.l[1], false, *winclient);
--            setState(win, ce.data.l[2], false, *winclient);
--        } else if (ce.data.l[0] == STATE_ADD) {
--            setState(win, ce.data.l[1], true, *winclient);
--            setState(win, ce.data.l[2], true, *winclient);
--        } else if (ce.data.l[0] == STATE_TOGGLE) {
--            toggleState(win, ce.data.l[1]);
--            toggleState(win, ce.data.l[2]);
-+        bool addremove = false; // add true, remove false
-+
-+        switch (ce.data.l[0]) {
-+          case STATE_TOGGLE:
-+              toggleState(win, ce.data.l[1]);
-+              toggleState(win, ce.data.l[2]);
-+              break;
-+          case STATE_ADD:
-+              addremove = true;
-+          case STATE_REMOVE:
-+              setState(win, ce.data.l[1], addremove, *winclient);
-+              setState(win, ce.data.l[2], addremove, *winclient);
-+              break;
-         }
-         return true;
-     } else if (ce.message_type == m_net->number_of_desktops) {
-diff --git a/src/FbMenuParser.cc b/src/FbMenuParser.cc
-index 716ced29..5a56e6f5 100644
---- a/src/FbMenuParser.cc
-+++ b/src/FbMenuParser.cc
-@@ -33,9 +33,9 @@ bool FbMenuParser::open(const std::string &filename) {
- }
- 
- FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
--    if (eof()) {        
-+    if (eof()) {
-         out = FbTk::Parser::s_empty_item;
--        return *this; 
-+        return *this;
-     }
- 
-     if (m_curr_line.empty())
-@@ -69,20 +69,26 @@ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
-         return (*this)>>out;
-         break;
-     }
--    
-+
-     std::string key;
-     int err = FbTk::StringUtil::
-         getStringBetween(key, m_curr_line.c_str() + m_curr_pos,
-                          first, second);
--    if (err <= 0) {        
--        if (m_curr_token == TYPE)
-+    if (err <= 0) {
-+        switch (m_curr_token) {
-+          case TYPE:
-             m_curr_token = NAME;
--        else if (m_curr_token == NAME)
-+            break;
-+          case NAME:
-             m_curr_token = ARGUMENT;
--        else if (m_curr_token == ARGUMENT)
-+            break;
-+          case ARGUMENT:
-             m_curr_token = ICON;
--        else if (m_curr_token == ICON)
-+            break;
-+          case ICON:
-             m_curr_token = DONE;
-+            break;
-+        }
- 
-         out = FbTk::Parser::s_empty_item;
-         return *this;
-diff --git a/src/Remember.cc b/src/Remember.cc
-index 49e61062..4f0ba3db 100644
---- a/src/Remember.cc
-+++ b/src/Remember.cc
-@@ -802,39 +802,41 @@ void Remember::reload() {
-             int pos = getStringBetween(key, line.c_str(), '[', ']');
-             string lc_key = toLower(key);
- 
--            if (pos > 0 && (lc_key == "app" || lc_key == "transient")) {
--                ClientPattern *pat = new ClientPattern(line.c_str() + pos);
--                if (!in_group) {
--                    if ((err = pat->error()) == 0) {
--                        bool transient = (lc_key == "transient");
--                        Application *app = findMatchingPatterns(pat,
--                                               old_pats, transient, false);
--                        if (app) {
--                            app->reset();
--                            reused_apps.insert(app);
-+            if (pos > 0) {
-+                if (lc_key == "app" || lc_key == "transient") {
-+                    ClientPattern *pat = new ClientPattern(line.c_str() + pos);
-+                    if (!in_group) {
-+                        if ((err = pat->error()) == 0) {
-+                            bool transient = (lc_key == "transient");
-+                            Application *app = findMatchingPatterns(pat,
-+                                                   old_pats, transient, false);
-+                            if (app) {
-+                                app->reset();
-+                                reused_apps.insert(app);
-+                            } else {
-+                                app = new Application(transient, false);
-+                            }
-+
-+                            m_pats->push_back(make_pair(pat, app));
-+                            row += parseApp(apps_file, *app);
-                         } else {
--                            app = new Application(transient, false);
-+                            cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
-+                            delete pat; // since it didn't work
-                         }
--
--                        m_pats->push_back(make_pair(pat, app));
--                        row += parseApp(apps_file, *app);
-                     } else {
--                        cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
--                        delete pat; // since it didn't work
-+                        grouped_pats.push_back(pat);
-                     }
--                } else {
--                    grouped_pats.push_back(pat);
--                }
--            } else if (pos > 0 && lc_key == "startup" && fb.isStartup()) {
--                if (!handleStartupItem(line, pos)) {
--                    cerr<<"Error reading apps file at line "<<row<<"."<<endl;
-+                } else if (lc_key == "startup" && fb.isStartup()) {
-+                    if (!handleStartupItem(line, pos)) {
-+                        cerr<<"Error reading apps file at line "<<row<<"."<<endl;
-+                    }
-+                    // save the item even if it was bad (aren't we nice)
-+                    m_startups.push_back(line.substr(pos));
-+                } else if (lc_key == "group") {
-+                    in_group = true;
-+                    if (line.find('(') != string::npos)
-+                        pat = new ClientPattern(line.c_str() + pos);
-                 }
--                // save the item even if it was bad (aren't we nice)
--                m_startups.push_back(line.substr(pos));
--            } else if (pos > 0 && lc_key == "group") {
--                in_group = true;
--                if (line.find('(') != string::npos)
--                    pat = new ClientPattern(line.c_str() + pos);
-             } else if (in_group) {
-                 // otherwise assume that it is the start of the attributes
-                 Application *app = 0;
-diff --git a/src/SystemTray.cc b/src/SystemTray.cc
-index 8c42877a..1fc2b0a8 100644
---- a/src/SystemTray.cc
-+++ b/src/SystemTray.cc
-@@ -550,10 +550,12 @@ void SystemTray::rearrangeClients() {
-     ClientList::iterator client_it = m_clients.begin();
-     ClientList::iterator client_it_end = m_clients.end();
-     int next_x = bw;
-+    int x, y;
-     for (; client_it != client_it_end; ++client_it) {
-         if (!(*client_it)->isVisible())
-             continue;
--        int x = next_x, y = bw;
-+        x = next_x;
-+        y = bw;
-         next_x += h_rot0+bw;
-         translateCoords(orientation(), x, y, w_rot0, h_rot0);
-         translatePosition(orientation(), x, y, h_rot0, h_rot0, 0);
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..713d1510 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -3267,14 +3267,18 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top, bool resize) {
- FluxboxWindow::ReferenceCorner FluxboxWindow::getResizeDirection(int x, int y,
-         ResizeModel model, int corner_size_px, int corner_size_pc) const
- {
--    if (model == TOPLEFTRESIZE)     return LEFTTOP;
--    if (model == TOPRESIZE)         return TOP;
--    if (model == TOPRIGHTRESIZE)    return RIGHTTOP;
--    if (model == LEFTRESIZE)        return LEFT;
--    if (model == RIGHTRESIZE)       return RIGHT;
--    if (model == BOTTOMLEFTRESIZE)  return LEFTBOTTOM;
--    if (model == BOTTOMRESIZE)      return BOTTOM;
--    if (model == CENTERRESIZE)      return CENTER;
-+    switch (model) {
-+    case TOPLEFTRESIZE:     return LEFTTOP;
-+    case TOPRESIZE:         return TOP;
-+    case TOPRIGHTRESIZE:    return RIGHTTOP;
-+    case LEFTRESIZE:        return LEFT;
-+    case RIGHTRESIZE:       return RIGHT;
-+    case BOTTOMLEFTRESIZE:  return LEFTBOTTOM;
-+    case BOTTOMRESIZE:      return BOTTOM;
-+    case CENTERRESIZE:      return CENTER;
-+    default:
-+    break;
-+    }
- 
-     if (model == EDGEORCORNERRESIZE)
-     {
diff --git a/srcpkgs/fluxbox/patches/flux_oversize.patch b/srcpkgs/fluxbox/patches/flux_oversize.patch
deleted file mode 100644
index 98d70d3b037e..000000000000
--- a/srcpkgs/fluxbox/patches/flux_oversize.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..02d10e90 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -532,19 +532,14 @@ void FluxboxWindow::init() {
-     if (!m_state.fullscreen) {
-         unsigned int new_width = 0, new_height = 0;
-         if (m_client->width() >= screen().width()) {
--            m_state.maximized |= WindowState::MAX_HORZ;
-             new_width = 2 * screen().width() / 3;
-         }
-         if (m_client->height() >= screen().height()) {
--            m_state.maximized |= WindowState::MAX_VERT;
-             new_height = 2 * screen().height() / 3;
-         }
-         if (new_width || new_height) {
--            const int maximized = m_state.maximized;
--            m_state.maximized = WindowState::MAX_NONE;
-             resize(new_width ? new_width : width(), new_height ? new_height : height());
-             m_placed = false;
--            m_state.maximized = maximized;
-         }
-     }
- 
diff --git a/srcpkgs/fluxbox/patches/focus_close_menu.patch b/srcpkgs/fluxbox/patches/focus_close_menu.patch
deleted file mode 100644
index 01830cf53460..000000000000
--- a/srcpkgs/fluxbox/patches/focus_close_menu.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/src/FocusControl.cc b/src/FocusControl.cc
-index 54c3d46c..7e49ff51 100644
---- a/src/FocusControl.cc
-+++ b/src/FocusControl.cc
-@@ -247,11 +247,7 @@ void FocusControl::stopCyclingFocus() {
- 
-     // put currently focused window to top
-     if (s_focused_window) {
--        // re-focus last window to give the client a chance to redistribute the
--        // focus internally (client-side only modality)
--        s_focused_window->focus();
--        if (s_focused_window)
--            setScreenFocusedWindow(*s_focused_window);
-+        setScreenFocusedWindow(*s_focused_window);
-         if (s_focused_fbwindow)
-             s_focused_fbwindow->raise();
-     } else
diff --git a/srcpkgs/fluxbox/patches/slit_raise.patch b/srcpkgs/fluxbox/patches/slit_raise.patch
deleted file mode 100644
index a3bc01c7ac85..000000000000
--- a/srcpkgs/fluxbox/patches/slit_raise.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/src/Slit.cc b/src/Slit.cc
-index 9baecf21..63ed8269 100644
---- a/src/Slit.cc
-+++ b/src/Slit.cc
-@@ -958,8 +958,8 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
-         return;
-     }
-
--    if (be.button == 1)
--        frame.window.raise();
-+    //if (be.button == 1)
-+    //    frame.window.raise();
-
-     if (be.button != Button3) {
-         XAllowEvents(dpy, ReplayPointer, CurrentTime);
-
diff --git a/srcpkgs/fluxbox/patches/toolbar_redo.patch b/srcpkgs/fluxbox/patches/toolbar_redo.patch
deleted file mode 100644
index ca95486583ce..000000000000
--- a/srcpkgs/fluxbox/patches/toolbar_redo.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-diff --git a/src/Toolbar.cc b/src/Toolbar.cc
-index aa9bc121..ee8b8bfc 100644
---- a/src/Toolbar.cc
-+++ b/src/Toolbar.cc
-@@ -74,7 +74,7 @@ using FbTk::STLUtil::forAll;
- 
- namespace {
- 
--const struct { 
-+const struct {
-     Toolbar::Placement placement;
-     const char* str;
-     FbTk::Orientation orient;
-@@ -362,13 +362,16 @@ void Toolbar::lower() {
- }
- 
- void Toolbar::screenChanged(BScreen &screen) {
--    reconfigure();
-+    //reconfigure();
- }
- 
- void Toolbar::relayout() {
--    forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
--    rearrangeItems();
--    forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
-+    //for (auto it : m_item_list)    (*item_it)->updateSizing();
-+    //rearrangeItems();
-+    //for (auto it : m_item_list)    (*item_it)->renderTheme(alpha());
-+    //forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
-+    //rearrangeItems();
-+    //forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
- }
- 
- void Toolbar::reconfigure() {
-@@ -557,12 +560,16 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
- }
- 
- void Toolbar::updateCrossingState() {
--    Window wr, wc;
--    int rx, ry, x, y;
-+    //Window wr, wc;
-+    //int rx, ry, x, y;
-+    //unsigned int mask;
-+    Window wrc;
-+    int rxy, x, y;
-     unsigned int mask;
-     const int bw = -theme()->border().width();
-     bool hovered = false;
--    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
-+    //if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
-+    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wrc, &wrc, &rxy, &rxy, &x, &y, &mask))
-         hovered = x >= bw && y >= bw && x < int(width()) && y < int(height());
-     if (hovered) {
-         if (m_rc_auto_raise)
-@@ -910,25 +917,26 @@ void Toolbar::rearrangeItems() {
-     // lock this
-     m_resize_lock = true;
-     // calculate size for fixed items
--    ItemList::iterator item_it = m_item_list.begin();
--    ItemList::iterator item_it_end = m_item_list.end();
-+    //ItemList::iterator item_it = m_item_list.begin();
-+    //ItemList::iterator item_it_end = m_item_list.end();
-     int bevel_width = theme()->bevelWidth();
-     int fixed_width = bevel_width; // combined size of all fixed items
-     int relative_width = 0; // combined *desired* size of all relative items
--    int stretch_items = 0;
-     int relative_items = 0;
-     int last_bw = 0; // we show the largest border of adjoining items
-     bool first = true;
-+    int leftover_width = 0;
- 
-     unsigned int width = this->width(), height = this->height();
-     unsigned int tmpw, tmph;
-     FbTk::translateSize(orient, width, height);
- 
--    for (; item_it != item_it_end; ++item_it) {
--        if (!(*item_it)->active())
-+    //for (; item_it != item_it_end; ++item_it) {
-+    for (auto item_it : m_item_list) {
-+        if (!(*item_it).active())
-             continue;
- 
--        int borderW = (*item_it)->borderWidth();
-+        int borderW = (*item_it).borderWidth();
- 
-         if (bevel_width > 0) {
-             // the bevel and border are fixed whether relative or not
-@@ -943,35 +951,35 @@ void Toolbar::rearrangeItems() {
- 
-         last_bw = borderW;
- 
--        tmpw = (*item_it)->preferredWidth();
--        tmph = (*item_it)->height();
-+        tmpw = (*item_it).preferredWidth();
-+        tmph = (*item_it).height();
-         FbTk::translateSize(orient, tmpw, tmph);
- 
--        if ((*item_it)->type() == ToolbarItem::FIXED) {
--            fixed_width += tmpw;
--        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
--            fixed_width += height;
--            if (bevel_width)
--                fixed_width -= 2*(borderW + bevel_width);
--        } else {
--            ++relative_items;
--            relative_width += tmpw;
--            if (!tmpw)
--                ++stretch_items;
-+        switch ( (*item_it).type() ) {
-+            case ToolbarItem::FIXED:
-+                fixed_width += tmpw;
-+                break;
-+            case ToolbarItem::SQUARE:
-+                fixed_width += height;
-+                if (bevel_width)
-+                    fixed_width -= 2*(borderW + bevel_width);
-+                break;
-+            case ToolbarItem::RELATIVE:
-+                ++relative_items;
-+                relative_width += tmpw;
-+                break;
-+            default:
-+                break;
-         }
-     }
- 
-     // calculate what's going to be left over to the relative sized items
--    float stretch_factor = 1.0f;
-     if (relative_items) {
--        if (relative_width <= width - fixed_width && stretch_items) {
--            relative_width = int(width - fixed_width - relative_width)/stretch_items;
--        } else if (relative_width) {
--            stretch_factor = float(width - fixed_width)/relative_width;
--            relative_width = 0;
--        }
-+        relative_width = (width - fixed_width) / relative_items;
-+        leftover_width = width - fixed_width - relative_items * relative_width;
-     }
- 
-+
-     // now move and resize the items
-     // borderWidth added back on straight away
-     int next_x = -m_item_list.front()->borderWidth(); // list isn't empty
-@@ -979,19 +987,22 @@ void Toolbar::rearrangeItems() {
-         next_x = 0;
- 
-     last_bw = 0;
--    for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
--        int borderW = (*item_it)->borderWidth();
--        if (!(*item_it)->active()) {
--            (*item_it)->hide();
-+    int borderW, offset, size_offset, tmpx, tmpy;
-+
-+    //for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
-+    for (auto item_it : m_item_list) {
-+        borderW = (*item_it).borderWidth();
-+        if (!(*item_it).active()) {
-+            (*item_it).hide();
-             // make sure it still gets told the toolbar height
-             tmpw = 1; tmph = height - 2*(bevel_width+borderW);
-             if (tmph >= (1<<30)) tmph = 1;
-             FbTk::translateSize(orient, tmpw, tmph);
--            (*item_it)->resize(tmpw, tmph);  // width of 0 changes to 1 anyway
-+            (*item_it).resize(tmpw, tmph);  // width of 0 changes to 1 anyway
-             continue;
-         }
--        int offset = bevel_width;
--        int size_offset = 2*(borderW + bevel_width);
-+        offset = bevel_width;
-+        size_offset = 2*(borderW + bevel_width);
- 
-         if (bevel_width == 0) {
-             offset = -borderW;
-@@ -1000,22 +1011,28 @@ void Toolbar::rearrangeItems() {
-         }
-         last_bw = borderW;
- 
--        int tmpx = next_x + offset,
--            tmpy = offset;
--
--        if ((*item_it)->type() == ToolbarItem::RELATIVE) {
--            unsigned int itemw = (*item_it)->preferredWidth(), itemh = (*item_it)->height();
--            FbTk::translateSize(orient, itemw, itemh);
--            tmpw = itemw ? std::floor(stretch_factor * itemw) : relative_width;
--            tmph = height - size_offset;
--        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
--            tmpw = tmph = height - size_offset;
--        } else { // fixed size
--            unsigned int itemw = (*item_it)->width(), itemh = (*item_it)->height();
--            FbTk::translateSize(orient, itemw, itemh);
--            tmpw = itemw;
--            tmph = height - size_offset;
-+        tmpx = next_x + offset,
-+        tmpy = offset;
-+        tmph = height - size_offset;
-+
-+        switch ( (*item_it).type() ) {
-+            case ToolbarItem::SQUARE:
-+                tmpw = tmph;
-+                break;
-+            case ToolbarItem::RELATIVE:
-+                tmpw = relative_width;
-+                if (leftover_width) {
-+                    --leftover_width;
-+                    ++tmpw;
-+                }
-+                break;
-+            case ToolbarItem::FIXED:
-+                unsigned int itemw = (*item_it).width(), itemh = (*item_it).height();
-+                FbTk::translateSize(orient, itemw, itemh);
-+                tmpw = itemw;
-+                break;
-         }
-+
-         if (tmpw >= (1<<30)) tmpw = 1;
-         if (tmph >= (1<<30)) tmph = 1;
-         next_x += tmpw + bevel_width;
-@@ -1025,8 +1042,8 @@ void Toolbar::rearrangeItems() {
-         FbTk::translateCoords(orient, tmpx, tmpy, width, height);
-         FbTk::translatePosition(orient, tmpx, tmpy, tmpw, tmph, borderW);
-         FbTk::translateSize(orient, tmpw, tmph);
--        (*item_it)->moveResize(tmpx, tmpy, tmpw, tmph);
--        (*item_it)->show();
-+        (*item_it).moveResize(tmpx, tmpy, tmpw, tmph);
-+        //(*item_it).show();
- 
-     }
-     // unlock
diff --git a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
deleted file mode 100644
index 189a314607bd..000000000000
--- a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
+++ /dev/null
@@ -1,350 +0,0 @@
-diff --git a/src/FbTk/EventManager.cc b/src/FbTk/EventManager.cc
-index 3df56de5..501766cc 100644
---- a/src/FbTk/EventManager.cc
-+++ b/src/FbTk/EventManager.cc
-@@ -194,23 +194,22 @@ void EventManager::dispatch(Window win, XEvent &ev, bool parent) {
- 
-     // find out which window is the parent and
-     // dispatch event
--    Window root, parent_win, *children = 0;
--    unsigned int num_children;
--    if (XQueryTree(FbTk::App::instance()->display(), win,
--                   &root, &parent_win, &children, &num_children) != 0) {
--        if (children != 0)
--            XFree(children);
--
--        if (parent_win != 0 &&
--            parent_win != root) {
--            if (m_parent[parent_win] == 0)
--                return;
--
--            // dispatch event to parent
--            dispatch(parent_win, ev, true);
--        }
--    }
--
-+//    Window root, parent_win, *children = 0;
-+//    unsigned int num_children;
-+//    if (XQueryTree(FbTk::App::instance()->display(), win,
-+//                   &root, &parent_win, &children, &num_children) != 0) {
-+//        if (children != 0)
-+//            XFree(children);
-+//
-+//        if (parent_win != 0 &&
-+//            parent_win != root) {
-+//            if (m_parent[parent_win] == 0)
-+//                return;
-+//
-+//            // dispatch event to parent
-+//            dispatch(parent_win, ev, true);
-+//        }
-+//    }
- }
- 
- } // end namespace FbTk
-diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc
-index 73f2ea06..cf863021 100644
---- a/src/FbTk/KeyUtil.cc
-+++ b/src/FbTk/KeyUtil.cc
-@@ -141,13 +141,14 @@ void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win,
-     const unsigned int scrollmod = instance().scrolllock();
- 
-     // Grab with numlock, capslock and scrlock
--    for (int i = 0; i < 8; i++) {
--        XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
--                    (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
--                    win, False, event_mask, GrabModeSync, GrabModeAsync,
--                    None, cursor);
--    }
--
-+    //for (int i = 0; i < 8; i++) {
-+    //    XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
-+    //                (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
-+    //                win, True, event_mask, GrabModeSync, GrabModeAsync,
-+    //                None, cursor);
-+    //}
-+    XGrabButton(display, button, mod, win, True, event_mask,
-+                GrabModeSync, GrabModeAsync, None, cursor);
- }
- 
- /**
-diff --git a/src/Keys.cc b/src/Keys.cc
-index 86591371..c27037e2 100644
---- a/src/Keys.cc
-+++ b/src/Keys.cc
-@@ -277,7 +277,7 @@ void Keys::grabWindow(Window win) {
-     if (win_it == m_window_map.end())
-         return;
- 
--    m_handler_map[win]->grabButtons();
-+    //m_handler_map[win]->grabButtons();
-     t_key::keylist_t::iterator it = m_keylist->keylist.begin();
-     t_key::keylist_t::iterator it_end = m_keylist->keylist.end();
-     for (; it != it_end; ++it) {
-@@ -586,16 +586,16 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-         isdouble = double_click;
-     }
- 
--    auto resetKeyChain = [&]() {
--        first_key_time = 0;
--        next_key.reset();
--        if (saved_keymode) {
--            setKeyMode(saved_keymode);
--            saved_keymode.reset();
--        }
--    };
--    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
--        resetKeyChain();
-+//    auto resetKeyChain = [&]() {
-+//        first_key_time = 0;
-+//        next_key.reset();
-+//        if (saved_keymode) {
-+//            setKeyMode(saved_keymode);
-+//            saved_keymode.reset();
-+//        }
-+//    };
-+//    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
-+//        resetKeyChain();
- 
-     if (!next_key)
-         next_key = m_keylist;
-@@ -612,29 +612,29 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-         next_key->find(MotionNotify, mods, key, context, false))
-         return true; // if there's a motion action, prevent replay to the client (but do nothing)
- 
--    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
--        if (!saved_keymode) {
--            first_key_time = time;
--            saved_keymode = m_keylist;
--        }
--        next_key = temp_key;
--        setKeyMode(next_key);
--        return true;
--    }
-+//    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
-+//        if (!saved_keymode) {
-+//            first_key_time = time;
-+//            saved_keymode = m_keylist;
-+//        }
-+//        next_key = temp_key;
-+//        setKeyMode(next_key);
-+//        return true;
-+//    }
-+
-     if (!temp_key || temp_key->m_command == 0) {
--        if (type == KeyPress &&
--            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
--            // if we're in the middle of an emacs-style keychain, exit it
--            resetKeyChain();
--        }
-+//        if (type == KeyPress &&
-+//            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
-+//            // if we're in the middle of an emacs-style keychain, exit it
-+//            resetKeyChain();
-+//        }
-         return false;
-     }
- 
-     // if focus changes, windows will get NotifyWhileGrabbed,
-     // which they tend to ignore
--    if (type == KeyPress) {
-+    if (type == KeyPress)
-         XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
--    }
- 
-     WinClient *old = WindowCmd<void>::client();
-     WindowCmd<void>::setClient(current);
-@@ -650,12 +650,13 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-     temp_key->m_command->execute();
-     WindowCmd<void>::setClient(old);
- 
--    if (saved_keymode) {
--        if (next_key == m_keylist) // don't reset keymode if command changed it
--            setKeyMode(saved_keymode);
--        saved_keymode.reset();
--    }
--    next_key.reset();
-+//    if (saved_keymode) {
-+//        if (next_key == m_keylist) // don't reset keymode if command changed it
-+//            setKeyMode(saved_keymode);
-+//        saved_keymode.reset();
-+//    }
-+//    next_key.reset();
-+
-     return true;
- }
- 
-@@ -685,15 +686,16 @@ void Keys::reconfigure() {
- }
- 
- void Keys::regrab() {
--    setKeyMode(m_keylist);
-+    //setKeyMode(m_keylist);
- }
- 
- void Keys::keyMode(const string& keyMode) {
--    keyspace_t::iterator it = m_map.find(keyMode + ":");
--    if (it == m_map.end())
-+    //keyspace_t::iterator it = m_map.find(keyMode + ":");
-+    //if (it == m_map.end())
-+    //    setKeyMode(m_map["default:"]);
-+    //else
-+    //    setKeyMode(it->second);
-         setKeyMode(m_map["default:"]);
--    else
--        setKeyMode(it->second);
- }
- 
- void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
-@@ -701,10 +703,10 @@ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
-     ungrabButtons();
- 
-     // notify handlers that their buttons have been ungrabbed
--    HandlerMap::iterator h_it = m_handler_map.begin(),
--                         h_it_end  = m_handler_map.end();
--    for (; h_it != h_it_end; ++h_it)
--        h_it->second->grabButtons();
-+    //HandlerMap::iterator h_it = m_handler_map.begin(),
-+    //                     h_it_end  = m_handler_map.end();
-+    //for (; h_it != h_it_end; ++h_it)
-+    //    h_it->second->grabButtons();
- 
-     t_key::keylist_t::iterator it = keyMode->keylist.begin();
-     t_key::keylist_t::iterator it_end = keyMode->keylist.end();
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..457c30c6 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -1133,13 +1133,25 @@ void FluxboxWindow::updateSizeHints() {
- }
- 
- void FluxboxWindow::grabButtons() {
--
-+//NOGRAB
-+    //if (m_client->window() != frame().window().window() ) return;
-     // needed for click to focus
--    XGrabButton(display, Button1, AnyModifier,
--                frame().window().window(), True, ButtonPressMask,
--                GrabModeSync, GrabModeSync, None, None);
--    XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
--                  frame().window().window());
-+    // grabbing async here breaks mouse1
-+    //XGrabButton(display, Button1, AnyModifier,
-+    //            frame().window().window(), True, ButtonPressMask,
-+    //            GrabModeSync, GrabModeSync, None, None);
-+    //            //GrabModeAsync, GrabModeAsync, None, None);
-+    //XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
-+    //              frame().window().window());
-+    //XGrabPointer(display,
-+    //             frame().window().window(),
-+    //             True,
-+    //             ButtonPressMask,
-+    //             GrabModeAsync, GrabModeAsync,
-+    //             None,
-+    //             None,
-+    //             CurrentTime);
-+    //XUngrabPointer(display, CurrentTime);
- }
- 
- 
-@@ -2429,63 +2441,41 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
-     m_last_pressed_button = be.button;
- 
-     FbTk::Menu::hideShownMenu();
--
-+//FIX ALLOW
-     Keys *k = Fluxbox::instance()->keys();
-     int context = 0;
-     context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);
-     if (!context && be.subwindow)
-         context = frame().getContext(be.window);
- 
--    if (k->doAction(be.type, be.state, be.button, context, &winClient(), be.time)) {
--        XAllowEvents(display, SyncPointer, CurrentTime);
--        return;
--    }
--
--    WinClient *client = 0;
--    if (!screen().focusControl().isMouseTabFocus()) {
--        // determine if we're in a label button (tab)
--        client = winClientOfLabelButtonWindow(be.window);
--    }
--
--
--    // - refeed the event into the queue so the app or titlebar subwindow gets it
--    if (be.subwindow)
--        XAllowEvents(display, ReplayPointer, CurrentTime);
--    else
--        XAllowEvents(display, SyncPointer, CurrentTime);
--
--    // if nothing was bound via keys-file then
--    // - raise() if clickRaise is enabled
--    // - hide open menues
--    // - focus on clickFocus
--    if (frame().window().window() == be.window) {
--        if (screen().clickRaises())
--            raise();
--
--        m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
--        m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
--    }
--
--    if (!m_focused && acceptsFocus() && m_click_focus)
--        focus();
--
--    if (!screen().focusControl().isMouseTabFocus() &&
--        client && client != m_client &&
--        !screen().focusControl().isIgnored(be.x_root, be.y_root) ) {
--        setCurrentClient(*client, isFocused());
--    }
--
--
--
-+std::cout << "button window: " << be.window << "\nbutton subwindow: " << be.subwindow << "\n";
-+k->doAction(be.type, be.state, be.button, context, &winClient(), CurrentTime); // w/o this, no mouse cmds
-+XAllowEvents(display, ReplayPointer, CurrentTime); // w/o this, no mouse
-+// ultimately none of the below matters
-+    // infinite loop
-+    //if (be.subwindow) {
-+    //  //XEvent omfg = (XEvent *)&be;
-+    //  //be.window = be.subwindow;
-+    //  //be.subwindow = 0;
-+    //  int huh = XSendEvent(display, be.window, False, ButtonPressMask, (XEvent*)&be);
-+    //  std::cout << "xsendevent: " << huh << "\n";
-+    //}
-+    //XSync(display, 0);
-+    //int wtf = XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
-+    //std::cout << "xallowevents: " << wtf << "\n";
-+    //XSync(display, 0);
-+    //XAllowEvents(display, ReplayPointer, be.time); // time means squat - works but not for menus
-+    //XAllowEvents(display, SyncPointer, CurrentTime); // sync will not doubleclick or act proper
-+    //XAllowEvents(display, AsyncPointer, CurrentTime); // ^^ same
-+    //if (be.subwindow)
-+    //  XFlush(display);
-+    //  //XSync(display, True);
- }
- 
- const unsigned int DEADZONE = 4;
- 
- void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
- 
--    if (m_last_pressed_button == static_cast<int>(re.button)) {
--        m_last_pressed_button = 0;
--    }
- 
-     if (isMoving())
-         stopMoving();
-@@ -2502,6 +2492,13 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
- 
-         Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button,
-                                               context, &winClient(), re.time);
-+      // syncs dont make a difference?
-+      //XSync(display, 0);
-+      XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
-+      //XSync(display, 0);
-+    }
-+    if (m_last_pressed_button == static_cast<int>(re.button)) {
-+        m_last_pressed_button = 0;
-     }
- }
- 
diff --git a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
deleted file mode 100644
index 36c572cea4ff..000000000000
--- a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
-index c2e49485..9b4058c8 100644
---- a/src/WorkspaceCmd.cc
-+++ b/src/WorkspaceCmd.cc
-@@ -521,22 +521,24 @@ void ArrangeWindowsCmd::execute() {
-     const unsigned int cal_width = max_width/cols; // width ratio (width of every window)
-     const unsigned int cal_height = max_height/rows; // height ratio (height of every window)
-
-+    int cell_center_x = 0, cell_center_y = 0, win_center_x = 0, win_center_y = 0, x = 0, y = 0;
-+    unsigned int closest_dist = ~0, dist = 0, w = 0, h = 0;
-     // Resizes and sets windows positions in columns and rows.
-     for (i = 0; i < rows; ++i) {
-         x_offs = orig_x_offs;
-         for (j = 0; j < cols && !normal_windows.empty(); ++j) {
-
-
--            int cell_center_x = x_offs + (x_offs + cal_width) / 2;
--            int cell_center_y = y_offs + (y_offs + cal_height) / 2;
--            unsigned int closest_dist = ~0;
-+            cell_center_x = x_offs + (x_offs + cal_width) / 2;
-+            cell_center_y = y_offs + (y_offs + cal_height) / 2;
-+            int closest_dist = ~0;
-
-             Workspace::Windows::iterator closest = normal_windows.end();
-             for (win = normal_windows.begin(); win != normal_windows.end(); ++win) {
-
--                int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
--                int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
--                unsigned int dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
-+                win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
-+                win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
-+                dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
-                                     (win_center_y - cell_center_y) * (win_center_y - cell_center_y);
-
-                 if (dist < closest_dist) {
-@@ -545,10 +547,10 @@ void ArrangeWindowsCmd::execute() {
-                 }
-             }
-
--            int x = x_offs + (*closest)->xOffset();
--            int y = y_offs + (*closest)->yOffset();
--            unsigned int w = cal_width - (*closest)->widthOffset();
--            unsigned int h = cal_height - (*closest)->heightOffset();
-+            x = x_offs + (*closest)->xOffset();
-+            y = y_offs + (*closest)->yOffset();
-+            w = cal_width - (*closest)->widthOffset();
-+            h = cal_height - (*closest)->heightOffset();
-
-             // the last window gets everything that is left.
-             if (normal_windows.size() == 1) {
-@@ -620,12 +622,9 @@ void UnclutterCmd::execute() {
-         return;
-
-     // place
--    MinOverlapPlacement mopp;
-     int x, y;
--    for (win = placed_windows.begin(); win != placed_windows.end(); ++win) {
--        mopp.placeWindow(**win, head, x, y);
--        (*win)->move(x, y);
--    }
-+    for (win = placed_windows.begin(); win != placed_windows.end(); ++win)
-+        (*win)->placeWindow((*win)->getOnHead());
- }
-
- REGISTER_COMMAND(showdesktop, ShowDesktopCmd, void);
diff --git a/srcpkgs/fluxbox/patches/zor_loops.patch b/srcpkgs/fluxbox/patches/zor_loops.patch
deleted file mode 100644
index 95d992f9071d..000000000000
--- a/srcpkgs/fluxbox/patches/zor_loops.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-diff --git a/src/FbTk/STLUtil.hh b/src/FbTk/STLUtil.hh
-index abc54729..9c9c27f9 100644
---- a/src/FbTk/STLUtil.hh
-+++ b/src/FbTk/STLUtil.hh
-@@ -48,46 +48,63 @@ struct IfThenElse<false, Ta, Tb> {
- /// calls delete on each item in the container and then clears the container
- template <typename A>
- void destroyAndClear(A &a) {
--    typedef typename A::iterator iterator;
--    iterator it = a.begin();
--    iterator it_end = a.end();
--    for (; it != it_end; ++it)
--        delete (*it);
-+    //typedef typename A::iterator iterator;
-+    //iterator it = a.begin();
-+    //iterator it_end = a.end();
-+    //for (; it != it_end; ++it)
-+    //    delete (*it);
- 
-+    //a.clear();
-+    typedef typename A::iterator iterator;
-+    for (auto it : a)
-+        delete it;
-     a.clear();
- }
- 
- /// calls delete on each item value in the map and then clears the map
- template <typename A>
- void destroyAndClearSecond(A &a) {
-+    //typedef typename A::iterator iterator;
-+    //iterator it = a.begin();
-+    //iterator it_end = a.end();
-+    //for (; it != it_end; ++it)
-+    //    delete it->second;
-+    //a.clear();
-     typedef typename A::iterator iterator;
--    iterator it = a.begin();
--    iterator it_end = a.end();
--    for (; it != it_end; ++it)
--        delete it->second;
-+    for (auto it : a)
-+        delete it.second;
-     a.clear();
- }
- 
- 
- template <typename C, typename F>
- F forAll(C& c, F f) {
-+    //typedef typename C::iterator iterator;
-+    //iterator i = c.begin();
-+    //iterator e = c.end();
-+    //for (; i != e; i++) {
-+    //    f(*i);
-+    //}
-     typedef typename C::iterator iterator;
--    iterator i = c.begin();
--    iterator e = c.end();
--    for (; i != e; i++) {
--        f(*i);
--    }
-+    for (auto i : c)
-+        f(i);
-     return f;
- }
- 
- template <typename C, typename I, typename F>
- F forAllIf(C& c, I i, F f) {
-+    //typedef typename C::iterator iterator;
-+    //iterator it = c.begin();
-+    //iterator end = c.end();
-+    //for (; it != end; ++it) {
-+    //    if (i(*it))
-+    //        f(*it);
-+    //}
-+    //return f;
-     typedef typename C::iterator iterator;
--    iterator it = c.begin();
--    iterator end = c.end();
--    for (; it != end; ++it) {
--        if (i(*it))
--            f(*it);
-+    for (auto it : c) {
-+        if (i(it))
-+            f(it);
-     }
-     return f;
- }
diff --git a/srcpkgs/freerdp/template b/srcpkgs/freerdp/template
index 53e67690f863..1b50e9a86bb2 100644
--- a/srcpkgs/freerdp/template
+++ b/srcpkgs/freerdp/template
@@ -1,7 +1,7 @@
 # Template file for 'freerdp'
 pkgname=freerdp
 version=2.9.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_ALSA=ON -DWITH_CUPS=OFF -DWITH_FFMPEG=ON
  -DWITH_GSTREAMER_0_10=OFF -DWITH_GSTREAMER_1_0=OFF -DWITH_JPEG=ON
diff --git a/srcpkgs/gerbera/template b/srcpkgs/gerbera/template
index ae14f35c767c..2dc0ac0ce03b 100644
--- a/srcpkgs/gerbera/template
+++ b/srcpkgs/gerbera/template
@@ -1,7 +1,7 @@
 # Template file for 'gerbera'
 pkgname=gerbera
 version=1.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_SYSTEMD=0 -DWITH_AVCODEC=1"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-1.patch b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
new file mode 100644
index 000000000000..7cfc98ada368
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
@@ -0,0 +1,232 @@
+From 03bbe01b79a1f07a6780cb60f23a087104c5d77b Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 30 Mar 2018 22:53:24 +0300
+Subject: [PATCH] Fix warnings while compile with FFMpeg 3.4.2 (issue #978)
+
+---
+ ffmpegaudio.cc | 68 +++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 62 insertions(+), 6 deletions(-)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index ed1172bdd..56e8f788e 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -91,6 +91,7 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++  AVCodec * codec_;
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
+@@ -114,6 +115,7 @@ DecoderContext::DecoderContext( QByteArray const & audioData, QAtomicInt & isCan
+   audioData_( audioData ),
+   audioDataStream_( audioData_ ),
+   formatContext_( NULL ),
++  codec_( NULL ),
+   codecContext_( NULL ),
+   avioContext_( NULL ),
+   audioStream_( NULL ),
+@@ -143,7 +145,11 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 56 || ( LIBAVCODEC_VERSION_MAJOR == 56 && LIBAVCODEC_VERSION_MINOR < 56 )
+   unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
++#else
++  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
++#endif
+   if ( !avioBuffer )
+   {
+     errorString = QObject::tr( "av_malloc() failed." );
+@@ -186,7 +192,11 @@ bool DecoderContext::openCodec( QString & errorString )
+   // Find audio stream, use the first audio stream if available
+   for ( unsigned i = 0; i < formatContext_->nb_streams; i++ )
+   {
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+     if ( formatContext_->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO )
++#else
++      if ( formatContext_->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO )
++#endif
+     {
+       audioStream_ = formatContext_->streams[i];
+       break;
+@@ -198,22 +208,38 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+   codecContext_ = audioStream_->codec;
+-  AVCodec * codec = avcodec_find_decoder( codecContext_->codec_id );
+-  if ( !codec )
++  codec_ = avcodec_find_decoder( codecContext_->codec_id );
++  if ( !codec_ )
+   {
+     errorString = QObject::tr( "Codec [id: %1] not found." ).arg( codecContext_->codec_id );
+     return false;
+   }
++#else
++  codec_ = avcodec_find_decoder( audioStream_->codecpar->codec_id );
++  if ( !codec_ )
++  {
++    errorString = QObject::tr( "Codec [id: %1] not found." ).arg( audioStream_->codecpar->codec_id );
++    return false;
++  }
++  codecContext_ = avcodec_alloc_context3( codec_ );
++  if ( !codecContext_ )
++  {
++    errorString = QObject::tr( "avcodec_alloc_context3() failed." );
++    return false;
++  }
++  avcodec_parameters_to_context( codecContext_, audioStream_->codecpar );
++#endif
+
+-  ret = avcodec_open2( codecContext_, codec, NULL );
++  ret = avcodec_open2( codecContext_, codec_, NULL );
+   if ( ret < 0 )
+   {
+     errorString = QObject::tr( "avcodec_open2() failed: %1." ).arg( avErrorString( ret ) );
+     return false;
+   }
+
+-  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec->long_name,
++  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec_->long_name,
+           codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
+   return true;
+ }
+@@ -252,10 +278,13 @@ void DecoderContext::closeCodec()
+
+   // Closing a codec context without prior avcodec_open2() will result in
+   // a crash in ffmpeg
+-  if ( audioStream_ && audioStream_->codec && audioStream_->codec->codec )
++  if ( audioStream_ && codecContext_ && codec_ )
+   {
+     audioStream_->discard = AVDISCARD_ALL;
+-    avcodec_close( audioStream_->codec );
++    avcodec_close( codecContext_ );
++#if LIBAVCODEC_VERSION_MAJOR > 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR >= 33 )
++    avcodec_free_context( &codecContext_ );
++#endif
+   }
+
+   avformat_close_input( &formatContext_ );
+@@ -356,6 +385,7 @@ bool DecoderContext::play( QString & errorString )
+     if ( packet.stream_index == audioStream_->index )
+     {
+       AVPacket pack = packet;
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+       int gotFrame = 0;
+       do
+       {
+@@ -370,6 +400,19 @@ bool DecoderContext::play( QString & errorString )
+         pack.data += len;
+       }
+       while( pack.size > 0 );
++#else
++      int ret = avcodec_send_packet( codecContext_, &pack );
++      /* read all the output frames (in general there may be any number of them) */
++      while( ret >= 0 )
++      {
++        ret = avcodec_receive_frame( codecContext_, frame);
++
++        if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++          break;
++
++        playFrame( frame );
++      }
++#endif
+     }
+     // av_free_packet() must be called after each call to av_read_frame()
+ #if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 )
+@@ -379,6 +422,7 @@ bool DecoderContext::play( QString & errorString )
+ #endif
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
+        codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+   {
+@@ -391,6 +435,18 @@ bool DecoderContext::play( QString & errorString )
+       playFrame( frame );
+     }
+   }
++#else
++  /* flush the decoder */
++  av_init_packet( &packet );
++  int ret = avcodec_send_packet(codecContext_, &packet );
++  while( ret >= 0 )
++  {
++    ret = avcodec_receive_frame(codecContext_, frame);
++    if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++      break;
++    playFrame( frame );
++  }
++#endif
+
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+   av_free( frame );
+32
+srcpkgs/goldendict/patches/ffmpeg5-2.patch
+Comment on this file
+@@ -0,0 +1,32 @@
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
+25
+srcpkgs/goldendict/patches/ffmpeg5-3.patch
+Comment on this file
+@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-2.patch b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
new file mode 100644
index 000000000000..9c477b0c1347
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
@@ -0,0 +1,33 @@
+
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-3.patch b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
new file mode 100644
index 000000000000..72101903d1d1
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/template b/srcpkgs/goldendict/template
index f41b5b2c6899..4544ae710ee6 100644
--- a/srcpkgs/goldendict/template
+++ b/srcpkgs/goldendict/template
@@ -1,7 +1,7 @@
 # Template file for 'goldendict'
 pkgname=goldendict
 version=1.5.0RC2
-revision=5
+revision=6
 build_style=qmake
 configure_args="CONFIG+=zim_support"
 hostmakedepends="qt5-qmake pkg-config qt5-host-tools"
diff --git a/srcpkgs/gst-libav/template b/srcpkgs/gst-libav/template
index e9a79dc650a5..f082bd211c65 100644
--- a/srcpkgs/gst-libav/template
+++ b/srcpkgs/gst-libav/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-libav'
 pkgname=gst-libav
 version=1.20.3
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config yasm"
 makedepends="orc-devel gst-plugins-base1-devel ffmpeg-devel"
diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index bb9c4d87f4c6..f55f82fd4c77 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.20.3
-revision=2
+revision=3
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled
diff --git a/srcpkgs/gst-rtsp-server/template b/srcpkgs/gst-rtsp-server/template
index 33cd64ceb95e..8ceea8d34b4b 100644
--- a/srcpkgs/gst-rtsp-server/template
+++ b/srcpkgs/gst-rtsp-server/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-rtsp-server'
 pkgname=gst-rtsp-server
 version=1.20.3
-revision=2
+revision=3
 build_style=meson
 hostmakedepends="pkg-config python3"
 makedepends="glib-devel gst-plugins-bad1-devel gobject-introspection
diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 6a50567f53a9..6976aee84817 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
 # Template file for 'gtk4'
 pkgname=gtk4
 version=4.10.1
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dman-pages=true -Dgtk_doc=true
diff --git a/srcpkgs/guvcview/template b/srcpkgs/guvcview/template
index 345cf6006f24..d42fd38fa4ad 100644
--- a/srcpkgs/guvcview/template
+++ b/srcpkgs/guvcview/template
@@ -1,7 +1,7 @@
 # Template file for 'guvcview'
 pkgname=guvcview
 version=2.0.7
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-static --disable-debian-menu"
diff --git a/srcpkgs/handbrake/template b/srcpkgs/handbrake/template
index ca5e4571e49c..188a79f2bf5c 100644
--- a/srcpkgs/handbrake/template
+++ b/srcpkgs/handbrake/template
@@ -1,7 +1,7 @@
 # Template file for 'handbrake'
 pkgname=handbrake
 version=1.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--force --disable-gtk-update-checks --disable-df-fetch --harden
  $(vopt_enable fdk_aac fdk-aac) $(vopt_enable nvenc)"
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index 419f29b98b44..a343b3172a72 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,7 +1,7 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
  -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
diff --git a/srcpkgs/idjc/template b/srcpkgs/idjc/template
index df60318b3db9..b205e74745fe 100644
--- a/srcpkgs/idjc/template
+++ b/srcpkgs/idjc/template
@@ -1,7 +1,7 @@
 # Template file for 'idjc'
 pkgname=idjc
 version=0.9.1
-revision=3
+revision=4
 build_style=gnu-configure
 hostmakedepends="pkg-config git python3 automake gettext-devel libtool"
 makedepends="libvorbis-devel libogg-devel jack-devel libsamplerate-devel
diff --git a/srcpkgs/kfilemetadata5/template b/srcpkgs/kfilemetadata5/template
index 83f4d583bcb7..b90ef056a196 100644
--- a/srcpkgs/kfilemetadata5/template
+++ b/srcpkgs/kfilemetadata5/template
@@ -1,7 +1,7 @@
 # Template file for 'kfilemetadata5'
 pkgname=kfilemetadata5
 version=5.103.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="kcoreaddons extra-cmake-modules pkg-config qt5-host-tools qt5-qmake
  gettext kcoreaddons python3"
diff --git a/srcpkgs/kid3/template b/srcpkgs/kid3/template
index 456206d90e16..f32f9decb0e7 100644
--- a/srcpkgs/kid3/template
+++ b/srcpkgs/kid3/template
@@ -1,7 +1,7 @@
 # Template file for 'kid3'
 pkgname=kid3
 version=3.9.1
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DWITH_APPS='CLI;$(vopt_if KDE KDE Qt)'
  -DWITH_DOCBOOKDIR=/usr/share/xsl/docbook -DWITH_FLAC=$(vopt_if flac ON OFF)
diff --git a/srcpkgs/kodi/template b/srcpkgs/kodi/template
index 8057964d78a3..991325f6c477 100644
--- a/srcpkgs/kodi/template
+++ b/srcpkgs/kodi/template
@@ -1,7 +1,7 @@
 # Template file for 'kodi'
 pkgname=kodi
 version=19.4
-revision=6
+revision=7
 _codename="Matrix"
 build_style=cmake
 configure_args="-DWITH_FFMPEG=/usr -DENABLE_LDGOLD=OFF
diff --git a/srcpkgs/kpipewire/template b/srcpkgs/kpipewire/template
index 1d1e963f296d..07cdc0c7384a 100644
--- a/srcpkgs/kpipewire/template
+++ b/srcpkgs/kpipewire/template
@@ -1,7 +1,7 @@
 # Template file for 'kpipewire'
 pkgname=kpipewire
 version=5.27.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules plasma-wayland-protocols gettext
  qt5-qmake qt5-host-tools pkg-config wayland-devel kcoreaddons
diff --git a/srcpkgs/libavresample b/srcpkgs/libavresample
index 887f354e7c6b..a9f1eea092d5 120000
--- a/srcpkgs/libavresample
+++ b/srcpkgs/libavresample
@@ -1 +1 @@
-ffmpeg4
\ No newline at end of file
+ffmpeg
\ No newline at end of file
diff --git a/srcpkgs/libextractor/template b/srcpkgs/libextractor/template
index 29d5b8df01f8..ddd4790f93e8 100644
--- a/srcpkgs/libextractor/template
+++ b/srcpkgs/libextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'libextractor'
 pkgname=libextractor
 version=1.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/libopenal/template b/srcpkgs/libopenal/template
index 77218f9e539d..3f49ed75a1fd 100644
--- a/srcpkgs/libopenal/template
+++ b/srcpkgs/libopenal/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenal'
 pkgname=libopenal
 version=1.22.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DALSOFT_EXAMPLES=OFF"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template
index db831f69b474..81aa0d7136d9 100644
--- a/srcpkgs/libopenshot/template
+++ b/srcpkgs/libopenshot/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenshot'
 pkgname=libopenshot
 version=0.3.0
-revision=1
+revision=2
 build_style=cmake
 # Builds fail with Ruby-2.4.1
 configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON"
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index da4f2d56e94c..4d6bf29efb4f 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
diff --git a/srcpkgs/mediastreamer/template b/srcpkgs/mediastreamer/template
index d0e97e858e29..d29210c1bf9c 100644
--- a/srcpkgs/mediastreamer/template
+++ b/srcpkgs/mediastreamer/template
@@ -1,7 +1,7 @@
 # Template file for 'mediastreamer'
 pkgname=mediastreamer
 version=5.2.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_STRICT=0 -DENABLE_UNIT_TESTS=0"
 hostmakedepends="python3"
diff --git a/srcpkgs/mgba/patches/ffmpeg5.patch b/srcpkgs/mgba/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..ad7049efcac3
--- /dev/null
+++ b/srcpkgs/mgba/patches/ffmpeg5.patch
@@ -0,0 +1,117 @@
+From cdc753516798882a805db1d2042dbce8313382bf Mon Sep 17 00:00:00 2001
+From: Ryan Tandy <ryan@nardis.ca>
+Date: Thu, 3 Feb 2022 19:02:52 -0800
+Subject: [PATCH] FFmpeg: Support FFmpeg 5.0
+
+---
+ src/feature/ffmpeg/ffmpeg-decoder.c |  3 ++-
+ src/feature/ffmpeg/ffmpeg-encoder.c | 25 ++++++++++++++-----------
+ 2 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/src/feature/ffmpeg/ffmpeg-decoder.c b/src/feature/ffmpeg/ffmpeg-decoder.c
+index c3bb6d1c5c..daa47fbf2c 100644
+--- a/src/feature/ffmpeg/ffmpeg-decoder.c
++++ b/src/feature/ffmpeg/ffmpeg-decoder.c
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ #include "ffmpeg-decoder.h"
+
++#include <libavcodec/avcodec.h>
+ #include <libswscale/swscale.h>
+
+ void FFmpegDecoderInit(struct FFmpegDecoder* decoder) {
+@@ -38,7 +39,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) {
+ #else
+ 		enum AVMediaType type = decoder->context->streams[i]->codec->codec_type;
+ #endif
+-		struct AVCodec* codec;
++		const struct AVCodec* codec;
+ 		struct AVCodecContext* context = NULL;
+ 		if (type == AVMEDIA_TYPE_VIDEO && decoder->videoStream < 0) {
+ 			decoder->video = avcodec_alloc_context3(NULL);
+diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c
+index ad76ca57b2..be6bd3af5e 100644
+--- a/src/feature/ffmpeg/ffmpeg-encoder.c
++++ b/src/feature/ffmpeg/ffmpeg-encoder.c
+@@ -12,6 +12,9 @@
+
+ #include <libavcodec/version.h>
+ #include <libavcodec/avcodec.h>
++#if LIBAVCODEC_VERSION_MAJOR >= 58
++#include <libavcodec/bsf.h>
++#endif
+
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+@@ -121,7 +124,7 @@ bool FFmpegEncoderSetAudio(struct FFmpegEncoder* encoder, const char* acodec, un
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(acodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(acodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -193,7 +196,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -213,7 +216,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 	if (encoder->pixFormat == AV_PIX_FMT_NONE) {
+ 		return false;
+ 	}
+-	if (vbr < 0 && !av_opt_find(&codec->priv_class, "crf", NULL, 0, 0)) {
++	if (vbr < 0 && !av_opt_find((void*) &codec->priv_class, "crf", NULL, 0, 0)) {
+ 		return false;
+ 	}
+ 	encoder->videoCodec = vcodec;
+@@ -223,7 +226,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ }
+
+ bool FFmpegEncoderSetContainer(struct FFmpegEncoder* encoder, const char* container) {
+-	AVOutputFormat* oformat = av_guess_format(container, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(container, 0, 0);
+ 	if (!oformat) {
+ 		return false;
+ 	}
+@@ -241,9 +244,9 @@ void FFmpegEncoderSetLooping(struct FFmpegEncoder* encoder, bool loop) {
+ }
+
+ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !oformat || (!acodec && !vcodec)) {
+ 		return false;
+ 	}
+@@ -257,8 +260,8 @@ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+ }
+
+ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !FFmpegEncoderVerifyContainer(encoder)) {
+ 		return false;
+ 	}
+@@ -272,9 +275,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+ 	encoder->currentVideoFrame = 0;
+ 	encoder->skipResidue = 0;
+
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+ #ifndef USE_LIBAV
+-	avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile);
++	avformat_alloc_output_context2(&encoder->context, (AVOutputFormat*) oformat, 0, outfile);
+ #else
+ 	encoder->context = avformat_alloc_context();
+ 	strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1);
diff --git a/srcpkgs/mgba/template b/srcpkgs/mgba/template
index 05bca15c1750..f5b6b8464428 100644
--- a/srcpkgs/mgba/template
+++ b/srcpkgs/mgba/template
@@ -1,7 +1,7 @@
 # Template file for 'mgba'
 pkgname=mgba
 version=0.10.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake desktop-file-utils"
 makedepends="SDL2-devel ffmpeg-devel libedit-devel libepoxy-devel libmagick-devel
diff --git a/srcpkgs/minidlna/template b/srcpkgs/minidlna/template
index e8081b1cbc67..9ee9714861fd 100644
--- a/srcpkgs/minidlna/template
+++ b/srcpkgs/minidlna/template
@@ -1,7 +1,7 @@
 # Template file for 'minidlna'
 pkgname=minidlna
 version=1.3.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --sbindir=/usr/bin
diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template
index 619ddca0d332..4b9ea00d3fb3 100644
--- a/srcpkgs/mixxx/template
+++ b/srcpkgs/mixxx/template
@@ -1,7 +1,7 @@
 # Template file for 'mixxx'
 pkgname=mixxx
 version=2.3.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="extra-cmake-modules pkg-config protobuf qt5-host-tools qt5-devel"
diff --git a/srcpkgs/mlt/template b/srcpkgs/mlt/template
index 8933eb4e7bb9..ed6b27503f9a 100644
--- a/srcpkgs/mlt/template
+++ b/srcpkgs/mlt/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt'
 pkgname=mlt
 version=6.26.1
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --libdir=/usr/lib$XBPS_TARGET_WORDSIZE
  --enable-gpl --enable-gpl3 --disable-swfdec --without-kde
diff --git a/srcpkgs/mlt7/template b/srcpkgs/mlt7/template
index e5972cc0411b..d0e9ec02e58a 100644
--- a/srcpkgs/mlt7/template
+++ b/srcpkgs/mlt7/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt7'
 pkgname=mlt7
 version=7.12.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSWIG_PYTHON=ON"
 hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which
diff --git a/srcpkgs/moc/template b/srcpkgs/moc/template
index c42be650a1d2..4b95426599bf 100644
--- a/srcpkgs/moc/template
+++ b/srcpkgs/moc/template
@@ -1,7 +1,7 @@
 # Template file for 'moc'
 pkgname=moc
 version=2.5.2
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg-devel
diff --git a/srcpkgs/motion/template b/srcpkgs/motion/template
index 3cf3c3035c5b..7dca12d851e3 100644
--- a/srcpkgs/motion/template
+++ b/srcpkgs/motion/template
@@ -1,7 +1,7 @@
 # Template file for 'motion'
 pkgname=motion
 version=4.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake pkg-config gettext-devel tar"
 makedepends="ffmpeg-devel libmicrohttpd-devel v4l-utils-devel gettext-devel"
diff --git a/srcpkgs/mpd/template b/srcpkgs/mpd/template
index 63701b7d56b1..df35e751ea60 100644
--- a/srcpkgs/mpd/template
+++ b/srcpkgs/mpd/template
@@ -1,7 +1,7 @@
 # Template file for 'mpd'
 pkgname=mpd
 version=0.23.12
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true
  -Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled
diff --git a/srcpkgs/mpv/template b/srcpkgs/mpv/template
index e163c496c6eb..d4fefbf5e3c7 100644
--- a/srcpkgs/mpv/template
+++ b/srcpkgs/mpv/template
@@ -1,7 +1,7 @@
 # Template file for 'mpv'
 pkgname=mpv
 version=0.35.1
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled
  -Dlibmpv=true -Dcplugins=enabled
diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template
index 4b7930041126..7cd65cf76b77 100644
--- a/srcpkgs/musikcube/template
+++ b/srcpkgs/musikcube/template
@@ -1,7 +1,7 @@
 # Template file for 'musikcube'
 pkgname=musikcube
 version=0.99.4
-revision=1
+revision=2
 build_style=cmake
 make_cmd=make
 configure_args="-DNO_NCURSESW=1"
diff --git a/srcpkgs/notcurses/template b/srcpkgs/notcurses/template
index 6dd8a091319f..3110c30c9aff 100644
--- a/srcpkgs/notcurses/template
+++ b/srcpkgs/notcurses/template
@@ -1,7 +1,7 @@
 # Template file for 'notcurses'
 pkgname=notcurses
 version=3.0.9
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_STATIC=ON $(vopt_bool man USE_PANDOC)"
 hostmakedepends="pkg-config $(vopt_if man pandoc)"
diff --git a/srcpkgs/obs/template b/srcpkgs/obs/template
index 1a7132ae832f..078feba62bbb 100644
--- a/srcpkgs/obs/template
+++ b/srcpkgs/obs/template
@@ -1,7 +1,7 @@
 # Template file for 'obs'
 pkgname=obs
 version=29.0.2
-revision=1
+revision=2
 archs="i686* x86_64* ppc64le* aarch64*"
 build_style=cmake
 configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON
diff --git a/srcpkgs/olive/template b/srcpkgs/olive/template
index 12a46936c990..5290d8e5aacd 100644
--- a/srcpkgs/olive/template
+++ b/srcpkgs/olive/template
@@ -1,7 +1,7 @@
 # Template file for 'olive'
 pkgname=olive
 version=0.1.2
-revision=2
+revision=3
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools pkg-config"
 makedepends="qt5-devel qt5-multimedia-devel qt5-svg-devel ffmpeg-devel frei0r-plugins"
diff --git a/srcpkgs/omxplayer/template b/srcpkgs/omxplayer/template
index e70bf7873d4d..80abdefe77b4 100644
--- a/srcpkgs/omxplayer/template
+++ b/srcpkgs/omxplayer/template
@@ -1,7 +1,7 @@
 # Template file for 'omxplayer'
 pkgname=omxplayer
 version=20190102
-revision=1
+revision=2
 short_desc="Commandline OMX player for the Raspberry Pi"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2"
diff --git a/srcpkgs/openimageio/template b/srcpkgs/openimageio/template
index cc9d7a33984e..ee988ae2ce07 100644
--- a/srcpkgs/openimageio/template
+++ b/srcpkgs/openimageio/template
@@ -1,7 +1,7 @@
 # Template file for 'openimageio'
 pkgname=openimageio
 version=2.3.18.0
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="-DUSE_OPENGL=0 -DUSE_QT=0 -DUSE_PYTHON=0 -DOIIO_BUILD_TESTS=1
diff --git a/srcpkgs/openmw/template b/srcpkgs/openmw/template
index 5251a0283dc1..e3771c7aaf1a 100644
--- a/srcpkgs/openmw/template
+++ b/srcpkgs/openmw/template
@@ -1,7 +1,7 @@
 # Template file for 'openmw'
 pkgname=openmw
 version=0.47.0
-revision=4
+revision=5
 build_style=cmake
 _recast_commit=e75adf86f91eb3082220085e42dda62679f9a3ea
 _bullet_tag=3.17
diff --git a/srcpkgs/openshot/template b/srcpkgs/openshot/template
index 322717d40abc..c074e0338773 100644
--- a/srcpkgs/openshot/template
+++ b/srcpkgs/openshot/template
@@ -1,7 +1,7 @@
 # Template file for 'openshot'
 pkgname=openshot
 version=3.0.0
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3 python3-setuptools"
 makedepends="ffmpeg-devel python3-PyQt5"
diff --git a/srcpkgs/opentoonz/template b/srcpkgs/opentoonz/template
index ee9f7603f55f..3e81834ca0ed 100644
--- a/srcpkgs/opentoonz/template
+++ b/srcpkgs/opentoonz/template
@@ -1,7 +1,7 @@
 # Template file for 'opentoonz'
 pkgname=opentoonz
 version=1.6.0
-revision=2
+revision=3
 build_wrksrc="toonz/sources"
 build_style=cmake
 make_cmd=make
diff --git a/srcpkgs/pianobar/template b/srcpkgs/pianobar/template
index a9b29e91993f..81efcd122c4d 100644
--- a/srcpkgs/pianobar/template
+++ b/srcpkgs/pianobar/template
@@ -1,7 +1,7 @@
 # Template file for 'pianobar'
 pkgname=pianobar
 version=2022.04.01
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="V=1"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/ppsspp/template b/srcpkgs/ppsspp/template
index 7984a733d4be..db9c95d0784c 100644
--- a/srcpkgs/ppsspp/template
+++ b/srcpkgs/ppsspp/template
@@ -1,7 +1,7 @@
 # Template file for 'ppsspp'
 pkgname=ppsspp
 version=1.14.4
-revision=1
+revision=2
 _glslang_commit=dc11adde23c455a24e13dd54de9b4ede8bdd7db8
 _SPIRV_Cross_commit=9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1
 _armips_commit=6719edebaae03330ee5441d9b28280672edf00d5
diff --git a/srcpkgs/pqiv/template b/srcpkgs/pqiv/template
index 542fc27a2d32..9308d949b6a1 100644
--- a/srcpkgs/pqiv/template
+++ b/srcpkgs/pqiv/template
@@ -1,7 +1,7 @@
 # Template file for 'pqiv'
 pkgname=pqiv
 version=2.12
-revision=1
+revision=2
 build_style=gnu-makefile
 hostmakedepends="pkg-config"
 makedepends="glib-devel gtk+3-devel $(vopt_if ffmpeg ffmpeg-devel)
diff --git a/srcpkgs/qmmp/template b/srcpkgs/qmmp/template
index 26c661ed16be..a150d7441c7a 100644
--- a/srcpkgs/qmmp/template
+++ b/srcpkgs/qmmp/template
@@ -1,7 +1,7 @@
 # Template file for 'qmmp'
 pkgname=qmmp
 version=1.6.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_HAL:BOOL=FALSE -DQMMP_DEFAULT_UI:STRING=simple"
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake"
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index f9d78eced929..0a71484208bc 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
 version=5.15.11
-revision=1
+revision=2
 _version="${version}-lts"
 _chromium_commit=be349eaf62e77955791d7bf29f893f1e8a37daf4
 archs="x86_64* i686* armv[67]* ppc64* aarch64*"
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"
diff --git a/srcpkgs/qt6-multimedia/template b/srcpkgs/qt6-multimedia/template
index d89e7d54eb5a..aae15e57ca7b 100644
--- a/srcpkgs/qt6-multimedia/template
+++ b/srcpkgs/qt6-multimedia/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-multimedia'
 pkgname=qt6-multimedia
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DQT_FEATURE_gstreamer=ON"
 hostmakedepends="perl qt6-declarative-host-tools pkg-config qt6-shadertools"
diff --git a/srcpkgs/qt6-webengine/template b/srcpkgs/qt6-webengine/template
index 99012732b53a..96846feaee83 100644
--- a/srcpkgs/qt6-webengine/template
+++ b/srcpkgs/qt6-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-webengine'
 pkgname=qt6-webengine
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DQT_FEATURE_webengine_system_ffmpeg=ON
diff --git a/srcpkgs/qtav/template b/srcpkgs/qtav/template
index 34c30b2c0c78..775d5a139a9e 100644
--- a/srcpkgs/qtav/template
+++ b/srcpkgs/qtav/template
@@ -1,7 +1,7 @@
 # Template file for 'qtav'
 pkgname=qtav
 version=1.13.0
-revision=1
+revision=2
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel libass-devel libopenal-devel
diff --git a/srcpkgs/qtox/patches/ffmpeg5.patch b/srcpkgs/qtox/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..3babe1c98447
--- /dev/null
+++ b/srcpkgs/qtox/patches/ffmpeg5.patch
@@ -0,0 +1,79 @@
+From 15673a52b6b4805d482b69281e21947fb7096e05 Mon Sep 17 00:00:00 2001
+From: Anthony Bilinski <me@abilinski.com>
+Date: Thu, 10 Feb 2022 17:24:38 -0800
+Subject: [PATCH] fix(macOS): Update video API usage for newer libavcodec
+
+Newer version of avformat_open_input, av_find_input_format,
+avcodec_find_decoder previously used non-const pointers that are now
+const. Support both version for compatibiltiy with other platforms.
+---
+ src/video/cameradevice.cpp | 9 ++++++---
+ src/video/cameradevice.h   | 1 -
+ src/video/camerasource.cpp | 3 +--
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/video/cameradevice.cpp b/src/video/cameradevice.cpp
+index 3b07968b32..a012a0f78d 100644
+--- a/src/video/cameradevice.cpp
++++ b/src/video/cameradevice.cpp
+@@ -31,6 +31,9 @@ extern "C" {
+ #include "cameradevice.h"
+ #include "src/persistence/settings.h"
+
++// no longer needed when avformat version < 59 is no longer supported
++using AvFindInputFormatRet = decltype(av_find_input_format(""));
++
+ #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
+ #define USING_V4L 1
+ #else
+@@ -71,8 +74,8 @@ extern "C" {
+
+ QHash<QString, CameraDevice*> CameraDevice::openDevices;
+ QMutex CameraDevice::openDeviceLock, CameraDevice::iformatLock;
+-AVInputFormat* CameraDevice::iformat{nullptr};
+-AVInputFormat* CameraDevice::idesktopFormat{nullptr};
++static AvFindInputFormatRet idesktopFormat{nullptr};
++static AvFindInputFormatRet iformat{nullptr};
+
+ CameraDevice::CameraDevice(const QString& devName, AVFormatContext* context)
+     : devName{devName}
+@@ -92,7 +95,7 @@ CameraDevice* CameraDevice::open(QString devName, AVDictionary** options)
+         goto out;
+     }
+
+-    AVInputFormat* format;
++    AvFindInputFormatRet format;
+     if (devName.startsWith("x11grab#")) {
+         devName = devName.mid(8);
+         format = idesktopFormat;
+diff --git a/src/video/cameradevice.h b/src/video/cameradevice.h
+index 910873325b..c05f1dbed4 100644
+--- a/src/video/cameradevice.h
++++ b/src/video/cameradevice.h
+@@ -64,5 +64,4 @@ class CameraDevice
+     std::atomic_int refcount;
+     static QHash<QString, CameraDevice*> openDevices;
+     static QMutex openDeviceLock, iformatLock;
+-    static AVInputFormat *iformat, *idesktopFormat;
+ };
+diff --git a/src/video/camerasource.cpp b/src/video/camerasource.cpp
+index 134bc49afc..3a899f11d0 100644
+--- a/src/video/camerasource.cpp
++++ b/src/video/camerasource.cpp
+@@ -278,7 +278,6 @@ void CameraSource::openDevice()
+     }
+
+     // We need to create a new CameraDevice
+-    AVCodec* codec;
+     device = CameraDevice::open(deviceName, mode);
+
+     if (!device) {
+@@ -322,7 +321,7 @@ void CameraSource::openDevice()
+     AVCodecParameters* cparams = device->context->streams[videoStreamIndex]->codecpar;
+     codecId = cparams->codec_id;
+ #endif
+-    codec = avcodec_find_decoder(codecId);
++    const AVCodec* codec = avcodec_find_decoder(codecId);
+     if (!codec) {
+         qWarning() << "Codec not found";
+         emit openFailed();
diff --git a/srcpkgs/qtox/template b/srcpkgs/qtox/template
index 16019d7eaec9..5cea0b11b697 100644
--- a/srcpkgs/qtox/template
+++ b/srcpkgs/qtox/template
@@ -1,7 +1,7 @@
 # Template file for 'qtox'
 pkgname=qtox
 version=1.17.6
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DUPDATE_CHECK=OFF
  -DGIT_DESCRIBE=${version}
diff --git a/srcpkgs/retroarch/template b/srcpkgs/retroarch/template
index 240d3df9db00..6d0b16ae2598 100644
--- a/srcpkgs/retroarch/template
+++ b/srcpkgs/retroarch/template
@@ -1,7 +1,7 @@
 # Template file for 'retroarch'
 pkgname=retroarch
 version=1.14.0
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking
  --enable-udev --disable-builtinflac --disable-builtinglslang
diff --git a/srcpkgs/scrcpy/template b/srcpkgs/scrcpy/template
index ee6e698e387f..8ada5ca4323f 100644
--- a/srcpkgs/scrcpy/template
+++ b/srcpkgs/scrcpy/template
@@ -1,7 +1,7 @@
 # Template file for 'scrcpy'
 pkgname=scrcpy
 version=2.0
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dcompile_server=false
  -Dprebuilt_server=/usr/share/scrcpy/scrcpy-server-v${version}"
diff --git a/srcpkgs/spek-alternative/template b/srcpkgs/spek-alternative/template
index d65086b8f008..72747cbb0a02 100644
--- a/srcpkgs/spek-alternative/template
+++ b/srcpkgs/spek-alternative/template
@@ -1,7 +1,7 @@
 # Template file for 'spek-alternative'
 pkgname=spek-alternative
 version=0.8.2.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake gettext-devel intltool libtool pkg-config wxWidgets-common"
 makedepends="ffmpeg-devel wxWidgets-gtk3-devel"
diff --git a/srcpkgs/ssr/template b/srcpkgs/ssr/template
index b055b9ec0774..842b2423aad1 100644
--- a/srcpkgs/ssr/template
+++ b/srcpkgs/ssr/template
@@ -1,7 +1,7 @@
 # Template file for 'ssr'
 pkgname=ssr
 version=0.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_QT5=ON"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template
index 0f9b9ec815f5..a3fe134aa5ac 100644
--- a/srcpkgs/sumo/template
+++ b/srcpkgs/sumo/template
@@ -1,7 +1,7 @@
 # Template file for 'sumo'
 pkgname=sumo
 version=1.12.0
-revision=5
+revision=6
 build_style=cmake
 hostmakedepends="libgdal-tools pkg-config swig python3-setuptools"
 makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel
diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template
index 182dc3cd280f..29afb3572e47 100644
--- a/srcpkgs/synfig/template
+++ b/srcpkgs/synfig/template
@@ -2,7 +2,7 @@
 # Should be kept in sync with 'synfigstudio' and 'ETL'
 pkgname=synfig
 version=1.4.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib"
 hostmakedepends="boost-build ImageMagick pkg-config intltool"
diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index aae9f3135100..7943b36f0b8a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=4.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 configure_args="-DTDESKTOP_API_ID=209235
diff --git a/srcpkgs/tg_owt/template b/srcpkgs/tg_owt/template
index 97d195ddb34a..551614b24956 100644
--- a/srcpkgs/tg_owt/template
+++ b/srcpkgs/tg_owt/template
@@ -1,7 +1,7 @@
 # Template file for 'tg_owt'
 pkgname=tg_owt
 version=0.0.0.20230107
-revision=1
+revision=2
 _commit=5098730b9eb6173f0b52068fe2555b7c1015123a
 _libyuv_commit=00950840d1c9bcbb3eb6ebc5aac5793e71166c8b
 _abseil_commit=8c0b94e793a66495e0b1f34a5eb26bd7dc672db0
diff --git a/srcpkgs/timg/template b/srcpkgs/timg/template
index 91f1516b2597..334443d3f9bb 100644
--- a/srcpkgs/timg/template
+++ b/srcpkgs/timg/template
@@ -1,7 +1,7 @@
 # Template file for 'timg'
 pkgname=timg
 version=1.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_OPENSLIDE_SUPPORT=off -Wno-dev"
 hostmakedepends="pkg-config git"
diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index 3e7966c2b4a9..285425ba1851 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.4.3
-revision=1
+revision=2
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss
diff --git a/srcpkgs/tvheadend/template b/srcpkgs/tvheadend/template
index e6b16d7ccf3b..a2004480332b 100644
--- a/srcpkgs/tvheadend/template
+++ b/srcpkgs/tvheadend/template
@@ -1,7 +1,7 @@
 # Template file for 'tvheadend'
 pkgname=tvheadend
 version=4.2.8
-revision=6
+revision=7
 build_style=gnu-configure
 configure_args="--enable-dvbscan --disable-ffmpeg_static
 --disable-hdhomerun_static --disable-bintray_cache --disable-libx264_static
diff --git a/srcpkgs/unpaper/template b/srcpkgs/unpaper/template
index 38ed47a58401..b05920d13101 100644
--- a/srcpkgs/unpaper/template
+++ b/srcpkgs/unpaper/template
@@ -1,7 +1,7 @@
 # Template file for 'unpaper'
 pkgname=unpaper
 version=6.1
-revision=3
+revision=4
 build_style=gnu-configure
 maintainer="Orphaned <orphan@voidlinux.org>"
 hostmakedepends="pkg-config libxslt"
diff --git a/srcpkgs/vba-m/template b/srcpkgs/vba-m/template
index ba153e0b58ca..aa6093645e97 100644
--- a/srcpkgs/vba-m/template
+++ b/srcpkgs/vba-m/template
@@ -2,7 +2,7 @@
 pkgname=vba-m
 reverts=1292_2
 version=2.1.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GTK=TRUE -DENABLE_FFMPEG=TRUE -DENABLE_LINK=TRUE -DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="gettext pkg-config unzip zip yasm wxWidgets-gtk3-devel"
diff --git a/srcpkgs/vice/template b/srcpkgs/vice/template
index 0924767cfcfb..ffa95384f64a 100644
--- a/srcpkgs/vice/template
+++ b/srcpkgs/vice/template
@@ -1,7 +1,7 @@
 # Template file for 'vice'
 pkgname=vice
 version=3.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
 	$(vopt_enable sdl2 sdlui2)
diff --git a/srcpkgs/waypipe/template b/srcpkgs/waypipe/template
index 5c4161900060..1a46fe27f7d8 100644
--- a/srcpkgs/waypipe/template
+++ b/srcpkgs/waypipe/template
@@ -1,7 +1,7 @@
 # Template file for 'waypipe'
 pkgname=waypipe
 version=0.8.4
-revision=1
+revision=2
 build_style=meson
 # lto is off because it causes linking errors in armv6l and armv7l (due to NEON)
 configure_args="-Dwerror=false -Dwith_dmabuf=enabled -Dwith_lz4=enabled
diff --git a/srcpkgs/wf-recorder/template b/srcpkgs/wf-recorder/template
index e278eb001600..5d014a5f28af 100644
--- a/srcpkgs/wf-recorder/template
+++ b/srcpkgs/wf-recorder/template
@@ -1,7 +1,7 @@
 # Template file for 'wf-recorder'
 pkgname=wf-recorder
 version=0.3.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config scdoc wayland-devel"
 makedepends="wayland-protocols wayland-devel ffmpeg-devel x264-devel
diff --git a/srcpkgs/xpra/template b/srcpkgs/xpra/template
index 38f83283b1e5..b6e01ff0a813 100644
--- a/srcpkgs/xpra/template
+++ b/srcpkgs/xpra/template
@@ -1,7 +1,7 @@
 # Template file for 'xpra'
 pkgname=xpra
 version=4.4.4
-revision=1
+revision=2
 build_style=python3-module
 make_build_args="--without-cuda_kernels --without-cuda_rebuild"
 make_install_args="$(vopt_with docs) ${make_build_args}"

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
  2023-03-22 22:54 ` [PR PATCH] [Updated] " zlice
@ 2023-03-22 22:59 ` zlice
  2023-03-22 23:08 ` paper42
                   ` (27 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-22 22:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3197 bytes --]

There is an updated pull request by zlice against master on the void-packages repository

https://github.com/zlice/void-packages ffmpeg5-split
https://github.com/void-linux/void-packages/pull/42936

draft: ffmpeg5 split
[ci skip]

#### Testing the changes

- I tested the changes in this PR: **NO**

I have conflicting changes from [intel packages](https://github.com/void-linux/void-packages/pull/41132) and don't want to mess with my system. If it makes sense I'll move these changes here like I originally intended. ffmpeg5 makes Intel vaapi easier and only rely on oneVPL iirc.

I do not use 80%+ of these packages. I may be able to run Blender, and I use shotcut.


#### New package

- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**



#### Local build testing

- I built this PR locally for my native architecture, **x86_64**


#### Discussion

Continuation of https://github.com/void-linux/void-packages/pull/36315 - thx tibequadorian :)

It was suggested to make `ffmpeg` version 5 and 'copy' (create a new?) `ffmpeg4` package, and that seems to work well.

As stated, I haven't and probably won't test most of these packages, hoping for others to voice in on what's working. 

A few months back (and now) afaict everything has been compiling with ffmpeg5 except for the few problem packages still using ffmpeg4 (below). Can add to the ffmpeg4 list as a incompatible package is found.

`libavresample` is deprecated, but marked as a dependency when trying to build other packages and install `ffmpeg`(5). I think the right way to handle this is make a meta package and the add to removals?

[gstreamer 1.22.1 updates](https://github.com/void-linux/void-packages/pull/42861) could go before this

##### Commit naming / misc

`ffpmeg4` isn't "new", not sure what the commit messages should be really for the 4 and 5 split. Additionally xlint complains about `ffmpeg4` revision being 3 and not 1 because it's a "new" package, I assume that's right but not sure.

Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?

I wouldn't mind moving the [intel packages](https://github.com/void-linux/void-packages/pull/41132) into here under another commit. That just got a potential fix that may allow merging but I imagine moving to ffmpeg5 will change and even remove some of those packages. (I won't really test these changes without Intel vaapi either way.)

Maintainer for previous ffmpeg(4) was orphaned, I can put my name in there if that matters, though I don't exactly see myself keeping up on ffmpeg.


##### still ffmpeg4

- `vlc` (vlc4 will support ffmpeg5, there's a patch to build 3.x with ffmpeg5 but it will lack vaapi)
- `osg` (OpenSceneGraph plus `xine-lib`)
- `ytmdl` ? not sure but it uses `python3-ffmpeg-python` which being 6-8yr old I imagine is ffmpeg4


A patch file from https://github.com/void-linux/void-packages/pull/42936.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ffmpeg5-split-42936.patch --]
[-- Type: text/x-diff, Size: 308311 bytes --]

From c5a8c096e2754e5184c83afeb25660963c3149b6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Tue, 21 Mar 2023 18:58:31 -0400
Subject: [PATCH 1/4] ffmpeg_split

---
 common/shlibs                                 |  26 +-
 srcpkgs/ffmpeg/template                       | 176 +++++----
 srcpkgs/ffmpeg4-devel                         |   1 +
 srcpkgs/ffmpeg4/ffmpeg4                       |   1 +
 .../{ffmpeg => ffmpeg4}/files/altivec.patch   |   0
 .../patches/armv5tel-floating-point.patch     |   0
 .../workaround-mesa-readeon-vaapi-bug.patch   |   0
 srcpkgs/ffmpeg4/template                      | 254 +++++++++++++
 ...Fix-infinite-loop-in-Menu-cycleitems.patch |  60 +++
 ...6c4d30f5b289c429c5ca88d800200db4fc4f.patch |  22 --
 .../MinOverlapPlacement.cc_improve.patch      |  29 ++
 srcpkgs/fluxbox/patches/center.patch          | 307 +++++++++++++++
 srcpkgs/fluxbox/patches/container_locks.patch | 325 ++++++++++++++++
 .../patches/container_relative_relative.patch |  15 +
 srcpkgs/fluxbox/patches/flux_improve.patch    | 205 ++++++++++
 srcpkgs/fluxbox/patches/flux_oversize.patch   |  24 ++
 .../fluxbox/patches/focus_close_menu.patch    |  17 +
 srcpkgs/fluxbox/patches/slit_raise.patch      |  16 +
 srcpkgs/fluxbox/patches/toolbar_redo.patch    | 228 ++++++++++++
 .../fluxbox/patches/tremor_graboid_hell.patch | 350 ++++++++++++++++++
 .../patches/unclutter_fix_workspacecmd.patch  |  65 ++++
 srcpkgs/fluxbox/patches/zor_loops.patch       |  87 +++++
 srcpkgs/fluxbox/template                      |  45 ++-
 srcpkgs/libavcodec4                           |   1 +
 srcpkgs/libavdevice4                          |   1 +
 srcpkgs/libavfilter4                          |   1 +
 srcpkgs/libavformat4                          |   1 +
 srcpkgs/libavresample                         |   2 +-
 srcpkgs/libavresample4                        |   1 +
 srcpkgs/libavutil4                            |   1 +
 srcpkgs/libpostproc4                          |   1 +
 srcpkgs/libswresample4                        |   1 +
 srcpkgs/libswscale4                           |   1 +
 srcpkgs/mesa/template                         |  35 +-
 34 files changed, 2167 insertions(+), 132 deletions(-)
 create mode 120000 srcpkgs/ffmpeg4-devel
 create mode 120000 srcpkgs/ffmpeg4/ffmpeg4
 rename srcpkgs/{ffmpeg => ffmpeg4}/files/altivec.patch (100%)
 rename srcpkgs/{ffmpeg => ffmpeg4}/patches/armv5tel-floating-point.patch (100%)
 rename srcpkgs/{ffmpeg => ffmpeg4}/patches/workaround-mesa-readeon-vaapi-bug.patch (100%)
 create mode 100644 srcpkgs/ffmpeg4/template
 create mode 100644 srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
 delete mode 100644 srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
 create mode 100644 srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
 create mode 100644 srcpkgs/fluxbox/patches/center.patch
 create mode 100644 srcpkgs/fluxbox/patches/container_locks.patch
 create mode 100644 srcpkgs/fluxbox/patches/container_relative_relative.patch
 create mode 100644 srcpkgs/fluxbox/patches/flux_improve.patch
 create mode 100644 srcpkgs/fluxbox/patches/flux_oversize.patch
 create mode 100644 srcpkgs/fluxbox/patches/focus_close_menu.patch
 create mode 100644 srcpkgs/fluxbox/patches/slit_raise.patch
 create mode 100644 srcpkgs/fluxbox/patches/toolbar_redo.patch
 create mode 100644 srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
 create mode 100644 srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
 create mode 100644 srcpkgs/fluxbox/patches/zor_loops.patch
 create mode 120000 srcpkgs/libavcodec4
 create mode 120000 srcpkgs/libavdevice4
 create mode 120000 srcpkgs/libavfilter4
 create mode 120000 srcpkgs/libavformat4
 create mode 120000 srcpkgs/libavresample4
 create mode 120000 srcpkgs/libavutil4
 create mode 120000 srcpkgs/libpostproc4
 create mode 120000 srcpkgs/libswresample4
 create mode 120000 srcpkgs/libswscale4

diff --git a/common/shlibs b/common/shlibs
index f972eebc4d3a..aab66c83f4b3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -389,15 +389,23 @@ libid3tag.so.0 libid3tag-0.15.1b_1
 libgif.so.7 giflib-5.1.0_1
 libImlib2.so.1 imlib2-1.4.2_1
 libmp3lame.so.0 lame-3.98.2_1
-libavdevice.so.58 libavdevice-4.0_1
-libavformat.so.58 libavformat-4.0_1
-libswscale.so.5 libswscale-4.0_1
-libswresample.so.3 libswresample-4.0_1
-libavresample.so.4 libavresample-4.0_1
-libpostproc.so.55 libpostproc-4.0_1
-libavcodec.so.58 libavcodec-4.0_1
-libavutil.so.56 libavutil-4.0_1
-libavfilter.so.7 libavfilter-4.0_1
+libavdevice.so.59 libavdevice-5.1.2_1
+libavformat.so.59 libavformat-5.1.2_1
+libswscale.so.6 libswscale-5.1.2_1
+libswresample.so.4 libswresample-5.1.2_1
+libpostproc.so.56 libpostproc-5.1.2_1
+libavcodec.so.59 libavcodec-5.1.2_1
+libavutil.so.57 libavutil-5.1.2_1
+libavfilter.so.8 libavfilter-5.1.2_1
+libavdevice.so.58 libavdevice4-4.0_1
+libavformat.so.58 libavformat4-4.0_1
+libswscale.so.5 libswscale4-4.0_1
+libswresample.so.3 libswresample4-4.0_1
+libavresample.so.4 libavresample4-4.0_1
+libpostproc.so.55 libpostproc4-4.0_1
+libavcodec.so.58 libavcodec4-4.0_1
+libavutil.so.56 libavutil4-4.0_1
+libavfilter.so.7 libavfilter4-4.0_1
 libSDL-1.2.so.0 SDL-1.2.14_1
 libSDL_image-1.2.so.0 SDL_image-1.2.10_1
 libx264.so.157 x264-20190507.2245_1
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 23a3d5c9967b..38978c5085a3 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -1,42 +1,36 @@
 # Template file for 'ffmpeg'
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg
-version=4.4.3
-revision=2
+version=5.1.2
+revision=1
 short_desc="Decoding, encoding and streaming software"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
 changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
 distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
-checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
-makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
- libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
- libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
- libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
- speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
- libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
- $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
- $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
- $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
- $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
- $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
- $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
- $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
- $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
- $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
- $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+makedepends="chromaprint-devel libgcrypt-devel ladspa-sdk lcms2-devel libaom-devel
+ alsa-lib-devel bzip2-devel libxcb-devel liblzma-devel SDL2-devel sndio-devel zlib-devel
+ frei0r-plugins libcdio-paranoia-devel rubberband-devel libvidstab-devel x264-devel x265-devel
+ xvidcore-devel fdk-aac-devel libtls-devel gmp-devel libass-devel libbluray-devel libcaca-devel
+ celt-devel codec2-devel libdav1d-devel libdrm-devel fontconfig-devel freetype-devel
+ fribidi-devel glslang-devel SPIRV-Tools-devel libgme-devel libgsm-devel jack-devel
+ libmodplug-devel lame-devel libopencv4-devel libopenjpeg2-devel libopenmpt-devel opus-devel
+ libplacebo-devel libpulseaudio rabbitmq-c-devel librist-devel librsvg-devel librtmp-devel
+ snappy-devel libsoxr-devel speex-devel srt-devel libssh-devel libtheora-devel twolame-devel
+ libvorbis-devel libvpx6-devel libwebp-devel libxml2-devel zimg-devel lilv-devel lv2
+ libopenal-devel mesa openssl-devel vapoursynth-devel ocl-icd-devel libmysofa-devel vulkan-loader
+ $(vopt_if vaapi libva-devel)
+ $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if nvenc nv-codec-headers)
+ $(vopt_if nvdec nv-codec-headers)
+ $(vopt_if svtav1 libsvt-av1-devel)
+"
 depends="ffplay>=${version}_${revision}"
-
-build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
- dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
-build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
-desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
-desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
-desc_option_sofa="Enable support for AES SOFA"
-desc_option_webp="Enable support for WebP"
+build_options="vaapi vdpau nvenc nvdec svtav1"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
@@ -52,22 +46,6 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-_apply_patch() {
-	local args="$1" pname="$(basename $2)"
-
-	if [ ! -f ".${pname}_done" ]; then
-		patch -N $args -i $2
-		touch .${pname}_done
-	fi
-}
-
-post_patch() {
-	case "$XBPS_TARGET_MACHINE" in
-		ppc64le*) ;;
-		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
-	esac
-}
-
 do_configure() {
 	# Fix gcc on x86_64-musl only
 	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
@@ -98,39 +76,47 @@ do_configure() {
 		_args+=" --extra-libs=-latomic"
 	fi
 
-	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+	./configure \
+		--prefix='/usr' \
+		--extra-cflags='-I/opt/cuda/include' \
+		--extra-ldflags='-L/opt/cuda/lib64' \
 		--disable-stripping \
-		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
-		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
-		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
-		--enable-shared --enable-static --enable-libxcb \
-		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
-		--enable-libspeex --enable-libcelt --enable-libass \
-		--enable-libopus --enable-librtmp --enable-libjack \
-		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
-		--disable-libopencore_amrnb --disable-libopencore_amrwb \
-		--disable-libopenjpeg \
-		--enable-postproc --enable-opencl ${_args} \
-		$(vopt_enable x265 libx265) \
-		$(vopt_enable v4l2 libv4l2) \
-		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
-		--enable-libbs2b --enable-avresample --enable-libvidstab \
-		$(vopt_enable dav1d libdav1d) \
-		$(vopt_enable zimg libzimg) \
-		$(vopt_enable webp libwebp) \
-		$(vopt_enable sofa libmysofa) \
-		$(vopt_enable vulkan) \
-		$(vopt_enable drm libdrm) \
-		$(vopt_enable svtav1 libsvtav1) \
-		$(vopt_enable srt libsrt) \
-		$(vopt_enable rist librist) \
+		--enable-shared --enable-static \
+		--enable-nonfree --enable-gpl \
+		--enable-version3 --enable-libxcb \
+		--enable-frei0r --enable-libcdio \
+		--enable-librubberband --enable-libvidstab \
+		--enable-libx264 --enable-libx265 --enable-libxvid \
+		--enable-libfdk-aac --enable-libtls --enable-gmp \
+		--enable-chromaprint --enable-gcrypt --enable-ladspa \
+		--enable-lcms2 --enable-libaom --enable-libass \
+		--enable-libbluray --enable-libcaca --enable-libcelt \
+		--enable-libcodec2 --enable-libdav1d --enable-libdrm \
+		--enable-libfontconfig --enable-libfreetype \
+		--enable-libfribidi --enable-libglslang \
+		--enable-libgme --enable-libgsm \
+		--enable-vapoursynth --enable-openssl --enable-opengl \
+		--enable-openal --enable-lv2 --enable-libzimg \
+		--enable-libxml2 --enable-libwebp --enable-libvorbis \
+		--enable-libtwolame --enable-libtheora --enable-libssh \
+		--enable-libsrt --enable-libspeex --enable-libsoxr \
+		--enable-librtmp --enable-librsvg --enable-librist \
+		--enable-librabbitmq --enable-libpulse --enable-libplacebo \
+		--enable-libopus --enable-libopenmpt --enable-libopenjpeg \
+		--enable-libmp3lame --enable-libmodplug --enable-libjack \
+		--enable-opencl --enable-libvpx --enable-libmysofa \
+		$(vopt_enable vaapi) \
+		$(vopt_enable vdpau) \
 		$(vopt_if nvenc '--enable-nvenc') \
-		$(vopt_if nvdec '--enable-nvdec')
+		$(vopt_if nvdec '--enable-nvdec') \
+		$(vopt_enable svtav1 libsvtav1)
 }
+
 do_build() {
 	make ${makejobs}
 	make doc/ff{mpeg,play}.1
 }
+
 do_install() {
 	make DESTDIR=${DESTDIR} install install-man
 }
@@ -147,12 +133,6 @@ libavdevice_package() {
 		vmove "usr/lib/libavdevice.so.*"
 	}
 }
-libavresample_package() {
-	short_desc="FFmpeg audio resampling library"
-	pkg_install() {
-		vmove "usr/lib/libavresample.so.*"
-	}
-}
 libavformat_package() {
 	short_desc="FFmpeg file format library"
 	pkg_install() {
@@ -198,9 +178,49 @@ ffmpeg-devel_package() {
 		libavfilter>=${version}_${revision}
 		libpostproc>=${version}_${revision}
 		libswscale>=${version}_${revision}
-		libswresample>=${version}_${revision}
-		libavresample>=${version}_${revision}"
+		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
+	alternatives="
+	 ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec5.3
+	 ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice5.3
+	 ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter5.3
+	 ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat5.3
+	 ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil5.3
+	 ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample5.3
+	 ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale5.3
+	 ffmpeg-devel:libavcodec:/usr/include/libavcodec5
+	 ffmpeg-devel:libavdevice:/usr/include/libavdevice5
+	 ffmpeg-devel:libavformat:/usr/include/libavformat5
+	 ffmpeg-devel:libavutil:/usr/include/libavutil5
+	 ffmpeg-devel:libavpostproc:/usr/include/libavpostproc5
+	 ffmpeg-devel:libswresample:/usr/include/libswresample5
+	 ffmpeg-devel:libswcaale:/usr/include/libswscale5
+	 ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec5.pc
+	 ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice5.pc
+	 ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter5.pc
+	 ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat5.pc
+	 ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil5.pc
+	 ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc5.pc
+	 ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample5.pc
+	 ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale5.pc
+	 ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec5.a
+	 ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec5.so
+	 ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice5.a
+	 ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice5.so
+	 ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter5.a
+	 ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter5.so
+	 ffmpeg-devel:libavformat.a:/usr/lib/libavformat5.a
+	 ffmpeg-devel:libavformat.so:/usr/lib/libavformat5.so
+	 ffmpeg-devel:libavutil.a:/usr/lib/libavutil5.a
+	 ffmpeg-devel:libavutil.so:/usr/lib/libavutil5.so
+	 ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc5.a
+	 ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc5.so
+	 ffmpeg-devel:libswresample.a:/usr/lib/libswresample5.a
+	 ffmpeg-devel:libswresample.so:/usr/lib/libswresample5.so
+	 ffmpeg-devel:libswscale.a:/usr/lib/libswscale5.a
+	 ffmpeg-devel:libswscale.so:/usr/lib/libswscale5.so
+	 ffmpeg-devel:ffmpeg:/usr/share/ffmpeg5
+	"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
@@ -211,7 +231,7 @@ ffmpeg-devel_package() {
 	}
 }
 ffplay_package() {
-	short_desc="Simple video player using FFmpeg and SDL2"
+	short_desc="Simple media player using FFmpeg and SDL2"
 	pkg_install() {
 		vmove usr/bin/ffplay
 		vmove "usr/share/man/man1/ffplay*"
diff --git a/srcpkgs/ffmpeg4-devel b/srcpkgs/ffmpeg4-devel
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4-devel
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg4/ffmpeg4 b/srcpkgs/ffmpeg4/ffmpeg4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4/ffmpeg4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg/files/altivec.patch b/srcpkgs/ffmpeg4/files/altivec.patch
similarity index 100%
rename from srcpkgs/ffmpeg/files/altivec.patch
rename to srcpkgs/ffmpeg4/files/altivec.patch
diff --git a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
similarity index 100%
rename from srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
rename to srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
diff --git a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
similarity index 100%
rename from srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
rename to srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
new file mode 100644
index 000000000000..cd9154978b3e
--- /dev/null
+++ b/srcpkgs/ffmpeg4/template
@@ -0,0 +1,254 @@
+# Template file for 'ffmpeg4'
+# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
+pkgname=ffmpeg4
+version=4.4.3
+revision=3
+short_desc="ffmpeg4 libraries only - Decoding, encoding and streaming software"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.ffmpeg.org"
+changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
+distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
+checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+
+hostmakedepends="pkg-config perl yasm"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
+
+case "$XBPS_TARGET_MACHINE" in
+	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
+	ppc64*) build_options_default+=" vaapi vdpau";;
+	mips*) CFLAGS="-mnan=legacy";;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" != "32" ]; then
+	build_options_default+=" svtav1"
+fi
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
+do_configure() {
+	# Fix gcc on x86_64-musl only
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
+		sed -i configure -e "s;_cflags_speed='-O3';_cflags_speed='-O2';"
+	fi
+
+	if [ "$CROSS_BUILD" ]; then
+		case "$XBPS_TARGET_MACHINE" in
+			arm*) _arch="arm";;
+			aarch64*) _arch="aarch64";;
+			mips*) _arch="mips";;
+			ppc64*) _arch="ppc64";;
+			ppc*) _arch="ppc";;
+			*) _arch="${XBPS_TARGET_MACHINE%%-musl}";;
+		esac
+
+		_args+=" --enable-cross-compile
+			--sysroot=$XBPS_CROSS_BASE
+			--cross-prefix=${XBPS_CROSS_TRIPLET}-
+			--target-os=linux --arch=${_arch}"
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc|ppc-musl) _args+=" --disable-altivec";;
+	esac
+
+	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+		_args+=" --extra-libs=-latomic"
+	fi
+
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+		--disable-stripping \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
+		$(vopt_if nvenc '--enable-nvenc') \
+		$(vopt_if nvdec '--enable-nvdec')
+}
+do_build() {
+	make ${makejobs}
+	make doc/ff{mpeg,play}.1
+}
+do_install() {
+	make DESTDIR=${DESTDIR} install install-man
+	rm -rf ${DESTDIR}/usr/bin
+}
+
+libavcodec4_package() {
+	short_desc="FFmpeg codec library"
+	pkg_install() {
+		vmove "usr/lib/libavcodec.so.*"
+	}
+}
+libavdevice4_package() {
+	short_desc="FFmpeg device handling library"
+	pkg_install() {
+		vmove "usr/lib/libavdevice.so.*"
+	}
+}
+libavresample4_package() {
+	short_desc="FFmpeg audio resampling library"
+	pkg_install() {
+		vmove "usr/lib/libavresample.so.*"
+	}
+}
+libavformat4_package() {
+	short_desc="FFmpeg file format library"
+	pkg_install() {
+		vmove "usr/lib/libavformat.so.*"
+	}
+}
+libavutil4_package() {
+	short_desc="FFmpeg utility library"
+	pkg_install() {
+		vmove "usr/lib/libavutil.so.*"
+	}
+}
+libavfilter4_package() {
+	short_desc="FFmpeg audio/video filter library"
+	pkg_install() {
+		vmove "usr/lib/libavfilter.so.*"
+	}
+}
+libpostproc4_package() {
+	short_desc="FFmpeg video postprocessing library"
+	pkg_install() {
+		vmove "usr/lib/libpostproc.so.*"
+	}
+}
+libswscale4_package() {
+	short_desc="FFmpeg video scaling library"
+	pkg_install() {
+		vmove "usr/lib/libswscale.so.*"
+	}
+}
+libswresample4_package() {
+	short_desc="FFmpeg video resampling library"
+	pkg_install() {
+		vmove "usr/lib/libswresample.so.*"
+	}
+}
+ffmpeg4-devel_package() {
+	depends="
+		libavcodec4>=${version}_${revision}
+		libavdevice4>=${version}_${revision}
+		libavformat4>=${version}_${revision}
+		libavutil4>=${version}_${revision}
+		libavfilter4>=${version}_${revision}
+		libpostproc4>=${version}_${revision}
+		libswscale4>=${version}_${revision}
+		libswresample4>=${version}_${revision}
+		libavresample4>=${version}_${revision}"
+	short_desc+=" - development files"
+	alternatives="
+		ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec4.3
+		ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice4.3
+		ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter4.3
+		ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat4.3
+		ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil4.3
+		ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample4.3
+		ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale4.3
+		ffmpeg-devel:libavcodec:/usr/include/libavcodec4
+		ffmpeg-devel:libavdevice:/usr/include/libavdevice4
+		ffmpeg-devel:libavformat:/usr/include/libavformat4
+		ffmpeg-devel:libavutil:/usr/include/libavutil4
+		ffmpeg-devel:libavpostproc:/usr/include/libavpostproc4
+		ffmpeg-devel:libswresample:/usr/include/libswresample4
+		ffmpeg-devel:libswcaale:/usr/include/libswscale4
+		ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec4.pc
+		ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice4.pc
+		ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter4.pc
+		ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat4.pc
+		ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil4.pc
+		ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc4.pc
+		ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample4.pc
+		ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale4.pc
+		ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec4.a
+		ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec4.so
+		ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice4.a
+		ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice4.so
+		ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter4.a
+		ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter4.so
+		ffmpeg-devel:libavformat.a:/usr/lib/libavformat4.a
+		ffmpeg-devel:libavformat.so:/usr/lib/libavformat4.so
+		ffmpeg-devel:libavutil.a:/usr/lib/libavutil4.a
+		ffmpeg-devel:libavutil.so:/usr/lib/libavutil4.so
+		ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc4.a
+		ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc4.so
+		ffmpeg-devel:libswresample.a:/usr/lib/libswresample4.a
+		ffmpeg-devel:libswresample.so:/usr/lib/libswresample4.so
+		ffmpeg-devel:libswscale.a:/usr/lib/libswscale4.a
+		ffmpeg-devel:libswscale.so:/usr/lib/libswscale4.so
+		ffmpeg-devel:ffmpeg:/usr/share/ffmpeg4
+	"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/*.a
+		vmove usr/lib/*.so
+		vmove usr/share/ffmpeg/examples
+		vmove usr/share/man/man3
+	}
+}
diff --git a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
new file mode 100644
index 000000000000..4c450fd45bfb
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
@@ -0,0 +1,60 @@
+From 9d8202f32338a3f08d3fa39057dc5eec5d97be4e Mon Sep 17 00:00:00 2001
+From: Mathias Gumz <akira@fluxbox.org>
+Date: Sat, 28 May 2022 11:13:43 +0200
+Subject: [PATCH] Fix infinite loop in Menu::cycleitems()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a menu contains no selectable item (example given: a "list" of user
+styles and the only available one is already selected), cycling through
+the menu will lead to an infinite loop and thus a disfunctional fluxbox.
+
+This commit addresses the issue by checking if there is any selectable
+item before entering the cycling stage.
+
+Discovered by Sébastien Ballet[1].
+
+[1]: https://sourceforge.net/p/fluxbox/bugs/1185/
+---
+ src/FbTk/Menu.cc | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
+index 6b2db3a4..ff040bae 100644
+--- a/src/FbTk/Menu.cc
++++ b/src/FbTk/Menu.cc
+@@ -320,15 +320,24 @@ void Menu::lower() {
+ 
+ void Menu::cycleItems(bool reverse) {
+ 
+-    if (m_items.empty())
+-        return;
+-
+-    int offset = reverse ? -1 : 1;
+     int l = m_items.size();
+-    int i = m_active_index;
++    int i;
++    int offset = reverse ? -1 : 1;
+     size_t ignore;
+ 
+-    for (i += offset; i != m_active_index; i += offset ) {
++    // check if there is _any_ selectable item
++    for (i = 0; i < l; i++) {
++        if (isItemSelectable(i)) {
++            break;
++        }
++    }
++
++    // no selectable item
++    if (i >= l) {
++        return;
++    }
++
++    for (i = m_active_index + offset; i != m_active_index; i += offset ) {
+         if (i < 0) {
+             i = l - 1;
+         } else if (i >= l) {
+-- 
+2.39.0
+
diff --git a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
deleted file mode 100644
index dc151643cb45..000000000000
--- a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 22866c4d30f5b289c429c5ca88d800200db4fc4f Mon Sep 17 00:00:00 2001
-From: John Sennesael <john@aminking.com>
-Date: Mon, 2 Nov 2015 15:14:32 -0600
-Subject: [PATCH] fixes bug #1138
-
----
- util/fluxbox-remote.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc
-index 59852e6a7..504015b50 100644
---- a/util/fluxbox-remote.cc
-+++ b/util/fluxbox-remote.cc
-@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
-     if (strcmp(cmd, "result") == 0) {
-         XTextProperty text_prop;
-         if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
--            && text_prop.value > 0
-+            && text_prop.value != 0
-             && text_prop.nitems > 0) {
- 
-             printf("%s", text_prop.value);
diff --git a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
new file mode 100644
index 000000000000..5b64b11ab2a8
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
@@ -0,0 +1,29 @@
+--- a/src/MinOverlapPlacement.cc  2015-02-08 05:44:34.000000000 -0500
++++ b/src/MinOverlapPlacement.cc  2022-07-18 15:14:41.012275200 -0400
+@@ -196,19 +196,21 @@
+     std::set<Area>::iterator min_reg = areas.end();
+
+     std::set<Area>::iterator ar_it = areas.begin();
++    int overlap = 0, min_right = 0, min_bottom = 0, max_left = 0, max_top = 0;
++
+     for (; ar_it != areas.end(); ++ar_it) {
+
+-        int overlap = 0;
++        overlap = 0;
+         it = const_windowlist.rbegin();
+         for (; it != it_end; ++it) {
+
+             getWindowDimensions(*(*it), left, top, right, bottom);
+
+             // get the coordinates of the overlap region
+-            int min_right = std::min(right, ar_it->x + win_w);
+-            int min_bottom = std::min(bottom, ar_it->y + win_h);
+-            int max_left = std::max(left, ar_it->x);
+-            int max_top = std::max(top, ar_it->y);
++            min_right = std::min(right, ar_it->x + win_w);
++            min_bottom = std::min(bottom, ar_it->y + win_h);
++            max_left = std::max(left, ar_it->x);
++            max_top = std::max(top, ar_it->y);
+
+             // now compute the overlap and add to running total
+             if (min_right > max_left && min_bottom > max_top)
diff --git a/srcpkgs/fluxbox/patches/center.patch b/srcpkgs/fluxbox/patches/center.patch
new file mode 100644
index 000000000000..39e3e4c7f37e
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/center.patch
@@ -0,0 +1,307 @@
+From ec83993c236de9c9442e2fcd31c08aae852a5a16 Mon Sep 17 00:00:00 2001
+From: zlice <zlice555@gmail.com>
+Date: Fri, 22 Jul 2022 21:21:33 -0400
+Subject: [PATCH 1/2] whitespace cleanup
+
+---
+ doc/asciidoc/fluxbox.txt |  8 ++++----
+ src/ScreenPlacement.cc   | 12 ++++++------
+ src/ScreenPlacement.hh   | 10 +++++-----
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
+index 95624842..0e3f27b9 100644
+--- a/doc/asciidoc/fluxbox.txt
++++ b/doc/asciidoc/fluxbox.txt
+@@ -4,7 +4,7 @@ Henrik Kinnunen <fluxgen@fluxbox.org>
+ v1.3.7, 08 February 2015
+ :man source:   fluxbox.txt
+ :man version:  {revision}
+-:man manual:   Fluxbox Manual  
++:man manual:   Fluxbox Manual
+ 
+ NAME
+ ----
+@@ -475,7 +475,7 @@ By default, this menu contains:
+ 
+ *Remember...*:::
+ Specify which window settings should be stored in the `apps' file and
+-resumed the next time this window is opened. 
++resumed the next time this window is opened.
+ +
+ Specifically the setting you may store are:
+ +
+@@ -740,7 +740,7 @@ There are three more settings in the ``Focus Model'' menu:
+ 
+ TAB OPTIONS
+ -----------
+-This section of fluxbox configuration menu lets you configure many features of 
++This section of fluxbox configuration menu lets you configure many features of
+ tabs. Inside of it there are three main options:
+ 
+ *Placement*:::
+@@ -1060,7 +1060,7 @@ whenever the mouse moves over them, but only when the mouse is moving. With
+ area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc.
+ +
+ Default: *ClickToFocus*
+-      
++
+ *session.screen0.autoRaise*: 'boolean'::
+ When True, this setting automatically raises any window that gains focus.
+ +
+diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
+index 19ddf78a..ca58d83f 100644
+--- a/src/ScreenPlacement.cc
++++ b/src/ScreenPlacement.cc
+@@ -43,14 +43,14 @@ using std::cerr;
+ using std::endl;
+ 
+ ScreenPlacement::ScreenPlacement(BScreen &screen):
+-    m_row_direction(screen.resourceManager(), LEFTRIGHT, 
+-                    screen.name()+".rowPlacementDirection", 
++    m_row_direction(screen.resourceManager(), LEFTRIGHT,
++                    screen.name()+".rowPlacementDirection",
+                     screen.altName()+".RowPlacementDirection"),
+-    m_col_direction(screen.resourceManager(), TOPBOTTOM, 
+-                    screen.name()+".colPlacementDirection", 
++    m_col_direction(screen.resourceManager(), TOPBOTTOM,
++                    screen.name()+".colPlacementDirection",
+                     screen.altName()+".ColPlacementDirection"),
+-    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT, 
+-                       screen.name()+".windowPlacement", 
++    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT,
++                       screen.name()+".windowPlacement",
+                        screen.altName()+".WindowPlacement"),
+     m_old_policy(ROWSMARTPLACEMENT),
+     m_screen(screen)
+diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
+index 0f210d94..f1234983 100644
+--- a/src/ScreenPlacement.hh
++++ b/src/ScreenPlacement.hh
+@@ -34,7 +34,7 @@ class BScreen;
+ 
+ /**
+  * Main class for strategy handling
+- * This is a bridge between screen and 
++ * This is a bridge between screen and
+  * the real placement strategy (rowcol, undermouse etc)
+  * The placeWindow function in this class is guaranteed to succeed.
+  * It holds a pointer to the real placement strategy which is
+@@ -42,8 +42,8 @@ class BScreen;
+  */
+ class ScreenPlacement: public PlacementStrategy {
+ public:
+-    enum PlacementPolicy { 
+-        ROWSMARTPLACEMENT, 
++    enum PlacementPolicy {
++        ROWSMARTPLACEMENT,
+         COLSMARTPLACEMENT,
+         COLMINOVERLAPPLACEMENT,
+         ROWMINOVERLAPPLACEMENT,
+@@ -52,11 +52,11 @@ public:
+         AUTOTABPLACEMENT
+     };
+ 
+-    enum RowDirection { 
++    enum RowDirection {
+         LEFTRIGHT, ///< from left to right
+         RIGHTLEFT  ///< from right to left
+     };
+-    enum ColumnDirection { 
++    enum ColumnDirection {
+         TOPBOTTOM,  ///< from top to bottom
+         BOTTOMTOP   ///< from bottom to top
+     };
+-- 
+2.37.1
+
+
+From 6e05f44c94fa4bfc0e44e8f42a9d24665a95840f Mon Sep 17 00:00:00 2001
+From: zlice <zlice555@gmail.com>
+Date: Fri, 22 Jul 2022 21:27:25 -0400
+Subject: [PATCH 2/2] new feature: CenterPlacement. Places new windows in
+ center of the current workspace
+
+---
+ doc/asciidoc/fluxbox.txt |  1 +
+ src/CenterPlacement.cc   | 43 ++++++++++++++++++++++++++++++++++++++++
+ src/CenterPlacement.hh   | 37 ++++++++++++++++++++++++++++++++++
+ src/Makemodule.am        |  2 ++
+ src/ScreenPlacement.cc   |  8 ++++++++
+ src/ScreenPlacement.hh   |  1 +
+ 6 files changed, 92 insertions(+)
+ create mode 100644 src/CenterPlacement.cc
+ create mode 100644 src/CenterPlacement.hh
+
+diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
+index 0e3f27b9..46ca2861 100644
+--- a/doc/asciidoc/fluxbox.txt
++++ b/doc/asciidoc/fluxbox.txt
+@@ -1141,6 +1141,7 @@ Available strategies:;;
+ - RowSmartPlacement: tries to place windows in rows without overlapping
+ - ColSmartPlacement: tries to place windows in columns without overlapping
+ - CascadePlacement: places windows below the titlebar of the previous one
++- CenterPlacement: places windows in the center of the current workspace
+ - UnderMousePlacement: places new windows underneath the mouse
+ - RowMinOverlapPlacement: place windows in rows with minimal overlapping
+ - ColMinOverlapPlacement: place windows in columns with minimal overlapping
+diff --git a/src/CenterPlacement.cc b/src/CenterPlacement.cc
+new file mode 100644
+index 00000000..efaf76b9
+--- /dev/null
++++ b/src/CenterPlacement.cc
+@@ -0,0 +1,43 @@
++// CenterPlacement.cc
++// Copyright (c) 2006 Fluxbox Team (fluxgen at fluxbox dot org)
++//
++// Permission is hereby granted, free of charge, to any person obtaining a
++// copy of this software and associated documentation files (the "Software"),
++// to deal in the Software without restriction, including without limitation
++// the rights to use, copy, modify, merge, publish, distribute, sublicense,
++// and/or sell copies of the Software, and to permit persons to whom the
++// Software is furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++
++#include "CenterPlacement.hh"
++
++#include "FbTk/App.hh"
++#include "Screen.hh"
++#include "Window.hh"
++
++bool CenterPlacement::placeWindow(const FluxboxWindow &win, int head,
++                                      int &place_x, int &place_y) {
++
++    int cent_x = (signed) win.screen().maxRight(head) - (signed) win.screen().maxLeft(head);
++    int cent_y = (signed) win.screen().maxBottom(head) - (signed) win.screen().maxTop(head);
++
++    // border on 1 side, dividing in half
++    // with rounding, this will probably favor top left
++    int win_half_w = (win.width() / 2) + win.fbWindow().borderWidth(),
++        win_half_h = (win.height() / 2) + win.fbWindow().borderWidth();
++
++    place_x = cent_x - win_half_w;
++    place_y = cent_y - win_half_h;
++
++    return true;
++}
+diff --git a/src/CenterPlacement.hh b/src/CenterPlacement.hh
+new file mode 100644
+index 00000000..9f70a6c8
+--- /dev/null
++++ b/src/CenterPlacement.hh
+@@ -0,0 +1,37 @@
++// CenterPlacement.hh
++// Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org)
++//
++// Permission is hereby granted, free of charge, to any person obtaining a
++// copy of this software and associated documentation files (the "Software"),
++// to deal in the Software without restriction, including without limitation
++// the rights to use, copy, modify, merge, publish, distribute, sublicense,
++// and/or sell copies of the Software, and to permit persons to whom the
++// Software is furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++
++#ifndef CENTERPLACEMENT_HH
++#define CENTERPLACEMENT_HH
++
++#include "ScreenPlacement.hh"
++
++class CenterPlacement: public PlacementStrategy {
++public:
++    CenterPlacement() { };
++
++    bool placeWindow(const FluxboxWindow &win, int head,
++                     int &place_x, int &place_y);
++
++private:
++};
++
++#endif // CENTERPLACEMENT_HH
+diff --git a/src/Makemodule.am b/src/Makemodule.am
+index 5be5692c..53d35e8e 100644
+--- a/src/Makemodule.am
++++ b/src/Makemodule.am
+@@ -165,6 +165,8 @@ fluxbox_SOURCES = \
+ 	src/AttentionNoticeHandler.hh \
+ 	src/CascadePlacement.cc \
+ 	src/CascadePlacement.hh \
++	src/CenterPlacement.cc \
++	src/CenterPlacement.hh \
+ 	src/ClientMenu.cc \
+ 	src/ClientMenu.hh \
+ 	src/ClientPattern.cc \
+diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
+index ca58d83f..ce47a910 100644
+--- a/src/ScreenPlacement.cc
++++ b/src/ScreenPlacement.cc
+@@ -24,6 +24,7 @@
+ #include "RowSmartPlacement.hh"
+ #include "MinOverlapPlacement.hh"
+ #include "UnderMousePlacement.hh"
++#include "CenterPlacement.hh"
+ #include "ColSmartPlacement.hh"
+ #include "CascadePlacement.hh"
+ 
+@@ -82,6 +83,9 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
+         case UNDERMOUSEPLACEMENT:
+             m_strategy.reset(new UnderMousePlacement());
+             break;
++        case CENTERPLACEMENT:
++            m_strategy.reset(new CenterPlacement());
++            break;
+         case AUTOTABPLACEMENT:
+             m_strategy.reset(0);
+             break;
+@@ -197,6 +201,8 @@ std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const
+         return "ColMinOverlapPlacement";
+     case ScreenPlacement::UNDERMOUSEPLACEMENT:
+         return "UnderMousePlacement";
++    case ScreenPlacement::CENTERPLACEMENT:
++        return "CenterPlacement";
+     case ScreenPlacement::CASCADEPLACEMENT:
+         return "CascadePlacement";
+     case ScreenPlacement::AUTOTABPLACEMENT:
+@@ -218,6 +224,8 @@ void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char
+         *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
+     else if (strcasecmp("UnderMousePlacement", str) == 0)
+         *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
++    else if (strcasecmp("CenterPlacement", str) == 0)
++        *(*this) = ScreenPlacement::CENTERPLACEMENT;
+     else if (strcasecmp("CascadePlacement", str) == 0)
+         *(*this) = ScreenPlacement::CASCADEPLACEMENT;
+     else if (strcasecmp("AutotabPlacement", str) == 0)
+diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
+index f1234983..a5c9b885 100644
+--- a/src/ScreenPlacement.hh
++++ b/src/ScreenPlacement.hh
+@@ -49,6 +49,7 @@ public:
+         ROWMINOVERLAPPLACEMENT,
+         CASCADEPLACEMENT,
+         UNDERMOUSEPLACEMENT,
++        CENTERPLACEMENT,
+         AUTOTABPLACEMENT
+     };
+ 
+-- 
+2.37.1
+
diff --git a/srcpkgs/fluxbox/patches/container_locks.patch b/srcpkgs/fluxbox/patches/container_locks.patch
new file mode 100644
index 000000000000..498ab44a23c6
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/container_locks.patch
@@ -0,0 +1,325 @@
+diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
+index 00bc1187..f8a4c475 100644
+--- a/src/FbWinFrame.cc
++++ b/src/FbWinFrame.cc
+@@ -148,6 +148,11 @@ FbWinFrame::FbWinFrame(BScreen &screen, unsigned int client_depth,
+     m_button_size(1),
+     m_shape(m_window, theme->shapePlace()) {
+ 
++    m_locker_timer.setTimeout(timerVal() ); // 10millisec
++    m_locker_timer.fireOnce(true);
++    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<FbWinFrame>(*this, &FbWinFrame::unlockSig));
++    m_locker_timer.setCommand(usig);
++
+     init();
+ }
+ 
+@@ -156,6 +161,27 @@ FbWinFrame::~FbWinFrame() {
+     removeAllButtons();
+ }
+ 
++// for incremental changes, back off for a bit
++// prevents slowdown from say, making 200 windows
++void FbWinFrame::resetLock() {
++    m_lock_gfx = true;
++    m_locker_timer.start();
++}
++
++void FbWinFrame::unlockSig() {
++    m_lock_gfx = false;
++    // this is what we wanted to do
++    FbTk::Container& tabs = tabcontainer();
++    tabs.setUpdateLock(m_lock_gfx);
++    renderTabContainer();
++    applyTabContainer();
++
++    tabs.clear();
++    tabs.raise();
++    tabs.show();
++}
++
++
+ bool FbWinFrame::setTabMode(TabMode tabmode) {
+     if (m_tabmode == tabmode)
+         return false;
+@@ -187,6 +213,7 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
+ 
+     } else {
+         tabs.setUpdateLock(true);
++        resetLock();
+ 
+         tabs.setAlignment(FbTk::Container::RELATIVE);
+         tabs.setOrientation(FbTk::ROT0);
+@@ -200,9 +227,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
+         }
+         tabs.setBorderWidth(0);
+         tabs.setMaxTotalSize(0);
+-        tabs.setUpdateLock(false);
++        tabs.setUpdateLock(m_lock_gfx);
+         tabs.setMaxSizePerClient(0);
+ 
++        if (m_lock_gfx)
++            return false;
++
+         renderTabContainer();
+         applyTabContainer();
+ 
+diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
+index 617b9b91..725c84a0 100644
+--- a/src/FbWinFrame.hh
++++ b/src/FbWinFrame.hh
+@@ -33,6 +33,7 @@
+ #include "FbTk/Container.hh"
+ #include "FbTk/Shape.hh"
+ #include "FbTk/Signal.hh"
++#include "FbTk/Timer.hh"
+ 
+ #include <vector>
+ #include <memory>
+@@ -176,6 +177,12 @@ public:
+     void setShapingClient(FbTk::FbWindow *win, bool always_update);
+     void updateShape() { m_shape.update(); }
+ 
++    void resetLock();
++    void unlockSig();
++    FbTk::Timer m_locker_timer;
++    static unsigned int timerVal() { return 10 * FbTk::FbTime::IN_MILLISECONDS; }
++    bool m_lock_gfx = false;
++
+     /**
+        @name accessors
+     */
+diff --git a/src/IconButton.cc b/src/IconButton.cc
+index 1290c2aa..2ea7af9e 100644
+--- a/src/IconButton.cc
++++ b/src/IconButton.cc
+@@ -71,8 +71,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent,
+ 
+     FbTk::EventManager::instance()->add(*this, m_icon_window);
+ 
+-    reconfigTheme();
+-    refreshEverything(false);
++    //reconfigTheme();
++    //refreshEverything(false);
+ }
+ 
+ IconButton::~IconButton() {
+@@ -163,12 +163,12 @@ void IconButton::reconfigTheme() {
+                            width(), height(), m_theme->texture(),
+                            orientation()));
+         setBackgroundPixmap(m_pm);
+-    } else{
++    } else {
+         m_pm.reset(0);
+         setBackgroundColor(m_theme->texture().color());
+     }
+ 
+-    updateBackground(false);
++    //updateBackground(false);
+ }
+ 
+ void IconButton::reconfigAndClear() {
+@@ -181,7 +181,8 @@ void IconButton::refreshEverything(bool setup) {
+     Display *display = FbTk::App::instance()->display();
+     int screen = m_win.screen().screenNumber();
+ 
+-    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None) {
++    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None &&
++                                     width() > m_icon_window.width() ) {
+         // setup icon window
+         m_icon_window.show();
+         unsigned int w = width();
+@@ -242,7 +243,6 @@ void IconButton::refreshEverything(bool setup) {
+         m_icon_window.clear();
+     }
+ 
+-
+ }
+ 
+ void IconButton::clientTitleChanged() {
+@@ -251,24 +251,30 @@ void IconButton::clientTitleChanged() {
+ 
+     if (m_has_tooltip)
+         showTooltip();
++
+ }
+ 
+ void IconButton::setupWindow() {
+     m_icon_window.clear();
++    //FbTk::FbString title = "wtf2";
+     FbTk::FbString title = m_win.title().logical();
+-    if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
+-        title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
++    //#if USE_TOOLBAR
++    //if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
++    //    title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
++    //#endif
+     setText(title);
+     FbTk::TextButton::clear();
+ }
+ 
+ void IconButton::drawText(int x, int y, FbTk::FbDrawable *drawable) {
+ 
+-    // offset text
+-    if (m_icon_pixmap.drawable() != 0)
+-        FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
+-    else
+-        FbTk::TextButton::drawText(1, y, drawable);
++    if (width() > m_icon_window.width() ) {
++      // offset text
++      if (m_icon_pixmap.drawable() != 0)
++          FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
++      else
++          FbTk::TextButton::drawText(1, y, drawable);
++    }
+ }
+ 
+ bool IconButton::setOrientation(FbTk::Orientation orient) {
+diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
+index 027ab1c6..f64a4cf6 100644
+--- a/src/IconbarTool.cc
++++ b/src/IconbarTool.cc
+@@ -300,6 +300,11 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
+     FbTk::RefCount<FbTk::Command<void> > ers(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::emitResizeSig));
+     m_resizeSig_timer.setCommand(ers);
+ 
++    m_locker_timer.setTimeout(IconButton::updateLaziness() / 10); // 10millisec
++    m_locker_timer.fireOnce(true);
++    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::unlockSig));
++    m_locker_timer.setCommand(usig);
++
+     themeReconfigured();
+ }
+ 
+@@ -325,7 +330,7 @@ void IconbarTool::updateMaxSizes(unsigned int width, unsigned int height) {
+ 
+ void IconbarTool::resize(unsigned int width, unsigned int height) {
+     m_icon_container.resize(width, height);
+-    updateMaxSizes(width, height);
++    //updateMaxSizes(width, height);
+     renderTheme();
+ }
+ 
+@@ -333,7 +338,7 @@ void IconbarTool::moveResize(int x, int y,
+                              unsigned int width, unsigned int height) {
+ 
+     m_icon_container.moveResize(x, y, width, height);
+-    updateMaxSizes(width, height);
++    //updateMaxSizes(width, height);
+     renderTheme();
+ }
+ 
+@@ -393,6 +398,25 @@ void IconbarTool::setMode(string mode) {
+     m_menu.reconfigure();
+ }
+ 
++// for incremental changes, back off for a bit
++// prevents slowdown from say, making 200 windows
++void IconbarTool::resetLock() {
++    m_lock_gfx = true;
++    m_locker_timer.start();
++}
++
++void IconbarTool::unlockSig() {
++    m_lock_gfx = false;
++    //resizeSig().emit();
++    // this is what we wanted to do
++    m_icon_container.setUpdateLock(false);
++    m_icon_container.update();
++    m_icon_container.showSubwindows();
++    renderTheme();
++    update(ALIGN, NULL);
++    m_resizeSig_timer.start();
++}
++
+ void IconbarTool::emitResizeSig() {
+     resizeSig().emit();
+ }
+@@ -441,9 +465,11 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
+     switch(reason) {
+         case LIST_ADD: case LIST_ORDER:
+             insertWindow(*win);
++            resetLock();
+             break;
+         case LIST_REMOVE:
+             removeWindow(*win);
++            resetLock();
+             break;
+         case LIST_RESET:
+             reset();
+@@ -455,6 +481,10 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
+     m_resizeSig_timer.start();
+ 
+     updateMaxSizes(width(), height());
++
++    if (m_lock_gfx)
++        return;
++
+     // unlock container and update graphics
+     m_icon_container.setUpdateLock(false);
+     m_icon_container.update();
+@@ -496,13 +526,13 @@ void IconbarTool::insertWindow(Focusable &win, int pos) {
+         button = makeButton(win);
+     if (!button) return;
+ 
+-    if (pos == -2) {
+-        pos = 0;
+-        list<Focusable *>::iterator it = m_winlist->clientList().begin(),
+-                                    it_end = m_winlist->clientList().end();
+-        for (; it != it_end && *it != &win; ++it)
+-            pos++;
+-    }
++    //if (pos == -2) {
++    //    pos = 0;
++    //    list<Focusable *>::iterator it = m_winlist->clientList().begin(),
++    //                                it_end = m_winlist->clientList().end();
++    //    for (; it != it_end && *it != &win; ++it)
++    //        pos++;
++    //}
+ 
+     m_icon_container.insertItem(button, pos);
+     m_tracker.join(button->titleChanged(), FbTk::MemFun(m_resizeSig_timer, &FbTk::Timer::start));
+@@ -517,9 +547,9 @@ void IconbarTool::updateSizing() {
+     m_icon_container.setBorderWidth(m_theme.border().width());
+     m_icon_container.setBorderColor(m_theme.border().color());
+ 
+-    FbTk::STLUtil::forAll(m_icons, 
+-            FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
+-                FbTk::Select2nd<IconMap::value_type>()));
++    //FbTk::STLUtil::forAll(m_icons, 
++    //        FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
++    //            FbTk::Select2nd<IconMap::value_type>()));
+ 
+ }
+ 
+@@ -560,7 +590,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear) {
+ 
+     button.setPixmap(*m_rc_use_pixmap);
+     button.setTextPadding(*m_rc_client_padding);
+-    button.reconfigTheme();
++    //button.reconfigTheme();
+     if (clear)
+         button.clear(); // the clear also updates transparent
+ }
+diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
+index df6d9a65..1c2101ac 100644
+--- a/src/IconbarTool.hh
++++ b/src/IconbarTool.hh
+@@ -106,6 +106,9 @@ private:
+ 
+     void themeReconfigured();
+ 
++    void resetLock();
++    void unlockSig();
++    FbTk::Timer m_locker_timer;
+     FbTk::Timer m_resizeSig_timer;
+     void emitResizeSig();
+ 
+@@ -128,6 +131,7 @@ private:
+     FbMenu m_menu;
+     int m_alpha;
+     static std::string s_iconifiedDecoration[2];
++    bool m_lock_gfx = false;
+ };
+ 
+ #endif // ICONBARTOOL_HH
diff --git a/srcpkgs/fluxbox/patches/container_relative_relative.patch b/srcpkgs/fluxbox/patches/container_relative_relative.patch
new file mode 100644
index 000000000000..dc3ddb5181b5
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/container_relative_relative.patch
@@ -0,0 +1,15 @@
+diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
+index cea761b3..0e050a0b 100644
+--- a/src/FbTk/Container.cc
++++ b/src/FbTk/Container.cc
+@@ -365,6 +365,9 @@ void Container::repositionItems() {
+     const ItemList::iterator it_end = end();
+
+     int rounding_error = 0;
++    if (align == RELATIVE || total_width == m_max_total_size) {
++        rounding_error = total_width - ((max_width_per_client + borderW)* num_items - borderW);
++    }
+
+     int next_x = -borderW; // zero so the border of the first shows
+     int extra = 0;
+
diff --git a/srcpkgs/fluxbox/patches/flux_improve.patch b/srcpkgs/fluxbox/patches/flux_improve.patch
new file mode 100644
index 000000000000..13a1aeba621c
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/flux_improve.patch
@@ -0,0 +1,205 @@
+diff --git a/src/Ewmh.cc b/src/Ewmh.cc
+index e12a7923..db1ddd45 100644
+--- a/src/Ewmh.cc
++++ b/src/Ewmh.cc
+@@ -1096,15 +1096,19 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
+         // ce.data.l[0] = the action (remove, add or toggle)
+         // ce.data.l[1] = the first property to alter
+         // ce.data.l[2] = second property to alter (can be zero)
+-        if (ce.data.l[0] == STATE_REMOVE) {
+-            setState(win, ce.data.l[1], false, *winclient);
+-            setState(win, ce.data.l[2], false, *winclient);
+-        } else if (ce.data.l[0] == STATE_ADD) {
+-            setState(win, ce.data.l[1], true, *winclient);
+-            setState(win, ce.data.l[2], true, *winclient);
+-        } else if (ce.data.l[0] == STATE_TOGGLE) {
+-            toggleState(win, ce.data.l[1]);
+-            toggleState(win, ce.data.l[2]);
++        bool addremove = false; // add true, remove false
++
++        switch (ce.data.l[0]) {
++          case STATE_TOGGLE:
++              toggleState(win, ce.data.l[1]);
++              toggleState(win, ce.data.l[2]);
++              break;
++          case STATE_ADD:
++              addremove = true;
++          case STATE_REMOVE:
++              setState(win, ce.data.l[1], addremove, *winclient);
++              setState(win, ce.data.l[2], addremove, *winclient);
++              break;
+         }
+         return true;
+     } else if (ce.message_type == m_net->number_of_desktops) {
+diff --git a/src/FbMenuParser.cc b/src/FbMenuParser.cc
+index 716ced29..5a56e6f5 100644
+--- a/src/FbMenuParser.cc
++++ b/src/FbMenuParser.cc
+@@ -33,9 +33,9 @@ bool FbMenuParser::open(const std::string &filename) {
+ }
+ 
+ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
+-    if (eof()) {        
++    if (eof()) {
+         out = FbTk::Parser::s_empty_item;
+-        return *this; 
++        return *this;
+     }
+ 
+     if (m_curr_line.empty())
+@@ -69,20 +69,26 @@ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
+         return (*this)>>out;
+         break;
+     }
+-    
++
+     std::string key;
+     int err = FbTk::StringUtil::
+         getStringBetween(key, m_curr_line.c_str() + m_curr_pos,
+                          first, second);
+-    if (err <= 0) {        
+-        if (m_curr_token == TYPE)
++    if (err <= 0) {
++        switch (m_curr_token) {
++          case TYPE:
+             m_curr_token = NAME;
+-        else if (m_curr_token == NAME)
++            break;
++          case NAME:
+             m_curr_token = ARGUMENT;
+-        else if (m_curr_token == ARGUMENT)
++            break;
++          case ARGUMENT:
+             m_curr_token = ICON;
+-        else if (m_curr_token == ICON)
++            break;
++          case ICON:
+             m_curr_token = DONE;
++            break;
++        }
+ 
+         out = FbTk::Parser::s_empty_item;
+         return *this;
+diff --git a/src/Remember.cc b/src/Remember.cc
+index 49e61062..4f0ba3db 100644
+--- a/src/Remember.cc
++++ b/src/Remember.cc
+@@ -802,39 +802,41 @@ void Remember::reload() {
+             int pos = getStringBetween(key, line.c_str(), '[', ']');
+             string lc_key = toLower(key);
+ 
+-            if (pos > 0 && (lc_key == "app" || lc_key == "transient")) {
+-                ClientPattern *pat = new ClientPattern(line.c_str() + pos);
+-                if (!in_group) {
+-                    if ((err = pat->error()) == 0) {
+-                        bool transient = (lc_key == "transient");
+-                        Application *app = findMatchingPatterns(pat,
+-                                               old_pats, transient, false);
+-                        if (app) {
+-                            app->reset();
+-                            reused_apps.insert(app);
++            if (pos > 0) {
++                if (lc_key == "app" || lc_key == "transient") {
++                    ClientPattern *pat = new ClientPattern(line.c_str() + pos);
++                    if (!in_group) {
++                        if ((err = pat->error()) == 0) {
++                            bool transient = (lc_key == "transient");
++                            Application *app = findMatchingPatterns(pat,
++                                                   old_pats, transient, false);
++                            if (app) {
++                                app->reset();
++                                reused_apps.insert(app);
++                            } else {
++                                app = new Application(transient, false);
++                            }
++
++                            m_pats->push_back(make_pair(pat, app));
++                            row += parseApp(apps_file, *app);
+                         } else {
+-                            app = new Application(transient, false);
++                            cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
++                            delete pat; // since it didn't work
+                         }
+-
+-                        m_pats->push_back(make_pair(pat, app));
+-                        row += parseApp(apps_file, *app);
+                     } else {
+-                        cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
+-                        delete pat; // since it didn't work
++                        grouped_pats.push_back(pat);
+                     }
+-                } else {
+-                    grouped_pats.push_back(pat);
+-                }
+-            } else if (pos > 0 && lc_key == "startup" && fb.isStartup()) {
+-                if (!handleStartupItem(line, pos)) {
+-                    cerr<<"Error reading apps file at line "<<row<<"."<<endl;
++                } else if (lc_key == "startup" && fb.isStartup()) {
++                    if (!handleStartupItem(line, pos)) {
++                        cerr<<"Error reading apps file at line "<<row<<"."<<endl;
++                    }
++                    // save the item even if it was bad (aren't we nice)
++                    m_startups.push_back(line.substr(pos));
++                } else if (lc_key == "group") {
++                    in_group = true;
++                    if (line.find('(') != string::npos)
++                        pat = new ClientPattern(line.c_str() + pos);
+                 }
+-                // save the item even if it was bad (aren't we nice)
+-                m_startups.push_back(line.substr(pos));
+-            } else if (pos > 0 && lc_key == "group") {
+-                in_group = true;
+-                if (line.find('(') != string::npos)
+-                    pat = new ClientPattern(line.c_str() + pos);
+             } else if (in_group) {
+                 // otherwise assume that it is the start of the attributes
+                 Application *app = 0;
+diff --git a/src/SystemTray.cc b/src/SystemTray.cc
+index 8c42877a..1fc2b0a8 100644
+--- a/src/SystemTray.cc
++++ b/src/SystemTray.cc
+@@ -550,10 +550,12 @@ void SystemTray::rearrangeClients() {
+     ClientList::iterator client_it = m_clients.begin();
+     ClientList::iterator client_it_end = m_clients.end();
+     int next_x = bw;
++    int x, y;
+     for (; client_it != client_it_end; ++client_it) {
+         if (!(*client_it)->isVisible())
+             continue;
+-        int x = next_x, y = bw;
++        x = next_x;
++        y = bw;
+         next_x += h_rot0+bw;
+         translateCoords(orientation(), x, y, w_rot0, h_rot0);
+         translatePosition(orientation(), x, y, h_rot0, h_rot0, 0);
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..713d1510 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -3267,14 +3267,18 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top, bool resize) {
+ FluxboxWindow::ReferenceCorner FluxboxWindow::getResizeDirection(int x, int y,
+         ResizeModel model, int corner_size_px, int corner_size_pc) const
+ {
+-    if (model == TOPLEFTRESIZE)     return LEFTTOP;
+-    if (model == TOPRESIZE)         return TOP;
+-    if (model == TOPRIGHTRESIZE)    return RIGHTTOP;
+-    if (model == LEFTRESIZE)        return LEFT;
+-    if (model == RIGHTRESIZE)       return RIGHT;
+-    if (model == BOTTOMLEFTRESIZE)  return LEFTBOTTOM;
+-    if (model == BOTTOMRESIZE)      return BOTTOM;
+-    if (model == CENTERRESIZE)      return CENTER;
++    switch (model) {
++    case TOPLEFTRESIZE:     return LEFTTOP;
++    case TOPRESIZE:         return TOP;
++    case TOPRIGHTRESIZE:    return RIGHTTOP;
++    case LEFTRESIZE:        return LEFT;
++    case RIGHTRESIZE:       return RIGHT;
++    case BOTTOMLEFTRESIZE:  return LEFTBOTTOM;
++    case BOTTOMRESIZE:      return BOTTOM;
++    case CENTERRESIZE:      return CENTER;
++    default:
++    break;
++    }
+ 
+     if (model == EDGEORCORNERRESIZE)
+     {
diff --git a/srcpkgs/fluxbox/patches/flux_oversize.patch b/srcpkgs/fluxbox/patches/flux_oversize.patch
new file mode 100644
index 000000000000..98d70d3b037e
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/flux_oversize.patch
@@ -0,0 +1,24 @@
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..02d10e90 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -532,19 +532,14 @@ void FluxboxWindow::init() {
+     if (!m_state.fullscreen) {
+         unsigned int new_width = 0, new_height = 0;
+         if (m_client->width() >= screen().width()) {
+-            m_state.maximized |= WindowState::MAX_HORZ;
+             new_width = 2 * screen().width() / 3;
+         }
+         if (m_client->height() >= screen().height()) {
+-            m_state.maximized |= WindowState::MAX_VERT;
+             new_height = 2 * screen().height() / 3;
+         }
+         if (new_width || new_height) {
+-            const int maximized = m_state.maximized;
+-            m_state.maximized = WindowState::MAX_NONE;
+             resize(new_width ? new_width : width(), new_height ? new_height : height());
+             m_placed = false;
+-            m_state.maximized = maximized;
+         }
+     }
+ 
diff --git a/srcpkgs/fluxbox/patches/focus_close_menu.patch b/srcpkgs/fluxbox/patches/focus_close_menu.patch
new file mode 100644
index 000000000000..01830cf53460
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/focus_close_menu.patch
@@ -0,0 +1,17 @@
+diff --git a/src/FocusControl.cc b/src/FocusControl.cc
+index 54c3d46c..7e49ff51 100644
+--- a/src/FocusControl.cc
++++ b/src/FocusControl.cc
+@@ -247,11 +247,7 @@ void FocusControl::stopCyclingFocus() {
+ 
+     // put currently focused window to top
+     if (s_focused_window) {
+-        // re-focus last window to give the client a chance to redistribute the
+-        // focus internally (client-side only modality)
+-        s_focused_window->focus();
+-        if (s_focused_window)
+-            setScreenFocusedWindow(*s_focused_window);
++        setScreenFocusedWindow(*s_focused_window);
+         if (s_focused_fbwindow)
+             s_focused_fbwindow->raise();
+     } else
diff --git a/srcpkgs/fluxbox/patches/slit_raise.patch b/srcpkgs/fluxbox/patches/slit_raise.patch
new file mode 100644
index 000000000000..a3bc01c7ac85
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/slit_raise.patch
@@ -0,0 +1,16 @@
+diff --git a/src/Slit.cc b/src/Slit.cc
+index 9baecf21..63ed8269 100644
+--- a/src/Slit.cc
++++ b/src/Slit.cc
+@@ -958,8 +958,8 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
+         return;
+     }
+
+-    if (be.button == 1)
+-        frame.window.raise();
++    //if (be.button == 1)
++    //    frame.window.raise();
+
+     if (be.button != Button3) {
+         XAllowEvents(dpy, ReplayPointer, CurrentTime);
+
diff --git a/srcpkgs/fluxbox/patches/toolbar_redo.patch b/srcpkgs/fluxbox/patches/toolbar_redo.patch
new file mode 100644
index 000000000000..ca95486583ce
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/toolbar_redo.patch
@@ -0,0 +1,228 @@
+diff --git a/src/Toolbar.cc b/src/Toolbar.cc
+index aa9bc121..ee8b8bfc 100644
+--- a/src/Toolbar.cc
++++ b/src/Toolbar.cc
+@@ -74,7 +74,7 @@ using FbTk::STLUtil::forAll;
+ 
+ namespace {
+ 
+-const struct { 
++const struct {
+     Toolbar::Placement placement;
+     const char* str;
+     FbTk::Orientation orient;
+@@ -362,13 +362,16 @@ void Toolbar::lower() {
+ }
+ 
+ void Toolbar::screenChanged(BScreen &screen) {
+-    reconfigure();
++    //reconfigure();
+ }
+ 
+ void Toolbar::relayout() {
+-    forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
+-    rearrangeItems();
+-    forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
++    //for (auto it : m_item_list)    (*item_it)->updateSizing();
++    //rearrangeItems();
++    //for (auto it : m_item_list)    (*item_it)->renderTheme(alpha());
++    //forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
++    //rearrangeItems();
++    //forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
+ }
+ 
+ void Toolbar::reconfigure() {
+@@ -557,12 +560,16 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
+ }
+ 
+ void Toolbar::updateCrossingState() {
+-    Window wr, wc;
+-    int rx, ry, x, y;
++    //Window wr, wc;
++    //int rx, ry, x, y;
++    //unsigned int mask;
++    Window wrc;
++    int rxy, x, y;
+     unsigned int mask;
+     const int bw = -theme()->border().width();
+     bool hovered = false;
+-    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
++    //if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
++    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wrc, &wrc, &rxy, &rxy, &x, &y, &mask))
+         hovered = x >= bw && y >= bw && x < int(width()) && y < int(height());
+     if (hovered) {
+         if (m_rc_auto_raise)
+@@ -910,25 +917,26 @@ void Toolbar::rearrangeItems() {
+     // lock this
+     m_resize_lock = true;
+     // calculate size for fixed items
+-    ItemList::iterator item_it = m_item_list.begin();
+-    ItemList::iterator item_it_end = m_item_list.end();
++    //ItemList::iterator item_it = m_item_list.begin();
++    //ItemList::iterator item_it_end = m_item_list.end();
+     int bevel_width = theme()->bevelWidth();
+     int fixed_width = bevel_width; // combined size of all fixed items
+     int relative_width = 0; // combined *desired* size of all relative items
+-    int stretch_items = 0;
+     int relative_items = 0;
+     int last_bw = 0; // we show the largest border of adjoining items
+     bool first = true;
++    int leftover_width = 0;
+ 
+     unsigned int width = this->width(), height = this->height();
+     unsigned int tmpw, tmph;
+     FbTk::translateSize(orient, width, height);
+ 
+-    for (; item_it != item_it_end; ++item_it) {
+-        if (!(*item_it)->active())
++    //for (; item_it != item_it_end; ++item_it) {
++    for (auto item_it : m_item_list) {
++        if (!(*item_it).active())
+             continue;
+ 
+-        int borderW = (*item_it)->borderWidth();
++        int borderW = (*item_it).borderWidth();
+ 
+         if (bevel_width > 0) {
+             // the bevel and border are fixed whether relative or not
+@@ -943,35 +951,35 @@ void Toolbar::rearrangeItems() {
+ 
+         last_bw = borderW;
+ 
+-        tmpw = (*item_it)->preferredWidth();
+-        tmph = (*item_it)->height();
++        tmpw = (*item_it).preferredWidth();
++        tmph = (*item_it).height();
+         FbTk::translateSize(orient, tmpw, tmph);
+ 
+-        if ((*item_it)->type() == ToolbarItem::FIXED) {
+-            fixed_width += tmpw;
+-        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
+-            fixed_width += height;
+-            if (bevel_width)
+-                fixed_width -= 2*(borderW + bevel_width);
+-        } else {
+-            ++relative_items;
+-            relative_width += tmpw;
+-            if (!tmpw)
+-                ++stretch_items;
++        switch ( (*item_it).type() ) {
++            case ToolbarItem::FIXED:
++                fixed_width += tmpw;
++                break;
++            case ToolbarItem::SQUARE:
++                fixed_width += height;
++                if (bevel_width)
++                    fixed_width -= 2*(borderW + bevel_width);
++                break;
++            case ToolbarItem::RELATIVE:
++                ++relative_items;
++                relative_width += tmpw;
++                break;
++            default:
++                break;
+         }
+     }
+ 
+     // calculate what's going to be left over to the relative sized items
+-    float stretch_factor = 1.0f;
+     if (relative_items) {
+-        if (relative_width <= width - fixed_width && stretch_items) {
+-            relative_width = int(width - fixed_width - relative_width)/stretch_items;
+-        } else if (relative_width) {
+-            stretch_factor = float(width - fixed_width)/relative_width;
+-            relative_width = 0;
+-        }
++        relative_width = (width - fixed_width) / relative_items;
++        leftover_width = width - fixed_width - relative_items * relative_width;
+     }
+ 
++
+     // now move and resize the items
+     // borderWidth added back on straight away
+     int next_x = -m_item_list.front()->borderWidth(); // list isn't empty
+@@ -979,19 +987,22 @@ void Toolbar::rearrangeItems() {
+         next_x = 0;
+ 
+     last_bw = 0;
+-    for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
+-        int borderW = (*item_it)->borderWidth();
+-        if (!(*item_it)->active()) {
+-            (*item_it)->hide();
++    int borderW, offset, size_offset, tmpx, tmpy;
++
++    //for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
++    for (auto item_it : m_item_list) {
++        borderW = (*item_it).borderWidth();
++        if (!(*item_it).active()) {
++            (*item_it).hide();
+             // make sure it still gets told the toolbar height
+             tmpw = 1; tmph = height - 2*(bevel_width+borderW);
+             if (tmph >= (1<<30)) tmph = 1;
+             FbTk::translateSize(orient, tmpw, tmph);
+-            (*item_it)->resize(tmpw, tmph);  // width of 0 changes to 1 anyway
++            (*item_it).resize(tmpw, tmph);  // width of 0 changes to 1 anyway
+             continue;
+         }
+-        int offset = bevel_width;
+-        int size_offset = 2*(borderW + bevel_width);
++        offset = bevel_width;
++        size_offset = 2*(borderW + bevel_width);
+ 
+         if (bevel_width == 0) {
+             offset = -borderW;
+@@ -1000,22 +1011,28 @@ void Toolbar::rearrangeItems() {
+         }
+         last_bw = borderW;
+ 
+-        int tmpx = next_x + offset,
+-            tmpy = offset;
+-
+-        if ((*item_it)->type() == ToolbarItem::RELATIVE) {
+-            unsigned int itemw = (*item_it)->preferredWidth(), itemh = (*item_it)->height();
+-            FbTk::translateSize(orient, itemw, itemh);
+-            tmpw = itemw ? std::floor(stretch_factor * itemw) : relative_width;
+-            tmph = height - size_offset;
+-        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
+-            tmpw = tmph = height - size_offset;
+-        } else { // fixed size
+-            unsigned int itemw = (*item_it)->width(), itemh = (*item_it)->height();
+-            FbTk::translateSize(orient, itemw, itemh);
+-            tmpw = itemw;
+-            tmph = height - size_offset;
++        tmpx = next_x + offset,
++        tmpy = offset;
++        tmph = height - size_offset;
++
++        switch ( (*item_it).type() ) {
++            case ToolbarItem::SQUARE:
++                tmpw = tmph;
++                break;
++            case ToolbarItem::RELATIVE:
++                tmpw = relative_width;
++                if (leftover_width) {
++                    --leftover_width;
++                    ++tmpw;
++                }
++                break;
++            case ToolbarItem::FIXED:
++                unsigned int itemw = (*item_it).width(), itemh = (*item_it).height();
++                FbTk::translateSize(orient, itemw, itemh);
++                tmpw = itemw;
++                break;
+         }
++
+         if (tmpw >= (1<<30)) tmpw = 1;
+         if (tmph >= (1<<30)) tmph = 1;
+         next_x += tmpw + bevel_width;
+@@ -1025,8 +1042,8 @@ void Toolbar::rearrangeItems() {
+         FbTk::translateCoords(orient, tmpx, tmpy, width, height);
+         FbTk::translatePosition(orient, tmpx, tmpy, tmpw, tmph, borderW);
+         FbTk::translateSize(orient, tmpw, tmph);
+-        (*item_it)->moveResize(tmpx, tmpy, tmpw, tmph);
+-        (*item_it)->show();
++        (*item_it).moveResize(tmpx, tmpy, tmpw, tmph);
++        //(*item_it).show();
+ 
+     }
+     // unlock
diff --git a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
new file mode 100644
index 000000000000..189a314607bd
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
@@ -0,0 +1,350 @@
+diff --git a/src/FbTk/EventManager.cc b/src/FbTk/EventManager.cc
+index 3df56de5..501766cc 100644
+--- a/src/FbTk/EventManager.cc
++++ b/src/FbTk/EventManager.cc
+@@ -194,23 +194,22 @@ void EventManager::dispatch(Window win, XEvent &ev, bool parent) {
+ 
+     // find out which window is the parent and
+     // dispatch event
+-    Window root, parent_win, *children = 0;
+-    unsigned int num_children;
+-    if (XQueryTree(FbTk::App::instance()->display(), win,
+-                   &root, &parent_win, &children, &num_children) != 0) {
+-        if (children != 0)
+-            XFree(children);
+-
+-        if (parent_win != 0 &&
+-            parent_win != root) {
+-            if (m_parent[parent_win] == 0)
+-                return;
+-
+-            // dispatch event to parent
+-            dispatch(parent_win, ev, true);
+-        }
+-    }
+-
++//    Window root, parent_win, *children = 0;
++//    unsigned int num_children;
++//    if (XQueryTree(FbTk::App::instance()->display(), win,
++//                   &root, &parent_win, &children, &num_children) != 0) {
++//        if (children != 0)
++//            XFree(children);
++//
++//        if (parent_win != 0 &&
++//            parent_win != root) {
++//            if (m_parent[parent_win] == 0)
++//                return;
++//
++//            // dispatch event to parent
++//            dispatch(parent_win, ev, true);
++//        }
++//    }
+ }
+ 
+ } // end namespace FbTk
+diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc
+index 73f2ea06..cf863021 100644
+--- a/src/FbTk/KeyUtil.cc
++++ b/src/FbTk/KeyUtil.cc
+@@ -141,13 +141,14 @@ void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win,
+     const unsigned int scrollmod = instance().scrolllock();
+ 
+     // Grab with numlock, capslock and scrlock
+-    for (int i = 0; i < 8; i++) {
+-        XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
+-                    (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
+-                    win, False, event_mask, GrabModeSync, GrabModeAsync,
+-                    None, cursor);
+-    }
+-
++    //for (int i = 0; i < 8; i++) {
++    //    XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
++    //                (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
++    //                win, True, event_mask, GrabModeSync, GrabModeAsync,
++    //                None, cursor);
++    //}
++    XGrabButton(display, button, mod, win, True, event_mask,
++                GrabModeSync, GrabModeAsync, None, cursor);
+ }
+ 
+ /**
+diff --git a/src/Keys.cc b/src/Keys.cc
+index 86591371..c27037e2 100644
+--- a/src/Keys.cc
++++ b/src/Keys.cc
+@@ -277,7 +277,7 @@ void Keys::grabWindow(Window win) {
+     if (win_it == m_window_map.end())
+         return;
+ 
+-    m_handler_map[win]->grabButtons();
++    //m_handler_map[win]->grabButtons();
+     t_key::keylist_t::iterator it = m_keylist->keylist.begin();
+     t_key::keylist_t::iterator it_end = m_keylist->keylist.end();
+     for (; it != it_end; ++it) {
+@@ -586,16 +586,16 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+         isdouble = double_click;
+     }
+ 
+-    auto resetKeyChain = [&]() {
+-        first_key_time = 0;
+-        next_key.reset();
+-        if (saved_keymode) {
+-            setKeyMode(saved_keymode);
+-            saved_keymode.reset();
+-        }
+-    };
+-    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
+-        resetKeyChain();
++//    auto resetKeyChain = [&]() {
++//        first_key_time = 0;
++//        next_key.reset();
++//        if (saved_keymode) {
++//            setKeyMode(saved_keymode);
++//            saved_keymode.reset();
++//        }
++//    };
++//    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
++//        resetKeyChain();
+ 
+     if (!next_key)
+         next_key = m_keylist;
+@@ -612,29 +612,29 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+         next_key->find(MotionNotify, mods, key, context, false))
+         return true; // if there's a motion action, prevent replay to the client (but do nothing)
+ 
+-    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
+-        if (!saved_keymode) {
+-            first_key_time = time;
+-            saved_keymode = m_keylist;
+-        }
+-        next_key = temp_key;
+-        setKeyMode(next_key);
+-        return true;
+-    }
++//    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
++//        if (!saved_keymode) {
++//            first_key_time = time;
++//            saved_keymode = m_keylist;
++//        }
++//        next_key = temp_key;
++//        setKeyMode(next_key);
++//        return true;
++//    }
++
+     if (!temp_key || temp_key->m_command == 0) {
+-        if (type == KeyPress &&
+-            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
+-            // if we're in the middle of an emacs-style keychain, exit it
+-            resetKeyChain();
+-        }
++//        if (type == KeyPress &&
++//            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
++//            // if we're in the middle of an emacs-style keychain, exit it
++//            resetKeyChain();
++//        }
+         return false;
+     }
+ 
+     // if focus changes, windows will get NotifyWhileGrabbed,
+     // which they tend to ignore
+-    if (type == KeyPress) {
++    if (type == KeyPress)
+         XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
+-    }
+ 
+     WinClient *old = WindowCmd<void>::client();
+     WindowCmd<void>::setClient(current);
+@@ -650,12 +650,13 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+     temp_key->m_command->execute();
+     WindowCmd<void>::setClient(old);
+ 
+-    if (saved_keymode) {
+-        if (next_key == m_keylist) // don't reset keymode if command changed it
+-            setKeyMode(saved_keymode);
+-        saved_keymode.reset();
+-    }
+-    next_key.reset();
++//    if (saved_keymode) {
++//        if (next_key == m_keylist) // don't reset keymode if command changed it
++//            setKeyMode(saved_keymode);
++//        saved_keymode.reset();
++//    }
++//    next_key.reset();
++
+     return true;
+ }
+ 
+@@ -685,15 +686,16 @@ void Keys::reconfigure() {
+ }
+ 
+ void Keys::regrab() {
+-    setKeyMode(m_keylist);
++    //setKeyMode(m_keylist);
+ }
+ 
+ void Keys::keyMode(const string& keyMode) {
+-    keyspace_t::iterator it = m_map.find(keyMode + ":");
+-    if (it == m_map.end())
++    //keyspace_t::iterator it = m_map.find(keyMode + ":");
++    //if (it == m_map.end())
++    //    setKeyMode(m_map["default:"]);
++    //else
++    //    setKeyMode(it->second);
+         setKeyMode(m_map["default:"]);
+-    else
+-        setKeyMode(it->second);
+ }
+ 
+ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
+@@ -701,10 +703,10 @@ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
+     ungrabButtons();
+ 
+     // notify handlers that their buttons have been ungrabbed
+-    HandlerMap::iterator h_it = m_handler_map.begin(),
+-                         h_it_end  = m_handler_map.end();
+-    for (; h_it != h_it_end; ++h_it)
+-        h_it->second->grabButtons();
++    //HandlerMap::iterator h_it = m_handler_map.begin(),
++    //                     h_it_end  = m_handler_map.end();
++    //for (; h_it != h_it_end; ++h_it)
++    //    h_it->second->grabButtons();
+ 
+     t_key::keylist_t::iterator it = keyMode->keylist.begin();
+     t_key::keylist_t::iterator it_end = keyMode->keylist.end();
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..457c30c6 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -1133,13 +1133,25 @@ void FluxboxWindow::updateSizeHints() {
+ }
+ 
+ void FluxboxWindow::grabButtons() {
+-
++//NOGRAB
++    //if (m_client->window() != frame().window().window() ) return;
+     // needed for click to focus
+-    XGrabButton(display, Button1, AnyModifier,
+-                frame().window().window(), True, ButtonPressMask,
+-                GrabModeSync, GrabModeSync, None, None);
+-    XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
+-                  frame().window().window());
++    // grabbing async here breaks mouse1
++    //XGrabButton(display, Button1, AnyModifier,
++    //            frame().window().window(), True, ButtonPressMask,
++    //            GrabModeSync, GrabModeSync, None, None);
++    //            //GrabModeAsync, GrabModeAsync, None, None);
++    //XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
++    //              frame().window().window());
++    //XGrabPointer(display,
++    //             frame().window().window(),
++    //             True,
++    //             ButtonPressMask,
++    //             GrabModeAsync, GrabModeAsync,
++    //             None,
++    //             None,
++    //             CurrentTime);
++    //XUngrabPointer(display, CurrentTime);
+ }
+ 
+ 
+@@ -2429,63 +2441,41 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
+     m_last_pressed_button = be.button;
+ 
+     FbTk::Menu::hideShownMenu();
+-
++//FIX ALLOW
+     Keys *k = Fluxbox::instance()->keys();
+     int context = 0;
+     context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);
+     if (!context && be.subwindow)
+         context = frame().getContext(be.window);
+ 
+-    if (k->doAction(be.type, be.state, be.button, context, &winClient(), be.time)) {
+-        XAllowEvents(display, SyncPointer, CurrentTime);
+-        return;
+-    }
+-
+-    WinClient *client = 0;
+-    if (!screen().focusControl().isMouseTabFocus()) {
+-        // determine if we're in a label button (tab)
+-        client = winClientOfLabelButtonWindow(be.window);
+-    }
+-
+-
+-    // - refeed the event into the queue so the app or titlebar subwindow gets it
+-    if (be.subwindow)
+-        XAllowEvents(display, ReplayPointer, CurrentTime);
+-    else
+-        XAllowEvents(display, SyncPointer, CurrentTime);
+-
+-    // if nothing was bound via keys-file then
+-    // - raise() if clickRaise is enabled
+-    // - hide open menues
+-    // - focus on clickFocus
+-    if (frame().window().window() == be.window) {
+-        if (screen().clickRaises())
+-            raise();
+-
+-        m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
+-        m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
+-    }
+-
+-    if (!m_focused && acceptsFocus() && m_click_focus)
+-        focus();
+-
+-    if (!screen().focusControl().isMouseTabFocus() &&
+-        client && client != m_client &&
+-        !screen().focusControl().isIgnored(be.x_root, be.y_root) ) {
+-        setCurrentClient(*client, isFocused());
+-    }
+-
+-
+-
++std::cout << "button window: " << be.window << "\nbutton subwindow: " << be.subwindow << "\n";
++k->doAction(be.type, be.state, be.button, context, &winClient(), CurrentTime); // w/o this, no mouse cmds
++XAllowEvents(display, ReplayPointer, CurrentTime); // w/o this, no mouse
++// ultimately none of the below matters
++    // infinite loop
++    //if (be.subwindow) {
++    //  //XEvent omfg = (XEvent *)&be;
++    //  //be.window = be.subwindow;
++    //  //be.subwindow = 0;
++    //  int huh = XSendEvent(display, be.window, False, ButtonPressMask, (XEvent*)&be);
++    //  std::cout << "xsendevent: " << huh << "\n";
++    //}
++    //XSync(display, 0);
++    //int wtf = XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
++    //std::cout << "xallowevents: " << wtf << "\n";
++    //XSync(display, 0);
++    //XAllowEvents(display, ReplayPointer, be.time); // time means squat - works but not for menus
++    //XAllowEvents(display, SyncPointer, CurrentTime); // sync will not doubleclick or act proper
++    //XAllowEvents(display, AsyncPointer, CurrentTime); // ^^ same
++    //if (be.subwindow)
++    //  XFlush(display);
++    //  //XSync(display, True);
+ }
+ 
+ const unsigned int DEADZONE = 4;
+ 
+ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
+ 
+-    if (m_last_pressed_button == static_cast<int>(re.button)) {
+-        m_last_pressed_button = 0;
+-    }
+ 
+     if (isMoving())
+         stopMoving();
+@@ -2502,6 +2492,13 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
+ 
+         Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button,
+                                               context, &winClient(), re.time);
++      // syncs dont make a difference?
++      //XSync(display, 0);
++      XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
++      //XSync(display, 0);
++    }
++    if (m_last_pressed_button == static_cast<int>(re.button)) {
++        m_last_pressed_button = 0;
+     }
+ }
+ 
diff --git a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
new file mode 100644
index 000000000000..36c572cea4ff
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
@@ -0,0 +1,65 @@
+diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
+index c2e49485..9b4058c8 100644
+--- a/src/WorkspaceCmd.cc
++++ b/src/WorkspaceCmd.cc
+@@ -521,22 +521,24 @@ void ArrangeWindowsCmd::execute() {
+     const unsigned int cal_width = max_width/cols; // width ratio (width of every window)
+     const unsigned int cal_height = max_height/rows; // height ratio (height of every window)
+
++    int cell_center_x = 0, cell_center_y = 0, win_center_x = 0, win_center_y = 0, x = 0, y = 0;
++    unsigned int closest_dist = ~0, dist = 0, w = 0, h = 0;
+     // Resizes and sets windows positions in columns and rows.
+     for (i = 0; i < rows; ++i) {
+         x_offs = orig_x_offs;
+         for (j = 0; j < cols && !normal_windows.empty(); ++j) {
+
+
+-            int cell_center_x = x_offs + (x_offs + cal_width) / 2;
+-            int cell_center_y = y_offs + (y_offs + cal_height) / 2;
+-            unsigned int closest_dist = ~0;
++            cell_center_x = x_offs + (x_offs + cal_width) / 2;
++            cell_center_y = y_offs + (y_offs + cal_height) / 2;
++            int closest_dist = ~0;
+
+             Workspace::Windows::iterator closest = normal_windows.end();
+             for (win = normal_windows.begin(); win != normal_windows.end(); ++win) {
+
+-                int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
+-                int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
+-                unsigned int dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
++                win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
++                win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
++                dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
+                                     (win_center_y - cell_center_y) * (win_center_y - cell_center_y);
+
+                 if (dist < closest_dist) {
+@@ -545,10 +547,10 @@ void ArrangeWindowsCmd::execute() {
+                 }
+             }
+
+-            int x = x_offs + (*closest)->xOffset();
+-            int y = y_offs + (*closest)->yOffset();
+-            unsigned int w = cal_width - (*closest)->widthOffset();
+-            unsigned int h = cal_height - (*closest)->heightOffset();
++            x = x_offs + (*closest)->xOffset();
++            y = y_offs + (*closest)->yOffset();
++            w = cal_width - (*closest)->widthOffset();
++            h = cal_height - (*closest)->heightOffset();
+
+             // the last window gets everything that is left.
+             if (normal_windows.size() == 1) {
+@@ -620,12 +622,9 @@ void UnclutterCmd::execute() {
+         return;
+
+     // place
+-    MinOverlapPlacement mopp;
+     int x, y;
+-    for (win = placed_windows.begin(); win != placed_windows.end(); ++win) {
+-        mopp.placeWindow(**win, head, x, y);
+-        (*win)->move(x, y);
+-    }
++    for (win = placed_windows.begin(); win != placed_windows.end(); ++win)
++        (*win)->placeWindow((*win)->getOnHead());
+ }
+
+ REGISTER_COMMAND(showdesktop, ShowDesktopCmd, void);
diff --git a/srcpkgs/fluxbox/patches/zor_loops.patch b/srcpkgs/fluxbox/patches/zor_loops.patch
new file mode 100644
index 000000000000..95d992f9071d
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/zor_loops.patch
@@ -0,0 +1,87 @@
+diff --git a/src/FbTk/STLUtil.hh b/src/FbTk/STLUtil.hh
+index abc54729..9c9c27f9 100644
+--- a/src/FbTk/STLUtil.hh
++++ b/src/FbTk/STLUtil.hh
+@@ -48,46 +48,63 @@ struct IfThenElse<false, Ta, Tb> {
+ /// calls delete on each item in the container and then clears the container
+ template <typename A>
+ void destroyAndClear(A &a) {
+-    typedef typename A::iterator iterator;
+-    iterator it = a.begin();
+-    iterator it_end = a.end();
+-    for (; it != it_end; ++it)
+-        delete (*it);
++    //typedef typename A::iterator iterator;
++    //iterator it = a.begin();
++    //iterator it_end = a.end();
++    //for (; it != it_end; ++it)
++    //    delete (*it);
+ 
++    //a.clear();
++    typedef typename A::iterator iterator;
++    for (auto it : a)
++        delete it;
+     a.clear();
+ }
+ 
+ /// calls delete on each item value in the map and then clears the map
+ template <typename A>
+ void destroyAndClearSecond(A &a) {
++    //typedef typename A::iterator iterator;
++    //iterator it = a.begin();
++    //iterator it_end = a.end();
++    //for (; it != it_end; ++it)
++    //    delete it->second;
++    //a.clear();
+     typedef typename A::iterator iterator;
+-    iterator it = a.begin();
+-    iterator it_end = a.end();
+-    for (; it != it_end; ++it)
+-        delete it->second;
++    for (auto it : a)
++        delete it.second;
+     a.clear();
+ }
+ 
+ 
+ template <typename C, typename F>
+ F forAll(C& c, F f) {
++    //typedef typename C::iterator iterator;
++    //iterator i = c.begin();
++    //iterator e = c.end();
++    //for (; i != e; i++) {
++    //    f(*i);
++    //}
+     typedef typename C::iterator iterator;
+-    iterator i = c.begin();
+-    iterator e = c.end();
+-    for (; i != e; i++) {
+-        f(*i);
+-    }
++    for (auto i : c)
++        f(i);
+     return f;
+ }
+ 
+ template <typename C, typename I, typename F>
+ F forAllIf(C& c, I i, F f) {
++    //typedef typename C::iterator iterator;
++    //iterator it = c.begin();
++    //iterator end = c.end();
++    //for (; it != end; ++it) {
++    //    if (i(*it))
++    //        f(*it);
++    //}
++    //return f;
+     typedef typename C::iterator iterator;
+-    iterator it = c.begin();
+-    iterator end = c.end();
+-    for (; it != end; ++it) {
+-        if (i(*it))
+-            f(*it);
++    for (auto it : c) {
++        if (i(it))
++            f(it);
+     }
+     return f;
+ }
diff --git a/srcpkgs/fluxbox/template b/srcpkgs/fluxbox/template
index e10b426c4924..6b0e4cd260cb 100644
--- a/srcpkgs/fluxbox/template
+++ b/srcpkgs/fluxbox/template
@@ -1,29 +1,56 @@
 # Template file for 'fluxbox'
 pkgname=fluxbox
-version=1.3.7
-revision=4
+version=1.3.8
+#nostrip=nostrip
+_commit=e2cbd179ecb2ef2d76e0ad1fde84b44325305799
+revision=0
+wrksrc=fluxbox-${_commit}
 build_style=gnu-configure
-configure_args="--enable-nls
+configure_args="--disable-nls --disable-xinerama --disable-shape --disable-xrender
+ --disable-fribidi --disable-slit
  ac_cv_lib_X11_XOpenDisplay=yes ac_cv_lib_Xft_XftFontOpen=yes
  ac_cv_lib_Xrender_XRenderCreatePicture=yes ac_cv_lib_Xpm_XpmReadFileToPixmap=yes
- ac_cv_lib_Xinerama_XineramaQueryScreens=yes ac_cv_lib_Xext_XShapeCombineShape=yes
+ ac_cv_lib_Xext_XShapeCombineShape=no
  ac_cv_lib_Xrandr_XRRQueryExtension=yes ac_cv_lib_fribidi_fribidi_version_info=yes"
-hostmakedepends="pkg-config automake libtool gettext gettext-devel"
+hostmakedepends="pkg-config automake libtool gettext gettext-devel clang llvm"
 makedepends="libSM-devel libXrender-devel libXft-devel libXpm-devel imlib2-devel
- libXext-devel libXinerama-devel libXrandr-devel fribidi-devel"
+ libXext-devel libXrandr-devel fribidi-devel"
 short_desc="Highly configurable and low resource X11 Window manager"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="http://www.fluxbox.org"
-distfiles="https://github.com/fluxbox/fluxbox/archive/refs/tags/Release-${version//./_}.tar.gz"
-checksum=990414ae342a35c5703e5025a8bf019b0b4dada55d57071c51d3d498abb5cd36
+distfiles="https://github.com/fluxbox/fluxbox/archive/${_commit}.tar.gz"
+checksum=6740d9cd4a3e631e0130cbcbc91ccac6af6335dc120f9adc5ebbc8dc9d3259a0
+
+nopie=yes
+X11_FLAGS="-Os -pipe"
+#FRIBIDI_CFLAGS="-Os -pipe"
+XRANDR_CFLAGS="-Os -pipe"
+AM_CPPFLAGS="-Os -pipe"
+CFLAGS="-Os -pipe"
+CXXFLAGS="-Os -pipe -std=c++11"
+CC="clang"
+CXX="clang++"
+HOST_CC=clang
+HOST_CXX=clang++
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) configure_args="${configure_args/enable-nls/disable-nls}" ;;
 esac
 
 pre_configure() {
-	./autogen.sh
+  export X11_FLAGS="-Os -pipe"
+  # export FRIBIDI_CFLAGS="-Os -pipe"
+  export XRANDR_CFLAGS="-Os -pipe"
+  export AM_CPPFLAGS="-Os -pipe"
+  export CFLAGS="-Os -pipe"
+  export CXXFLAGS="-Os -pipe -std=c++11"
+  export CC="clang"
+  export CXX="clang++"
+  export HOST_CC=clang
+  export HOST_CXX=clang++
+  export PREFIX=/usr
+  ./autogen.sh
 }
 
 post_install() {
diff --git a/srcpkgs/libavcodec4 b/srcpkgs/libavcodec4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavcodec4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavdevice4 b/srcpkgs/libavdevice4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavdevice4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavfilter4 b/srcpkgs/libavfilter4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavfilter4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavformat4 b/srcpkgs/libavformat4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavformat4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample b/srcpkgs/libavresample
index a9f1eea092d5..887f354e7c6b 120000
--- a/srcpkgs/libavresample
+++ b/srcpkgs/libavresample
@@ -1 +1 @@
-ffmpeg
\ No newline at end of file
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample4 b/srcpkgs/libavresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavutil4 b/srcpkgs/libavutil4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavutil4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libpostproc4 b/srcpkgs/libpostproc4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libpostproc4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswresample4 b/srcpkgs/libswresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswscale4 b/srcpkgs/libswscale4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswscale4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..bdeb22b13aaa 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,12 +1,13 @@
 # Template file for 'mesa'
 pkgname=mesa
-version=22.3.5
+version=23.0.0
 revision=1
+#wrksrc="Mesa-dg2-20230125"
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
  -Dlmsensors=enabled -Dplatforms=x11$(vopt_if wayland ,wayland)
- -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++14"
+ -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++17"
 hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
@@ -22,11 +23,23 @@ license="MIT, LGPL-2.1-or-later"
 homepage="https://www.mesa3d.org/"
 changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
-checksum=3eed2ecae2bc674494566faab9fcc9beb21cd804c7ba2b59a1694f3d7236e6a9
+checksum=01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4
+# intel dg2 jan 25
+#checksum=4ec8ec65dbdb1ee9444dba72970890128a19543a58cf05931bd6f54f124e117f
+#checksum=37a1ddaf03f41919ee3c89c97cff41e87de96e00e9d3247959cc8279d8294593
+#distfiles="https://github.com/intel-gpu/Mesa/archive/refs/tags/dg2-20230125.tar.gz"
+#checksum=22203186779222ec5244ecb74fbae706d3557588c82089b18c7bf77a54799a59
 
 build_options="wayland"
 build_options_default="wayland"
 
+export CC=clang
+export CXX=clang++
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -Duse-elf-tls=false"
+fi
+
 # only use llvmpipe on targets where it's supported and reliable
 # especially on big endian it's all kinds of broken, and e.g. on
 # 32-bit powerpc it does not work at all, so fall back to softpipe
@@ -91,7 +104,7 @@ fi
 if [ "$_have_intel" ]; then
 	_have_vulkan=yes
 	_gallium_drivers+=",crocus,iris,i915"
-	_vulkan_drivers+=",intel,intel_hasvk"
+	_vulkan_drivers+=",intel"
 	subpackages+=" mesa-vulkan-intel"
 	# transitional dummy packages
 	subpackages+=" mesa-intel-dri"
@@ -140,10 +153,10 @@ fi
 
 # enabled currently by amd drivers
 if [ "$_have_opencl" ]; then
-	hostmakedepends+=" clang rust rust-bindgen"
-	makedepends+=" clang libclc rust SPIRV-LLVM-Translator-devel SPIRV-Tools-devel"
+	hostmakedepends+=" clang"
+	makedepends+=" clang libclc"
 	subpackages+=" mesa-opencl"
-	configure_args+=" -Dgallium-opencl=icd -Dgallium-rusticl=true -Drust_std=2021"
+	configure_args+=" -Dgallium-opencl=icd"
 fi
 
 if [ "$_have_hwdec" ]; then
@@ -187,7 +200,6 @@ esac
 post_configure() {
 	if [ "$CROSS_BUILD" ]; then
 		find -iname "*.ninja" -exec sed -i "{}" \
-			-e "/rustc/s; --sysroot ${XBPS_CROSS_BASE}/usr;;g" \
 			-e "s; /usr/lib/; ${XBPS_CROSS_BASE}/usr/lib/;g" \
 			-e "s;-L/usr/lib;-L${XBPS_CROSS_BASE}/usr/lib;g" \
 			-e "s;-I/usr/include;-I${XBPS_CROSS_BASE}/usr/include;g" \
@@ -286,7 +298,6 @@ MesaLib-devel_package() {
 		fi
 		if [ "$_have_opencl" ]; then
 			vmove usr/lib/libMesaOpenCL.so
-			vmove usr/lib/libRusticlOpenCL.so
 		fi
 	}
 }
@@ -305,7 +316,6 @@ mesa-opencl_package() {
 		vmove etc/OpenCL
 		vmove usr/lib/gallium-pipe
 		vmove "usr/lib/libMesaOpenCL.so.*"
-		vmove "usr/lib/libRusticlOpenCL.so.*"
 	}
 }
 
@@ -336,15 +346,14 @@ mesa-vdpau_package() {
 mesa-vulkan-intel_package() {
 	short_desc="Mesa Intel Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/vulkan/icd.d/intel*.json"
-		vmove "usr/lib/libvulkan_intel*.so"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
 mesa-vulkan-radeon_package() {
 	short_desc="Mesa Radeon Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/drirc.d/00-radv-defaults.conf"
 		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
 		vmove "usr/lib/libvulkan_radeon.so"
 	}

From 67b2aefebf41e6c55d20094c6ed107ac3e6f64d8 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 17:41:38 -0400
Subject: [PATCH 2/4] opencv: update to 4.7.0.

---
 common/shlibs                            | 104 +++++++++++------------
 srcpkgs/actiona/template                 |   2 +-
 srcpkgs/digikam/template                 |   2 +-
 srcpkgs/gmic/template                    |   2 +-
 srcpkgs/goldendict/patches/ffmpeg4.patch |  21 -----
 srcpkgs/nomacs/template                  |   2 +-
 srcpkgs/opencv/template                  |   8 +-
 srcpkgs/qimgv/template                   |   2 +-
 srcpkgs/retroshare/template              |   2 +-
 srcpkgs/siril/template                   |   2 +-
 srcpkgs/waifu2x-converter-cpp/template   |   2 +-
 11 files changed, 64 insertions(+), 85 deletions(-)
 delete mode 100644 srcpkgs/goldendict/patches/ffmpeg4.patch

diff --git a/common/shlibs b/common/shlibs
index aab66c83f4b3..a9d1c6a16ec6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2128,58 +2128,58 @@ libcapstone.so.4 capstone-4.0_1
 libhavege.so.2 libhaveged-1.9.11_1
 libnih.so.1 libnih-1.0.3_1
 libnih-dbus.so.1 libnih-1.0.3_1
-libopencv_quality.so.406 libopencv-4.6.0_1
-libopencv_reg.so.406 libopencv-4.6.0_1
-libopencv_surface_matching.so.406 libopencv-4.6.0_1
-libopencv_xphoto.so.406 libopencv-4.6.0_1
-libopencv_freetype.so.406 libopencv-4.6.0_1
-libopencv_fuzzy.so.406 libopencv-4.6.0_1
-libopencv_hfs.so.406 libopencv-4.6.0_1
-libopencv_img_hash.so.406 libopencv-4.6.0_1
-libopencv_line_descriptor.so.406 libopencv-4.6.0_1
-libopencv_saliency.so.406 libopencv-4.6.0_1
-libopencv_structured_light.so.406 libopencv-4.6.0_1
-libopencv_aruco.so.406 libopencv-4.6.0_1
-libopencv_bgsegm.so.406 libopencv-4.6.0_1
-libopencv_bioinspired.so.406 libopencv-4.6.0_1
-libopencv_ccalib.so.406 libopencv-4.6.0_1
-libopencv_face.so.406 libopencv-4.6.0_1
-libopencv_tracking.so.406 libopencv-4.6.0_1
-libopencv_xfeatures2d.so.406 libopencv-4.6.0_1
-libopencv_optflow.so.406 libopencv-4.6.0_1
-libopencv_ximgproc.so.406 libopencv-4.6.0_1
-libopencv_plot.so.406 libopencv-4.6.0_1
-libopencv_text.so.406 libopencv-4.6.0_1
-libopencv_ml.so.406 libopencv-4.6.0_1
-libopencv_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn.so.406 libopencv-4.6.0_1
-libopencv_shape.so.406 libopencv-4.6.0_1
-libopencv_stitching.so.406 libopencv-4.6.0_1
-libopencv_photo.so.406 libopencv-4.6.0_1
-libopencv_video.so.406 libopencv-4.6.0_1
-libopencv_calib3d.so.406 libopencv-4.6.0_1
-libopencv_features2d.so.406 libopencv-4.6.0_1
-libopencv_flann.so.406 libopencv-4.6.0_1
-libopencv_highgui.so.406 libopencv-4.6.0_1
-libopencv_videoio.so.406 libopencv-4.6.0_1
-libopencv_imgcodecs.so.406 libopencv-4.6.0_1
-libopencv_imgproc.so.406 libopencv-4.6.0_1
-libopencv_core.so.406 libopencv-4.6.0_1
-libopencv_superres.so.406 libopencv-4.6.0_1
-libopencv_videostab.so.406 libopencv-4.6.0_1
-libopencv_gapi.so.406 libopencv-4.6.0_1
-libopencv_xobjdetect.so.406 libopencv-4.6.0_1
-libopencv_datasets.so.406 libopencv-4.6.0_1
-libopencv_dnn_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn_superres.so.406 libopencv-4.6.0_1
-libopencv_dpm.so.406 libopencv-4.6.0_1
-libopencv_phase_unwrapping.so.406 libopencv-4.6.0_1
-libopencv_stereo.so.406 libopencv-4.6.0_1
-libopencv_rapid.so.406 libopencv-4.6.0_1
-libopencv_intensity_transform.so.406 libopencv-4.6.0_1
-libopencv_alphamat.so.406 libopencv-4.6.0_1
-libopencv_barcode.so.406 libopencv-4.6.0_1
-libopencv_mcc.so.406 libopencv-4.6.0_1
+libopencv_quality.so.407 libopencv-4.7.0_1
+libopencv_reg.so.407 libopencv-4.7.0_1
+libopencv_surface_matching.so.407 libopencv-4.7.0_1
+libopencv_xphoto.so.407 libopencv-4.7.0_1
+libopencv_freetype.so.407 libopencv-4.7.0_1
+libopencv_fuzzy.so.407 libopencv-4.7.0_1
+libopencv_hfs.so.407 libopencv-4.7.0_1
+libopencv_img_hash.so.407 libopencv-4.7.0_1
+libopencv_line_descriptor.so.407 libopencv-4.7.0_1
+libopencv_saliency.so.407 libopencv-4.7.0_1
+libopencv_structured_light.so.407 libopencv-4.7.0_1
+libopencv_aruco.so.407 libopencv-4.7.0_1
+libopencv_bgsegm.so.407 libopencv-4.7.0_1
+libopencv_bioinspired.so.407 libopencv-4.7.0_1
+libopencv_ccalib.so.407 libopencv-4.7.0_1
+libopencv_face.so.407 libopencv-4.7.0_1
+libopencv_tracking.so.407 libopencv-4.7.0_1
+libopencv_xfeatures2d.so.407 libopencv-4.7.0_1
+libopencv_optflow.so.407 libopencv-4.7.0_1
+libopencv_ximgproc.so.407 libopencv-4.7.0_1
+libopencv_plot.so.407 libopencv-4.7.0_1
+libopencv_text.so.407 libopencv-4.7.0_1
+libopencv_ml.so.407 libopencv-4.7.0_1
+libopencv_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn.so.407 libopencv-4.7.0_1
+libopencv_shape.so.407 libopencv-4.7.0_1
+libopencv_stitching.so.407 libopencv-4.7.0_1
+libopencv_photo.so.407 libopencv-4.7.0_1
+libopencv_video.so.407 libopencv-4.7.0_1
+libopencv_calib3d.so.407 libopencv-4.7.0_1
+libopencv_features2d.so.407 libopencv-4.7.0_1
+libopencv_flann.so.407 libopencv-4.7.0_1
+libopencv_highgui.so.407 libopencv-4.7.0_1
+libopencv_videoio.so.407 libopencv-4.7.0_1
+libopencv_imgcodecs.so.407 libopencv-4.7.0_1
+libopencv_imgproc.so.407 libopencv-4.7.0_1
+libopencv_core.so.407 libopencv-4.7.0_1
+libopencv_superres.so.407 libopencv-4.7.0_1
+libopencv_videostab.so.407 libopencv-4.7.0_1
+libopencv_gapi.so.407 libopencv-4.7.0_1
+libopencv_xobjdetect.so.407 libopencv-4.7.0_1
+libopencv_datasets.so.407 libopencv-4.7.0_1
+libopencv_dnn_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn_superres.so.407 libopencv-4.7.0_1
+libopencv_dpm.so.407 libopencv-4.7.0_1
+libopencv_phase_unwrapping.so.407 libopencv-4.7.0_1
+libopencv_stereo.so.407 libopencv-4.7.0_1
+libopencv_rapid.so.407 libopencv-4.7.0_1
+libopencv_intensity_transform.so.407 libopencv-4.7.0_1
+libopencv_alphamat.so.407 libopencv-4.7.0_1
+libopencv_barcode.so.407 libopencv-4.7.0_1
+libopencv_mcc.so.407 libopencv-4.7.0_1
 libuniconf.so.4.6 wvstreams-4.6.1_20
 libwvbase.so.4.6 wvstreams-4.6.1_20
 libwvutils.so.4.6 wvstreams-4.6.1_20
diff --git a/srcpkgs/actiona/template b/srcpkgs/actiona/template
index cf5f0b7a2ae6..0d899311e6df 100644
--- a/srcpkgs/actiona/template
+++ b/srcpkgs/actiona/template
@@ -1,7 +1,7 @@
 # Template file for 'actiona'
 pkgname=actiona
 version=3.10.1
-revision=2
+revision=3
 build_style=qmake
 configure_args="PKGCONFIG_OPENCV=opencv4"
 hostmakedepends="pkg-config qt5-plugin-mysql qt5-qmake qt5-host-tools"
diff --git a/srcpkgs/digikam/template b/srcpkgs/digikam/template
index e8ec4961457b..0a8984db85bc 100644
--- a/srcpkgs/digikam/template
+++ b/srcpkgs/digikam/template
@@ -1,7 +1,7 @@
 # Template file for 'digikam'
 pkgname=digikam
 version=7.10.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext pkg-config bison flex qt5-qmake
diff --git a/srcpkgs/gmic/template b/srcpkgs/gmic/template
index 8e3b80047f26..43c6e0672a2b 100644
--- a/srcpkgs/gmic/template
+++ b/srcpkgs/gmic/template
@@ -1,7 +1,7 @@
 # Template file for 'gmic'
 pkgname=gmic
 version=3.1.6
-revision=1
+revision=2
 _zart_hash=34ebf6cce0bafb98abe57cec83c4a02cd1abeca0
 create_wrksrc=yes
 build_wrksrc="src"
diff --git a/srcpkgs/goldendict/patches/ffmpeg4.patch b/srcpkgs/goldendict/patches/ffmpeg4.patch
deleted file mode 100644
index f045fa27f54b..000000000000
--- a/srcpkgs/goldendict/patches/ffmpeg4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ffmpegaudio.cc.orig 2018-05-09 22:16:13.480659958 +0200
-+++ b/ffmpegaudio.cc      2018-05-09 22:16:50.748322790 +0200
-@@ -143,7 +143,7 @@
-     return false;
-   }
-
--  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
-+  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
-   if ( !avioBuffer )
-   {
-     errorString = QObject::tr( "av_malloc() failed." );
-@@ -380,7 +380,7 @@
-   }
-
-   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
--       codecContext_->codec->capabilities & CODEC_CAP_DELAY )
-+       codecContext_->codec->capabilities & AV_CODEC_CAP_DELAY )
-   {
-     av_init_packet( &packet );
-     int gotFrame = 0;
-
diff --git a/srcpkgs/nomacs/template b/srcpkgs/nomacs/template
index 895e83071a8a..ce4e7f7093da 100644
--- a/srcpkgs/nomacs/template
+++ b/srcpkgs/nomacs/template
@@ -1,7 +1,7 @@
 # Template file for 'nomacs'
 pkgname=nomacs
 version=3.16.224
-revision=3
+revision=4
 build_wrksrc=ImageLounge
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_TRANSLATIONS=1
diff --git a/srcpkgs/opencv/template b/srcpkgs/opencv/template
index a09b8dd0d449..41f3183f1582 100644
--- a/srcpkgs/opencv/template
+++ b/srcpkgs/opencv/template
@@ -1,7 +1,7 @@
 # Template file for 'opencv'
 pkgname=opencv
-version=4.6.0
-revision=3
+version=4.7.0
+revision=1
 create_wrksrc=yes
 build_wrksrc=${pkgname}-${version}
 build_style=cmake
@@ -24,8 +24,8 @@ homepage="https://opencv.org"
 changelog="https://github.com/opencv/opencv/wiki/ChangeLog"
 distfiles="https://github.com/opencv/opencv/archive/${version}.tar.gz
  https://github.com/opencv/opencv_contrib/archive/${version}.tar.gz>contrib.tar.gz"
-checksum="1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
- 1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7"
+checksum="8df0079cdbe179748a18d44731af62a245a45ebf5085223dc03133954c662973
+ 42df840cf9055e59d0e22c249cfb19f04743e1bdad113d31b1573d3934d62584"
 patch_args="-Np1 -d ${build_wrksrc}"
 # tests hang indenfinitely, even with test data included
 make_check=no
diff --git a/srcpkgs/qimgv/template b/srcpkgs/qimgv/template
index 7eb30db33992..dd341dfe1bfc 100644
--- a/srcpkgs/qimgv/template
+++ b/srcpkgs/qimgv/template
@@ -1,7 +1,7 @@
 # Template file for 'qimgv'
 pkgname=qimgv
 version=1.0.2
-revision=2
+revision=3
 build_style=cmake
 configure_args="$(vopt_if video -DVIDEO_SUPPORT=ON -DVIDEO_SUPPORT=OFF)
  $(vopt_if scale -DOPENCV_SUPPORT=ON -DOPENCV_SUPPORT=OFF)
diff --git a/srcpkgs/retroshare/template b/srcpkgs/retroshare/template
index 8a0786c21a08..72023fa98b75 100644
--- a/srcpkgs/retroshare/template
+++ b/srcpkgs/retroshare/template
@@ -1,7 +1,7 @@
 # Template file for 'retroshare'
 pkgname=retroshare
 version=0.6.6
-revision=2
+revision=4
 build_style=qmake
 #XXX broadcast feature requires an ancient udp-discovery-cpp which either needs
 # to be fetched+patched (FTBFS) here or packaged :/
diff --git a/srcpkgs/siril/template b/srcpkgs/siril/template
index e06aa5d0559c..84332f79d060 100644
--- a/srcpkgs/siril/template
+++ b/srcpkgs/siril/template
@@ -1,7 +1,7 @@
 # Template file for 'siril'
 pkgname=siril
 version=0.9.12
-revision=8
+revision=10
 build_style=gnu-configure
 hostmakedepends="pkg-config intltool autoconf automake gettext-devel"
 makedepends="fftw-devel libconfig-devel libopencv-devel libffms2-devel
diff --git a/srcpkgs/waifu2x-converter-cpp/template b/srcpkgs/waifu2x-converter-cpp/template
index 8c095d0d7bab..aa52d8c981a8 100644
--- a/srcpkgs/waifu2x-converter-cpp/template
+++ b/srcpkgs/waifu2x-converter-cpp/template
@@ -1,7 +1,7 @@
 # Template file for 'waifu2x-converter-cpp'
 pkgname=waifu2x-converter-cpp
 version=5.2.4
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DINSTALL_MODELS=ON"
 hostmakedepends="pkg-config"

From deb1b4d1f9786d58c3fad3807b9cb7a1a46b119c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 18:07:58 -0400
Subject: [PATCH 3/4] ffmpeg4 bumps

---
 srcpkgs/osg/template      | 4 ++--
 srcpkgs/vlc/template      | 4 ++--
 srcpkgs/xine-lib/template | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index 1a031448b3cf..755793f7e11b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,14 +1,14 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms
 configure_args="-DLIB_POSTFIX="
 hostmakedepends="pkg-config xrandr"
 makedepends="MesaLib-devel gtkglext-devel libcurl-devel giflib-devel librsvg-devel
- jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg-devel xine-lib-devel
+ jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg4-devel xine-lib-devel
  SDL2-devel gst-plugins-base1-devel
  $(vopt_if openexr libopenexr-devel)
  $(vopt_if poppler poppler-glib-devel)
diff --git a/srcpkgs/vlc/template b/srcpkgs/vlc/template
index 210762b0a7e2..855ca5238662 100644
--- a/srcpkgs/vlc/template
+++ b/srcpkgs/vlc/template
@@ -1,7 +1,7 @@
 # Template file for 'vlc'
 pkgname=vlc
 version=3.0.18
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-gme --disable-libtar --enable-jack
  --enable-live555 --disable-fluidsynth --enable-dvdread
@@ -25,7 +25,7 @@ lib32disabled=yes
 hostmakedepends="automake libtool pkg-config flex gettext libgcrypt-devel
  live555-devel gettext-devel $(vopt_if lua lua52) $(vopt_if chromecast protobuf)"
 makedepends="
- avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg-devel freefont-ttf
+ avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg4-devel freefont-ttf
  gnutls-devel jack-devel liba52-devel libass-devel libbluray-devel
  libcdio-devel libdca-devel libdvbpsi-devel libdvdnav-devel libmad-devel
  libmatroska-devel libmodplug-devel libmpcdec-devel libmpeg2-devel
diff --git a/srcpkgs/xine-lib/template b/srcpkgs/xine-lib/template
index f713eff49b07..ed6194c17d11 100644
--- a/srcpkgs/xine-lib/template
+++ b/srcpkgs/xine-lib/template
@@ -1,6 +1,6 @@
 # Template file for 'xine-lib'
 pkgname=xine-lib
-version=1.2.12
+version=1.2.13
 revision=1
 build_style=gnu-configure
 configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
@@ -8,7 +8,7 @@ configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
 hostmakedepends="automake gettext-devel libtool pkg-config perl"
 makedepends="
  zlib-devel alsa-lib-devel libxcb-devel libSM-devel libXext-devel libXv-devel
- libXvMC-devel liba52-devel libmad-devel ffmpeg-devel pulseaudio-devel
+ libXvMC-devel liba52-devel libmad-devel ffmpeg4-devel pulseaudio-devel
  jack-devel samba-devel libflac-devel libmodplug-devel libmpcdec-devel
  speex-devel libtheora-devel libvorbis-devel libdca-devel faad2-devel
  libcdio-devel libbluray-devel aalib-devel libcaca-devel libXinerama-devel
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="http://www.xine-project.org"
 changelog="https://sourceforge.net/projects/xine/files/xine-lib/${version}/README.txt/view"
 distfiles="${SOURCEFORGE_SITE}/xine/${pkgname}-${version}.tar.xz"
-checksum=d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098
+checksum=5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f
 
 case "$XBPS_TARGET_MACHINE" in
 	i686-musl)

From ff0bb807e956a3096eac9487dff18fafa29fff95 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 18:08:05 -0400
Subject: [PATCH 4/4] ffmpeg5 bumps

---
 srcpkgs/QMPlay2/template                      |   2 +-
 srcpkgs/alsa-plugins/template                 |   2 +-
 srcpkgs/arcan/template                        |   2 +-
 srcpkgs/attract/template                      |   2 +-
 srcpkgs/aubio/patches/ffmpeg5.patch           |  37 ++
 srcpkgs/aubio/template                        |   2 +-
 .../audacious-plugins/patches/ffmpeg5.patch   |  43 ++
 srcpkgs/audacious-plugins/template            |   2 +-
 srcpkgs/audacity/template                     |   3 +-
 srcpkgs/avidemux/template                     |   2 +-
 srcpkgs/baresip/template                      |   2 +-
 srcpkgs/blender/template                      |   2 +-
 srcpkgs/cantata/template                      |   2 +-
 srcpkgs/ccextractor/template                  |   2 +-
 srcpkgs/chromaprint/patches/ffmpeg5.patch     | 569 ++++++++++++++++++
 srcpkgs/chromaprint/template                  |   2 +-
 srcpkgs/chromium/template                     |   2 +-
 srcpkgs/cmus/template                         |   2 +-
 srcpkgs/cyanrip/template                      |   2 +-
 srcpkgs/deadbeef/template                     |   2 +-
 srcpkgs/dolphin-emu/template                  |   2 +-
 srcpkgs/droidcam-obs-plugin/template          |   2 +-
 srcpkgs/droidcam/template                     |   2 +-
 srcpkgs/electron19/template                   |   2 +-
 srcpkgs/ffmpeg/template                       | 166 +++--
 srcpkgs/ffmpeg4/template                      |  46 +-
 srcpkgs/ffmpegthumbnailer/template            |   6 +-
 srcpkgs/ffmpegthumbs/template                 |   2 +-
 srcpkgs/ffms2/patches/ffmpeg5.patch           | 419 +++++++++++++
 srcpkgs/ffms2/template                        |   2 +-
 ...Fix-infinite-loop-in-Menu-cycleitems.patch |  60 --
 ...6c4d30f5b289c429c5ca88d800200db4fc4f.patch |  23 +
 .../MinOverlapPlacement.cc_improve.patch      |  29 -
 srcpkgs/fluxbox/patches/center.patch          | 307 ----------
 srcpkgs/fluxbox/patches/container_locks.patch | 325 ----------
 .../patches/container_relative_relative.patch |  15 -
 srcpkgs/fluxbox/patches/flux_improve.patch    | 205 -------
 srcpkgs/fluxbox/patches/flux_oversize.patch   |  24 -
 .../fluxbox/patches/focus_close_menu.patch    |  17 -
 srcpkgs/fluxbox/patches/slit_raise.patch      |  16 -
 srcpkgs/fluxbox/patches/toolbar_redo.patch    | 228 -------
 .../fluxbox/patches/tremor_graboid_hell.patch | 350 -----------
 .../patches/unclutter_fix_workspacecmd.patch  |  65 --
 srcpkgs/fluxbox/patches/zor_loops.patch       |  87 ---
 srcpkgs/fluxbox/template                      |  45 +-
 srcpkgs/freerdp/template                      |   2 +-
 srcpkgs/gerbera/template                      |   2 +-
 srcpkgs/goldendict/patches/ffmpeg5-1.patch    | 232 +++++++
 srcpkgs/goldendict/patches/ffmpeg5-2.patch    |  33 +
 srcpkgs/goldendict/patches/ffmpeg5-3.patch    |  25 +
 srcpkgs/goldendict/template                   |   2 +-
 srcpkgs/gst-libav/template                    |   2 +-
 srcpkgs/gst-plugins-bad1/template             |   2 +-
 srcpkgs/gst-rtsp-server/template              |   2 +-
 srcpkgs/gtk4/template                         |   2 +-
 srcpkgs/guvcview/template                     |   2 +-
 srcpkgs/handbrake/template                    |   2 +-
 srcpkgs/hedgewars/template                    |   2 +-
 srcpkgs/idjc/template                         |   2 +-
 srcpkgs/kfilemetadata5/template               |   2 +-
 srcpkgs/kid3/template                         |   2 +-
 srcpkgs/kodi/template                         |   2 +-
 srcpkgs/kpipewire/template                    |   2 +-
 srcpkgs/libavresample                         |   2 +-
 srcpkgs/libextractor/template                 |   2 +-
 srcpkgs/libopenal/template                    |   2 +-
 srcpkgs/libopenshot/template                  |   2 +-
 srcpkgs/loudgain/template                     |   2 +-
 srcpkgs/mediastreamer/template                |   2 +-
 srcpkgs/mgba/patches/ffmpeg5.patch            | 117 ++++
 srcpkgs/mgba/template                         |   2 +-
 srcpkgs/minidlna/template                     |   2 +-
 srcpkgs/mixxx/template                        |   2 +-
 srcpkgs/mlt/template                          |   2 +-
 srcpkgs/mlt7/template                         |   2 +-
 srcpkgs/moc/template                          |   2 +-
 srcpkgs/motion/template                       |   2 +-
 srcpkgs/mpd/template                          |   2 +-
 srcpkgs/mpv/template                          |   2 +-
 srcpkgs/musikcube/template                    |   2 +-
 srcpkgs/notcurses/template                    |   2 +-
 srcpkgs/obs/template                          |   2 +-
 srcpkgs/olive/template                        |   2 +-
 srcpkgs/omxplayer/template                    |   2 +-
 srcpkgs/openimageio/template                  |   2 +-
 srcpkgs/openmw/template                       |   2 +-
 srcpkgs/openshot/template                     |   2 +-
 srcpkgs/opentoonz/template                    |   2 +-
 srcpkgs/pianobar/template                     |   2 +-
 srcpkgs/ppsspp/template                       |   2 +-
 srcpkgs/pqiv/template                         |   2 +-
 srcpkgs/qmmp/template                         |   2 +-
 srcpkgs/qt5-webengine/template                |   2 +-
 srcpkgs/qt5/template                          |   2 +-
 srcpkgs/qt6-multimedia/template               |   2 +-
 srcpkgs/qt6-webengine/template                |   2 +-
 srcpkgs/qtav/template                         |   2 +-
 srcpkgs/qtox/patches/ffmpeg5.patch            |  79 +++
 srcpkgs/qtox/template                         |   2 +-
 srcpkgs/retroarch/template                    |   2 +-
 srcpkgs/scrcpy/template                       |   2 +-
 srcpkgs/spek-alternative/template             |   2 +-
 srcpkgs/ssr/template                          |   2 +-
 srcpkgs/sumo/template                         |   2 +-
 srcpkgs/synfig/template                       |   2 +-
 srcpkgs/telegram-desktop/template             |   2 +-
 srcpkgs/tg_owt/template                       |   2 +-
 srcpkgs/timg/template                         |   2 +-
 srcpkgs/tracker-miners/template               |   2 +-
 srcpkgs/tvheadend/template                    |   2 +-
 srcpkgs/unpaper/template                      |   2 +-
 srcpkgs/vba-m/template                        |   2 +-
 srcpkgs/vice/template                         |   2 +-
 srcpkgs/waypipe/template                      |   2 +-
 srcpkgs/wf-recorder/template                  |   2 +-
 srcpkgs/xpra/template                         |   2 +-
 116 files changed, 1753 insertions(+), 1994 deletions(-)
 create mode 100644 srcpkgs/aubio/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/audacious-plugins/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/chromaprint/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/ffms2/patches/ffmpeg5.patch
 delete mode 100644 srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
 create mode 100644 srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
 delete mode 100644 srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
 delete mode 100644 srcpkgs/fluxbox/patches/center.patch
 delete mode 100644 srcpkgs/fluxbox/patches/container_locks.patch
 delete mode 100644 srcpkgs/fluxbox/patches/container_relative_relative.patch
 delete mode 100644 srcpkgs/fluxbox/patches/flux_improve.patch
 delete mode 100644 srcpkgs/fluxbox/patches/flux_oversize.patch
 delete mode 100644 srcpkgs/fluxbox/patches/focus_close_menu.patch
 delete mode 100644 srcpkgs/fluxbox/patches/slit_raise.patch
 delete mode 100644 srcpkgs/fluxbox/patches/toolbar_redo.patch
 delete mode 100644 srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
 delete mode 100644 srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
 delete mode 100644 srcpkgs/fluxbox/patches/zor_loops.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-1.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-2.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-3.patch
 create mode 100644 srcpkgs/mgba/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/qtox/patches/ffmpeg5.patch

diff --git a/srcpkgs/QMPlay2/template b/srcpkgs/QMPlay2/template
index ad73cbb01bae..55284c051161 100644
--- a/srcpkgs/QMPlay2/template
+++ b/srcpkgs/QMPlay2/template
@@ -1,7 +1,7 @@
 # Template file for 'QMPlay2'
 pkgname=QMPlay2
 version=23.02.05
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="alsa-lib-devel ffmpeg-devel libass-devel libcdio-devel libgme-devel
diff --git a/srcpkgs/alsa-plugins/template b/srcpkgs/alsa-plugins/template
index 0bfa6d9fd264..a5708a7d82a8 100644
--- a/srcpkgs/alsa-plugins/template
+++ b/srcpkgs/alsa-plugins/template
@@ -1,7 +1,7 @@
 # Template file for 'alsa-plugins'
 pkgname=alsa-plugins
 version=1.2.7.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-maemo-plugin"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/arcan/template b/srcpkgs/arcan/template
index 7be9652eccf3..ccc7df11ceac 100644
--- a/srcpkgs/arcan/template
+++ b/srcpkgs/arcan/template
@@ -2,7 +2,7 @@
 # !! keep synced with: acfgfs aclip aloadimage
 pkgname=arcan
 version=0.6.2.1
-revision=1
+revision=2
 create_wrksrc=yes
 build_wrksrc=arcan/src
 build_style=cmake
diff --git a/srcpkgs/attract/template b/srcpkgs/attract/template
index 26144e931a3c..24017d2bacc2 100644
--- a/srcpkgs/attract/template
+++ b/srcpkgs/attract/template
@@ -1,7 +1,7 @@
 # Template file for 'attract'
 pkgname=attract
 version=2.6.2
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="VERBOSE=1"
 make_use_env=yes
diff --git a/srcpkgs/aubio/patches/ffmpeg5.patch b/srcpkgs/aubio/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a2c8e11ecff0
--- /dev/null
+++ b/srcpkgs/aubio/patches/ffmpeg5.patch
@@ -0,0 +1,37 @@
+commit 35eee003f034a1a2097cd4557deb773eacb18f7b
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:11 2022 +0100
+
+    aubio: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/aubio/patches/ffmpeg-5.0.patch b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..aace41a6e6
+--- /dev/null
++++ b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,25 @@
++From 8a05420e5dd8c7b8b2447f82dc919765876511b3 Mon Sep 17 00:00:00 2001
++From: Paul Brossier <piem@piem.org>
++Date: Tue, 25 Jan 2022 18:30:27 +0100
++Subject: [PATCH] [source_avcodec] define FF_API_LAVF_AVCTX for libavcodec >
++ 59, thx @berolinux (closes gh-353)
++
++---
++ src/io/source_avcodec.c | 4 ++++
++ 1 file changed, 4 insertions(+)
++
++diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c
++index e0ae93b5..1421bd9a 100644
++--- a/src/io/source_avcodec.c
+++++ b/src/io/source_avcodec.c
++@@ -68,6 +68,10 @@
++ #define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
++ #endif
++ 
+++#if LIBAVCODEC_VERSION_MAJOR >= 59
+++#define FF_API_LAVF_AVCTX 1
+++#endif
+++
++ struct _aubio_source_avcodec_t {
++   uint_t hop_size;
++   uint_t samplerate;
diff --git a/srcpkgs/aubio/template b/srcpkgs/aubio/template
index ad1c4b256991..7d875cc02541 100644
--- a/srcpkgs/aubio/template
+++ b/srcpkgs/aubio/template
@@ -1,7 +1,7 @@
 # Template file for 'aubio'
 pkgname=aubio
 version=0.4.9
-revision=1
+revision=2
 build_style=waf3
 # XXX lash, pure and swig support.
 hostmakedepends="pkg-config txt2man"
diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg5.patch b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..4e5e34099d71
--- /dev/null
+++ b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
@@ -0,0 +1,43 @@
+commit 298aa371c56c2f52c25a33d9bdec4918b11cebdc
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:12 2022 +0100
+
+    audacious-plugins: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..617c11215b
+--- /dev/null
++++ b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,31 @@
++From f60beb400eeb1e4778bbfd738bc4a4ccef3de539 Mon Sep 17 00:00:00 2001
++From: John Lindgren <john@jlindgren.net>
++Date: Sat, 5 Mar 2022 12:05:34 -0500
++Subject: [PATCH] Fix build with FFmpeg 5.0
++
++---
++ src/ffaudio/ffaudio-core.cc | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/src/ffaudio/ffaudio-core.cc b/src/ffaudio/ffaudio-core.cc
++index 16dc63e3a..a2b95fd6c 100644
++--- a/src/ffaudio/ffaudio-core.cc
+++++ b/src/ffaudio/ffaudio-core.cc
++@@ -274,7 +274,7 @@ static AVInputFormat * get_format_by_content (const char * name, VFSFile & file)
++         AVProbeData d = {name, buf, filled};
++         score = target;
++ 
++-        f = av_probe_input_format2 (& d, true, & score);
+++        f = (AVInputFormat *) av_probe_input_format2 (& d, true, & score);
++         if (f)
++             break;
++ 
++@@ -347,7 +347,7 @@ static bool find_codec (AVFormatContext * c, CodecInfo * cinfo)
++ #endif
++         if (stream && stream->codecpar && stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
++         {
++-            AVCodec * codec = avcodec_find_decoder (stream->codecpar->codec_id);
+++            AVCodec * codec = (AVCodec *) avcodec_find_decoder (stream->codecpar->codec_id);
++ 
++             if (codec)
++             {
diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template
index 910ec0d1891f..def0678bc611 100644
--- a/srcpkgs/audacious-plugins/template
+++ b/srcpkgs/audacious-plugins/template
@@ -2,7 +2,7 @@
 #Keep in sync with audacious!
 pkgname=audacious-plugins
 version=4.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="$(vopt_enable gtk) $(vopt_enable qt)"
 hostmakedepends="gettext pkg-config glib-devel"
diff --git a/srcpkgs/audacity/template b/srcpkgs/audacity/template
index d509c0a89407..c18a4eeb0a73 100644
--- a/srcpkgs/audacity/template
+++ b/srcpkgs/audacity/template
@@ -1,7 +1,7 @@
 # Template file for 'audacity'
 pkgname=audacity
 version=2.4.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--with-ffmpeg=system --with-libsndfile=system --with-expat=system
  --with-libsoxr=system --with-lame=system --with-lv2=system ac_cv_path_WX_CONFIG=wx-config-gtk3"
@@ -33,5 +33,4 @@ post_install() {
 	vcopy plug-ins /usr/share/audacity
 
 	rm ${DESTDIR}/usr/share/doc/audacity/LICENSE.txt
-	vlicense LICENSE.txt LICENSE
 }
diff --git a/srcpkgs/avidemux/template b/srcpkgs/avidemux/template
index 253a0243e225..557285982d2b 100644
--- a/srcpkgs/avidemux/template
+++ b/srcpkgs/avidemux/template
@@ -1,7 +1,7 @@
 # Template file for 'avidemux'
 pkgname=avidemux
 version=2.8.0
-revision=2
+revision=3
 # Can't be compiled for aarch64, arm* or mips*
 archs="x86_64* i686*"
 hostmakedepends="cmake pkg-config qt5-host-tools qt5-devel tar yasm"
diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index f1bd1817048b..b21e22334316 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=2.10.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel
diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index a3255cddbc95..4ec73e05acf5 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
 # Template file for 'blender'
 pkgname=blender
 version=3.4.1
-revision=1
+revision=2
 archs="x86_64* ppc64*"
 build_style="cmake"
 pycompile_dirs="/usr/share/blender/${version%.*}/scripts"
diff --git a/srcpkgs/cantata/template b/srcpkgs/cantata/template
index 4b417d80d5c2..8a90aaa4c07a 100644
--- a/srcpkgs/cantata/template
+++ b/srcpkgs/cantata/template
@@ -1,7 +1,7 @@
 # Template file for 'cantata'
 pkgname=cantata
 version=2.5.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools qt5-tools"
 makedepends="qt5-devel qt5-tools-devel qt5-svg-devel qt5-xmlpatterns-devel
diff --git a/srcpkgs/ccextractor/template b/srcpkgs/ccextractor/template
index 9abcd82852b2..7fe2ba4f27b6 100644
--- a/srcpkgs/ccextractor/template
+++ b/srcpkgs/ccextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'ccextractor'
 pkgname=ccextractor
 version=0.93
-revision=1
+revision=2
 build_wrksrc="linux"
 build_style=gnu-configure
 configure_args="--enable-ocr --enable-hardsubx"
diff --git a/srcpkgs/chromaprint/patches/ffmpeg5.patch b/srcpkgs/chromaprint/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a9fd307a23c8
--- /dev/null
+++ b/srcpkgs/chromaprint/patches/ffmpeg5.patch
@@ -0,0 +1,569 @@
+From 8ccad6937177b1b92e40ab8f4447ea27bac009a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
+Date: Fri, 4 Nov 2022 21:47:38 +0100
+Subject: [PATCH] Use FFmpeg 5.x (#120)
+
+* Use FFmpeg 5.1.2 for CI builds
+
+* Build on Ubuntu 20.04
+
+* Upgrade code to FFmpeg 5.x APIs
+
+* Only set FFmpeg include dirs if building tools
+
+* No longer needed
+
+* Use ubuntu 20.04
+---
+ .github/workflows/build.yml                   |   6 +-
+ CMakeLists.txt                                |  16 --
+ package/build.sh                              |   4 +-
+ src/audio/ffmpeg_audio_processor.h            |   2 -
+ src/audio/ffmpeg_audio_processor_avresample.h |  72 -------
+ src/audio/ffmpeg_audio_processor_swresample.h |  18 +-
+ src/audio/ffmpeg_audio_reader.h               | 197 +++++++++---------
+ tests/CMakeLists.txt                          |   6 +
+ 8 files changed, 122 insertions(+), 199 deletions(-)
+ delete mode 100644 src/audio/ffmpeg_audio_processor_avresample.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8d6a32..4da2405 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -84,9 +84,6 @@ find_package(FFmpeg)
+ if(FFMPEG_LIBRARIES)
+ 	cmake_push_check_state(RESET)
+ 	set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lm)
+-	check_function_exists(av_packet_unref HAVE_AV_PACKET_UNREF)
+-	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
+-	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
+ 	cmake_pop_check_state()
+ endif()
+
+@@ -163,14 +160,11 @@ message(STATUS "Using ${FFT_LIB} for FFT calculations")
+ if(NOT AUDIO_PROCESSOR_LIB)
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+ 		set(AUDIO_PROCESSOR_LIB "swresample")
+-	elseif(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(AUDIO_PROCESSOR_LIB "avresample")
+ 	endif()
+ endif()
+
+ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE OFF)
+ 		set(USE_SWRESAMPLE ON)
+ 		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+ 		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS})
+@@ -178,16 +172,6 @@ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+ 	endif()
+ 	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+-elseif(AUDIO_PROCESSOR_LIB STREQUAL "avresample")
+-	if(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE ON)
+-		set(USE_SWRESAMPLE OFF)
+-		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBAVRESAMPLE_LIBRARIES})
+-		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS})
+-	else()
+-		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+-	endif()
+-	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+ else()
+ 	message(STATUS "Building without audio conversion support, please install FFmpeg with libswresample")
+ endif()
+diff --git a/package/build.sh b/package/build.sh
+index da631ae..b41d36e 100755
+--- a/package/build.sh
++++ b/package/build.sh
+@@ -7,8 +7,8 @@ set -eux
+
+ BASE_DIR=$(cd $(dirname $0)/.. && pwd)
+
+-FFMPEG_VERSION=4.4.1
+-FFMPEG_BUILD_TAG=v4.4.1-1
++FFMPEG_VERSION=5.1.2
++FFMPEG_BUILD_TAG=v${FFMPEG_VERSION}-1
+
+ TMP_BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX)
+ trap 'rm -rf $TMP_BUILD_DIR' EXIT
+diff --git a/src/audio/ffmpeg_audio_processor.h b/src/audio/ffmpeg_audio_processor.h
+index 7628fc7..39f4f6d 100644
+--- a/src/audio/ffmpeg_audio_processor.h
++++ b/src/audio/ffmpeg_audio_processor.h
+@@ -10,8 +10,6 @@
+
+ #if defined(USE_SWRESAMPLE)
+ #include "audio/ffmpeg_audio_processor_swresample.h"
+-#elif defined(USE_AVRESAMPLE)
+-#include "audio/ffmpeg_audio_processor_avresample.h"
+ #else
+ #error "no audio processing library"
+ #endif
+diff --git a/src/audio/ffmpeg_audio_processor_avresample.h b/src/audio/ffmpeg_audio_processor_avresample.h
+deleted file mode 100644
+index bd85f92..0000000
+--- a/src/audio/ffmpeg_audio_processor_avresample.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-// Copyright (C) 2016  Lukas Lalinsky
+-// Distributed under the MIT license, see the LICENSE file for details.
+-
+-#ifndef CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-#define CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-
+-extern "C" {
+-#include <libavresample/avresample.h>
+-}
+-
+-namespace chromaprint {
+-
+-class FFmpegAudioProcessor {
+-public:
+-	FFmpegAudioProcessor() {
+-		m_resample_ctx = avresample_alloc_context();
+-	}
+-
+-	~FFmpegAudioProcessor() {
+-		avresample_free(&m_resample_ctx);
+-	}
+-
+-	void SetCompatibleMode() {
+-		av_opt_set_int(m_resample_ctx, "filter_size", 16, 0);
+-		av_opt_set_int(m_resample_ctx, "phase_shift", 8, 0);
+-		av_opt_set_int(m_resample_ctx, "linear_interp", 1, 0);
+-		av_opt_set_double(m_resample_ctx, "cutoff", 0.8, 0);
+-	}
+-
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "in_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_rate", sample_rate, 0);
+-	}
+-
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "out_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_rate, 0);
+-	}
+-
+-	int Init() {
+-		return avresample_open(m_resample_ctx);
+-	}
+-
+-	int Convert(uint8_t **out, int out_count, const uint8_t **in, int in_count) {
+-		return avresample_convert(m_resample_ctx, out, 0, out_count, (uint8_t **) in, 0, in_count);
+-	}
+-
+-	int Flush(uint8_t **out, int out_count) {
+-		return avresample_read(m_resample_ctx, out, out_count);
+-	}
+-
+-private:
+-	AVAudioResampleContext *m_resample_ctx = nullptr;
+-};
+-
+-}; // namespace chromaprint
+-
+-#endif
+diff --git a/src/audio/ffmpeg_audio_processor_swresample.h b/src/audio/ffmpeg_audio_processor_swresample.h
+index b86266b..b1d4bea 100644
+--- a/src/audio/ffmpeg_audio_processor_swresample.h
++++ b/src/audio/ffmpeg_audio_processor_swresample.h
+@@ -28,30 +28,28 @@ public:
+ 		av_opt_set_double(m_swr_ctx, "cutoff", 0.8, 0);
+ 	}
+
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "icl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "ich", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetInputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "isf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "in_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "isr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "in_sample_rate", sample_rate, 0);
+ 	}
+
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "ocl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "och", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "osf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "out_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "osr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "out_sample_rate", sample_rate, 0);
+ 	}
+
+ 	int Init() {
+diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h
+index 5550164..1c6b346 100644
+--- a/src/audio/ffmpeg_audio_reader.h
++++ b/src/audio/ffmpeg_audio_reader.h
+@@ -62,7 +62,7 @@ public:
+ 	bool Read(const int16_t **data, size_t *size);
+
+ 	bool IsOpen() const { return m_opened; }
+-	bool IsFinished() const { return m_finished && !m_got_frame; }
++	bool IsFinished() const { return !m_has_more_packets && !m_has_more_frames; }
+
+ 	std::string GetError() const { return m_error; }
+ 	int GetErrorCode() const { return m_error_code; }
+@@ -74,20 +74,19 @@ private:
+ 	uint8_t *m_convert_buffer[1] = { nullptr };
+ 	int m_convert_buffer_nb_samples = 0;
+
+-	AVInputFormat *m_input_fmt = nullptr;
++	const AVInputFormat *m_input_fmt = nullptr;
+ 	AVDictionary *m_input_opts = nullptr;
+
+ 	AVFormatContext *m_format_ctx = nullptr;
+ 	AVCodecContext *m_codec_ctx = nullptr;
+-	AVFrame *m_frame = nullptr;
+ 	int m_stream_index = -1;
+ 	std::string m_error;
+ 	int m_error_code = 0;
+-	bool m_finished = false;
+ 	bool m_opened = false;
+-	int m_got_frame = 0;
+-	AVPacket m_packet;
+-	AVPacket m_packet0;
++	bool m_has_more_packets = true;
++	bool m_has_more_frames = true;
++	AVPacket *m_packet = nullptr;
++	AVFrame *m_frame = nullptr;
+
+ 	int m_output_sample_rate = 0;
+ 	int m_output_channels = 0;
+@@ -98,19 +97,12 @@ private:
+
+ inline FFmpegAudioReader::FFmpegAudioReader() {
+ 	av_log_set_level(AV_LOG_QUIET);
+-
+-	av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
+ }
+
+ inline FFmpegAudioReader::~FFmpegAudioReader() {
+ 	Close();
+ 	av_dict_free(&m_input_opts);
+ 	av_freep(&m_convert_buffer[0]);
+-	av_packet_unref(&m_packet0);
+ }
+
+ inline bool FFmpegAudioReader::SetInputFormat(const char *name) {
+@@ -135,11 +127,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ 	Close();
+
+-    av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
++	m_packet = av_packet_alloc();
++	if (!m_packet) {
++		return false;
++	}
+
+ 	ret = avformat_open_input(&m_format_ctx, file_name.c_str(), m_input_fmt, &m_input_opts);
+ 	if (ret < 0) {
+@@ -153,26 +144,31 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		return false;
+ 	}
+
+-	AVCodec *codec;
++	const AVCodec *codec;
+ 	ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
+ 	if (ret < 0) {
+ 		SetError("Could not find any audio stream in the file", ret);
+ 		return false;
+ 	}
+ 	m_stream_index = ret;
++	auto stream = m_format_ctx->streams[m_stream_index];
+
+-	m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec;
++	m_codec_ctx = avcodec_alloc_context3(codec);
+ 	m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
+
++	ret = avcodec_parameters_to_context(m_codec_ctx, stream->codecpar);
++	if (ret < 0) {
++		SetError("Could not copy the stream parameters", ret);
++		return false;
++	}
++
+ 	ret = avcodec_open2(m_codec_ctx, codec, nullptr);
+ 	if (ret < 0) {
+ 		SetError("Could not open the codec", ret);
+ 		return false;
+ 	}
+
+-	if (!m_codec_ctx->channel_layout) {
+-		m_codec_ctx->channel_layout = av_get_default_channel_layout(m_codec_ctx->channels);
+-	}
++	av_dump_format(m_format_ctx, 0, "foo", 0);
+
+ 	m_frame = av_frame_alloc();
+ 	if (!m_frame) {
+@@ -183,19 +179,23 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		m_output_sample_rate = m_codec_ctx->sample_rate;
+ 	}
+
+-	if (!m_output_channels) {
+-		m_output_channels = m_codec_ctx->channels;
++	AVChannelLayout output_channel_layout;
++	if (m_output_channels) {
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
++	} else {
++		m_output_channels = m_codec_ctx->ch_layout.nb_channels;
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
+ 	}
+
+-	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
++	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
+ 		m_converter.reset(new FFmpegAudioProcessor());
+ 		m_converter->SetCompatibleMode();
+ 		m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
+ 		m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
+-		m_converter->SetInputChannelLayout(m_codec_ctx->channel_layout);
++		m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
+ 		m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
+ 		m_converter->SetOutputSampleRate(m_output_sample_rate);
+-		m_converter->SetOutputChannelLayout(av_get_default_channel_layout(m_output_channels));
++		m_converter->SetOutputChannelLayout(&output_channel_layout);
+ 		auto ret = m_converter->Init();
+ 		if (ret != 0) {
+ 			SetError("Could not create an audio converter instance", ret);
+@@ -203,10 +203,11 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		}
+ 	}
+
++	av_channel_layout_uninit(&output_channel_layout);
++
+ 	m_opened = true;
+-	m_finished = false;
+-	m_got_frame = 0;
+-	m_nb_packets = 0;
++	m_has_more_packets = true;
++	m_has_more_frames = true;
+ 	m_decode_error = 0;
+
+ 	return true;
+@@ -214,6 +215,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ inline void FFmpegAudioReader::Close() {
+ 	av_frame_free(&m_frame);
++	av_packet_free(&m_packet);
+
+ 	m_stream_index = -1;
+
+@@ -252,91 +254,98 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
+ 		return false;
+ 	}
+
++	*data = nullptr;
++	*size = 0;
++
+ 	int ret;
++	bool needs_packet = false;
+ 	while (true) {
+-		while (m_packet.size <= 0) {
+-			av_packet_unref(&m_packet0);
+-			av_init_packet(&m_packet);
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			ret = av_read_frame(m_format_ctx, &m_packet);
++		while (needs_packet && m_packet->size == 0) {
++			ret = av_read_frame(m_format_ctx, m_packet);
+ 			if (ret < 0) {
+ 				if (ret == AVERROR_EOF) {
+-					m_finished = true;
++					needs_packet = false;
++					m_has_more_packets = false;
+ 					break;
+-				} else {
++				}
++				SetError("Error reading from the audio source", ret);
++				return false;
++			}
++			if (m_packet->stream_index == m_stream_index) {
++				needs_packet = false;
++			} else {
++				av_packet_unref(m_packet);
++			}
++		}
++
++		if (m_packet->size != 0) {
++			ret = avcodec_send_packet(m_codec_ctx, m_packet);
++			if (ret < 0) {
++				if (ret != AVERROR(EAGAIN)) {
+ 					SetError("Error reading from the audio source", ret);
+ 					return false;
+ 				}
+-			}
+-			m_packet0 = m_packet;
+-			if (m_packet.stream_index != m_stream_index) {
+-				m_packet.data = nullptr;
+-				m_packet.size = 0;
+ 			} else {
+-				m_nb_packets++;
++				av_packet_unref(m_packet);
+ 			}
+ 		}
+
+-		ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet);
++		ret = avcodec_receive_frame(m_codec_ctx, m_frame);
+ 		if (ret < 0) {
+-			if (m_decode_error) {
+-				SetError("Error decoding audio frame", m_decode_error);
+-				return false;
++			if (ret == AVERROR_EOF) {
++				m_has_more_frames = false;
++			} else if (ret == AVERROR(EAGAIN)) {
++				if (m_has_more_packets) {
++					needs_packet = true;
++					continue;
++				} else {
++					m_has_more_frames = false;
++				}
+ 			}
+-			m_decode_error = ret;
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			continue;
++			SetError("Error decoding the audio source", ret);
++			return false;
+ 		}
+
+-		break;
+-	}
+-
+-	m_decode_error = 0;
+-
+-	const int decoded = std::min(ret, m_packet.size);
+-	m_packet.data += decoded;
+-	m_packet.size -= decoded;
+-
+-	if (m_got_frame) {
+-		if (m_converter) {
+-			if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
+-				int linsize;
+-				av_freep(&m_convert_buffer[0]);
+-				m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
+-				ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
+-				if (ret < 0) {
+-					SetError("Couldn't allocate audio converter buffer", ret);
++		if (m_frame->nb_samples > 0) {
++			if (m_converter) {
++				if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
++					int linsize;
++					av_freep(&m_convert_buffer[0]);
++					m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
++					ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
++					if (ret < 0) {
++						SetError("Couldn't allocate audio converter buffer", ret);
++						return false;
++					}
++				}
++				auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
++				if (nb_samples < 0) {
++					SetError("Couldn't convert audio", ret);
+ 					return false;
+ 				}
+-			}
+-			auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			}
+-			*data = (const int16_t *) m_convert_buffer[0];
+-			*size = nb_samples;
+-		} else {
+-			*data = (const int16_t *) m_frame->data[0];
+-			*size = m_frame->nb_samples;
+-		}
+-	} else {
+-		if (m_finished && m_converter) {
+-			auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			} else if (nb_samples > 0) {
+-				m_got_frame = 1;
+ 				*data = (const int16_t *) m_convert_buffer[0];
+ 				*size = nb_samples;
++			} else {
++				*data = (const int16_t *) m_frame->data[0];
++				*size = m_frame->nb_samples;
++			}
++		} else {
++			if (m_converter) {
++				if (IsFinished()) {
++					auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
++					if (nb_samples < 0) {
++						SetError("Couldn't convert audio", ret);
++						return false;
++					} else if (nb_samples > 0) {
++						*data = (const int16_t *) m_convert_buffer[0];
++						*size = nb_samples;
++					}
++				}
+ 			}
+ 		}
+-	}
+
+-	return true;
++		return true;
++	}
+ }
+
+ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index a2b517b..123e643 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -38,6 +38,12 @@ set(SRCS
+
+ if(BUILD_TOOLS)
+ 	set(SRCS ${SRCS} ../src/audio/ffmpeg_audio_reader_test.cpp)
++    include_directories(
++        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
++        ${AUDIO_PROCESSOR_INCLUDE_DIRS}
++    )
+ 	link_libraries(fpcalc_libs)
+ endif()
+
+-- 
+2.38.1
+
+
diff --git a/srcpkgs/chromaprint/template b/srcpkgs/chromaprint/template
index 7ef7838949f3..1f7bbc70a22c 100644
--- a/srcpkgs/chromaprint/template
+++ b/srcpkgs/chromaprint/template
@@ -1,7 +1,7 @@
 # Template file for 'chromaprint'
 pkgname=chromaprint
 version=1.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TOOLS=ON"
 make_check_target="check"
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 3c1c1caf3765..1f28cde5d3c1 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,7 +2,7 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=111.0.5563.64
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
  $(vopt_if clang "clang lld llvm12")
diff --git a/srcpkgs/cmus/template b/srcpkgs/cmus/template
index 0fcb424ce336..05b77d0fecae 100644
--- a/srcpkgs/cmus/template
+++ b/srcpkgs/cmus/template
@@ -1,7 +1,7 @@
 # Template file for 'cmus'
 pkgname=cmus
 version=2.10.0
-revision=1
+revision=2
 build_style=configure
 configure_args="prefix=/usr LD=$CC"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/cyanrip/template b/srcpkgs/cyanrip/template
index 9796e3461601..5db30e020d17 100644
--- a/srcpkgs/cyanrip/template
+++ b/srcpkgs/cyanrip/template
@@ -1,7 +1,7 @@
 # Template file for 'cyanrip'
 pkgname=cyanrip
 version=0.9.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="ffmpeg-devel libcdio-devel libcdio-paranoia-devel libcurl-devel libmusicbrainz5-devel"
diff --git a/srcpkgs/deadbeef/template b/srcpkgs/deadbeef/template
index b664bb1b9bd9..f0fcced864be 100644
--- a/srcpkgs/deadbeef/template
+++ b/srcpkgs/deadbeef/template
@@ -1,7 +1,7 @@
 # Template file for 'deadbeef'
 pkgname=deadbeef
 version=1.8.8
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-oss --disable-lfm --disable-notify --disable-gtk2"
diff --git a/srcpkgs/dolphin-emu/template b/srcpkgs/dolphin-emu/template
index 7ea197ceb2a8..7aeb0a5b645e 100644
--- a/srcpkgs/dolphin-emu/template
+++ b/srcpkgs/dolphin-emu/template
@@ -1,7 +1,7 @@
 # Template file for 'dolphin-emu'
 pkgname=dolphin-emu
 version=5.0.16101
-revision=1
+revision=2
 _dolphin_commit=8ecfa537a242de74d2e372e30d9d79b14584b2fb
 _mgba_commit=40d4c430fc36caeb7ea32fd39624947ed487d2f2
 #Version/hash pair can be found at https://dolphin-emu.org/download/
diff --git a/srcpkgs/droidcam-obs-plugin/template b/srcpkgs/droidcam-obs-plugin/template
index fc9c9bf6b9d5..fb0480754df4 100644
--- a/srcpkgs/droidcam-obs-plugin/template
+++ b/srcpkgs/droidcam-obs-plugin/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam-obs-plugin'
 pkgname=droidcam-obs-plugin
 version=2.0.1
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=yes
 make_build_args="ALLOW_STATIC=no"
diff --git a/srcpkgs/droidcam/template b/srcpkgs/droidcam/template
index 1c3f1b8b1fc6..32a9220b79a4 100644
--- a/srcpkgs/droidcam/template
+++ b/srcpkgs/droidcam/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam'
 pkgname=droidcam
 version=1.8.2
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="USBMUXD=-lusbmuxd-2.0 JPEG=-lturbojpeg"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/electron19/template b/srcpkgs/electron19/template
index 068136be7623..32ce301e730c 100644
--- a/srcpkgs/electron19/template
+++ b/srcpkgs/electron19/template
@@ -1,7 +1,7 @@
 # Template file for 'electron19'
 pkgname=electron19
 version=19.0.8
-revision=2
+revision=3
 _nodever=16.14.2
 _chromiumver=102.0.5005.125
 archs="x86_64* aarch64* ppc64le*"
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 38978c5085a3..1ac1e4b8df49 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -12,25 +12,31 @@ distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
 checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
-makedepends="chromaprint-devel libgcrypt-devel ladspa-sdk lcms2-devel libaom-devel
- alsa-lib-devel bzip2-devel libxcb-devel liblzma-devel SDL2-devel sndio-devel zlib-devel
- frei0r-plugins libcdio-paranoia-devel rubberband-devel libvidstab-devel x264-devel x265-devel
- xvidcore-devel fdk-aac-devel libtls-devel gmp-devel libass-devel libbluray-devel libcaca-devel
- celt-devel codec2-devel libdav1d-devel libdrm-devel fontconfig-devel freetype-devel
- fribidi-devel glslang-devel SPIRV-Tools-devel libgme-devel libgsm-devel jack-devel
- libmodplug-devel lame-devel libopencv4-devel libopenjpeg2-devel libopenmpt-devel opus-devel
- libplacebo-devel libpulseaudio rabbitmq-c-devel librist-devel librsvg-devel librtmp-devel
- snappy-devel libsoxr-devel speex-devel srt-devel libssh-devel libtheora-devel twolame-devel
- libvorbis-devel libvpx6-devel libwebp-devel libxml2-devel zimg-devel lilv-devel lv2
- libopenal-devel mesa openssl-devel vapoursynth-devel ocl-icd-devel libmysofa-devel vulkan-loader
- $(vopt_if vaapi libva-devel)
- $(vopt_if vdpau libvdpau-devel)
- $(vopt_if nvenc nv-codec-headers)
- $(vopt_if nvdec nv-codec-headers)
- $(vopt_if svtav1 libsvt-av1-devel)
-"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
 depends="ffplay>=${version}_${revision}"
-build_options="vaapi vdpau nvenc nvdec svtav1"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
@@ -46,6 +52,22 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
 do_configure() {
 	# Fix gcc on x86_64-musl only
 	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
@@ -76,47 +98,39 @@ do_configure() {
 		_args+=" --extra-libs=-latomic"
 	fi
 
-	./configure \
-		--prefix='/usr' \
-		--extra-cflags='-I/opt/cuda/include' \
-		--extra-ldflags='-L/opt/cuda/lib64' \
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
 		--disable-stripping \
-		--enable-shared --enable-static \
-		--enable-nonfree --enable-gpl \
-		--enable-version3 --enable-libxcb \
-		--enable-frei0r --enable-libcdio \
-		--enable-librubberband --enable-libvidstab \
-		--enable-libx264 --enable-libx265 --enable-libxvid \
-		--enable-libfdk-aac --enable-libtls --enable-gmp \
-		--enable-chromaprint --enable-gcrypt --enable-ladspa \
-		--enable-lcms2 --enable-libaom --enable-libass \
-		--enable-libbluray --enable-libcaca --enable-libcelt \
-		--enable-libcodec2 --enable-libdav1d --enable-libdrm \
-		--enable-libfontconfig --enable-libfreetype \
-		--enable-libfribidi --enable-libglslang \
-		--enable-libgme --enable-libgsm \
-		--enable-vapoursynth --enable-openssl --enable-opengl \
-		--enable-openal --enable-lv2 --enable-libzimg \
-		--enable-libxml2 --enable-libwebp --enable-libvorbis \
-		--enable-libtwolame --enable-libtheora --enable-libssh \
-		--enable-libsrt --enable-libspeex --enable-libsoxr \
-		--enable-librtmp --enable-librsvg --enable-librist \
-		--enable-librabbitmq --enable-libpulse --enable-libplacebo \
-		--enable-libopus --enable-libopenmpt --enable-libopenjpeg \
-		--enable-libmp3lame --enable-libmodplug --enable-libjack \
-		--enable-opencl --enable-libvpx --enable-libmysofa \
-		$(vopt_enable vaapi) \
-		$(vopt_enable vdpau) \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
 		$(vopt_if nvenc '--enable-nvenc') \
-		$(vopt_if nvdec '--enable-nvdec') \
-		$(vopt_enable svtav1 libsvtav1)
+		$(vopt_if nvdec '--enable-nvdec')
 }
-
 do_build() {
 	make ${makejobs}
 	make doc/ff{mpeg,play}.1
 }
-
 do_install() {
 	make DESTDIR=${DESTDIR} install install-man
 }
@@ -133,6 +147,10 @@ libavdevice_package() {
 		vmove "usr/lib/libavdevice.so.*"
 	}
 }
+libavresample_package() {
+	short_desc="Package deprecated, removal needed"
+	build_style=meta
+}
 libavformat_package() {
 	short_desc="FFmpeg file format library"
 	pkg_install() {
@@ -180,47 +198,7 @@ ffmpeg-devel_package() {
 		libswscale>=${version}_${revision}
 		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
-	alternatives="
-	 ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec5.3
-	 ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice5.3
-	 ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter5.3
-	 ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat5.3
-	 ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil5.3
-	 ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample5.3
-	 ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale5.3
-	 ffmpeg-devel:libavcodec:/usr/include/libavcodec5
-	 ffmpeg-devel:libavdevice:/usr/include/libavdevice5
-	 ffmpeg-devel:libavformat:/usr/include/libavformat5
-	 ffmpeg-devel:libavutil:/usr/include/libavutil5
-	 ffmpeg-devel:libavpostproc:/usr/include/libavpostproc5
-	 ffmpeg-devel:libswresample:/usr/include/libswresample5
-	 ffmpeg-devel:libswcaale:/usr/include/libswscale5
-	 ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec5.pc
-	 ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice5.pc
-	 ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter5.pc
-	 ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat5.pc
-	 ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil5.pc
-	 ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc5.pc
-	 ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample5.pc
-	 ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale5.pc
-	 ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec5.a
-	 ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec5.so
-	 ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice5.a
-	 ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice5.so
-	 ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter5.a
-	 ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter5.so
-	 ffmpeg-devel:libavformat.a:/usr/lib/libavformat5.a
-	 ffmpeg-devel:libavformat.so:/usr/lib/libavformat5.so
-	 ffmpeg-devel:libavutil.a:/usr/lib/libavutil5.a
-	 ffmpeg-devel:libavutil.so:/usr/lib/libavutil5.so
-	 ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc5.a
-	 ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc5.so
-	 ffmpeg-devel:libswresample.a:/usr/lib/libswresample5.a
-	 ffmpeg-devel:libswresample.so:/usr/lib/libswresample5.so
-	 ffmpeg-devel:libswscale.a:/usr/lib/libswscale5.a
-	 ffmpeg-devel:libswscale.so:/usr/lib/libswscale5.so
-	 ffmpeg-devel:ffmpeg:/usr/share/ffmpeg5
-	"
+	conflicts="ffmpeg4-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
@@ -231,7 +209,7 @@ ffmpeg-devel_package() {
 	}
 }
 ffplay_package() {
-	short_desc="Simple media player using FFmpeg and SDL2"
+	short_desc="Simple video player using FFmpeg and SDL2"
 	pkg_install() {
 		vmove usr/bin/ffplay
 		vmove "usr/share/man/man1/ffplay*"
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
index cd9154978b3e..7bc64bb39f41 100644
--- a/srcpkgs/ffmpeg4/template
+++ b/srcpkgs/ffmpeg4/template
@@ -2,8 +2,8 @@
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg4
 version=4.4.3
-revision=3
-short_desc="ffmpeg4 libraries only - Decoding, encoding and streaming software"
+revision=1
+short_desc="Decoding, encoding and streaming software - ffmpeg4 libraries only"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
@@ -202,47 +202,7 @@ ffmpeg4-devel_package() {
 		libswresample4>=${version}_${revision}
 		libavresample4>=${version}_${revision}"
 	short_desc+=" - development files"
-	alternatives="
-		ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec4.3
-		ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice4.3
-		ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter4.3
-		ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat4.3
-		ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil4.3
-		ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample4.3
-		ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale4.3
-		ffmpeg-devel:libavcodec:/usr/include/libavcodec4
-		ffmpeg-devel:libavdevice:/usr/include/libavdevice4
-		ffmpeg-devel:libavformat:/usr/include/libavformat4
-		ffmpeg-devel:libavutil:/usr/include/libavutil4
-		ffmpeg-devel:libavpostproc:/usr/include/libavpostproc4
-		ffmpeg-devel:libswresample:/usr/include/libswresample4
-		ffmpeg-devel:libswcaale:/usr/include/libswscale4
-		ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec4.pc
-		ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice4.pc
-		ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter4.pc
-		ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat4.pc
-		ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil4.pc
-		ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc4.pc
-		ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample4.pc
-		ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale4.pc
-		ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec4.a
-		ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec4.so
-		ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice4.a
-		ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice4.so
-		ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter4.a
-		ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter4.so
-		ffmpeg-devel:libavformat.a:/usr/lib/libavformat4.a
-		ffmpeg-devel:libavformat.so:/usr/lib/libavformat4.so
-		ffmpeg-devel:libavutil.a:/usr/lib/libavutil4.a
-		ffmpeg-devel:libavutil.so:/usr/lib/libavutil4.so
-		ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc4.a
-		ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc4.so
-		ffmpeg-devel:libswresample.a:/usr/lib/libswresample4.a
-		ffmpeg-devel:libswresample.so:/usr/lib/libswresample4.so
-		ffmpeg-devel:libswscale.a:/usr/lib/libswscale4.a
-		ffmpeg-devel:libswscale.so:/usr/lib/libswscale4.so
-		ffmpeg-devel:ffmpeg:/usr/share/ffmpeg4
-	"
+	conflicts="ffmpeg-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
diff --git a/srcpkgs/ffmpegthumbnailer/template b/srcpkgs/ffmpegthumbnailer/template
index 039eea7622b3..35d546018d12 100644
--- a/srcpkgs/ffmpegthumbnailer/template
+++ b/srcpkgs/ffmpegthumbnailer/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbnailer'
 pkgname=ffmpegthumbnailer
 version=2.2.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libpng-devel libjpeg-turbo-devel ffmpeg-devel"
@@ -9,8 +9,8 @@ depends="ffmpeg"
 short_desc="Lightweight video thumbnailer"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
-homepage="https://github.com/dirkvdb/${pkgname}"
-distfiles="${homepage}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
+homepage="https://github.com/dirkvdb"
+distfiles="${homepage}/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
 checksum=1cb24059c38223f657b300c84dd80491b7040d4b69471c4fea69be862bc99b5b
 
 post_install() {
diff --git a/srcpkgs/ffmpegthumbs/template b/srcpkgs/ffmpegthumbs/template
index 5f0b9414dada..11b88193528f 100644
--- a/srcpkgs/ffmpegthumbs/template
+++ b/srcpkgs/ffmpegthumbs/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbs'
 pkgname=ffmpegthumbs
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules kcoreaddons kconfig-devel
  pkg-config qt5-host-tools qt5-qmake gettext"
diff --git a/srcpkgs/ffms2/patches/ffmpeg5.patch b/srcpkgs/ffms2/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..0766db172473
--- /dev/null
+++ b/srcpkgs/ffms2/patches/ffmpeg5.patch
@@ -0,0 +1,419 @@
+From 28fc493fda2fa2064afeeb0a5d85fdc42db05dcf Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:12:41 +0100
+Subject: [PATCH 1/3] all: Update AVPacket API usage
+
+AVPackets must all be on the heap now, since it is no longer
+part of the libav* ABI.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 16 ++++++----
+ src/core/indexing.cpp    | 63 ++++++++++++++++++++++------------------
+ src/core/indexing.h      |  4 +--
+ src/core/utils.cpp       |  6 ----
+ src/core/utils.h         |  1 -
+ src/core/videosource.cpp | 30 ++++++++++---------
+ 6 files changed, 64 insertions(+), 56 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index 37cf9aeef..e4ce97cdb 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -285,10 +285,15 @@ FFMS_AudioSource::AudioBlock *FFMS_AudioSource::CacheBlock(CacheIterator &pos) {
+ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     CurrentFrame = &Frames[PacketNumber];
+
+-    AVPacket Packet;
+-    if (!ReadPacket(&Packet))
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++    if (!ReadPacket(Packet)) {
++        av_packet_free(&Packet);
+         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_UNKNOWN,
+             "ReadPacket unexpectedly failed to read a packet");
++    }
+
+     // ReadPacket may have changed the packet number
+     CurrentFrame = &Frames[PacketNumber];
+@@ -297,8 +302,9 @@ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     int NumberOfSamples = 0;
+     AudioBlock *CachedBlock = nullptr;
+
+-    int Ret = avcodec_send_packet(CodecContext, &Packet);
+-    av_packet_unref(&Packet);
++    int Ret = avcodec_send_packet(CodecContext, Packet);
++    av_packet_unref(Packet);
++    av_packet_free(&Packet);
+
+     av_frame_unref(DecodeFrame);
+     Ret = avcodec_receive_frame(CodecContext, DecodeFrame);
+@@ -513,8 +519,6 @@ void FFMS_AudioSource::Seek() {
+ }
+
+ bool FFMS_AudioSource::ReadPacket(AVPacket *Packet) {
+-    InitNullPacket(*Packet);
+-
+     while (av_read_frame(FormatContext, Packet) >= 0) {
+         if (Packet->stream_index == TrackNumber) {
+             // Required because not all audio packets, especially in ogg, have a pts. Use the previous valid packet's pts instead.
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index 23fb95b12..e547c5abf 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -320,7 +320,7 @@ void FFMS_Indexer::CheckAudioProperties(int Track, AVCodecContext *Context) {
+     }
+ }
+
+-void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict,
++void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict,
+                                     int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct) {
+     if (VideoContext.Parser) {
+         uint8_t *OB;
+@@ -330,8 +330,8 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+         av_parser_parse2(VideoContext.Parser,
+             VideoContext.CodecContext,
+             &OB, &OBSize,
+-            pkt.data, pkt.size,
+-            pkt.pts, pkt.dts, pkt.pos);
++            pkt->data, pkt->size,
++            pkt->pts, pkt->dts, pkt->pos);
+
+         // H.264 (PAFF) and HEVC may have one field per packet, so we need to track
+         // when we have a full or half frame available, and mark one of them as
+@@ -351,15 +351,15 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+
+         *RepeatPict = VideoContext.Parser->repeat_pict;
+         *FrameType = VideoContext.Parser->pict_type;
+-        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt.flags & AV_PKT_FLAG_DISCARD));
++        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt->flags & AV_PKT_FLAG_DISCARD));
+     } else {
+-        *Invisible = !!(pkt.flags & AV_PKT_FLAG_DISCARD);
++        *Invisible = !!(pkt->flags & AV_PKT_FLAG_DISCARD);
+     }
+
+     if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP8)
+-        ParseVP8(pkt.data[0], Invisible, FrameType);
++        ParseVP8(pkt->data[0], Invisible, FrameType);
+     else if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP9)
+-        ParseVP9(pkt.data[0], Invisible, FrameType);
++        ParseVP9(pkt->data[0], Invisible, FrameType);
+ }
+
+ void FFMS_Indexer::Free() {
+@@ -458,32 +458,36 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+         }
+     }
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
+     std::vector<int64_t> LastValidTS(FormatContext->nb_streams, AV_NOPTS_VALUE);
+
+     int64_t filesize = avio_size(FormatContext->pb);
+     enum AVPictureStructure LastPicStruct = AV_PICTURE_STRUCTURE_UNKNOWN;
+-    while (av_read_frame(FormatContext, &Packet) >= 0) {
++    while (av_read_frame(FormatContext, Packet) >= 0) {
+         // Update progress
+         // FormatContext->pb can apparently be NULL when opening images.
+         if (IC && FormatContext->pb) {
+-            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate))
++            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate)) {
++                av_packet_free(&Packet);
+                 throw FFMS_Exception(FFMS_ERROR_CANCELLED, FFMS_ERROR_USER,
+                     "Cancelled by user");
++            }
+         }
+-        if (!IndexMask.count(Packet.stream_index)) {
+-            av_packet_unref(&Packet);
++        if (!IndexMask.count(Packet->stream_index)) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+-        int Track = Packet.stream_index;
++        int Track = Packet->stream_index;
+         FFMS_Track &TrackInfo = (*TrackIndices)[Track];
+-        bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
++        bool KeyFrame = !!(Packet->flags & AV_PKT_FLAG_KEY);
+         ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
+
+         if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            int64_t PTS = TrackInfo.UseDTS ? Packet.dts : Packet.pts;
++            int64_t PTS = TrackInfo.UseDTS ? Packet->dts : Packet->pts;
+             if (PTS == AV_NOPTS_VALUE) {
+                 // VPx alt-refs are output as packets which lack timestmps or durations, since
+                 // they are invisible. Currently, the timestamp mangling code in libavformat
+@@ -495,9 +499,11 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 // FFMS2 currently sorts packets by PTS, which will break decoding, otherwise.
+                 bool HasAltRefs = (FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP8 ||
+                                    FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP9);
+-                if (Packet.duration == 0 && !HasAltRefs)
++                if (Packet->duration == 0 && !HasAltRefs) {
++                    av_packet_free(&Packet);
+                     throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER,
+                         "Invalid packet pts, dts, and duration");
++                }
+
+                 if (TrackInfo.empty())
+                     PTS = 0;
+@@ -513,7 +519,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             ParseVideoPacket(AVContexts[Track], Packet, &RepeatPict, &FrameType, &Invisible, &LastPicStruct);
+
+             TrackInfo.AddVideoFrame(PTS, RepeatPict, KeyFrame,
+-                FrameType, Packet.pos, Invisible);
++                FrameType, Packet->pos, Invisible);
+         } else if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+             // For video seeking timestamps are used only if all packets have
+             // timestamps, while for audio they're used if any have timestamps,
+@@ -522,28 +528,29 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 TrackInfo.HasTS = true;
+
+             int64_t StartSample = AVContexts[Track].CurrentSample;
+-            uint32_t SampleCount = IndexAudioPacket(Track, &Packet, AVContexts[Track], *TrackIndices);
++            uint32_t SampleCount = IndexAudioPacket(Track, Packet, AVContexts[Track], *TrackIndices);
+             TrackInfo.SampleRate = AVContexts[Track].CodecContext->sample_rate;
+
+             TrackInfo.AddAudioFrame(LastValidTS[Track],
+-                StartSample, SampleCount, KeyFrame, Packet.pos, Packet.flags & AV_PKT_FLAG_DISCARD);
++                StartSample, SampleCount, KeyFrame, Packet->pos, Packet->flags & AV_PKT_FLAG_DISCARD);
+         }
+
+-        if (!(Packet.flags & AV_PKT_FLAG_DISCARD))
+-            TrackInfo.LastDuration = Packet.duration;
++        if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
++            TrackInfo.LastDuration = Packet->duration;
+
+-        av_packet_unref(&Packet);
++        av_packet_unref(Packet);
+     }
++    av_packet_free(&Packet);
+
+     TrackIndices->Finalize(AVContexts, FormatContext->iformat->name);
+     return TrackIndices.release();
+ }
+
+-void FFMS_Indexer::ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS) {
+-    if (!UseDTS && Packet.pts != AV_NOPTS_VALUE)
+-        TS = Packet.pts;
++void FFMS_Indexer::ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS) {
++    if (!UseDTS && Packet->pts != AV_NOPTS_VALUE)
++        TS = Packet->pts;
+     if (TS == AV_NOPTS_VALUE)
+         UseDTS = true;
+-    if (UseDTS && Packet.dts != AV_NOPTS_VALUE)
+-        TS = Packet.dts;
++    if (UseDTS && Packet->dts != AV_NOPTS_VALUE)
++        TS = Packet->dts;
+ }
+diff --git a/src/core/indexing.h b/src/core/indexing.h
+index 3cfc3c30b..5c0686889 100644
+--- a/src/core/indexing.h
++++ b/src/core/indexing.h
+@@ -80,10 +80,10 @@ struct FFMS_Indexer {
+     int64_t Filesize;
+     uint8_t Digest[20];
+
+-    void ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS);
++    void ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS);
+     void CheckAudioProperties(int Track, AVCodecContext *Context);
+     uint32_t IndexAudioPacket(int Track, AVPacket *Packet, SharedAVContext &Context, FFMS_Index &TrackIndices);
+-    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
++    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
+     void Free();
+ public:
+     FFMS_Indexer(const char *Filename);
+diff --git a/src/core/utils.cpp b/src/core/utils.cpp
+index ce67533fd..8a2e99710 100644
+--- a/src/core/utils.cpp
++++ b/src/core/utils.cpp
+@@ -62,12 +62,6 @@ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo) {
+     }
+ }
+
+-void InitNullPacket(AVPacket &pkt) {
+-    av_init_packet(&pkt);
+-    pkt.data = nullptr;
+-    pkt.size = 0;
+-}
+-
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames) {
+     AP.SampleFormat = static_cast<FFMS_SampleFormat>(av_get_packed_sample_fmt(CTX->sample_fmt));
+     AP.BitsPerSample = av_get_bytes_per_sample(CTX->sample_fmt) * 8;
+diff --git a/src/core/utils.h b/src/core/utils.h
+index 9819dc7c9..003ab794e 100644
+--- a/src/core/utils.h
++++ b/src/core/utils.h
+@@ -58,7 +58,6 @@ std::unique_ptr<T> make_unique(Args&&... args) {
+ }
+
+ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo);
+-void InitNullPacket(AVPacket &pkt);
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames);
+
+ void LAVFOpenFile(const char *SourceFile, AVFormatContext *&FormatContext, int Track);
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index 06bd1610e..b889970e2 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -673,30 +673,34 @@ void FFMS_VideoSource::DecodeNextFrame(int64_t &AStartTime, int64_t &Pos) {
+     if (HasPendingDelayedFrames())
+         return;
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
+-
+-    while (ReadFrame(&Packet) >= 0) {
+-        if (Packet.stream_index != VideoTrack) {
+-            av_packet_unref(&Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++
++    while (ReadFrame(Packet) >= 0) {
++        if (Packet->stream_index != VideoTrack) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+         if (AStartTime < 0)
+-            AStartTime = Frames.UseDTS ? Packet.dts : Packet.pts;
++            AStartTime = Frames.UseDTS ? Packet->dts : Packet->pts;
+
+         if (Pos < 0)
+-            Pos = Packet.pos;
++            Pos = Packet->pos;
+
+-        bool FrameFinished = DecodePacket(&Packet);
+-        av_packet_unref(&Packet);
+-        if (FrameFinished)
++        bool FrameFinished = DecodePacket(Packet);
++        av_packet_unref(Packet);
++        if (FrameFinished) {
++            av_packet_free(&Packet);
+             return;
++        }
+     }
+
+     // Flush final frames
+-    InitNullPacket(Packet);
+-    DecodePacket(&Packet);
++    DecodePacket(Packet);
++    av_packet_free(&Packet);
+ }
+
+ bool FFMS_VideoSource::SeekTo(int n, int SeekOffset) {
+
+From bf9e03e9e08534c024e5a744a6437c4aac160201 Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:20:47 +0100
+Subject: [PATCH 2/3] configure: Remove deprecated API use
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b35ef80bc..d19714d0f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,10 +102,10 @@ CFLAGS="$_CFLAGS $FFMPEG_CFLAGS"
+
+ AC_DEFUN([TEST_FFMPEG],
+          [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-            #include <libavcodec/avcodec.h>
++            #include <libavformat/avformat.h>
+             #include <libswscale/swscale.h>
+             ]],[[
+-                avcodec_register_all();
++                avformat_network_init();
+                 swscale_version();
+             ]])], [eval $1=yes], [eval $1=no])
+         ])
+
+From a18c8296687e267b20ec90ef81671b77d393a36e Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:41:21 +0100
+Subject: [PATCH 3/3] Use auto for AVCodec
+
+The geniuses over at FFmpeg decided to constify this API, so old
+versions of the library will return AVCodec *, while new versions
+of the libary will return const AVCodec *, which, in C++, are not
+OK to convert between.
+
+Rather than use some macro hell in ffmscompat.h, we can work around
+this by using auto.
+
+Gross.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 2 +-
+ src/core/indexing.cpp    | 6 +++---
+ src/core/videosource.cpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index e4ce97cdb..ac0966636 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -469,7 +469,7 @@ void FFMS_AudioSource::OpenFile() {
+
+     LAVFOpenFile(SourceFile.c_str(), FormatContext, TrackNumber);
+
+-    AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
++    auto *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
+     if (Codec == nullptr)
+         throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+             "Audio codec not found");
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index e547c5abf..59fb4e8ea 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -384,7 +384,7 @@ FFMS_TrackType FFMS_Indexer::GetTrackType(int Track) {
+ }
+
+ const char *FFMS_Indexer::GetTrackCodec(int Track) {
+-    AVCodec *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
++    auto *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
+     return codec ? codec->name : nullptr;
+ }
+
+@@ -402,7 +402,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             UseDTS);
+
+         if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (!VideoCodec) {
+                 FormatContext->streams[i]->discard = AVDISCARD_ALL;
+                 IndexMask.erase(i);
+@@ -433,7 +433,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 IndexMask.insert(i);
+             }
+         } else if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+-            AVCodec *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (AudioCodec == nullptr)
+                 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
+                     "Audio codec not found");
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index b889970e2..8956c2256 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -171,7 +171,7 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in
+
+         LAVFOpenFile(SourceFile, FormatContext, VideoTrack);
+
+-        AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
++        auto *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
+         if (Codec == nullptr)
+             throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+                 "Video codec not found");
diff --git a/srcpkgs/ffms2/template b/srcpkgs/ffms2/template
index 68e8a0c14bce..2acfadac44b3 100644
--- a/srcpkgs/ffms2/template
+++ b/srcpkgs/ffms2/template
@@ -1,7 +1,7 @@
 # Template file for 'ffms2'
 pkgname=ffms2
 version=2.40
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--enable-shared --disable-static"
 hostmakedepends="pkg-config autoconf automake libtool"
diff --git a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
deleted file mode 100644
index 4c450fd45bfb..000000000000
--- a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 9d8202f32338a3f08d3fa39057dc5eec5d97be4e Mon Sep 17 00:00:00 2001
-From: Mathias Gumz <akira@fluxbox.org>
-Date: Sat, 28 May 2022 11:13:43 +0200
-Subject: [PATCH] Fix infinite loop in Menu::cycleitems()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When a menu contains no selectable item (example given: a "list" of user
-styles and the only available one is already selected), cycling through
-the menu will lead to an infinite loop and thus a disfunctional fluxbox.
-
-This commit addresses the issue by checking if there is any selectable
-item before entering the cycling stage.
-
-Discovered by Sébastien Ballet[1].
-
-[1]: https://sourceforge.net/p/fluxbox/bugs/1185/
----
- src/FbTk/Menu.cc | 21 +++++++++++++++------
- 1 file changed, 15 insertions(+), 6 deletions(-)
-
-diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
-index 6b2db3a4..ff040bae 100644
---- a/src/FbTk/Menu.cc
-+++ b/src/FbTk/Menu.cc
-@@ -320,15 +320,24 @@ void Menu::lower() {
- 
- void Menu::cycleItems(bool reverse) {
- 
--    if (m_items.empty())
--        return;
--
--    int offset = reverse ? -1 : 1;
-     int l = m_items.size();
--    int i = m_active_index;
-+    int i;
-+    int offset = reverse ? -1 : 1;
-     size_t ignore;
- 
--    for (i += offset; i != m_active_index; i += offset ) {
-+    // check if there is _any_ selectable item
-+    for (i = 0; i < l; i++) {
-+        if (isItemSelectable(i)) {
-+            break;
-+        }
-+    }
-+
-+    // no selectable item
-+    if (i >= l) {
-+        return;
-+    }
-+
-+    for (i = m_active_index + offset; i != m_active_index; i += offset ) {
-         if (i < 0) {
-             i = l - 1;
-         } else if (i >= l) {
--- 
-2.39.0
-
diff --git a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
new file mode 100644
index 000000000000..8dd44e538ce8
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
@@ -0,0 +1,23 @@
+
+From 22866c4d30f5b289c429c5ca88d800200db4fc4f Mon Sep 17 00:00:00 2001
+From: John Sennesael <john@aminking.com>
+Date: Mon, 2 Nov 2015 15:14:32 -0600
+Subject: [PATCH] fixes bug #1138
+
+---
+ util/fluxbox-remote.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc
+index 59852e6a7..504015b50 100644
+--- a/util/fluxbox-remote.cc
++++ b/util/fluxbox-remote.cc
+@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
+     if (strcmp(cmd, "result") == 0) {
+         XTextProperty text_prop;
+         if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
+-            && text_prop.value > 0
++            && text_prop.value != 0
+             && text_prop.nitems > 0) {
+ 
+             printf("%s", text_prop.value);
diff --git a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
deleted file mode 100644
index 5b64b11ab2a8..000000000000
--- a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/src/MinOverlapPlacement.cc  2015-02-08 05:44:34.000000000 -0500
-+++ b/src/MinOverlapPlacement.cc  2022-07-18 15:14:41.012275200 -0400
-@@ -196,19 +196,21 @@
-     std::set<Area>::iterator min_reg = areas.end();
-
-     std::set<Area>::iterator ar_it = areas.begin();
-+    int overlap = 0, min_right = 0, min_bottom = 0, max_left = 0, max_top = 0;
-+
-     for (; ar_it != areas.end(); ++ar_it) {
-
--        int overlap = 0;
-+        overlap = 0;
-         it = const_windowlist.rbegin();
-         for (; it != it_end; ++it) {
-
-             getWindowDimensions(*(*it), left, top, right, bottom);
-
-             // get the coordinates of the overlap region
--            int min_right = std::min(right, ar_it->x + win_w);
--            int min_bottom = std::min(bottom, ar_it->y + win_h);
--            int max_left = std::max(left, ar_it->x);
--            int max_top = std::max(top, ar_it->y);
-+            min_right = std::min(right, ar_it->x + win_w);
-+            min_bottom = std::min(bottom, ar_it->y + win_h);
-+            max_left = std::max(left, ar_it->x);
-+            max_top = std::max(top, ar_it->y);
-
-             // now compute the overlap and add to running total
-             if (min_right > max_left && min_bottom > max_top)
diff --git a/srcpkgs/fluxbox/patches/center.patch b/srcpkgs/fluxbox/patches/center.patch
deleted file mode 100644
index 39e3e4c7f37e..000000000000
--- a/srcpkgs/fluxbox/patches/center.patch
+++ /dev/null
@@ -1,307 +0,0 @@
-From ec83993c236de9c9442e2fcd31c08aae852a5a16 Mon Sep 17 00:00:00 2001
-From: zlice <zlice555@gmail.com>
-Date: Fri, 22 Jul 2022 21:21:33 -0400
-Subject: [PATCH 1/2] whitespace cleanup
-
----
- doc/asciidoc/fluxbox.txt |  8 ++++----
- src/ScreenPlacement.cc   | 12 ++++++------
- src/ScreenPlacement.hh   | 10 +++++-----
- 3 files changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
-index 95624842..0e3f27b9 100644
---- a/doc/asciidoc/fluxbox.txt
-+++ b/doc/asciidoc/fluxbox.txt
-@@ -4,7 +4,7 @@ Henrik Kinnunen <fluxgen@fluxbox.org>
- v1.3.7, 08 February 2015
- :man source:   fluxbox.txt
- :man version:  {revision}
--:man manual:   Fluxbox Manual  
-+:man manual:   Fluxbox Manual
- 
- NAME
- ----
-@@ -475,7 +475,7 @@ By default, this menu contains:
- 
- *Remember...*:::
- Specify which window settings should be stored in the `apps' file and
--resumed the next time this window is opened. 
-+resumed the next time this window is opened.
- +
- Specifically the setting you may store are:
- +
-@@ -740,7 +740,7 @@ There are three more settings in the ``Focus Model'' menu:
- 
- TAB OPTIONS
- -----------
--This section of fluxbox configuration menu lets you configure many features of 
-+This section of fluxbox configuration menu lets you configure many features of
- tabs. Inside of it there are three main options:
- 
- *Placement*:::
-@@ -1060,7 +1060,7 @@ whenever the mouse moves over them, but only when the mouse is moving. With
- area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc.
- +
- Default: *ClickToFocus*
--      
-+
- *session.screen0.autoRaise*: 'boolean'::
- When True, this setting automatically raises any window that gains focus.
- +
-diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
-index 19ddf78a..ca58d83f 100644
---- a/src/ScreenPlacement.cc
-+++ b/src/ScreenPlacement.cc
-@@ -43,14 +43,14 @@ using std::cerr;
- using std::endl;
- 
- ScreenPlacement::ScreenPlacement(BScreen &screen):
--    m_row_direction(screen.resourceManager(), LEFTRIGHT, 
--                    screen.name()+".rowPlacementDirection", 
-+    m_row_direction(screen.resourceManager(), LEFTRIGHT,
-+                    screen.name()+".rowPlacementDirection",
-                     screen.altName()+".RowPlacementDirection"),
--    m_col_direction(screen.resourceManager(), TOPBOTTOM, 
--                    screen.name()+".colPlacementDirection", 
-+    m_col_direction(screen.resourceManager(), TOPBOTTOM,
-+                    screen.name()+".colPlacementDirection",
-                     screen.altName()+".ColPlacementDirection"),
--    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT, 
--                       screen.name()+".windowPlacement", 
-+    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT,
-+                       screen.name()+".windowPlacement",
-                        screen.altName()+".WindowPlacement"),
-     m_old_policy(ROWSMARTPLACEMENT),
-     m_screen(screen)
-diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
-index 0f210d94..f1234983 100644
---- a/src/ScreenPlacement.hh
-+++ b/src/ScreenPlacement.hh
-@@ -34,7 +34,7 @@ class BScreen;
- 
- /**
-  * Main class for strategy handling
-- * This is a bridge between screen and 
-+ * This is a bridge between screen and
-  * the real placement strategy (rowcol, undermouse etc)
-  * The placeWindow function in this class is guaranteed to succeed.
-  * It holds a pointer to the real placement strategy which is
-@@ -42,8 +42,8 @@ class BScreen;
-  */
- class ScreenPlacement: public PlacementStrategy {
- public:
--    enum PlacementPolicy { 
--        ROWSMARTPLACEMENT, 
-+    enum PlacementPolicy {
-+        ROWSMARTPLACEMENT,
-         COLSMARTPLACEMENT,
-         COLMINOVERLAPPLACEMENT,
-         ROWMINOVERLAPPLACEMENT,
-@@ -52,11 +52,11 @@ public:
-         AUTOTABPLACEMENT
-     };
- 
--    enum RowDirection { 
-+    enum RowDirection {
-         LEFTRIGHT, ///< from left to right
-         RIGHTLEFT  ///< from right to left
-     };
--    enum ColumnDirection { 
-+    enum ColumnDirection {
-         TOPBOTTOM,  ///< from top to bottom
-         BOTTOMTOP   ///< from bottom to top
-     };
--- 
-2.37.1
-
-
-From 6e05f44c94fa4bfc0e44e8f42a9d24665a95840f Mon Sep 17 00:00:00 2001
-From: zlice <zlice555@gmail.com>
-Date: Fri, 22 Jul 2022 21:27:25 -0400
-Subject: [PATCH 2/2] new feature: CenterPlacement. Places new windows in
- center of the current workspace
-
----
- doc/asciidoc/fluxbox.txt |  1 +
- src/CenterPlacement.cc   | 43 ++++++++++++++++++++++++++++++++++++++++
- src/CenterPlacement.hh   | 37 ++++++++++++++++++++++++++++++++++
- src/Makemodule.am        |  2 ++
- src/ScreenPlacement.cc   |  8 ++++++++
- src/ScreenPlacement.hh   |  1 +
- 6 files changed, 92 insertions(+)
- create mode 100644 src/CenterPlacement.cc
- create mode 100644 src/CenterPlacement.hh
-
-diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
-index 0e3f27b9..46ca2861 100644
---- a/doc/asciidoc/fluxbox.txt
-+++ b/doc/asciidoc/fluxbox.txt
-@@ -1141,6 +1141,7 @@ Available strategies:;;
- - RowSmartPlacement: tries to place windows in rows without overlapping
- - ColSmartPlacement: tries to place windows in columns without overlapping
- - CascadePlacement: places windows below the titlebar of the previous one
-+- CenterPlacement: places windows in the center of the current workspace
- - UnderMousePlacement: places new windows underneath the mouse
- - RowMinOverlapPlacement: place windows in rows with minimal overlapping
- - ColMinOverlapPlacement: place windows in columns with minimal overlapping
-diff --git a/src/CenterPlacement.cc b/src/CenterPlacement.cc
-new file mode 100644
-index 00000000..efaf76b9
---- /dev/null
-+++ b/src/CenterPlacement.cc
-@@ -0,0 +1,43 @@
-+// CenterPlacement.cc
-+// Copyright (c) 2006 Fluxbox Team (fluxgen at fluxbox dot org)
-+//
-+// Permission is hereby granted, free of charge, to any person obtaining a
-+// copy of this software and associated documentation files (the "Software"),
-+// to deal in the Software without restriction, including without limitation
-+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+// and/or sell copies of the Software, and to permit persons to whom the
-+// Software is furnished to do so, subject to the following conditions:
-+//
-+// The above copyright notice and this permission notice shall be included in
-+// all copies or substantial portions of the Software.
-+//
-+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+// DEALINGS IN THE SOFTWARE.
-+
-+#include "CenterPlacement.hh"
-+
-+#include "FbTk/App.hh"
-+#include "Screen.hh"
-+#include "Window.hh"
-+
-+bool CenterPlacement::placeWindow(const FluxboxWindow &win, int head,
-+                                      int &place_x, int &place_y) {
-+
-+    int cent_x = (signed) win.screen().maxRight(head) - (signed) win.screen().maxLeft(head);
-+    int cent_y = (signed) win.screen().maxBottom(head) - (signed) win.screen().maxTop(head);
-+
-+    // border on 1 side, dividing in half
-+    // with rounding, this will probably favor top left
-+    int win_half_w = (win.width() / 2) + win.fbWindow().borderWidth(),
-+        win_half_h = (win.height() / 2) + win.fbWindow().borderWidth();
-+
-+    place_x = cent_x - win_half_w;
-+    place_y = cent_y - win_half_h;
-+
-+    return true;
-+}
-diff --git a/src/CenterPlacement.hh b/src/CenterPlacement.hh
-new file mode 100644
-index 00000000..9f70a6c8
---- /dev/null
-+++ b/src/CenterPlacement.hh
-@@ -0,0 +1,37 @@
-+// CenterPlacement.hh
-+// Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org)
-+//
-+// Permission is hereby granted, free of charge, to any person obtaining a
-+// copy of this software and associated documentation files (the "Software"),
-+// to deal in the Software without restriction, including without limitation
-+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+// and/or sell copies of the Software, and to permit persons to whom the
-+// Software is furnished to do so, subject to the following conditions:
-+//
-+// The above copyright notice and this permission notice shall be included in
-+// all copies or substantial portions of the Software.
-+//
-+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+// DEALINGS IN THE SOFTWARE.
-+
-+#ifndef CENTERPLACEMENT_HH
-+#define CENTERPLACEMENT_HH
-+
-+#include "ScreenPlacement.hh"
-+
-+class CenterPlacement: public PlacementStrategy {
-+public:
-+    CenterPlacement() { };
-+
-+    bool placeWindow(const FluxboxWindow &win, int head,
-+                     int &place_x, int &place_y);
-+
-+private:
-+};
-+
-+#endif // CENTERPLACEMENT_HH
-diff --git a/src/Makemodule.am b/src/Makemodule.am
-index 5be5692c..53d35e8e 100644
---- a/src/Makemodule.am
-+++ b/src/Makemodule.am
-@@ -165,6 +165,8 @@ fluxbox_SOURCES = \
- 	src/AttentionNoticeHandler.hh \
- 	src/CascadePlacement.cc \
- 	src/CascadePlacement.hh \
-+	src/CenterPlacement.cc \
-+	src/CenterPlacement.hh \
- 	src/ClientMenu.cc \
- 	src/ClientMenu.hh \
- 	src/ClientPattern.cc \
-diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
-index ca58d83f..ce47a910 100644
---- a/src/ScreenPlacement.cc
-+++ b/src/ScreenPlacement.cc
-@@ -24,6 +24,7 @@
- #include "RowSmartPlacement.hh"
- #include "MinOverlapPlacement.hh"
- #include "UnderMousePlacement.hh"
-+#include "CenterPlacement.hh"
- #include "ColSmartPlacement.hh"
- #include "CascadePlacement.hh"
- 
-@@ -82,6 +83,9 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
-         case UNDERMOUSEPLACEMENT:
-             m_strategy.reset(new UnderMousePlacement());
-             break;
-+        case CENTERPLACEMENT:
-+            m_strategy.reset(new CenterPlacement());
-+            break;
-         case AUTOTABPLACEMENT:
-             m_strategy.reset(0);
-             break;
-@@ -197,6 +201,8 @@ std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const
-         return "ColMinOverlapPlacement";
-     case ScreenPlacement::UNDERMOUSEPLACEMENT:
-         return "UnderMousePlacement";
-+    case ScreenPlacement::CENTERPLACEMENT:
-+        return "CenterPlacement";
-     case ScreenPlacement::CASCADEPLACEMENT:
-         return "CascadePlacement";
-     case ScreenPlacement::AUTOTABPLACEMENT:
-@@ -218,6 +224,8 @@ void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char
-         *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
-     else if (strcasecmp("UnderMousePlacement", str) == 0)
-         *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
-+    else if (strcasecmp("CenterPlacement", str) == 0)
-+        *(*this) = ScreenPlacement::CENTERPLACEMENT;
-     else if (strcasecmp("CascadePlacement", str) == 0)
-         *(*this) = ScreenPlacement::CASCADEPLACEMENT;
-     else if (strcasecmp("AutotabPlacement", str) == 0)
-diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
-index f1234983..a5c9b885 100644
---- a/src/ScreenPlacement.hh
-+++ b/src/ScreenPlacement.hh
-@@ -49,6 +49,7 @@ public:
-         ROWMINOVERLAPPLACEMENT,
-         CASCADEPLACEMENT,
-         UNDERMOUSEPLACEMENT,
-+        CENTERPLACEMENT,
-         AUTOTABPLACEMENT
-     };
- 
--- 
-2.37.1
-
diff --git a/srcpkgs/fluxbox/patches/container_locks.patch b/srcpkgs/fluxbox/patches/container_locks.patch
deleted file mode 100644
index 498ab44a23c6..000000000000
--- a/srcpkgs/fluxbox/patches/container_locks.patch
+++ /dev/null
@@ -1,325 +0,0 @@
-diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
-index 00bc1187..f8a4c475 100644
---- a/src/FbWinFrame.cc
-+++ b/src/FbWinFrame.cc
-@@ -148,6 +148,11 @@ FbWinFrame::FbWinFrame(BScreen &screen, unsigned int client_depth,
-     m_button_size(1),
-     m_shape(m_window, theme->shapePlace()) {
- 
-+    m_locker_timer.setTimeout(timerVal() ); // 10millisec
-+    m_locker_timer.fireOnce(true);
-+    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<FbWinFrame>(*this, &FbWinFrame::unlockSig));
-+    m_locker_timer.setCommand(usig);
-+
-     init();
- }
- 
-@@ -156,6 +161,27 @@ FbWinFrame::~FbWinFrame() {
-     removeAllButtons();
- }
- 
-+// for incremental changes, back off for a bit
-+// prevents slowdown from say, making 200 windows
-+void FbWinFrame::resetLock() {
-+    m_lock_gfx = true;
-+    m_locker_timer.start();
-+}
-+
-+void FbWinFrame::unlockSig() {
-+    m_lock_gfx = false;
-+    // this is what we wanted to do
-+    FbTk::Container& tabs = tabcontainer();
-+    tabs.setUpdateLock(m_lock_gfx);
-+    renderTabContainer();
-+    applyTabContainer();
-+
-+    tabs.clear();
-+    tabs.raise();
-+    tabs.show();
-+}
-+
-+
- bool FbWinFrame::setTabMode(TabMode tabmode) {
-     if (m_tabmode == tabmode)
-         return false;
-@@ -187,6 +213,7 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
- 
-     } else {
-         tabs.setUpdateLock(true);
-+        resetLock();
- 
-         tabs.setAlignment(FbTk::Container::RELATIVE);
-         tabs.setOrientation(FbTk::ROT0);
-@@ -200,9 +227,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
-         }
-         tabs.setBorderWidth(0);
-         tabs.setMaxTotalSize(0);
--        tabs.setUpdateLock(false);
-+        tabs.setUpdateLock(m_lock_gfx);
-         tabs.setMaxSizePerClient(0);
- 
-+        if (m_lock_gfx)
-+            return false;
-+
-         renderTabContainer();
-         applyTabContainer();
- 
-diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
-index 617b9b91..725c84a0 100644
---- a/src/FbWinFrame.hh
-+++ b/src/FbWinFrame.hh
-@@ -33,6 +33,7 @@
- #include "FbTk/Container.hh"
- #include "FbTk/Shape.hh"
- #include "FbTk/Signal.hh"
-+#include "FbTk/Timer.hh"
- 
- #include <vector>
- #include <memory>
-@@ -176,6 +177,12 @@ public:
-     void setShapingClient(FbTk::FbWindow *win, bool always_update);
-     void updateShape() { m_shape.update(); }
- 
-+    void resetLock();
-+    void unlockSig();
-+    FbTk::Timer m_locker_timer;
-+    static unsigned int timerVal() { return 10 * FbTk::FbTime::IN_MILLISECONDS; }
-+    bool m_lock_gfx = false;
-+
-     /**
-        @name accessors
-     */
-diff --git a/src/IconButton.cc b/src/IconButton.cc
-index 1290c2aa..2ea7af9e 100644
---- a/src/IconButton.cc
-+++ b/src/IconButton.cc
-@@ -71,8 +71,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent,
- 
-     FbTk::EventManager::instance()->add(*this, m_icon_window);
- 
--    reconfigTheme();
--    refreshEverything(false);
-+    //reconfigTheme();
-+    //refreshEverything(false);
- }
- 
- IconButton::~IconButton() {
-@@ -163,12 +163,12 @@ void IconButton::reconfigTheme() {
-                            width(), height(), m_theme->texture(),
-                            orientation()));
-         setBackgroundPixmap(m_pm);
--    } else{
-+    } else {
-         m_pm.reset(0);
-         setBackgroundColor(m_theme->texture().color());
-     }
- 
--    updateBackground(false);
-+    //updateBackground(false);
- }
- 
- void IconButton::reconfigAndClear() {
-@@ -181,7 +181,8 @@ void IconButton::refreshEverything(bool setup) {
-     Display *display = FbTk::App::instance()->display();
-     int screen = m_win.screen().screenNumber();
- 
--    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None) {
-+    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None &&
-+                                     width() > m_icon_window.width() ) {
-         // setup icon window
-         m_icon_window.show();
-         unsigned int w = width();
-@@ -242,7 +243,6 @@ void IconButton::refreshEverything(bool setup) {
-         m_icon_window.clear();
-     }
- 
--
- }
- 
- void IconButton::clientTitleChanged() {
-@@ -251,24 +251,30 @@ void IconButton::clientTitleChanged() {
- 
-     if (m_has_tooltip)
-         showTooltip();
-+
- }
- 
- void IconButton::setupWindow() {
-     m_icon_window.clear();
-+    //FbTk::FbString title = "wtf2";
-     FbTk::FbString title = m_win.title().logical();
--    if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
--        title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
-+    //#if USE_TOOLBAR
-+    //if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
-+    //    title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
-+    //#endif
-     setText(title);
-     FbTk::TextButton::clear();
- }
- 
- void IconButton::drawText(int x, int y, FbTk::FbDrawable *drawable) {
- 
--    // offset text
--    if (m_icon_pixmap.drawable() != 0)
--        FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
--    else
--        FbTk::TextButton::drawText(1, y, drawable);
-+    if (width() > m_icon_window.width() ) {
-+      // offset text
-+      if (m_icon_pixmap.drawable() != 0)
-+          FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
-+      else
-+          FbTk::TextButton::drawText(1, y, drawable);
-+    }
- }
- 
- bool IconButton::setOrientation(FbTk::Orientation orient) {
-diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
-index 027ab1c6..f64a4cf6 100644
---- a/src/IconbarTool.cc
-+++ b/src/IconbarTool.cc
-@@ -300,6 +300,11 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
-     FbTk::RefCount<FbTk::Command<void> > ers(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::emitResizeSig));
-     m_resizeSig_timer.setCommand(ers);
- 
-+    m_locker_timer.setTimeout(IconButton::updateLaziness() / 10); // 10millisec
-+    m_locker_timer.fireOnce(true);
-+    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::unlockSig));
-+    m_locker_timer.setCommand(usig);
-+
-     themeReconfigured();
- }
- 
-@@ -325,7 +330,7 @@ void IconbarTool::updateMaxSizes(unsigned int width, unsigned int height) {
- 
- void IconbarTool::resize(unsigned int width, unsigned int height) {
-     m_icon_container.resize(width, height);
--    updateMaxSizes(width, height);
-+    //updateMaxSizes(width, height);
-     renderTheme();
- }
- 
-@@ -333,7 +338,7 @@ void IconbarTool::moveResize(int x, int y,
-                              unsigned int width, unsigned int height) {
- 
-     m_icon_container.moveResize(x, y, width, height);
--    updateMaxSizes(width, height);
-+    //updateMaxSizes(width, height);
-     renderTheme();
- }
- 
-@@ -393,6 +398,25 @@ void IconbarTool::setMode(string mode) {
-     m_menu.reconfigure();
- }
- 
-+// for incremental changes, back off for a bit
-+// prevents slowdown from say, making 200 windows
-+void IconbarTool::resetLock() {
-+    m_lock_gfx = true;
-+    m_locker_timer.start();
-+}
-+
-+void IconbarTool::unlockSig() {
-+    m_lock_gfx = false;
-+    //resizeSig().emit();
-+    // this is what we wanted to do
-+    m_icon_container.setUpdateLock(false);
-+    m_icon_container.update();
-+    m_icon_container.showSubwindows();
-+    renderTheme();
-+    update(ALIGN, NULL);
-+    m_resizeSig_timer.start();
-+}
-+
- void IconbarTool::emitResizeSig() {
-     resizeSig().emit();
- }
-@@ -441,9 +465,11 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
-     switch(reason) {
-         case LIST_ADD: case LIST_ORDER:
-             insertWindow(*win);
-+            resetLock();
-             break;
-         case LIST_REMOVE:
-             removeWindow(*win);
-+            resetLock();
-             break;
-         case LIST_RESET:
-             reset();
-@@ -455,6 +481,10 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
-     m_resizeSig_timer.start();
- 
-     updateMaxSizes(width(), height());
-+
-+    if (m_lock_gfx)
-+        return;
-+
-     // unlock container and update graphics
-     m_icon_container.setUpdateLock(false);
-     m_icon_container.update();
-@@ -496,13 +526,13 @@ void IconbarTool::insertWindow(Focusable &win, int pos) {
-         button = makeButton(win);
-     if (!button) return;
- 
--    if (pos == -2) {
--        pos = 0;
--        list<Focusable *>::iterator it = m_winlist->clientList().begin(),
--                                    it_end = m_winlist->clientList().end();
--        for (; it != it_end && *it != &win; ++it)
--            pos++;
--    }
-+    //if (pos == -2) {
-+    //    pos = 0;
-+    //    list<Focusable *>::iterator it = m_winlist->clientList().begin(),
-+    //                                it_end = m_winlist->clientList().end();
-+    //    for (; it != it_end && *it != &win; ++it)
-+    //        pos++;
-+    //}
- 
-     m_icon_container.insertItem(button, pos);
-     m_tracker.join(button->titleChanged(), FbTk::MemFun(m_resizeSig_timer, &FbTk::Timer::start));
-@@ -517,9 +547,9 @@ void IconbarTool::updateSizing() {
-     m_icon_container.setBorderWidth(m_theme.border().width());
-     m_icon_container.setBorderColor(m_theme.border().color());
- 
--    FbTk::STLUtil::forAll(m_icons, 
--            FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
--                FbTk::Select2nd<IconMap::value_type>()));
-+    //FbTk::STLUtil::forAll(m_icons, 
-+    //        FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
-+    //            FbTk::Select2nd<IconMap::value_type>()));
- 
- }
- 
-@@ -560,7 +590,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear) {
- 
-     button.setPixmap(*m_rc_use_pixmap);
-     button.setTextPadding(*m_rc_client_padding);
--    button.reconfigTheme();
-+    //button.reconfigTheme();
-     if (clear)
-         button.clear(); // the clear also updates transparent
- }
-diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
-index df6d9a65..1c2101ac 100644
---- a/src/IconbarTool.hh
-+++ b/src/IconbarTool.hh
-@@ -106,6 +106,9 @@ private:
- 
-     void themeReconfigured();
- 
-+    void resetLock();
-+    void unlockSig();
-+    FbTk::Timer m_locker_timer;
-     FbTk::Timer m_resizeSig_timer;
-     void emitResizeSig();
- 
-@@ -128,6 +131,7 @@ private:
-     FbMenu m_menu;
-     int m_alpha;
-     static std::string s_iconifiedDecoration[2];
-+    bool m_lock_gfx = false;
- };
- 
- #endif // ICONBARTOOL_HH
diff --git a/srcpkgs/fluxbox/patches/container_relative_relative.patch b/srcpkgs/fluxbox/patches/container_relative_relative.patch
deleted file mode 100644
index dc3ddb5181b5..000000000000
--- a/srcpkgs/fluxbox/patches/container_relative_relative.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
-index cea761b3..0e050a0b 100644
---- a/src/FbTk/Container.cc
-+++ b/src/FbTk/Container.cc
-@@ -365,6 +365,9 @@ void Container::repositionItems() {
-     const ItemList::iterator it_end = end();
-
-     int rounding_error = 0;
-+    if (align == RELATIVE || total_width == m_max_total_size) {
-+        rounding_error = total_width - ((max_width_per_client + borderW)* num_items - borderW);
-+    }
-
-     int next_x = -borderW; // zero so the border of the first shows
-     int extra = 0;
-
diff --git a/srcpkgs/fluxbox/patches/flux_improve.patch b/srcpkgs/fluxbox/patches/flux_improve.patch
deleted file mode 100644
index 13a1aeba621c..000000000000
--- a/srcpkgs/fluxbox/patches/flux_improve.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/src/Ewmh.cc b/src/Ewmh.cc
-index e12a7923..db1ddd45 100644
---- a/src/Ewmh.cc
-+++ b/src/Ewmh.cc
-@@ -1096,15 +1096,19 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
-         // ce.data.l[0] = the action (remove, add or toggle)
-         // ce.data.l[1] = the first property to alter
-         // ce.data.l[2] = second property to alter (can be zero)
--        if (ce.data.l[0] == STATE_REMOVE) {
--            setState(win, ce.data.l[1], false, *winclient);
--            setState(win, ce.data.l[2], false, *winclient);
--        } else if (ce.data.l[0] == STATE_ADD) {
--            setState(win, ce.data.l[1], true, *winclient);
--            setState(win, ce.data.l[2], true, *winclient);
--        } else if (ce.data.l[0] == STATE_TOGGLE) {
--            toggleState(win, ce.data.l[1]);
--            toggleState(win, ce.data.l[2]);
-+        bool addremove = false; // add true, remove false
-+
-+        switch (ce.data.l[0]) {
-+          case STATE_TOGGLE:
-+              toggleState(win, ce.data.l[1]);
-+              toggleState(win, ce.data.l[2]);
-+              break;
-+          case STATE_ADD:
-+              addremove = true;
-+          case STATE_REMOVE:
-+              setState(win, ce.data.l[1], addremove, *winclient);
-+              setState(win, ce.data.l[2], addremove, *winclient);
-+              break;
-         }
-         return true;
-     } else if (ce.message_type == m_net->number_of_desktops) {
-diff --git a/src/FbMenuParser.cc b/src/FbMenuParser.cc
-index 716ced29..5a56e6f5 100644
---- a/src/FbMenuParser.cc
-+++ b/src/FbMenuParser.cc
-@@ -33,9 +33,9 @@ bool FbMenuParser::open(const std::string &filename) {
- }
- 
- FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
--    if (eof()) {        
-+    if (eof()) {
-         out = FbTk::Parser::s_empty_item;
--        return *this; 
-+        return *this;
-     }
- 
-     if (m_curr_line.empty())
-@@ -69,20 +69,26 @@ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
-         return (*this)>>out;
-         break;
-     }
--    
-+
-     std::string key;
-     int err = FbTk::StringUtil::
-         getStringBetween(key, m_curr_line.c_str() + m_curr_pos,
-                          first, second);
--    if (err <= 0) {        
--        if (m_curr_token == TYPE)
-+    if (err <= 0) {
-+        switch (m_curr_token) {
-+          case TYPE:
-             m_curr_token = NAME;
--        else if (m_curr_token == NAME)
-+            break;
-+          case NAME:
-             m_curr_token = ARGUMENT;
--        else if (m_curr_token == ARGUMENT)
-+            break;
-+          case ARGUMENT:
-             m_curr_token = ICON;
--        else if (m_curr_token == ICON)
-+            break;
-+          case ICON:
-             m_curr_token = DONE;
-+            break;
-+        }
- 
-         out = FbTk::Parser::s_empty_item;
-         return *this;
-diff --git a/src/Remember.cc b/src/Remember.cc
-index 49e61062..4f0ba3db 100644
---- a/src/Remember.cc
-+++ b/src/Remember.cc
-@@ -802,39 +802,41 @@ void Remember::reload() {
-             int pos = getStringBetween(key, line.c_str(), '[', ']');
-             string lc_key = toLower(key);
- 
--            if (pos > 0 && (lc_key == "app" || lc_key == "transient")) {
--                ClientPattern *pat = new ClientPattern(line.c_str() + pos);
--                if (!in_group) {
--                    if ((err = pat->error()) == 0) {
--                        bool transient = (lc_key == "transient");
--                        Application *app = findMatchingPatterns(pat,
--                                               old_pats, transient, false);
--                        if (app) {
--                            app->reset();
--                            reused_apps.insert(app);
-+            if (pos > 0) {
-+                if (lc_key == "app" || lc_key == "transient") {
-+                    ClientPattern *pat = new ClientPattern(line.c_str() + pos);
-+                    if (!in_group) {
-+                        if ((err = pat->error()) == 0) {
-+                            bool transient = (lc_key == "transient");
-+                            Application *app = findMatchingPatterns(pat,
-+                                                   old_pats, transient, false);
-+                            if (app) {
-+                                app->reset();
-+                                reused_apps.insert(app);
-+                            } else {
-+                                app = new Application(transient, false);
-+                            }
-+
-+                            m_pats->push_back(make_pair(pat, app));
-+                            row += parseApp(apps_file, *app);
-                         } else {
--                            app = new Application(transient, false);
-+                            cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
-+                            delete pat; // since it didn't work
-                         }
--
--                        m_pats->push_back(make_pair(pat, app));
--                        row += parseApp(apps_file, *app);
-                     } else {
--                        cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
--                        delete pat; // since it didn't work
-+                        grouped_pats.push_back(pat);
-                     }
--                } else {
--                    grouped_pats.push_back(pat);
--                }
--            } else if (pos > 0 && lc_key == "startup" && fb.isStartup()) {
--                if (!handleStartupItem(line, pos)) {
--                    cerr<<"Error reading apps file at line "<<row<<"."<<endl;
-+                } else if (lc_key == "startup" && fb.isStartup()) {
-+                    if (!handleStartupItem(line, pos)) {
-+                        cerr<<"Error reading apps file at line "<<row<<"."<<endl;
-+                    }
-+                    // save the item even if it was bad (aren't we nice)
-+                    m_startups.push_back(line.substr(pos));
-+                } else if (lc_key == "group") {
-+                    in_group = true;
-+                    if (line.find('(') != string::npos)
-+                        pat = new ClientPattern(line.c_str() + pos);
-                 }
--                // save the item even if it was bad (aren't we nice)
--                m_startups.push_back(line.substr(pos));
--            } else if (pos > 0 && lc_key == "group") {
--                in_group = true;
--                if (line.find('(') != string::npos)
--                    pat = new ClientPattern(line.c_str() + pos);
-             } else if (in_group) {
-                 // otherwise assume that it is the start of the attributes
-                 Application *app = 0;
-diff --git a/src/SystemTray.cc b/src/SystemTray.cc
-index 8c42877a..1fc2b0a8 100644
---- a/src/SystemTray.cc
-+++ b/src/SystemTray.cc
-@@ -550,10 +550,12 @@ void SystemTray::rearrangeClients() {
-     ClientList::iterator client_it = m_clients.begin();
-     ClientList::iterator client_it_end = m_clients.end();
-     int next_x = bw;
-+    int x, y;
-     for (; client_it != client_it_end; ++client_it) {
-         if (!(*client_it)->isVisible())
-             continue;
--        int x = next_x, y = bw;
-+        x = next_x;
-+        y = bw;
-         next_x += h_rot0+bw;
-         translateCoords(orientation(), x, y, w_rot0, h_rot0);
-         translatePosition(orientation(), x, y, h_rot0, h_rot0, 0);
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..713d1510 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -3267,14 +3267,18 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top, bool resize) {
- FluxboxWindow::ReferenceCorner FluxboxWindow::getResizeDirection(int x, int y,
-         ResizeModel model, int corner_size_px, int corner_size_pc) const
- {
--    if (model == TOPLEFTRESIZE)     return LEFTTOP;
--    if (model == TOPRESIZE)         return TOP;
--    if (model == TOPRIGHTRESIZE)    return RIGHTTOP;
--    if (model == LEFTRESIZE)        return LEFT;
--    if (model == RIGHTRESIZE)       return RIGHT;
--    if (model == BOTTOMLEFTRESIZE)  return LEFTBOTTOM;
--    if (model == BOTTOMRESIZE)      return BOTTOM;
--    if (model == CENTERRESIZE)      return CENTER;
-+    switch (model) {
-+    case TOPLEFTRESIZE:     return LEFTTOP;
-+    case TOPRESIZE:         return TOP;
-+    case TOPRIGHTRESIZE:    return RIGHTTOP;
-+    case LEFTRESIZE:        return LEFT;
-+    case RIGHTRESIZE:       return RIGHT;
-+    case BOTTOMLEFTRESIZE:  return LEFTBOTTOM;
-+    case BOTTOMRESIZE:      return BOTTOM;
-+    case CENTERRESIZE:      return CENTER;
-+    default:
-+    break;
-+    }
- 
-     if (model == EDGEORCORNERRESIZE)
-     {
diff --git a/srcpkgs/fluxbox/patches/flux_oversize.patch b/srcpkgs/fluxbox/patches/flux_oversize.patch
deleted file mode 100644
index 98d70d3b037e..000000000000
--- a/srcpkgs/fluxbox/patches/flux_oversize.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..02d10e90 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -532,19 +532,14 @@ void FluxboxWindow::init() {
-     if (!m_state.fullscreen) {
-         unsigned int new_width = 0, new_height = 0;
-         if (m_client->width() >= screen().width()) {
--            m_state.maximized |= WindowState::MAX_HORZ;
-             new_width = 2 * screen().width() / 3;
-         }
-         if (m_client->height() >= screen().height()) {
--            m_state.maximized |= WindowState::MAX_VERT;
-             new_height = 2 * screen().height() / 3;
-         }
-         if (new_width || new_height) {
--            const int maximized = m_state.maximized;
--            m_state.maximized = WindowState::MAX_NONE;
-             resize(new_width ? new_width : width(), new_height ? new_height : height());
-             m_placed = false;
--            m_state.maximized = maximized;
-         }
-     }
- 
diff --git a/srcpkgs/fluxbox/patches/focus_close_menu.patch b/srcpkgs/fluxbox/patches/focus_close_menu.patch
deleted file mode 100644
index 01830cf53460..000000000000
--- a/srcpkgs/fluxbox/patches/focus_close_menu.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/src/FocusControl.cc b/src/FocusControl.cc
-index 54c3d46c..7e49ff51 100644
---- a/src/FocusControl.cc
-+++ b/src/FocusControl.cc
-@@ -247,11 +247,7 @@ void FocusControl::stopCyclingFocus() {
- 
-     // put currently focused window to top
-     if (s_focused_window) {
--        // re-focus last window to give the client a chance to redistribute the
--        // focus internally (client-side only modality)
--        s_focused_window->focus();
--        if (s_focused_window)
--            setScreenFocusedWindow(*s_focused_window);
-+        setScreenFocusedWindow(*s_focused_window);
-         if (s_focused_fbwindow)
-             s_focused_fbwindow->raise();
-     } else
diff --git a/srcpkgs/fluxbox/patches/slit_raise.patch b/srcpkgs/fluxbox/patches/slit_raise.patch
deleted file mode 100644
index a3bc01c7ac85..000000000000
--- a/srcpkgs/fluxbox/patches/slit_raise.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/src/Slit.cc b/src/Slit.cc
-index 9baecf21..63ed8269 100644
---- a/src/Slit.cc
-+++ b/src/Slit.cc
-@@ -958,8 +958,8 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
-         return;
-     }
-
--    if (be.button == 1)
--        frame.window.raise();
-+    //if (be.button == 1)
-+    //    frame.window.raise();
-
-     if (be.button != Button3) {
-         XAllowEvents(dpy, ReplayPointer, CurrentTime);
-
diff --git a/srcpkgs/fluxbox/patches/toolbar_redo.patch b/srcpkgs/fluxbox/patches/toolbar_redo.patch
deleted file mode 100644
index ca95486583ce..000000000000
--- a/srcpkgs/fluxbox/patches/toolbar_redo.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-diff --git a/src/Toolbar.cc b/src/Toolbar.cc
-index aa9bc121..ee8b8bfc 100644
---- a/src/Toolbar.cc
-+++ b/src/Toolbar.cc
-@@ -74,7 +74,7 @@ using FbTk::STLUtil::forAll;
- 
- namespace {
- 
--const struct { 
-+const struct {
-     Toolbar::Placement placement;
-     const char* str;
-     FbTk::Orientation orient;
-@@ -362,13 +362,16 @@ void Toolbar::lower() {
- }
- 
- void Toolbar::screenChanged(BScreen &screen) {
--    reconfigure();
-+    //reconfigure();
- }
- 
- void Toolbar::relayout() {
--    forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
--    rearrangeItems();
--    forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
-+    //for (auto it : m_item_list)    (*item_it)->updateSizing();
-+    //rearrangeItems();
-+    //for (auto it : m_item_list)    (*item_it)->renderTheme(alpha());
-+    //forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
-+    //rearrangeItems();
-+    //forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
- }
- 
- void Toolbar::reconfigure() {
-@@ -557,12 +560,16 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
- }
- 
- void Toolbar::updateCrossingState() {
--    Window wr, wc;
--    int rx, ry, x, y;
-+    //Window wr, wc;
-+    //int rx, ry, x, y;
-+    //unsigned int mask;
-+    Window wrc;
-+    int rxy, x, y;
-     unsigned int mask;
-     const int bw = -theme()->border().width();
-     bool hovered = false;
--    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
-+    //if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
-+    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wrc, &wrc, &rxy, &rxy, &x, &y, &mask))
-         hovered = x >= bw && y >= bw && x < int(width()) && y < int(height());
-     if (hovered) {
-         if (m_rc_auto_raise)
-@@ -910,25 +917,26 @@ void Toolbar::rearrangeItems() {
-     // lock this
-     m_resize_lock = true;
-     // calculate size for fixed items
--    ItemList::iterator item_it = m_item_list.begin();
--    ItemList::iterator item_it_end = m_item_list.end();
-+    //ItemList::iterator item_it = m_item_list.begin();
-+    //ItemList::iterator item_it_end = m_item_list.end();
-     int bevel_width = theme()->bevelWidth();
-     int fixed_width = bevel_width; // combined size of all fixed items
-     int relative_width = 0; // combined *desired* size of all relative items
--    int stretch_items = 0;
-     int relative_items = 0;
-     int last_bw = 0; // we show the largest border of adjoining items
-     bool first = true;
-+    int leftover_width = 0;
- 
-     unsigned int width = this->width(), height = this->height();
-     unsigned int tmpw, tmph;
-     FbTk::translateSize(orient, width, height);
- 
--    for (; item_it != item_it_end; ++item_it) {
--        if (!(*item_it)->active())
-+    //for (; item_it != item_it_end; ++item_it) {
-+    for (auto item_it : m_item_list) {
-+        if (!(*item_it).active())
-             continue;
- 
--        int borderW = (*item_it)->borderWidth();
-+        int borderW = (*item_it).borderWidth();
- 
-         if (bevel_width > 0) {
-             // the bevel and border are fixed whether relative or not
-@@ -943,35 +951,35 @@ void Toolbar::rearrangeItems() {
- 
-         last_bw = borderW;
- 
--        tmpw = (*item_it)->preferredWidth();
--        tmph = (*item_it)->height();
-+        tmpw = (*item_it).preferredWidth();
-+        tmph = (*item_it).height();
-         FbTk::translateSize(orient, tmpw, tmph);
- 
--        if ((*item_it)->type() == ToolbarItem::FIXED) {
--            fixed_width += tmpw;
--        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
--            fixed_width += height;
--            if (bevel_width)
--                fixed_width -= 2*(borderW + bevel_width);
--        } else {
--            ++relative_items;
--            relative_width += tmpw;
--            if (!tmpw)
--                ++stretch_items;
-+        switch ( (*item_it).type() ) {
-+            case ToolbarItem::FIXED:
-+                fixed_width += tmpw;
-+                break;
-+            case ToolbarItem::SQUARE:
-+                fixed_width += height;
-+                if (bevel_width)
-+                    fixed_width -= 2*(borderW + bevel_width);
-+                break;
-+            case ToolbarItem::RELATIVE:
-+                ++relative_items;
-+                relative_width += tmpw;
-+                break;
-+            default:
-+                break;
-         }
-     }
- 
-     // calculate what's going to be left over to the relative sized items
--    float stretch_factor = 1.0f;
-     if (relative_items) {
--        if (relative_width <= width - fixed_width && stretch_items) {
--            relative_width = int(width - fixed_width - relative_width)/stretch_items;
--        } else if (relative_width) {
--            stretch_factor = float(width - fixed_width)/relative_width;
--            relative_width = 0;
--        }
-+        relative_width = (width - fixed_width) / relative_items;
-+        leftover_width = width - fixed_width - relative_items * relative_width;
-     }
- 
-+
-     // now move and resize the items
-     // borderWidth added back on straight away
-     int next_x = -m_item_list.front()->borderWidth(); // list isn't empty
-@@ -979,19 +987,22 @@ void Toolbar::rearrangeItems() {
-         next_x = 0;
- 
-     last_bw = 0;
--    for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
--        int borderW = (*item_it)->borderWidth();
--        if (!(*item_it)->active()) {
--            (*item_it)->hide();
-+    int borderW, offset, size_offset, tmpx, tmpy;
-+
-+    //for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
-+    for (auto item_it : m_item_list) {
-+        borderW = (*item_it).borderWidth();
-+        if (!(*item_it).active()) {
-+            (*item_it).hide();
-             // make sure it still gets told the toolbar height
-             tmpw = 1; tmph = height - 2*(bevel_width+borderW);
-             if (tmph >= (1<<30)) tmph = 1;
-             FbTk::translateSize(orient, tmpw, tmph);
--            (*item_it)->resize(tmpw, tmph);  // width of 0 changes to 1 anyway
-+            (*item_it).resize(tmpw, tmph);  // width of 0 changes to 1 anyway
-             continue;
-         }
--        int offset = bevel_width;
--        int size_offset = 2*(borderW + bevel_width);
-+        offset = bevel_width;
-+        size_offset = 2*(borderW + bevel_width);
- 
-         if (bevel_width == 0) {
-             offset = -borderW;
-@@ -1000,22 +1011,28 @@ void Toolbar::rearrangeItems() {
-         }
-         last_bw = borderW;
- 
--        int tmpx = next_x + offset,
--            tmpy = offset;
--
--        if ((*item_it)->type() == ToolbarItem::RELATIVE) {
--            unsigned int itemw = (*item_it)->preferredWidth(), itemh = (*item_it)->height();
--            FbTk::translateSize(orient, itemw, itemh);
--            tmpw = itemw ? std::floor(stretch_factor * itemw) : relative_width;
--            tmph = height - size_offset;
--        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
--            tmpw = tmph = height - size_offset;
--        } else { // fixed size
--            unsigned int itemw = (*item_it)->width(), itemh = (*item_it)->height();
--            FbTk::translateSize(orient, itemw, itemh);
--            tmpw = itemw;
--            tmph = height - size_offset;
-+        tmpx = next_x + offset,
-+        tmpy = offset;
-+        tmph = height - size_offset;
-+
-+        switch ( (*item_it).type() ) {
-+            case ToolbarItem::SQUARE:
-+                tmpw = tmph;
-+                break;
-+            case ToolbarItem::RELATIVE:
-+                tmpw = relative_width;
-+                if (leftover_width) {
-+                    --leftover_width;
-+                    ++tmpw;
-+                }
-+                break;
-+            case ToolbarItem::FIXED:
-+                unsigned int itemw = (*item_it).width(), itemh = (*item_it).height();
-+                FbTk::translateSize(orient, itemw, itemh);
-+                tmpw = itemw;
-+                break;
-         }
-+
-         if (tmpw >= (1<<30)) tmpw = 1;
-         if (tmph >= (1<<30)) tmph = 1;
-         next_x += tmpw + bevel_width;
-@@ -1025,8 +1042,8 @@ void Toolbar::rearrangeItems() {
-         FbTk::translateCoords(orient, tmpx, tmpy, width, height);
-         FbTk::translatePosition(orient, tmpx, tmpy, tmpw, tmph, borderW);
-         FbTk::translateSize(orient, tmpw, tmph);
--        (*item_it)->moveResize(tmpx, tmpy, tmpw, tmph);
--        (*item_it)->show();
-+        (*item_it).moveResize(tmpx, tmpy, tmpw, tmph);
-+        //(*item_it).show();
- 
-     }
-     // unlock
diff --git a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
deleted file mode 100644
index 189a314607bd..000000000000
--- a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
+++ /dev/null
@@ -1,350 +0,0 @@
-diff --git a/src/FbTk/EventManager.cc b/src/FbTk/EventManager.cc
-index 3df56de5..501766cc 100644
---- a/src/FbTk/EventManager.cc
-+++ b/src/FbTk/EventManager.cc
-@@ -194,23 +194,22 @@ void EventManager::dispatch(Window win, XEvent &ev, bool parent) {
- 
-     // find out which window is the parent and
-     // dispatch event
--    Window root, parent_win, *children = 0;
--    unsigned int num_children;
--    if (XQueryTree(FbTk::App::instance()->display(), win,
--                   &root, &parent_win, &children, &num_children) != 0) {
--        if (children != 0)
--            XFree(children);
--
--        if (parent_win != 0 &&
--            parent_win != root) {
--            if (m_parent[parent_win] == 0)
--                return;
--
--            // dispatch event to parent
--            dispatch(parent_win, ev, true);
--        }
--    }
--
-+//    Window root, parent_win, *children = 0;
-+//    unsigned int num_children;
-+//    if (XQueryTree(FbTk::App::instance()->display(), win,
-+//                   &root, &parent_win, &children, &num_children) != 0) {
-+//        if (children != 0)
-+//            XFree(children);
-+//
-+//        if (parent_win != 0 &&
-+//            parent_win != root) {
-+//            if (m_parent[parent_win] == 0)
-+//                return;
-+//
-+//            // dispatch event to parent
-+//            dispatch(parent_win, ev, true);
-+//        }
-+//    }
- }
- 
- } // end namespace FbTk
-diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc
-index 73f2ea06..cf863021 100644
---- a/src/FbTk/KeyUtil.cc
-+++ b/src/FbTk/KeyUtil.cc
-@@ -141,13 +141,14 @@ void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win,
-     const unsigned int scrollmod = instance().scrolllock();
- 
-     // Grab with numlock, capslock and scrlock
--    for (int i = 0; i < 8; i++) {
--        XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
--                    (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
--                    win, False, event_mask, GrabModeSync, GrabModeAsync,
--                    None, cursor);
--    }
--
-+    //for (int i = 0; i < 8; i++) {
-+    //    XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
-+    //                (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
-+    //                win, True, event_mask, GrabModeSync, GrabModeAsync,
-+    //                None, cursor);
-+    //}
-+    XGrabButton(display, button, mod, win, True, event_mask,
-+                GrabModeSync, GrabModeAsync, None, cursor);
- }
- 
- /**
-diff --git a/src/Keys.cc b/src/Keys.cc
-index 86591371..c27037e2 100644
---- a/src/Keys.cc
-+++ b/src/Keys.cc
-@@ -277,7 +277,7 @@ void Keys::grabWindow(Window win) {
-     if (win_it == m_window_map.end())
-         return;
- 
--    m_handler_map[win]->grabButtons();
-+    //m_handler_map[win]->grabButtons();
-     t_key::keylist_t::iterator it = m_keylist->keylist.begin();
-     t_key::keylist_t::iterator it_end = m_keylist->keylist.end();
-     for (; it != it_end; ++it) {
-@@ -586,16 +586,16 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-         isdouble = double_click;
-     }
- 
--    auto resetKeyChain = [&]() {
--        first_key_time = 0;
--        next_key.reset();
--        if (saved_keymode) {
--            setKeyMode(saved_keymode);
--            saved_keymode.reset();
--        }
--    };
--    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
--        resetKeyChain();
-+//    auto resetKeyChain = [&]() {
-+//        first_key_time = 0;
-+//        next_key.reset();
-+//        if (saved_keymode) {
-+//            setKeyMode(saved_keymode);
-+//            saved_keymode.reset();
-+//        }
-+//    };
-+//    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
-+//        resetKeyChain();
- 
-     if (!next_key)
-         next_key = m_keylist;
-@@ -612,29 +612,29 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-         next_key->find(MotionNotify, mods, key, context, false))
-         return true; // if there's a motion action, prevent replay to the client (but do nothing)
- 
--    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
--        if (!saved_keymode) {
--            first_key_time = time;
--            saved_keymode = m_keylist;
--        }
--        next_key = temp_key;
--        setKeyMode(next_key);
--        return true;
--    }
-+//    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
-+//        if (!saved_keymode) {
-+//            first_key_time = time;
-+//            saved_keymode = m_keylist;
-+//        }
-+//        next_key = temp_key;
-+//        setKeyMode(next_key);
-+//        return true;
-+//    }
-+
-     if (!temp_key || temp_key->m_command == 0) {
--        if (type == KeyPress &&
--            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
--            // if we're in the middle of an emacs-style keychain, exit it
--            resetKeyChain();
--        }
-+//        if (type == KeyPress &&
-+//            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
-+//            // if we're in the middle of an emacs-style keychain, exit it
-+//            resetKeyChain();
-+//        }
-         return false;
-     }
- 
-     // if focus changes, windows will get NotifyWhileGrabbed,
-     // which they tend to ignore
--    if (type == KeyPress) {
-+    if (type == KeyPress)
-         XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
--    }
- 
-     WinClient *old = WindowCmd<void>::client();
-     WindowCmd<void>::setClient(current);
-@@ -650,12 +650,13 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-     temp_key->m_command->execute();
-     WindowCmd<void>::setClient(old);
- 
--    if (saved_keymode) {
--        if (next_key == m_keylist) // don't reset keymode if command changed it
--            setKeyMode(saved_keymode);
--        saved_keymode.reset();
--    }
--    next_key.reset();
-+//    if (saved_keymode) {
-+//        if (next_key == m_keylist) // don't reset keymode if command changed it
-+//            setKeyMode(saved_keymode);
-+//        saved_keymode.reset();
-+//    }
-+//    next_key.reset();
-+
-     return true;
- }
- 
-@@ -685,15 +686,16 @@ void Keys::reconfigure() {
- }
- 
- void Keys::regrab() {
--    setKeyMode(m_keylist);
-+    //setKeyMode(m_keylist);
- }
- 
- void Keys::keyMode(const string& keyMode) {
--    keyspace_t::iterator it = m_map.find(keyMode + ":");
--    if (it == m_map.end())
-+    //keyspace_t::iterator it = m_map.find(keyMode + ":");
-+    //if (it == m_map.end())
-+    //    setKeyMode(m_map["default:"]);
-+    //else
-+    //    setKeyMode(it->second);
-         setKeyMode(m_map["default:"]);
--    else
--        setKeyMode(it->second);
- }
- 
- void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
-@@ -701,10 +703,10 @@ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
-     ungrabButtons();
- 
-     // notify handlers that their buttons have been ungrabbed
--    HandlerMap::iterator h_it = m_handler_map.begin(),
--                         h_it_end  = m_handler_map.end();
--    for (; h_it != h_it_end; ++h_it)
--        h_it->second->grabButtons();
-+    //HandlerMap::iterator h_it = m_handler_map.begin(),
-+    //                     h_it_end  = m_handler_map.end();
-+    //for (; h_it != h_it_end; ++h_it)
-+    //    h_it->second->grabButtons();
- 
-     t_key::keylist_t::iterator it = keyMode->keylist.begin();
-     t_key::keylist_t::iterator it_end = keyMode->keylist.end();
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..457c30c6 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -1133,13 +1133,25 @@ void FluxboxWindow::updateSizeHints() {
- }
- 
- void FluxboxWindow::grabButtons() {
--
-+//NOGRAB
-+    //if (m_client->window() != frame().window().window() ) return;
-     // needed for click to focus
--    XGrabButton(display, Button1, AnyModifier,
--                frame().window().window(), True, ButtonPressMask,
--                GrabModeSync, GrabModeSync, None, None);
--    XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
--                  frame().window().window());
-+    // grabbing async here breaks mouse1
-+    //XGrabButton(display, Button1, AnyModifier,
-+    //            frame().window().window(), True, ButtonPressMask,
-+    //            GrabModeSync, GrabModeSync, None, None);
-+    //            //GrabModeAsync, GrabModeAsync, None, None);
-+    //XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
-+    //              frame().window().window());
-+    //XGrabPointer(display,
-+    //             frame().window().window(),
-+    //             True,
-+    //             ButtonPressMask,
-+    //             GrabModeAsync, GrabModeAsync,
-+    //             None,
-+    //             None,
-+    //             CurrentTime);
-+    //XUngrabPointer(display, CurrentTime);
- }
- 
- 
-@@ -2429,63 +2441,41 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
-     m_last_pressed_button = be.button;
- 
-     FbTk::Menu::hideShownMenu();
--
-+//FIX ALLOW
-     Keys *k = Fluxbox::instance()->keys();
-     int context = 0;
-     context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);
-     if (!context && be.subwindow)
-         context = frame().getContext(be.window);
- 
--    if (k->doAction(be.type, be.state, be.button, context, &winClient(), be.time)) {
--        XAllowEvents(display, SyncPointer, CurrentTime);
--        return;
--    }
--
--    WinClient *client = 0;
--    if (!screen().focusControl().isMouseTabFocus()) {
--        // determine if we're in a label button (tab)
--        client = winClientOfLabelButtonWindow(be.window);
--    }
--
--
--    // - refeed the event into the queue so the app or titlebar subwindow gets it
--    if (be.subwindow)
--        XAllowEvents(display, ReplayPointer, CurrentTime);
--    else
--        XAllowEvents(display, SyncPointer, CurrentTime);
--
--    // if nothing was bound via keys-file then
--    // - raise() if clickRaise is enabled
--    // - hide open menues
--    // - focus on clickFocus
--    if (frame().window().window() == be.window) {
--        if (screen().clickRaises())
--            raise();
--
--        m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
--        m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
--    }
--
--    if (!m_focused && acceptsFocus() && m_click_focus)
--        focus();
--
--    if (!screen().focusControl().isMouseTabFocus() &&
--        client && client != m_client &&
--        !screen().focusControl().isIgnored(be.x_root, be.y_root) ) {
--        setCurrentClient(*client, isFocused());
--    }
--
--
--
-+std::cout << "button window: " << be.window << "\nbutton subwindow: " << be.subwindow << "\n";
-+k->doAction(be.type, be.state, be.button, context, &winClient(), CurrentTime); // w/o this, no mouse cmds
-+XAllowEvents(display, ReplayPointer, CurrentTime); // w/o this, no mouse
-+// ultimately none of the below matters
-+    // infinite loop
-+    //if (be.subwindow) {
-+    //  //XEvent omfg = (XEvent *)&be;
-+    //  //be.window = be.subwindow;
-+    //  //be.subwindow = 0;
-+    //  int huh = XSendEvent(display, be.window, False, ButtonPressMask, (XEvent*)&be);
-+    //  std::cout << "xsendevent: " << huh << "\n";
-+    //}
-+    //XSync(display, 0);
-+    //int wtf = XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
-+    //std::cout << "xallowevents: " << wtf << "\n";
-+    //XSync(display, 0);
-+    //XAllowEvents(display, ReplayPointer, be.time); // time means squat - works but not for menus
-+    //XAllowEvents(display, SyncPointer, CurrentTime); // sync will not doubleclick or act proper
-+    //XAllowEvents(display, AsyncPointer, CurrentTime); // ^^ same
-+    //if (be.subwindow)
-+    //  XFlush(display);
-+    //  //XSync(display, True);
- }
- 
- const unsigned int DEADZONE = 4;
- 
- void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
- 
--    if (m_last_pressed_button == static_cast<int>(re.button)) {
--        m_last_pressed_button = 0;
--    }
- 
-     if (isMoving())
-         stopMoving();
-@@ -2502,6 +2492,13 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
- 
-         Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button,
-                                               context, &winClient(), re.time);
-+      // syncs dont make a difference?
-+      //XSync(display, 0);
-+      XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
-+      //XSync(display, 0);
-+    }
-+    if (m_last_pressed_button == static_cast<int>(re.button)) {
-+        m_last_pressed_button = 0;
-     }
- }
- 
diff --git a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
deleted file mode 100644
index 36c572cea4ff..000000000000
--- a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
-index c2e49485..9b4058c8 100644
---- a/src/WorkspaceCmd.cc
-+++ b/src/WorkspaceCmd.cc
-@@ -521,22 +521,24 @@ void ArrangeWindowsCmd::execute() {
-     const unsigned int cal_width = max_width/cols; // width ratio (width of every window)
-     const unsigned int cal_height = max_height/rows; // height ratio (height of every window)
-
-+    int cell_center_x = 0, cell_center_y = 0, win_center_x = 0, win_center_y = 0, x = 0, y = 0;
-+    unsigned int closest_dist = ~0, dist = 0, w = 0, h = 0;
-     // Resizes and sets windows positions in columns and rows.
-     for (i = 0; i < rows; ++i) {
-         x_offs = orig_x_offs;
-         for (j = 0; j < cols && !normal_windows.empty(); ++j) {
-
-
--            int cell_center_x = x_offs + (x_offs + cal_width) / 2;
--            int cell_center_y = y_offs + (y_offs + cal_height) / 2;
--            unsigned int closest_dist = ~0;
-+            cell_center_x = x_offs + (x_offs + cal_width) / 2;
-+            cell_center_y = y_offs + (y_offs + cal_height) / 2;
-+            int closest_dist = ~0;
-
-             Workspace::Windows::iterator closest = normal_windows.end();
-             for (win = normal_windows.begin(); win != normal_windows.end(); ++win) {
-
--                int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
--                int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
--                unsigned int dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
-+                win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
-+                win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
-+                dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
-                                     (win_center_y - cell_center_y) * (win_center_y - cell_center_y);
-
-                 if (dist < closest_dist) {
-@@ -545,10 +547,10 @@ void ArrangeWindowsCmd::execute() {
-                 }
-             }
-
--            int x = x_offs + (*closest)->xOffset();
--            int y = y_offs + (*closest)->yOffset();
--            unsigned int w = cal_width - (*closest)->widthOffset();
--            unsigned int h = cal_height - (*closest)->heightOffset();
-+            x = x_offs + (*closest)->xOffset();
-+            y = y_offs + (*closest)->yOffset();
-+            w = cal_width - (*closest)->widthOffset();
-+            h = cal_height - (*closest)->heightOffset();
-
-             // the last window gets everything that is left.
-             if (normal_windows.size() == 1) {
-@@ -620,12 +622,9 @@ void UnclutterCmd::execute() {
-         return;
-
-     // place
--    MinOverlapPlacement mopp;
-     int x, y;
--    for (win = placed_windows.begin(); win != placed_windows.end(); ++win) {
--        mopp.placeWindow(**win, head, x, y);
--        (*win)->move(x, y);
--    }
-+    for (win = placed_windows.begin(); win != placed_windows.end(); ++win)
-+        (*win)->placeWindow((*win)->getOnHead());
- }
-
- REGISTER_COMMAND(showdesktop, ShowDesktopCmd, void);
diff --git a/srcpkgs/fluxbox/patches/zor_loops.patch b/srcpkgs/fluxbox/patches/zor_loops.patch
deleted file mode 100644
index 95d992f9071d..000000000000
--- a/srcpkgs/fluxbox/patches/zor_loops.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-diff --git a/src/FbTk/STLUtil.hh b/src/FbTk/STLUtil.hh
-index abc54729..9c9c27f9 100644
---- a/src/FbTk/STLUtil.hh
-+++ b/src/FbTk/STLUtil.hh
-@@ -48,46 +48,63 @@ struct IfThenElse<false, Ta, Tb> {
- /// calls delete on each item in the container and then clears the container
- template <typename A>
- void destroyAndClear(A &a) {
--    typedef typename A::iterator iterator;
--    iterator it = a.begin();
--    iterator it_end = a.end();
--    for (; it != it_end; ++it)
--        delete (*it);
-+    //typedef typename A::iterator iterator;
-+    //iterator it = a.begin();
-+    //iterator it_end = a.end();
-+    //for (; it != it_end; ++it)
-+    //    delete (*it);
- 
-+    //a.clear();
-+    typedef typename A::iterator iterator;
-+    for (auto it : a)
-+        delete it;
-     a.clear();
- }
- 
- /// calls delete on each item value in the map and then clears the map
- template <typename A>
- void destroyAndClearSecond(A &a) {
-+    //typedef typename A::iterator iterator;
-+    //iterator it = a.begin();
-+    //iterator it_end = a.end();
-+    //for (; it != it_end; ++it)
-+    //    delete it->second;
-+    //a.clear();
-     typedef typename A::iterator iterator;
--    iterator it = a.begin();
--    iterator it_end = a.end();
--    for (; it != it_end; ++it)
--        delete it->second;
-+    for (auto it : a)
-+        delete it.second;
-     a.clear();
- }
- 
- 
- template <typename C, typename F>
- F forAll(C& c, F f) {
-+    //typedef typename C::iterator iterator;
-+    //iterator i = c.begin();
-+    //iterator e = c.end();
-+    //for (; i != e; i++) {
-+    //    f(*i);
-+    //}
-     typedef typename C::iterator iterator;
--    iterator i = c.begin();
--    iterator e = c.end();
--    for (; i != e; i++) {
--        f(*i);
--    }
-+    for (auto i : c)
-+        f(i);
-     return f;
- }
- 
- template <typename C, typename I, typename F>
- F forAllIf(C& c, I i, F f) {
-+    //typedef typename C::iterator iterator;
-+    //iterator it = c.begin();
-+    //iterator end = c.end();
-+    //for (; it != end; ++it) {
-+    //    if (i(*it))
-+    //        f(*it);
-+    //}
-+    //return f;
-     typedef typename C::iterator iterator;
--    iterator it = c.begin();
--    iterator end = c.end();
--    for (; it != end; ++it) {
--        if (i(*it))
--            f(*it);
-+    for (auto it : c) {
-+        if (i(it))
-+            f(it);
-     }
-     return f;
- }
diff --git a/srcpkgs/fluxbox/template b/srcpkgs/fluxbox/template
index 6b0e4cd260cb..e10b426c4924 100644
--- a/srcpkgs/fluxbox/template
+++ b/srcpkgs/fluxbox/template
@@ -1,56 +1,29 @@
 # Template file for 'fluxbox'
 pkgname=fluxbox
-version=1.3.8
-#nostrip=nostrip
-_commit=e2cbd179ecb2ef2d76e0ad1fde84b44325305799
-revision=0
-wrksrc=fluxbox-${_commit}
+version=1.3.7
+revision=4
 build_style=gnu-configure
-configure_args="--disable-nls --disable-xinerama --disable-shape --disable-xrender
- --disable-fribidi --disable-slit
+configure_args="--enable-nls
  ac_cv_lib_X11_XOpenDisplay=yes ac_cv_lib_Xft_XftFontOpen=yes
  ac_cv_lib_Xrender_XRenderCreatePicture=yes ac_cv_lib_Xpm_XpmReadFileToPixmap=yes
- ac_cv_lib_Xext_XShapeCombineShape=no
+ ac_cv_lib_Xinerama_XineramaQueryScreens=yes ac_cv_lib_Xext_XShapeCombineShape=yes
  ac_cv_lib_Xrandr_XRRQueryExtension=yes ac_cv_lib_fribidi_fribidi_version_info=yes"
-hostmakedepends="pkg-config automake libtool gettext gettext-devel clang llvm"
+hostmakedepends="pkg-config automake libtool gettext gettext-devel"
 makedepends="libSM-devel libXrender-devel libXft-devel libXpm-devel imlib2-devel
- libXext-devel libXrandr-devel fribidi-devel"
+ libXext-devel libXinerama-devel libXrandr-devel fribidi-devel"
 short_desc="Highly configurable and low resource X11 Window manager"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="http://www.fluxbox.org"
-distfiles="https://github.com/fluxbox/fluxbox/archive/${_commit}.tar.gz"
-checksum=6740d9cd4a3e631e0130cbcbc91ccac6af6335dc120f9adc5ebbc8dc9d3259a0
-
-nopie=yes
-X11_FLAGS="-Os -pipe"
-#FRIBIDI_CFLAGS="-Os -pipe"
-XRANDR_CFLAGS="-Os -pipe"
-AM_CPPFLAGS="-Os -pipe"
-CFLAGS="-Os -pipe"
-CXXFLAGS="-Os -pipe -std=c++11"
-CC="clang"
-CXX="clang++"
-HOST_CC=clang
-HOST_CXX=clang++
+distfiles="https://github.com/fluxbox/fluxbox/archive/refs/tags/Release-${version//./_}.tar.gz"
+checksum=990414ae342a35c5703e5025a8bf019b0b4dada55d57071c51d3d498abb5cd36
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) configure_args="${configure_args/enable-nls/disable-nls}" ;;
 esac
 
 pre_configure() {
-  export X11_FLAGS="-Os -pipe"
-  # export FRIBIDI_CFLAGS="-Os -pipe"
-  export XRANDR_CFLAGS="-Os -pipe"
-  export AM_CPPFLAGS="-Os -pipe"
-  export CFLAGS="-Os -pipe"
-  export CXXFLAGS="-Os -pipe -std=c++11"
-  export CC="clang"
-  export CXX="clang++"
-  export HOST_CC=clang
-  export HOST_CXX=clang++
-  export PREFIX=/usr
-  ./autogen.sh
+	./autogen.sh
 }
 
 post_install() {
diff --git a/srcpkgs/freerdp/template b/srcpkgs/freerdp/template
index 53e67690f863..1b50e9a86bb2 100644
--- a/srcpkgs/freerdp/template
+++ b/srcpkgs/freerdp/template
@@ -1,7 +1,7 @@
 # Template file for 'freerdp'
 pkgname=freerdp
 version=2.9.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_ALSA=ON -DWITH_CUPS=OFF -DWITH_FFMPEG=ON
  -DWITH_GSTREAMER_0_10=OFF -DWITH_GSTREAMER_1_0=OFF -DWITH_JPEG=ON
diff --git a/srcpkgs/gerbera/template b/srcpkgs/gerbera/template
index ae14f35c767c..2dc0ac0ce03b 100644
--- a/srcpkgs/gerbera/template
+++ b/srcpkgs/gerbera/template
@@ -1,7 +1,7 @@
 # Template file for 'gerbera'
 pkgname=gerbera
 version=1.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_SYSTEMD=0 -DWITH_AVCODEC=1"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-1.patch b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
new file mode 100644
index 000000000000..7cfc98ada368
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
@@ -0,0 +1,232 @@
+From 03bbe01b79a1f07a6780cb60f23a087104c5d77b Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 30 Mar 2018 22:53:24 +0300
+Subject: [PATCH] Fix warnings while compile with FFMpeg 3.4.2 (issue #978)
+
+---
+ ffmpegaudio.cc | 68 +++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 62 insertions(+), 6 deletions(-)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index ed1172bdd..56e8f788e 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -91,6 +91,7 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++  AVCodec * codec_;
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
+@@ -114,6 +115,7 @@ DecoderContext::DecoderContext( QByteArray const & audioData, QAtomicInt & isCan
+   audioData_( audioData ),
+   audioDataStream_( audioData_ ),
+   formatContext_( NULL ),
++  codec_( NULL ),
+   codecContext_( NULL ),
+   avioContext_( NULL ),
+   audioStream_( NULL ),
+@@ -143,7 +145,11 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 56 || ( LIBAVCODEC_VERSION_MAJOR == 56 && LIBAVCODEC_VERSION_MINOR < 56 )
+   unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
++#else
++  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
++#endif
+   if ( !avioBuffer )
+   {
+     errorString = QObject::tr( "av_malloc() failed." );
+@@ -186,7 +192,11 @@ bool DecoderContext::openCodec( QString & errorString )
+   // Find audio stream, use the first audio stream if available
+   for ( unsigned i = 0; i < formatContext_->nb_streams; i++ )
+   {
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+     if ( formatContext_->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO )
++#else
++      if ( formatContext_->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO )
++#endif
+     {
+       audioStream_ = formatContext_->streams[i];
+       break;
+@@ -198,22 +208,38 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+   codecContext_ = audioStream_->codec;
+-  AVCodec * codec = avcodec_find_decoder( codecContext_->codec_id );
+-  if ( !codec )
++  codec_ = avcodec_find_decoder( codecContext_->codec_id );
++  if ( !codec_ )
+   {
+     errorString = QObject::tr( "Codec [id: %1] not found." ).arg( codecContext_->codec_id );
+     return false;
+   }
++#else
++  codec_ = avcodec_find_decoder( audioStream_->codecpar->codec_id );
++  if ( !codec_ )
++  {
++    errorString = QObject::tr( "Codec [id: %1] not found." ).arg( audioStream_->codecpar->codec_id );
++    return false;
++  }
++  codecContext_ = avcodec_alloc_context3( codec_ );
++  if ( !codecContext_ )
++  {
++    errorString = QObject::tr( "avcodec_alloc_context3() failed." );
++    return false;
++  }
++  avcodec_parameters_to_context( codecContext_, audioStream_->codecpar );
++#endif
+
+-  ret = avcodec_open2( codecContext_, codec, NULL );
++  ret = avcodec_open2( codecContext_, codec_, NULL );
+   if ( ret < 0 )
+   {
+     errorString = QObject::tr( "avcodec_open2() failed: %1." ).arg( avErrorString( ret ) );
+     return false;
+   }
+
+-  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec->long_name,
++  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec_->long_name,
+           codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
+   return true;
+ }
+@@ -252,10 +278,13 @@ void DecoderContext::closeCodec()
+
+   // Closing a codec context without prior avcodec_open2() will result in
+   // a crash in ffmpeg
+-  if ( audioStream_ && audioStream_->codec && audioStream_->codec->codec )
++  if ( audioStream_ && codecContext_ && codec_ )
+   {
+     audioStream_->discard = AVDISCARD_ALL;
+-    avcodec_close( audioStream_->codec );
++    avcodec_close( codecContext_ );
++#if LIBAVCODEC_VERSION_MAJOR > 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR >= 33 )
++    avcodec_free_context( &codecContext_ );
++#endif
+   }
+
+   avformat_close_input( &formatContext_ );
+@@ -356,6 +385,7 @@ bool DecoderContext::play( QString & errorString )
+     if ( packet.stream_index == audioStream_->index )
+     {
+       AVPacket pack = packet;
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+       int gotFrame = 0;
+       do
+       {
+@@ -370,6 +400,19 @@ bool DecoderContext::play( QString & errorString )
+         pack.data += len;
+       }
+       while( pack.size > 0 );
++#else
++      int ret = avcodec_send_packet( codecContext_, &pack );
++      /* read all the output frames (in general there may be any number of them) */
++      while( ret >= 0 )
++      {
++        ret = avcodec_receive_frame( codecContext_, frame);
++
++        if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++          break;
++
++        playFrame( frame );
++      }
++#endif
+     }
+     // av_free_packet() must be called after each call to av_read_frame()
+ #if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 )
+@@ -379,6 +422,7 @@ bool DecoderContext::play( QString & errorString )
+ #endif
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
+        codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+   {
+@@ -391,6 +435,18 @@ bool DecoderContext::play( QString & errorString )
+       playFrame( frame );
+     }
+   }
++#else
++  /* flush the decoder */
++  av_init_packet( &packet );
++  int ret = avcodec_send_packet(codecContext_, &packet );
++  while( ret >= 0 )
++  {
++    ret = avcodec_receive_frame(codecContext_, frame);
++    if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++      break;
++    playFrame( frame );
++  }
++#endif
+
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+   av_free( frame );
+32
+srcpkgs/goldendict/patches/ffmpeg5-2.patch
+Comment on this file
+@@ -0,0 +1,32 @@
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
+25
+srcpkgs/goldendict/patches/ffmpeg5-3.patch
+Comment on this file
+@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-2.patch b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
new file mode 100644
index 000000000000..9c477b0c1347
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
@@ -0,0 +1,33 @@
+
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-3.patch b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
new file mode 100644
index 000000000000..72101903d1d1
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/template b/srcpkgs/goldendict/template
index f41b5b2c6899..4544ae710ee6 100644
--- a/srcpkgs/goldendict/template
+++ b/srcpkgs/goldendict/template
@@ -1,7 +1,7 @@
 # Template file for 'goldendict'
 pkgname=goldendict
 version=1.5.0RC2
-revision=5
+revision=6
 build_style=qmake
 configure_args="CONFIG+=zim_support"
 hostmakedepends="qt5-qmake pkg-config qt5-host-tools"
diff --git a/srcpkgs/gst-libav/template b/srcpkgs/gst-libav/template
index e9a79dc650a5..f082bd211c65 100644
--- a/srcpkgs/gst-libav/template
+++ b/srcpkgs/gst-libav/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-libav'
 pkgname=gst-libav
 version=1.20.3
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config yasm"
 makedepends="orc-devel gst-plugins-base1-devel ffmpeg-devel"
diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index bb9c4d87f4c6..f55f82fd4c77 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.20.3
-revision=2
+revision=3
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled
diff --git a/srcpkgs/gst-rtsp-server/template b/srcpkgs/gst-rtsp-server/template
index 33cd64ceb95e..8ceea8d34b4b 100644
--- a/srcpkgs/gst-rtsp-server/template
+++ b/srcpkgs/gst-rtsp-server/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-rtsp-server'
 pkgname=gst-rtsp-server
 version=1.20.3
-revision=2
+revision=3
 build_style=meson
 hostmakedepends="pkg-config python3"
 makedepends="glib-devel gst-plugins-bad1-devel gobject-introspection
diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 6a50567f53a9..6976aee84817 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
 # Template file for 'gtk4'
 pkgname=gtk4
 version=4.10.1
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dman-pages=true -Dgtk_doc=true
diff --git a/srcpkgs/guvcview/template b/srcpkgs/guvcview/template
index 345cf6006f24..d42fd38fa4ad 100644
--- a/srcpkgs/guvcview/template
+++ b/srcpkgs/guvcview/template
@@ -1,7 +1,7 @@
 # Template file for 'guvcview'
 pkgname=guvcview
 version=2.0.7
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-static --disable-debian-menu"
diff --git a/srcpkgs/handbrake/template b/srcpkgs/handbrake/template
index ca5e4571e49c..188a79f2bf5c 100644
--- a/srcpkgs/handbrake/template
+++ b/srcpkgs/handbrake/template
@@ -1,7 +1,7 @@
 # Template file for 'handbrake'
 pkgname=handbrake
 version=1.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--force --disable-gtk-update-checks --disable-df-fetch --harden
  $(vopt_enable fdk_aac fdk-aac) $(vopt_enable nvenc)"
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index 419f29b98b44..a343b3172a72 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,7 +1,7 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
  -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
diff --git a/srcpkgs/idjc/template b/srcpkgs/idjc/template
index df60318b3db9..b205e74745fe 100644
--- a/srcpkgs/idjc/template
+++ b/srcpkgs/idjc/template
@@ -1,7 +1,7 @@
 # Template file for 'idjc'
 pkgname=idjc
 version=0.9.1
-revision=3
+revision=4
 build_style=gnu-configure
 hostmakedepends="pkg-config git python3 automake gettext-devel libtool"
 makedepends="libvorbis-devel libogg-devel jack-devel libsamplerate-devel
diff --git a/srcpkgs/kfilemetadata5/template b/srcpkgs/kfilemetadata5/template
index 83f4d583bcb7..b90ef056a196 100644
--- a/srcpkgs/kfilemetadata5/template
+++ b/srcpkgs/kfilemetadata5/template
@@ -1,7 +1,7 @@
 # Template file for 'kfilemetadata5'
 pkgname=kfilemetadata5
 version=5.103.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="kcoreaddons extra-cmake-modules pkg-config qt5-host-tools qt5-qmake
  gettext kcoreaddons python3"
diff --git a/srcpkgs/kid3/template b/srcpkgs/kid3/template
index 456206d90e16..f32f9decb0e7 100644
--- a/srcpkgs/kid3/template
+++ b/srcpkgs/kid3/template
@@ -1,7 +1,7 @@
 # Template file for 'kid3'
 pkgname=kid3
 version=3.9.1
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DWITH_APPS='CLI;$(vopt_if KDE KDE Qt)'
  -DWITH_DOCBOOKDIR=/usr/share/xsl/docbook -DWITH_FLAC=$(vopt_if flac ON OFF)
diff --git a/srcpkgs/kodi/template b/srcpkgs/kodi/template
index 8057964d78a3..991325f6c477 100644
--- a/srcpkgs/kodi/template
+++ b/srcpkgs/kodi/template
@@ -1,7 +1,7 @@
 # Template file for 'kodi'
 pkgname=kodi
 version=19.4
-revision=6
+revision=7
 _codename="Matrix"
 build_style=cmake
 configure_args="-DWITH_FFMPEG=/usr -DENABLE_LDGOLD=OFF
diff --git a/srcpkgs/kpipewire/template b/srcpkgs/kpipewire/template
index 1d1e963f296d..07cdc0c7384a 100644
--- a/srcpkgs/kpipewire/template
+++ b/srcpkgs/kpipewire/template
@@ -1,7 +1,7 @@
 # Template file for 'kpipewire'
 pkgname=kpipewire
 version=5.27.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules plasma-wayland-protocols gettext
  qt5-qmake qt5-host-tools pkg-config wayland-devel kcoreaddons
diff --git a/srcpkgs/libavresample b/srcpkgs/libavresample
index 887f354e7c6b..a9f1eea092d5 120000
--- a/srcpkgs/libavresample
+++ b/srcpkgs/libavresample
@@ -1 +1 @@
-ffmpeg4
\ No newline at end of file
+ffmpeg
\ No newline at end of file
diff --git a/srcpkgs/libextractor/template b/srcpkgs/libextractor/template
index 29d5b8df01f8..ddd4790f93e8 100644
--- a/srcpkgs/libextractor/template
+++ b/srcpkgs/libextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'libextractor'
 pkgname=libextractor
 version=1.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/libopenal/template b/srcpkgs/libopenal/template
index 77218f9e539d..3f49ed75a1fd 100644
--- a/srcpkgs/libopenal/template
+++ b/srcpkgs/libopenal/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenal'
 pkgname=libopenal
 version=1.22.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DALSOFT_EXAMPLES=OFF"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template
index db831f69b474..81aa0d7136d9 100644
--- a/srcpkgs/libopenshot/template
+++ b/srcpkgs/libopenshot/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenshot'
 pkgname=libopenshot
 version=0.3.0
-revision=1
+revision=2
 build_style=cmake
 # Builds fail with Ruby-2.4.1
 configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON"
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index da4f2d56e94c..4d6bf29efb4f 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
diff --git a/srcpkgs/mediastreamer/template b/srcpkgs/mediastreamer/template
index d0e97e858e29..d29210c1bf9c 100644
--- a/srcpkgs/mediastreamer/template
+++ b/srcpkgs/mediastreamer/template
@@ -1,7 +1,7 @@
 # Template file for 'mediastreamer'
 pkgname=mediastreamer
 version=5.2.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_STRICT=0 -DENABLE_UNIT_TESTS=0"
 hostmakedepends="python3"
diff --git a/srcpkgs/mgba/patches/ffmpeg5.patch b/srcpkgs/mgba/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..ad7049efcac3
--- /dev/null
+++ b/srcpkgs/mgba/patches/ffmpeg5.patch
@@ -0,0 +1,117 @@
+From cdc753516798882a805db1d2042dbce8313382bf Mon Sep 17 00:00:00 2001
+From: Ryan Tandy <ryan@nardis.ca>
+Date: Thu, 3 Feb 2022 19:02:52 -0800
+Subject: [PATCH] FFmpeg: Support FFmpeg 5.0
+
+---
+ src/feature/ffmpeg/ffmpeg-decoder.c |  3 ++-
+ src/feature/ffmpeg/ffmpeg-encoder.c | 25 ++++++++++++++-----------
+ 2 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/src/feature/ffmpeg/ffmpeg-decoder.c b/src/feature/ffmpeg/ffmpeg-decoder.c
+index c3bb6d1c5c..daa47fbf2c 100644
+--- a/src/feature/ffmpeg/ffmpeg-decoder.c
++++ b/src/feature/ffmpeg/ffmpeg-decoder.c
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ #include "ffmpeg-decoder.h"
+
++#include <libavcodec/avcodec.h>
+ #include <libswscale/swscale.h>
+
+ void FFmpegDecoderInit(struct FFmpegDecoder* decoder) {
+@@ -38,7 +39,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) {
+ #else
+ 		enum AVMediaType type = decoder->context->streams[i]->codec->codec_type;
+ #endif
+-		struct AVCodec* codec;
++		const struct AVCodec* codec;
+ 		struct AVCodecContext* context = NULL;
+ 		if (type == AVMEDIA_TYPE_VIDEO && decoder->videoStream < 0) {
+ 			decoder->video = avcodec_alloc_context3(NULL);
+diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c
+index ad76ca57b2..be6bd3af5e 100644
+--- a/src/feature/ffmpeg/ffmpeg-encoder.c
++++ b/src/feature/ffmpeg/ffmpeg-encoder.c
+@@ -12,6 +12,9 @@
+
+ #include <libavcodec/version.h>
+ #include <libavcodec/avcodec.h>
++#if LIBAVCODEC_VERSION_MAJOR >= 58
++#include <libavcodec/bsf.h>
++#endif
+
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+@@ -121,7 +124,7 @@ bool FFmpegEncoderSetAudio(struct FFmpegEncoder* encoder, const char* acodec, un
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(acodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(acodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -193,7 +196,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -213,7 +216,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 	if (encoder->pixFormat == AV_PIX_FMT_NONE) {
+ 		return false;
+ 	}
+-	if (vbr < 0 && !av_opt_find(&codec->priv_class, "crf", NULL, 0, 0)) {
++	if (vbr < 0 && !av_opt_find((void*) &codec->priv_class, "crf", NULL, 0, 0)) {
+ 		return false;
+ 	}
+ 	encoder->videoCodec = vcodec;
+@@ -223,7 +226,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ }
+
+ bool FFmpegEncoderSetContainer(struct FFmpegEncoder* encoder, const char* container) {
+-	AVOutputFormat* oformat = av_guess_format(container, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(container, 0, 0);
+ 	if (!oformat) {
+ 		return false;
+ 	}
+@@ -241,9 +244,9 @@ void FFmpegEncoderSetLooping(struct FFmpegEncoder* encoder, bool loop) {
+ }
+
+ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !oformat || (!acodec && !vcodec)) {
+ 		return false;
+ 	}
+@@ -257,8 +260,8 @@ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+ }
+
+ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !FFmpegEncoderVerifyContainer(encoder)) {
+ 		return false;
+ 	}
+@@ -272,9 +275,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+ 	encoder->currentVideoFrame = 0;
+ 	encoder->skipResidue = 0;
+
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+ #ifndef USE_LIBAV
+-	avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile);
++	avformat_alloc_output_context2(&encoder->context, (AVOutputFormat*) oformat, 0, outfile);
+ #else
+ 	encoder->context = avformat_alloc_context();
+ 	strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1);
diff --git a/srcpkgs/mgba/template b/srcpkgs/mgba/template
index 05bca15c1750..f5b6b8464428 100644
--- a/srcpkgs/mgba/template
+++ b/srcpkgs/mgba/template
@@ -1,7 +1,7 @@
 # Template file for 'mgba'
 pkgname=mgba
 version=0.10.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake desktop-file-utils"
 makedepends="SDL2-devel ffmpeg-devel libedit-devel libepoxy-devel libmagick-devel
diff --git a/srcpkgs/minidlna/template b/srcpkgs/minidlna/template
index e8081b1cbc67..9ee9714861fd 100644
--- a/srcpkgs/minidlna/template
+++ b/srcpkgs/minidlna/template
@@ -1,7 +1,7 @@
 # Template file for 'minidlna'
 pkgname=minidlna
 version=1.3.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --sbindir=/usr/bin
diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template
index 619ddca0d332..4b9ea00d3fb3 100644
--- a/srcpkgs/mixxx/template
+++ b/srcpkgs/mixxx/template
@@ -1,7 +1,7 @@
 # Template file for 'mixxx'
 pkgname=mixxx
 version=2.3.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="extra-cmake-modules pkg-config protobuf qt5-host-tools qt5-devel"
diff --git a/srcpkgs/mlt/template b/srcpkgs/mlt/template
index 8933eb4e7bb9..ed6b27503f9a 100644
--- a/srcpkgs/mlt/template
+++ b/srcpkgs/mlt/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt'
 pkgname=mlt
 version=6.26.1
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --libdir=/usr/lib$XBPS_TARGET_WORDSIZE
  --enable-gpl --enable-gpl3 --disable-swfdec --without-kde
diff --git a/srcpkgs/mlt7/template b/srcpkgs/mlt7/template
index e5972cc0411b..d0e9ec02e58a 100644
--- a/srcpkgs/mlt7/template
+++ b/srcpkgs/mlt7/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt7'
 pkgname=mlt7
 version=7.12.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSWIG_PYTHON=ON"
 hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which
diff --git a/srcpkgs/moc/template b/srcpkgs/moc/template
index c42be650a1d2..4b95426599bf 100644
--- a/srcpkgs/moc/template
+++ b/srcpkgs/moc/template
@@ -1,7 +1,7 @@
 # Template file for 'moc'
 pkgname=moc
 version=2.5.2
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg-devel
diff --git a/srcpkgs/motion/template b/srcpkgs/motion/template
index 3cf3c3035c5b..7dca12d851e3 100644
--- a/srcpkgs/motion/template
+++ b/srcpkgs/motion/template
@@ -1,7 +1,7 @@
 # Template file for 'motion'
 pkgname=motion
 version=4.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake pkg-config gettext-devel tar"
 makedepends="ffmpeg-devel libmicrohttpd-devel v4l-utils-devel gettext-devel"
diff --git a/srcpkgs/mpd/template b/srcpkgs/mpd/template
index 63701b7d56b1..df35e751ea60 100644
--- a/srcpkgs/mpd/template
+++ b/srcpkgs/mpd/template
@@ -1,7 +1,7 @@
 # Template file for 'mpd'
 pkgname=mpd
 version=0.23.12
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true
  -Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled
diff --git a/srcpkgs/mpv/template b/srcpkgs/mpv/template
index e163c496c6eb..d4fefbf5e3c7 100644
--- a/srcpkgs/mpv/template
+++ b/srcpkgs/mpv/template
@@ -1,7 +1,7 @@
 # Template file for 'mpv'
 pkgname=mpv
 version=0.35.1
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled
  -Dlibmpv=true -Dcplugins=enabled
diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template
index 4b7930041126..7cd65cf76b77 100644
--- a/srcpkgs/musikcube/template
+++ b/srcpkgs/musikcube/template
@@ -1,7 +1,7 @@
 # Template file for 'musikcube'
 pkgname=musikcube
 version=0.99.4
-revision=1
+revision=2
 build_style=cmake
 make_cmd=make
 configure_args="-DNO_NCURSESW=1"
diff --git a/srcpkgs/notcurses/template b/srcpkgs/notcurses/template
index 6dd8a091319f..3110c30c9aff 100644
--- a/srcpkgs/notcurses/template
+++ b/srcpkgs/notcurses/template
@@ -1,7 +1,7 @@
 # Template file for 'notcurses'
 pkgname=notcurses
 version=3.0.9
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_STATIC=ON $(vopt_bool man USE_PANDOC)"
 hostmakedepends="pkg-config $(vopt_if man pandoc)"
diff --git a/srcpkgs/obs/template b/srcpkgs/obs/template
index 1a7132ae832f..078feba62bbb 100644
--- a/srcpkgs/obs/template
+++ b/srcpkgs/obs/template
@@ -1,7 +1,7 @@
 # Template file for 'obs'
 pkgname=obs
 version=29.0.2
-revision=1
+revision=2
 archs="i686* x86_64* ppc64le* aarch64*"
 build_style=cmake
 configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON
diff --git a/srcpkgs/olive/template b/srcpkgs/olive/template
index 12a46936c990..5290d8e5aacd 100644
--- a/srcpkgs/olive/template
+++ b/srcpkgs/olive/template
@@ -1,7 +1,7 @@
 # Template file for 'olive'
 pkgname=olive
 version=0.1.2
-revision=2
+revision=3
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools pkg-config"
 makedepends="qt5-devel qt5-multimedia-devel qt5-svg-devel ffmpeg-devel frei0r-plugins"
diff --git a/srcpkgs/omxplayer/template b/srcpkgs/omxplayer/template
index e70bf7873d4d..80abdefe77b4 100644
--- a/srcpkgs/omxplayer/template
+++ b/srcpkgs/omxplayer/template
@@ -1,7 +1,7 @@
 # Template file for 'omxplayer'
 pkgname=omxplayer
 version=20190102
-revision=1
+revision=2
 short_desc="Commandline OMX player for the Raspberry Pi"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2"
diff --git a/srcpkgs/openimageio/template b/srcpkgs/openimageio/template
index cc9d7a33984e..ee988ae2ce07 100644
--- a/srcpkgs/openimageio/template
+++ b/srcpkgs/openimageio/template
@@ -1,7 +1,7 @@
 # Template file for 'openimageio'
 pkgname=openimageio
 version=2.3.18.0
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="-DUSE_OPENGL=0 -DUSE_QT=0 -DUSE_PYTHON=0 -DOIIO_BUILD_TESTS=1
diff --git a/srcpkgs/openmw/template b/srcpkgs/openmw/template
index 5251a0283dc1..e3771c7aaf1a 100644
--- a/srcpkgs/openmw/template
+++ b/srcpkgs/openmw/template
@@ -1,7 +1,7 @@
 # Template file for 'openmw'
 pkgname=openmw
 version=0.47.0
-revision=4
+revision=5
 build_style=cmake
 _recast_commit=e75adf86f91eb3082220085e42dda62679f9a3ea
 _bullet_tag=3.17
diff --git a/srcpkgs/openshot/template b/srcpkgs/openshot/template
index 322717d40abc..c074e0338773 100644
--- a/srcpkgs/openshot/template
+++ b/srcpkgs/openshot/template
@@ -1,7 +1,7 @@
 # Template file for 'openshot'
 pkgname=openshot
 version=3.0.0
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3 python3-setuptools"
 makedepends="ffmpeg-devel python3-PyQt5"
diff --git a/srcpkgs/opentoonz/template b/srcpkgs/opentoonz/template
index ee9f7603f55f..3e81834ca0ed 100644
--- a/srcpkgs/opentoonz/template
+++ b/srcpkgs/opentoonz/template
@@ -1,7 +1,7 @@
 # Template file for 'opentoonz'
 pkgname=opentoonz
 version=1.6.0
-revision=2
+revision=3
 build_wrksrc="toonz/sources"
 build_style=cmake
 make_cmd=make
diff --git a/srcpkgs/pianobar/template b/srcpkgs/pianobar/template
index a9b29e91993f..81efcd122c4d 100644
--- a/srcpkgs/pianobar/template
+++ b/srcpkgs/pianobar/template
@@ -1,7 +1,7 @@
 # Template file for 'pianobar'
 pkgname=pianobar
 version=2022.04.01
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="V=1"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/ppsspp/template b/srcpkgs/ppsspp/template
index 7984a733d4be..db9c95d0784c 100644
--- a/srcpkgs/ppsspp/template
+++ b/srcpkgs/ppsspp/template
@@ -1,7 +1,7 @@
 # Template file for 'ppsspp'
 pkgname=ppsspp
 version=1.14.4
-revision=1
+revision=2
 _glslang_commit=dc11adde23c455a24e13dd54de9b4ede8bdd7db8
 _SPIRV_Cross_commit=9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1
 _armips_commit=6719edebaae03330ee5441d9b28280672edf00d5
diff --git a/srcpkgs/pqiv/template b/srcpkgs/pqiv/template
index 542fc27a2d32..9308d949b6a1 100644
--- a/srcpkgs/pqiv/template
+++ b/srcpkgs/pqiv/template
@@ -1,7 +1,7 @@
 # Template file for 'pqiv'
 pkgname=pqiv
 version=2.12
-revision=1
+revision=2
 build_style=gnu-makefile
 hostmakedepends="pkg-config"
 makedepends="glib-devel gtk+3-devel $(vopt_if ffmpeg ffmpeg-devel)
diff --git a/srcpkgs/qmmp/template b/srcpkgs/qmmp/template
index 26c661ed16be..a150d7441c7a 100644
--- a/srcpkgs/qmmp/template
+++ b/srcpkgs/qmmp/template
@@ -1,7 +1,7 @@
 # Template file for 'qmmp'
 pkgname=qmmp
 version=1.6.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_HAL:BOOL=FALSE -DQMMP_DEFAULT_UI:STRING=simple"
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake"
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index f9d78eced929..0a71484208bc 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
 version=5.15.11
-revision=1
+revision=2
 _version="${version}-lts"
 _chromium_commit=be349eaf62e77955791d7bf29f893f1e8a37daf4
 archs="x86_64* i686* armv[67]* ppc64* aarch64*"
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"
diff --git a/srcpkgs/qt6-multimedia/template b/srcpkgs/qt6-multimedia/template
index d89e7d54eb5a..aae15e57ca7b 100644
--- a/srcpkgs/qt6-multimedia/template
+++ b/srcpkgs/qt6-multimedia/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-multimedia'
 pkgname=qt6-multimedia
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DQT_FEATURE_gstreamer=ON"
 hostmakedepends="perl qt6-declarative-host-tools pkg-config qt6-shadertools"
diff --git a/srcpkgs/qt6-webengine/template b/srcpkgs/qt6-webengine/template
index 99012732b53a..96846feaee83 100644
--- a/srcpkgs/qt6-webengine/template
+++ b/srcpkgs/qt6-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-webengine'
 pkgname=qt6-webengine
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DQT_FEATURE_webengine_system_ffmpeg=ON
diff --git a/srcpkgs/qtav/template b/srcpkgs/qtav/template
index 34c30b2c0c78..775d5a139a9e 100644
--- a/srcpkgs/qtav/template
+++ b/srcpkgs/qtav/template
@@ -1,7 +1,7 @@
 # Template file for 'qtav'
 pkgname=qtav
 version=1.13.0
-revision=1
+revision=2
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel libass-devel libopenal-devel
diff --git a/srcpkgs/qtox/patches/ffmpeg5.patch b/srcpkgs/qtox/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..3babe1c98447
--- /dev/null
+++ b/srcpkgs/qtox/patches/ffmpeg5.patch
@@ -0,0 +1,79 @@
+From 15673a52b6b4805d482b69281e21947fb7096e05 Mon Sep 17 00:00:00 2001
+From: Anthony Bilinski <me@abilinski.com>
+Date: Thu, 10 Feb 2022 17:24:38 -0800
+Subject: [PATCH] fix(macOS): Update video API usage for newer libavcodec
+
+Newer version of avformat_open_input, av_find_input_format,
+avcodec_find_decoder previously used non-const pointers that are now
+const. Support both version for compatibiltiy with other platforms.
+---
+ src/video/cameradevice.cpp | 9 ++++++---
+ src/video/cameradevice.h   | 1 -
+ src/video/camerasource.cpp | 3 +--
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/video/cameradevice.cpp b/src/video/cameradevice.cpp
+index 3b07968b32..a012a0f78d 100644
+--- a/src/video/cameradevice.cpp
++++ b/src/video/cameradevice.cpp
+@@ -31,6 +31,9 @@ extern "C" {
+ #include "cameradevice.h"
+ #include "src/persistence/settings.h"
+
++// no longer needed when avformat version < 59 is no longer supported
++using AvFindInputFormatRet = decltype(av_find_input_format(""));
++
+ #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
+ #define USING_V4L 1
+ #else
+@@ -71,8 +74,8 @@ extern "C" {
+
+ QHash<QString, CameraDevice*> CameraDevice::openDevices;
+ QMutex CameraDevice::openDeviceLock, CameraDevice::iformatLock;
+-AVInputFormat* CameraDevice::iformat{nullptr};
+-AVInputFormat* CameraDevice::idesktopFormat{nullptr};
++static AvFindInputFormatRet idesktopFormat{nullptr};
++static AvFindInputFormatRet iformat{nullptr};
+
+ CameraDevice::CameraDevice(const QString& devName, AVFormatContext* context)
+     : devName{devName}
+@@ -92,7 +95,7 @@ CameraDevice* CameraDevice::open(QString devName, AVDictionary** options)
+         goto out;
+     }
+
+-    AVInputFormat* format;
++    AvFindInputFormatRet format;
+     if (devName.startsWith("x11grab#")) {
+         devName = devName.mid(8);
+         format = idesktopFormat;
+diff --git a/src/video/cameradevice.h b/src/video/cameradevice.h
+index 910873325b..c05f1dbed4 100644
+--- a/src/video/cameradevice.h
++++ b/src/video/cameradevice.h
+@@ -64,5 +64,4 @@ class CameraDevice
+     std::atomic_int refcount;
+     static QHash<QString, CameraDevice*> openDevices;
+     static QMutex openDeviceLock, iformatLock;
+-    static AVInputFormat *iformat, *idesktopFormat;
+ };
+diff --git a/src/video/camerasource.cpp b/src/video/camerasource.cpp
+index 134bc49afc..3a899f11d0 100644
+--- a/src/video/camerasource.cpp
++++ b/src/video/camerasource.cpp
+@@ -278,7 +278,6 @@ void CameraSource::openDevice()
+     }
+
+     // We need to create a new CameraDevice
+-    AVCodec* codec;
+     device = CameraDevice::open(deviceName, mode);
+
+     if (!device) {
+@@ -322,7 +321,7 @@ void CameraSource::openDevice()
+     AVCodecParameters* cparams = device->context->streams[videoStreamIndex]->codecpar;
+     codecId = cparams->codec_id;
+ #endif
+-    codec = avcodec_find_decoder(codecId);
++    const AVCodec* codec = avcodec_find_decoder(codecId);
+     if (!codec) {
+         qWarning() << "Codec not found";
+         emit openFailed();
diff --git a/srcpkgs/qtox/template b/srcpkgs/qtox/template
index 16019d7eaec9..5cea0b11b697 100644
--- a/srcpkgs/qtox/template
+++ b/srcpkgs/qtox/template
@@ -1,7 +1,7 @@
 # Template file for 'qtox'
 pkgname=qtox
 version=1.17.6
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DUPDATE_CHECK=OFF
  -DGIT_DESCRIBE=${version}
diff --git a/srcpkgs/retroarch/template b/srcpkgs/retroarch/template
index 240d3df9db00..6d0b16ae2598 100644
--- a/srcpkgs/retroarch/template
+++ b/srcpkgs/retroarch/template
@@ -1,7 +1,7 @@
 # Template file for 'retroarch'
 pkgname=retroarch
 version=1.14.0
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking
  --enable-udev --disable-builtinflac --disable-builtinglslang
diff --git a/srcpkgs/scrcpy/template b/srcpkgs/scrcpy/template
index ee6e698e387f..8ada5ca4323f 100644
--- a/srcpkgs/scrcpy/template
+++ b/srcpkgs/scrcpy/template
@@ -1,7 +1,7 @@
 # Template file for 'scrcpy'
 pkgname=scrcpy
 version=2.0
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dcompile_server=false
  -Dprebuilt_server=/usr/share/scrcpy/scrcpy-server-v${version}"
diff --git a/srcpkgs/spek-alternative/template b/srcpkgs/spek-alternative/template
index d65086b8f008..72747cbb0a02 100644
--- a/srcpkgs/spek-alternative/template
+++ b/srcpkgs/spek-alternative/template
@@ -1,7 +1,7 @@
 # Template file for 'spek-alternative'
 pkgname=spek-alternative
 version=0.8.2.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake gettext-devel intltool libtool pkg-config wxWidgets-common"
 makedepends="ffmpeg-devel wxWidgets-gtk3-devel"
diff --git a/srcpkgs/ssr/template b/srcpkgs/ssr/template
index b055b9ec0774..842b2423aad1 100644
--- a/srcpkgs/ssr/template
+++ b/srcpkgs/ssr/template
@@ -1,7 +1,7 @@
 # Template file for 'ssr'
 pkgname=ssr
 version=0.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_QT5=ON"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template
index 0f9b9ec815f5..a3fe134aa5ac 100644
--- a/srcpkgs/sumo/template
+++ b/srcpkgs/sumo/template
@@ -1,7 +1,7 @@
 # Template file for 'sumo'
 pkgname=sumo
 version=1.12.0
-revision=5
+revision=6
 build_style=cmake
 hostmakedepends="libgdal-tools pkg-config swig python3-setuptools"
 makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel
diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template
index 182dc3cd280f..29afb3572e47 100644
--- a/srcpkgs/synfig/template
+++ b/srcpkgs/synfig/template
@@ -2,7 +2,7 @@
 # Should be kept in sync with 'synfigstudio' and 'ETL'
 pkgname=synfig
 version=1.4.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib"
 hostmakedepends="boost-build ImageMagick pkg-config intltool"
diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index aae9f3135100..7943b36f0b8a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=4.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 configure_args="-DTDESKTOP_API_ID=209235
diff --git a/srcpkgs/tg_owt/template b/srcpkgs/tg_owt/template
index 97d195ddb34a..551614b24956 100644
--- a/srcpkgs/tg_owt/template
+++ b/srcpkgs/tg_owt/template
@@ -1,7 +1,7 @@
 # Template file for 'tg_owt'
 pkgname=tg_owt
 version=0.0.0.20230107
-revision=1
+revision=2
 _commit=5098730b9eb6173f0b52068fe2555b7c1015123a
 _libyuv_commit=00950840d1c9bcbb3eb6ebc5aac5793e71166c8b
 _abseil_commit=8c0b94e793a66495e0b1f34a5eb26bd7dc672db0
diff --git a/srcpkgs/timg/template b/srcpkgs/timg/template
index 91f1516b2597..334443d3f9bb 100644
--- a/srcpkgs/timg/template
+++ b/srcpkgs/timg/template
@@ -1,7 +1,7 @@
 # Template file for 'timg'
 pkgname=timg
 version=1.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_OPENSLIDE_SUPPORT=off -Wno-dev"
 hostmakedepends="pkg-config git"
diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index 3e7966c2b4a9..285425ba1851 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.4.3
-revision=1
+revision=2
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss
diff --git a/srcpkgs/tvheadend/template b/srcpkgs/tvheadend/template
index e6b16d7ccf3b..a2004480332b 100644
--- a/srcpkgs/tvheadend/template
+++ b/srcpkgs/tvheadend/template
@@ -1,7 +1,7 @@
 # Template file for 'tvheadend'
 pkgname=tvheadend
 version=4.2.8
-revision=6
+revision=7
 build_style=gnu-configure
 configure_args="--enable-dvbscan --disable-ffmpeg_static
 --disable-hdhomerun_static --disable-bintray_cache --disable-libx264_static
diff --git a/srcpkgs/unpaper/template b/srcpkgs/unpaper/template
index 38ed47a58401..b05920d13101 100644
--- a/srcpkgs/unpaper/template
+++ b/srcpkgs/unpaper/template
@@ -1,7 +1,7 @@
 # Template file for 'unpaper'
 pkgname=unpaper
 version=6.1
-revision=3
+revision=4
 build_style=gnu-configure
 maintainer="Orphaned <orphan@voidlinux.org>"
 hostmakedepends="pkg-config libxslt"
diff --git a/srcpkgs/vba-m/template b/srcpkgs/vba-m/template
index ba153e0b58ca..aa6093645e97 100644
--- a/srcpkgs/vba-m/template
+++ b/srcpkgs/vba-m/template
@@ -2,7 +2,7 @@
 pkgname=vba-m
 reverts=1292_2
 version=2.1.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GTK=TRUE -DENABLE_FFMPEG=TRUE -DENABLE_LINK=TRUE -DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="gettext pkg-config unzip zip yasm wxWidgets-gtk3-devel"
diff --git a/srcpkgs/vice/template b/srcpkgs/vice/template
index 0924767cfcfb..ffa95384f64a 100644
--- a/srcpkgs/vice/template
+++ b/srcpkgs/vice/template
@@ -1,7 +1,7 @@
 # Template file for 'vice'
 pkgname=vice
 version=3.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
 	$(vopt_enable sdl2 sdlui2)
diff --git a/srcpkgs/waypipe/template b/srcpkgs/waypipe/template
index 5c4161900060..1a46fe27f7d8 100644
--- a/srcpkgs/waypipe/template
+++ b/srcpkgs/waypipe/template
@@ -1,7 +1,7 @@
 # Template file for 'waypipe'
 pkgname=waypipe
 version=0.8.4
-revision=1
+revision=2
 build_style=meson
 # lto is off because it causes linking errors in armv6l and armv7l (due to NEON)
 configure_args="-Dwerror=false -Dwith_dmabuf=enabled -Dwith_lz4=enabled
diff --git a/srcpkgs/wf-recorder/template b/srcpkgs/wf-recorder/template
index e278eb001600..5d014a5f28af 100644
--- a/srcpkgs/wf-recorder/template
+++ b/srcpkgs/wf-recorder/template
@@ -1,7 +1,7 @@
 # Template file for 'wf-recorder'
 pkgname=wf-recorder
 version=0.3.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config scdoc wayland-devel"
 makedepends="wayland-protocols wayland-devel ffmpeg-devel x264-devel
diff --git a/srcpkgs/xpra/template b/srcpkgs/xpra/template
index 38f83283b1e5..b6e01ff0a813 100644
--- a/srcpkgs/xpra/template
+++ b/srcpkgs/xpra/template
@@ -1,7 +1,7 @@
 # Template file for 'xpra'
 pkgname=xpra
 version=4.4.4
-revision=1
+revision=2
 build_style=python3-module
 make_build_args="--without-cuda_kernels --without-cuda_rebuild"
 make_install_args="$(vopt_with docs) ${make_build_args}"

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
  2023-03-22 22:54 ` [PR PATCH] [Updated] " zlice
  2023-03-22 22:59 ` zlice
@ 2023-03-22 23:08 ` paper42
  2023-03-22 23:09 ` [PR REVIEW] " paper42
                   ` (26 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: paper42 @ 2023-03-22 23:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1480369485

Comment:
> fpmeg4 isn't "new", not sure what the commit messages should be really for the 4 and 5 split

It is a new package

> Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?

as mentioned in CONTRIBUTING.md, use one commit per package

> Testing the changes
>
>    I tested the changes in this PR: NO
>
> I have conflicting changes from https://github.com/void-linux/void-packages/pull/41132 and don't want to mess with my system.

I don't think it's a good idea to blindly do a complex update like this and not even test it.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (2 preceding siblings ...)
  2023-03-22 23:08 ` paper42
@ 2023-03-22 23:09 ` paper42
  2023-03-22 23:10 ` paper42
                   ` (25 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: paper42 @ 2023-03-22 23:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145498505

Comment:
this looks unrelated

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (3 preceding siblings ...)
  2023-03-22 23:09 ` [PR REVIEW] " paper42
@ 2023-03-22 23:10 ` paper42
  2023-03-22 23:10 ` paper42
                   ` (24 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: paper42 @ 2023-03-22 23:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 163 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145499023

Comment:
also unrelated?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (4 preceding siblings ...)
  2023-03-22 23:10 ` paper42
@ 2023-03-22 23:10 ` paper42
  2023-03-22 23:11 ` paper42
                   ` (23 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: paper42 @ 2023-03-22 23:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145499327

Comment:
random useless symlink

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (5 preceding siblings ...)
  2023-03-22 23:10 ` paper42
@ 2023-03-22 23:11 ` paper42
  2023-03-22 23:19 ` paper42
                   ` (22 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: paper42 @ 2023-03-22 23:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 149 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145499514

Comment:
1

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (6 preceding siblings ...)
  2023-03-22 23:11 ` paper42
@ 2023-03-22 23:19 ` paper42
  2023-03-22 23:20 ` paper42
                   ` (21 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: paper42 @ 2023-03-22 23:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145505856

Comment:
I think you should just remove the manpages and let -devel packages conflict. This will only cause issues.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (7 preceding siblings ...)
  2023-03-22 23:19 ` paper42
@ 2023-03-22 23:20 ` paper42
  2023-03-22 23:25 ` zlice
                   ` (20 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: paper42 @ 2023-03-22 23:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145506439

Comment:
what's the purpose of this?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (8 preceding siblings ...)
  2023-03-22 23:20 ` paper42
@ 2023-03-22 23:25 ` zlice
  2023-03-22 23:25 ` zlice
                   ` (19 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-22 23:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 172 bytes --]

New review comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145510396

Comment:
ya accidentally added that

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (9 preceding siblings ...)
  2023-03-22 23:25 ` zlice
@ 2023-03-22 23:25 ` zlice
  2023-03-22 23:28 ` paper42
                   ` (18 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-22 23:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

New review comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145510537

Comment:
accidental add

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (10 preceding siblings ...)
  2023-03-22 23:25 ` zlice
@ 2023-03-22 23:28 ` paper42
  2023-03-22 23:33 ` [PR PATCH] [Updated] " zlice
                   ` (17 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: paper42 @ 2023-03-22 23:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 507 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1480382829

Comment:
due to the large amount of random issues I found, I am not confident that the parts of this PR that I didn't check (like the huge lists of dependencies) don't contain similar random mistakes. Even if everything gets fixed, I don't think we should merge this without carefully checking every single line which is probably way harder than just doing the update again.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (11 preceding siblings ...)
  2023-03-22 23:28 ` paper42
@ 2023-03-22 23:33 ` zlice
  2023-03-22 23:36 ` [PR REVIEW] " zlice
                   ` (16 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-22 23:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3197 bytes --]

There is an updated pull request by zlice against master on the void-packages repository

https://github.com/zlice/void-packages ffmpeg5-split
https://github.com/void-linux/void-packages/pull/42936

draft: ffmpeg5 split
[ci skip]

#### Testing the changes

- I tested the changes in this PR: **NO**

I have conflicting changes from [intel packages](https://github.com/void-linux/void-packages/pull/41132) and don't want to mess with my system. If it makes sense I'll move these changes here like I originally intended. ffmpeg5 makes Intel vaapi easier and only rely on oneVPL iirc.

I do not use 80%+ of these packages. I may be able to run Blender, and I use shotcut.


#### New package

- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**



#### Local build testing

- I built this PR locally for my native architecture, **x86_64**


#### Discussion

Continuation of https://github.com/void-linux/void-packages/pull/36315 - thx tibequadorian :)

It was suggested to make `ffmpeg` version 5 and 'copy' (create a new?) `ffmpeg4` package, and that seems to work well.

As stated, I haven't and probably won't test most of these packages, hoping for others to voice in on what's working. 

A few months back (and now) afaict everything has been compiling with ffmpeg5 except for the few problem packages still using ffmpeg4 (below). Can add to the ffmpeg4 list as a incompatible package is found.

`libavresample` is deprecated, but marked as a dependency when trying to build other packages and install `ffmpeg`(5). I think the right way to handle this is make a meta package and the add to removals?

[gstreamer 1.22.1 updates](https://github.com/void-linux/void-packages/pull/42861) could go before this

##### Commit naming / misc

`ffpmeg4` isn't "new", not sure what the commit messages should be really for the 4 and 5 split. Additionally xlint complains about `ffmpeg4` revision being 3 and not 1 because it's a "new" package, I assume that's right but not sure.

Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?

I wouldn't mind moving the [intel packages](https://github.com/void-linux/void-packages/pull/41132) into here under another commit. That just got a potential fix that may allow merging but I imagine moving to ffmpeg5 will change and even remove some of those packages. (I won't really test these changes without Intel vaapi either way.)

Maintainer for previous ffmpeg(4) was orphaned, I can put my name in there if that matters, though I don't exactly see myself keeping up on ffmpeg.


##### still ffmpeg4

- `vlc` (vlc4 will support ffmpeg5, there's a patch to build 3.x with ffmpeg5 but it will lack vaapi)
- `osg` (OpenSceneGraph plus `xine-lib`)
- `ytmdl` ? not sure but it uses `python3-ffmpeg-python` which being 6-8yr old I imagine is ffmpeg4


A patch file from https://github.com/void-linux/void-packages/pull/42936.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ffmpeg5-split-42936.patch --]
[-- Type: text/x-diff, Size: 312577 bytes --]

From c5a8c096e2754e5184c83afeb25660963c3149b6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Tue, 21 Mar 2023 18:58:31 -0400
Subject: [PATCH 1/4] ffmpeg_split

---
 common/shlibs                                 |  26 +-
 srcpkgs/ffmpeg/template                       | 176 +++++----
 srcpkgs/ffmpeg4-devel                         |   1 +
 srcpkgs/ffmpeg4/ffmpeg4                       |   1 +
 .../{ffmpeg => ffmpeg4}/files/altivec.patch   |   0
 .../patches/armv5tel-floating-point.patch     |   0
 .../workaround-mesa-readeon-vaapi-bug.patch   |   0
 srcpkgs/ffmpeg4/template                      | 254 +++++++++++++
 ...Fix-infinite-loop-in-Menu-cycleitems.patch |  60 +++
 ...6c4d30f5b289c429c5ca88d800200db4fc4f.patch |  22 --
 .../MinOverlapPlacement.cc_improve.patch      |  29 ++
 srcpkgs/fluxbox/patches/center.patch          | 307 +++++++++++++++
 srcpkgs/fluxbox/patches/container_locks.patch | 325 ++++++++++++++++
 .../patches/container_relative_relative.patch |  15 +
 srcpkgs/fluxbox/patches/flux_improve.patch    | 205 ++++++++++
 srcpkgs/fluxbox/patches/flux_oversize.patch   |  24 ++
 .../fluxbox/patches/focus_close_menu.patch    |  17 +
 srcpkgs/fluxbox/patches/slit_raise.patch      |  16 +
 srcpkgs/fluxbox/patches/toolbar_redo.patch    | 228 ++++++++++++
 .../fluxbox/patches/tremor_graboid_hell.patch | 350 ++++++++++++++++++
 .../patches/unclutter_fix_workspacecmd.patch  |  65 ++++
 srcpkgs/fluxbox/patches/zor_loops.patch       |  87 +++++
 srcpkgs/fluxbox/template                      |  45 ++-
 srcpkgs/libavcodec4                           |   1 +
 srcpkgs/libavdevice4                          |   1 +
 srcpkgs/libavfilter4                          |   1 +
 srcpkgs/libavformat4                          |   1 +
 srcpkgs/libavresample                         |   2 +-
 srcpkgs/libavresample4                        |   1 +
 srcpkgs/libavutil4                            |   1 +
 srcpkgs/libpostproc4                          |   1 +
 srcpkgs/libswresample4                        |   1 +
 srcpkgs/libswscale4                           |   1 +
 srcpkgs/mesa/template                         |  35 +-
 34 files changed, 2167 insertions(+), 132 deletions(-)
 create mode 120000 srcpkgs/ffmpeg4-devel
 create mode 120000 srcpkgs/ffmpeg4/ffmpeg4
 rename srcpkgs/{ffmpeg => ffmpeg4}/files/altivec.patch (100%)
 rename srcpkgs/{ffmpeg => ffmpeg4}/patches/armv5tel-floating-point.patch (100%)
 rename srcpkgs/{ffmpeg => ffmpeg4}/patches/workaround-mesa-readeon-vaapi-bug.patch (100%)
 create mode 100644 srcpkgs/ffmpeg4/template
 create mode 100644 srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
 delete mode 100644 srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
 create mode 100644 srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
 create mode 100644 srcpkgs/fluxbox/patches/center.patch
 create mode 100644 srcpkgs/fluxbox/patches/container_locks.patch
 create mode 100644 srcpkgs/fluxbox/patches/container_relative_relative.patch
 create mode 100644 srcpkgs/fluxbox/patches/flux_improve.patch
 create mode 100644 srcpkgs/fluxbox/patches/flux_oversize.patch
 create mode 100644 srcpkgs/fluxbox/patches/focus_close_menu.patch
 create mode 100644 srcpkgs/fluxbox/patches/slit_raise.patch
 create mode 100644 srcpkgs/fluxbox/patches/toolbar_redo.patch
 create mode 100644 srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
 create mode 100644 srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
 create mode 100644 srcpkgs/fluxbox/patches/zor_loops.patch
 create mode 120000 srcpkgs/libavcodec4
 create mode 120000 srcpkgs/libavdevice4
 create mode 120000 srcpkgs/libavfilter4
 create mode 120000 srcpkgs/libavformat4
 create mode 120000 srcpkgs/libavresample4
 create mode 120000 srcpkgs/libavutil4
 create mode 120000 srcpkgs/libpostproc4
 create mode 120000 srcpkgs/libswresample4
 create mode 120000 srcpkgs/libswscale4

diff --git a/common/shlibs b/common/shlibs
index f972eebc4d3a..aab66c83f4b3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -389,15 +389,23 @@ libid3tag.so.0 libid3tag-0.15.1b_1
 libgif.so.7 giflib-5.1.0_1
 libImlib2.so.1 imlib2-1.4.2_1
 libmp3lame.so.0 lame-3.98.2_1
-libavdevice.so.58 libavdevice-4.0_1
-libavformat.so.58 libavformat-4.0_1
-libswscale.so.5 libswscale-4.0_1
-libswresample.so.3 libswresample-4.0_1
-libavresample.so.4 libavresample-4.0_1
-libpostproc.so.55 libpostproc-4.0_1
-libavcodec.so.58 libavcodec-4.0_1
-libavutil.so.56 libavutil-4.0_1
-libavfilter.so.7 libavfilter-4.0_1
+libavdevice.so.59 libavdevice-5.1.2_1
+libavformat.so.59 libavformat-5.1.2_1
+libswscale.so.6 libswscale-5.1.2_1
+libswresample.so.4 libswresample-5.1.2_1
+libpostproc.so.56 libpostproc-5.1.2_1
+libavcodec.so.59 libavcodec-5.1.2_1
+libavutil.so.57 libavutil-5.1.2_1
+libavfilter.so.8 libavfilter-5.1.2_1
+libavdevice.so.58 libavdevice4-4.0_1
+libavformat.so.58 libavformat4-4.0_1
+libswscale.so.5 libswscale4-4.0_1
+libswresample.so.3 libswresample4-4.0_1
+libavresample.so.4 libavresample4-4.0_1
+libpostproc.so.55 libpostproc4-4.0_1
+libavcodec.so.58 libavcodec4-4.0_1
+libavutil.so.56 libavutil4-4.0_1
+libavfilter.so.7 libavfilter4-4.0_1
 libSDL-1.2.so.0 SDL-1.2.14_1
 libSDL_image-1.2.so.0 SDL_image-1.2.10_1
 libx264.so.157 x264-20190507.2245_1
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 23a3d5c9967b..38978c5085a3 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -1,42 +1,36 @@
 # Template file for 'ffmpeg'
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg
-version=4.4.3
-revision=2
+version=5.1.2
+revision=1
 short_desc="Decoding, encoding and streaming software"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
 changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
 distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
-checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
-makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
- libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
- libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
- libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
- speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
- libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
- $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
- $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
- $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
- $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
- $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
- $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
- $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
- $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
- $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
- $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+makedepends="chromaprint-devel libgcrypt-devel ladspa-sdk lcms2-devel libaom-devel
+ alsa-lib-devel bzip2-devel libxcb-devel liblzma-devel SDL2-devel sndio-devel zlib-devel
+ frei0r-plugins libcdio-paranoia-devel rubberband-devel libvidstab-devel x264-devel x265-devel
+ xvidcore-devel fdk-aac-devel libtls-devel gmp-devel libass-devel libbluray-devel libcaca-devel
+ celt-devel codec2-devel libdav1d-devel libdrm-devel fontconfig-devel freetype-devel
+ fribidi-devel glslang-devel SPIRV-Tools-devel libgme-devel libgsm-devel jack-devel
+ libmodplug-devel lame-devel libopencv4-devel libopenjpeg2-devel libopenmpt-devel opus-devel
+ libplacebo-devel libpulseaudio rabbitmq-c-devel librist-devel librsvg-devel librtmp-devel
+ snappy-devel libsoxr-devel speex-devel srt-devel libssh-devel libtheora-devel twolame-devel
+ libvorbis-devel libvpx6-devel libwebp-devel libxml2-devel zimg-devel lilv-devel lv2
+ libopenal-devel mesa openssl-devel vapoursynth-devel ocl-icd-devel libmysofa-devel vulkan-loader
+ $(vopt_if vaapi libva-devel)
+ $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if nvenc nv-codec-headers)
+ $(vopt_if nvdec nv-codec-headers)
+ $(vopt_if svtav1 libsvt-av1-devel)
+"
 depends="ffplay>=${version}_${revision}"
-
-build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
- dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
-build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
-desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
-desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
-desc_option_sofa="Enable support for AES SOFA"
-desc_option_webp="Enable support for WebP"
+build_options="vaapi vdpau nvenc nvdec svtav1"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
@@ -52,22 +46,6 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-_apply_patch() {
-	local args="$1" pname="$(basename $2)"
-
-	if [ ! -f ".${pname}_done" ]; then
-		patch -N $args -i $2
-		touch .${pname}_done
-	fi
-}
-
-post_patch() {
-	case "$XBPS_TARGET_MACHINE" in
-		ppc64le*) ;;
-		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
-	esac
-}
-
 do_configure() {
 	# Fix gcc on x86_64-musl only
 	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
@@ -98,39 +76,47 @@ do_configure() {
 		_args+=" --extra-libs=-latomic"
 	fi
 
-	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+	./configure \
+		--prefix='/usr' \
+		--extra-cflags='-I/opt/cuda/include' \
+		--extra-ldflags='-L/opt/cuda/lib64' \
 		--disable-stripping \
-		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
-		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
-		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
-		--enable-shared --enable-static --enable-libxcb \
-		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
-		--enable-libspeex --enable-libcelt --enable-libass \
-		--enable-libopus --enable-librtmp --enable-libjack \
-		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
-		--disable-libopencore_amrnb --disable-libopencore_amrwb \
-		--disable-libopenjpeg \
-		--enable-postproc --enable-opencl ${_args} \
-		$(vopt_enable x265 libx265) \
-		$(vopt_enable v4l2 libv4l2) \
-		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
-		--enable-libbs2b --enable-avresample --enable-libvidstab \
-		$(vopt_enable dav1d libdav1d) \
-		$(vopt_enable zimg libzimg) \
-		$(vopt_enable webp libwebp) \
-		$(vopt_enable sofa libmysofa) \
-		$(vopt_enable vulkan) \
-		$(vopt_enable drm libdrm) \
-		$(vopt_enable svtav1 libsvtav1) \
-		$(vopt_enable srt libsrt) \
-		$(vopt_enable rist librist) \
+		--enable-shared --enable-static \
+		--enable-nonfree --enable-gpl \
+		--enable-version3 --enable-libxcb \
+		--enable-frei0r --enable-libcdio \
+		--enable-librubberband --enable-libvidstab \
+		--enable-libx264 --enable-libx265 --enable-libxvid \
+		--enable-libfdk-aac --enable-libtls --enable-gmp \
+		--enable-chromaprint --enable-gcrypt --enable-ladspa \
+		--enable-lcms2 --enable-libaom --enable-libass \
+		--enable-libbluray --enable-libcaca --enable-libcelt \
+		--enable-libcodec2 --enable-libdav1d --enable-libdrm \
+		--enable-libfontconfig --enable-libfreetype \
+		--enable-libfribidi --enable-libglslang \
+		--enable-libgme --enable-libgsm \
+		--enable-vapoursynth --enable-openssl --enable-opengl \
+		--enable-openal --enable-lv2 --enable-libzimg \
+		--enable-libxml2 --enable-libwebp --enable-libvorbis \
+		--enable-libtwolame --enable-libtheora --enable-libssh \
+		--enable-libsrt --enable-libspeex --enable-libsoxr \
+		--enable-librtmp --enable-librsvg --enable-librist \
+		--enable-librabbitmq --enable-libpulse --enable-libplacebo \
+		--enable-libopus --enable-libopenmpt --enable-libopenjpeg \
+		--enable-libmp3lame --enable-libmodplug --enable-libjack \
+		--enable-opencl --enable-libvpx --enable-libmysofa \
+		$(vopt_enable vaapi) \
+		$(vopt_enable vdpau) \
 		$(vopt_if nvenc '--enable-nvenc') \
-		$(vopt_if nvdec '--enable-nvdec')
+		$(vopt_if nvdec '--enable-nvdec') \
+		$(vopt_enable svtav1 libsvtav1)
 }
+
 do_build() {
 	make ${makejobs}
 	make doc/ff{mpeg,play}.1
 }
+
 do_install() {
 	make DESTDIR=${DESTDIR} install install-man
 }
@@ -147,12 +133,6 @@ libavdevice_package() {
 		vmove "usr/lib/libavdevice.so.*"
 	}
 }
-libavresample_package() {
-	short_desc="FFmpeg audio resampling library"
-	pkg_install() {
-		vmove "usr/lib/libavresample.so.*"
-	}
-}
 libavformat_package() {
 	short_desc="FFmpeg file format library"
 	pkg_install() {
@@ -198,9 +178,49 @@ ffmpeg-devel_package() {
 		libavfilter>=${version}_${revision}
 		libpostproc>=${version}_${revision}
 		libswscale>=${version}_${revision}
-		libswresample>=${version}_${revision}
-		libavresample>=${version}_${revision}"
+		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
+	alternatives="
+	 ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec5.3
+	 ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice5.3
+	 ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter5.3
+	 ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat5.3
+	 ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil5.3
+	 ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample5.3
+	 ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale5.3
+	 ffmpeg-devel:libavcodec:/usr/include/libavcodec5
+	 ffmpeg-devel:libavdevice:/usr/include/libavdevice5
+	 ffmpeg-devel:libavformat:/usr/include/libavformat5
+	 ffmpeg-devel:libavutil:/usr/include/libavutil5
+	 ffmpeg-devel:libavpostproc:/usr/include/libavpostproc5
+	 ffmpeg-devel:libswresample:/usr/include/libswresample5
+	 ffmpeg-devel:libswcaale:/usr/include/libswscale5
+	 ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec5.pc
+	 ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice5.pc
+	 ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter5.pc
+	 ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat5.pc
+	 ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil5.pc
+	 ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc5.pc
+	 ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample5.pc
+	 ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale5.pc
+	 ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec5.a
+	 ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec5.so
+	 ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice5.a
+	 ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice5.so
+	 ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter5.a
+	 ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter5.so
+	 ffmpeg-devel:libavformat.a:/usr/lib/libavformat5.a
+	 ffmpeg-devel:libavformat.so:/usr/lib/libavformat5.so
+	 ffmpeg-devel:libavutil.a:/usr/lib/libavutil5.a
+	 ffmpeg-devel:libavutil.so:/usr/lib/libavutil5.so
+	 ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc5.a
+	 ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc5.so
+	 ffmpeg-devel:libswresample.a:/usr/lib/libswresample5.a
+	 ffmpeg-devel:libswresample.so:/usr/lib/libswresample5.so
+	 ffmpeg-devel:libswscale.a:/usr/lib/libswscale5.a
+	 ffmpeg-devel:libswscale.so:/usr/lib/libswscale5.so
+	 ffmpeg-devel:ffmpeg:/usr/share/ffmpeg5
+	"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
@@ -211,7 +231,7 @@ ffmpeg-devel_package() {
 	}
 }
 ffplay_package() {
-	short_desc="Simple video player using FFmpeg and SDL2"
+	short_desc="Simple media player using FFmpeg and SDL2"
 	pkg_install() {
 		vmove usr/bin/ffplay
 		vmove "usr/share/man/man1/ffplay*"
diff --git a/srcpkgs/ffmpeg4-devel b/srcpkgs/ffmpeg4-devel
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4-devel
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg4/ffmpeg4 b/srcpkgs/ffmpeg4/ffmpeg4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4/ffmpeg4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg/files/altivec.patch b/srcpkgs/ffmpeg4/files/altivec.patch
similarity index 100%
rename from srcpkgs/ffmpeg/files/altivec.patch
rename to srcpkgs/ffmpeg4/files/altivec.patch
diff --git a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
similarity index 100%
rename from srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
rename to srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
diff --git a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
similarity index 100%
rename from srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
rename to srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
new file mode 100644
index 000000000000..cd9154978b3e
--- /dev/null
+++ b/srcpkgs/ffmpeg4/template
@@ -0,0 +1,254 @@
+# Template file for 'ffmpeg4'
+# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
+pkgname=ffmpeg4
+version=4.4.3
+revision=3
+short_desc="ffmpeg4 libraries only - Decoding, encoding and streaming software"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.ffmpeg.org"
+changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
+distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
+checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+
+hostmakedepends="pkg-config perl yasm"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
+
+case "$XBPS_TARGET_MACHINE" in
+	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
+	ppc64*) build_options_default+=" vaapi vdpau";;
+	mips*) CFLAGS="-mnan=legacy";;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" != "32" ]; then
+	build_options_default+=" svtav1"
+fi
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
+do_configure() {
+	# Fix gcc on x86_64-musl only
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
+		sed -i configure -e "s;_cflags_speed='-O3';_cflags_speed='-O2';"
+	fi
+
+	if [ "$CROSS_BUILD" ]; then
+		case "$XBPS_TARGET_MACHINE" in
+			arm*) _arch="arm";;
+			aarch64*) _arch="aarch64";;
+			mips*) _arch="mips";;
+			ppc64*) _arch="ppc64";;
+			ppc*) _arch="ppc";;
+			*) _arch="${XBPS_TARGET_MACHINE%%-musl}";;
+		esac
+
+		_args+=" --enable-cross-compile
+			--sysroot=$XBPS_CROSS_BASE
+			--cross-prefix=${XBPS_CROSS_TRIPLET}-
+			--target-os=linux --arch=${_arch}"
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc|ppc-musl) _args+=" --disable-altivec";;
+	esac
+
+	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+		_args+=" --extra-libs=-latomic"
+	fi
+
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+		--disable-stripping \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
+		$(vopt_if nvenc '--enable-nvenc') \
+		$(vopt_if nvdec '--enable-nvdec')
+}
+do_build() {
+	make ${makejobs}
+	make doc/ff{mpeg,play}.1
+}
+do_install() {
+	make DESTDIR=${DESTDIR} install install-man
+	rm -rf ${DESTDIR}/usr/bin
+}
+
+libavcodec4_package() {
+	short_desc="FFmpeg codec library"
+	pkg_install() {
+		vmove "usr/lib/libavcodec.so.*"
+	}
+}
+libavdevice4_package() {
+	short_desc="FFmpeg device handling library"
+	pkg_install() {
+		vmove "usr/lib/libavdevice.so.*"
+	}
+}
+libavresample4_package() {
+	short_desc="FFmpeg audio resampling library"
+	pkg_install() {
+		vmove "usr/lib/libavresample.so.*"
+	}
+}
+libavformat4_package() {
+	short_desc="FFmpeg file format library"
+	pkg_install() {
+		vmove "usr/lib/libavformat.so.*"
+	}
+}
+libavutil4_package() {
+	short_desc="FFmpeg utility library"
+	pkg_install() {
+		vmove "usr/lib/libavutil.so.*"
+	}
+}
+libavfilter4_package() {
+	short_desc="FFmpeg audio/video filter library"
+	pkg_install() {
+		vmove "usr/lib/libavfilter.so.*"
+	}
+}
+libpostproc4_package() {
+	short_desc="FFmpeg video postprocessing library"
+	pkg_install() {
+		vmove "usr/lib/libpostproc.so.*"
+	}
+}
+libswscale4_package() {
+	short_desc="FFmpeg video scaling library"
+	pkg_install() {
+		vmove "usr/lib/libswscale.so.*"
+	}
+}
+libswresample4_package() {
+	short_desc="FFmpeg video resampling library"
+	pkg_install() {
+		vmove "usr/lib/libswresample.so.*"
+	}
+}
+ffmpeg4-devel_package() {
+	depends="
+		libavcodec4>=${version}_${revision}
+		libavdevice4>=${version}_${revision}
+		libavformat4>=${version}_${revision}
+		libavutil4>=${version}_${revision}
+		libavfilter4>=${version}_${revision}
+		libpostproc4>=${version}_${revision}
+		libswscale4>=${version}_${revision}
+		libswresample4>=${version}_${revision}
+		libavresample4>=${version}_${revision}"
+	short_desc+=" - development files"
+	alternatives="
+		ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec4.3
+		ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice4.3
+		ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter4.3
+		ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat4.3
+		ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil4.3
+		ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample4.3
+		ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale4.3
+		ffmpeg-devel:libavcodec:/usr/include/libavcodec4
+		ffmpeg-devel:libavdevice:/usr/include/libavdevice4
+		ffmpeg-devel:libavformat:/usr/include/libavformat4
+		ffmpeg-devel:libavutil:/usr/include/libavutil4
+		ffmpeg-devel:libavpostproc:/usr/include/libavpostproc4
+		ffmpeg-devel:libswresample:/usr/include/libswresample4
+		ffmpeg-devel:libswcaale:/usr/include/libswscale4
+		ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec4.pc
+		ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice4.pc
+		ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter4.pc
+		ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat4.pc
+		ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil4.pc
+		ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc4.pc
+		ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample4.pc
+		ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale4.pc
+		ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec4.a
+		ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec4.so
+		ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice4.a
+		ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice4.so
+		ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter4.a
+		ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter4.so
+		ffmpeg-devel:libavformat.a:/usr/lib/libavformat4.a
+		ffmpeg-devel:libavformat.so:/usr/lib/libavformat4.so
+		ffmpeg-devel:libavutil.a:/usr/lib/libavutil4.a
+		ffmpeg-devel:libavutil.so:/usr/lib/libavutil4.so
+		ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc4.a
+		ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc4.so
+		ffmpeg-devel:libswresample.a:/usr/lib/libswresample4.a
+		ffmpeg-devel:libswresample.so:/usr/lib/libswresample4.so
+		ffmpeg-devel:libswscale.a:/usr/lib/libswscale4.a
+		ffmpeg-devel:libswscale.so:/usr/lib/libswscale4.so
+		ffmpeg-devel:ffmpeg:/usr/share/ffmpeg4
+	"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/*.a
+		vmove usr/lib/*.so
+		vmove usr/share/ffmpeg/examples
+		vmove usr/share/man/man3
+	}
+}
diff --git a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
new file mode 100644
index 000000000000..4c450fd45bfb
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
@@ -0,0 +1,60 @@
+From 9d8202f32338a3f08d3fa39057dc5eec5d97be4e Mon Sep 17 00:00:00 2001
+From: Mathias Gumz <akira@fluxbox.org>
+Date: Sat, 28 May 2022 11:13:43 +0200
+Subject: [PATCH] Fix infinite loop in Menu::cycleitems()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a menu contains no selectable item (example given: a "list" of user
+styles and the only available one is already selected), cycling through
+the menu will lead to an infinite loop and thus a disfunctional fluxbox.
+
+This commit addresses the issue by checking if there is any selectable
+item before entering the cycling stage.
+
+Discovered by Sébastien Ballet[1].
+
+[1]: https://sourceforge.net/p/fluxbox/bugs/1185/
+---
+ src/FbTk/Menu.cc | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
+index 6b2db3a4..ff040bae 100644
+--- a/src/FbTk/Menu.cc
++++ b/src/FbTk/Menu.cc
+@@ -320,15 +320,24 @@ void Menu::lower() {
+ 
+ void Menu::cycleItems(bool reverse) {
+ 
+-    if (m_items.empty())
+-        return;
+-
+-    int offset = reverse ? -1 : 1;
+     int l = m_items.size();
+-    int i = m_active_index;
++    int i;
++    int offset = reverse ? -1 : 1;
+     size_t ignore;
+ 
+-    for (i += offset; i != m_active_index; i += offset ) {
++    // check if there is _any_ selectable item
++    for (i = 0; i < l; i++) {
++        if (isItemSelectable(i)) {
++            break;
++        }
++    }
++
++    // no selectable item
++    if (i >= l) {
++        return;
++    }
++
++    for (i = m_active_index + offset; i != m_active_index; i += offset ) {
+         if (i < 0) {
+             i = l - 1;
+         } else if (i >= l) {
+-- 
+2.39.0
+
diff --git a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
deleted file mode 100644
index dc151643cb45..000000000000
--- a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 22866c4d30f5b289c429c5ca88d800200db4fc4f Mon Sep 17 00:00:00 2001
-From: John Sennesael <john@aminking.com>
-Date: Mon, 2 Nov 2015 15:14:32 -0600
-Subject: [PATCH] fixes bug #1138
-
----
- util/fluxbox-remote.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc
-index 59852e6a7..504015b50 100644
---- a/util/fluxbox-remote.cc
-+++ b/util/fluxbox-remote.cc
-@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
-     if (strcmp(cmd, "result") == 0) {
-         XTextProperty text_prop;
-         if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
--            && text_prop.value > 0
-+            && text_prop.value != 0
-             && text_prop.nitems > 0) {
- 
-             printf("%s", text_prop.value);
diff --git a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
new file mode 100644
index 000000000000..5b64b11ab2a8
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
@@ -0,0 +1,29 @@
+--- a/src/MinOverlapPlacement.cc  2015-02-08 05:44:34.000000000 -0500
++++ b/src/MinOverlapPlacement.cc  2022-07-18 15:14:41.012275200 -0400
+@@ -196,19 +196,21 @@
+     std::set<Area>::iterator min_reg = areas.end();
+
+     std::set<Area>::iterator ar_it = areas.begin();
++    int overlap = 0, min_right = 0, min_bottom = 0, max_left = 0, max_top = 0;
++
+     for (; ar_it != areas.end(); ++ar_it) {
+
+-        int overlap = 0;
++        overlap = 0;
+         it = const_windowlist.rbegin();
+         for (; it != it_end; ++it) {
+
+             getWindowDimensions(*(*it), left, top, right, bottom);
+
+             // get the coordinates of the overlap region
+-            int min_right = std::min(right, ar_it->x + win_w);
+-            int min_bottom = std::min(bottom, ar_it->y + win_h);
+-            int max_left = std::max(left, ar_it->x);
+-            int max_top = std::max(top, ar_it->y);
++            min_right = std::min(right, ar_it->x + win_w);
++            min_bottom = std::min(bottom, ar_it->y + win_h);
++            max_left = std::max(left, ar_it->x);
++            max_top = std::max(top, ar_it->y);
+
+             // now compute the overlap and add to running total
+             if (min_right > max_left && min_bottom > max_top)
diff --git a/srcpkgs/fluxbox/patches/center.patch b/srcpkgs/fluxbox/patches/center.patch
new file mode 100644
index 000000000000..39e3e4c7f37e
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/center.patch
@@ -0,0 +1,307 @@
+From ec83993c236de9c9442e2fcd31c08aae852a5a16 Mon Sep 17 00:00:00 2001
+From: zlice <zlice555@gmail.com>
+Date: Fri, 22 Jul 2022 21:21:33 -0400
+Subject: [PATCH 1/2] whitespace cleanup
+
+---
+ doc/asciidoc/fluxbox.txt |  8 ++++----
+ src/ScreenPlacement.cc   | 12 ++++++------
+ src/ScreenPlacement.hh   | 10 +++++-----
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
+index 95624842..0e3f27b9 100644
+--- a/doc/asciidoc/fluxbox.txt
++++ b/doc/asciidoc/fluxbox.txt
+@@ -4,7 +4,7 @@ Henrik Kinnunen <fluxgen@fluxbox.org>
+ v1.3.7, 08 February 2015
+ :man source:   fluxbox.txt
+ :man version:  {revision}
+-:man manual:   Fluxbox Manual  
++:man manual:   Fluxbox Manual
+ 
+ NAME
+ ----
+@@ -475,7 +475,7 @@ By default, this menu contains:
+ 
+ *Remember...*:::
+ Specify which window settings should be stored in the `apps' file and
+-resumed the next time this window is opened. 
++resumed the next time this window is opened.
+ +
+ Specifically the setting you may store are:
+ +
+@@ -740,7 +740,7 @@ There are three more settings in the ``Focus Model'' menu:
+ 
+ TAB OPTIONS
+ -----------
+-This section of fluxbox configuration menu lets you configure many features of 
++This section of fluxbox configuration menu lets you configure many features of
+ tabs. Inside of it there are three main options:
+ 
+ *Placement*:::
+@@ -1060,7 +1060,7 @@ whenever the mouse moves over them, but only when the mouse is moving. With
+ area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc.
+ +
+ Default: *ClickToFocus*
+-      
++
+ *session.screen0.autoRaise*: 'boolean'::
+ When True, this setting automatically raises any window that gains focus.
+ +
+diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
+index 19ddf78a..ca58d83f 100644
+--- a/src/ScreenPlacement.cc
++++ b/src/ScreenPlacement.cc
+@@ -43,14 +43,14 @@ using std::cerr;
+ using std::endl;
+ 
+ ScreenPlacement::ScreenPlacement(BScreen &screen):
+-    m_row_direction(screen.resourceManager(), LEFTRIGHT, 
+-                    screen.name()+".rowPlacementDirection", 
++    m_row_direction(screen.resourceManager(), LEFTRIGHT,
++                    screen.name()+".rowPlacementDirection",
+                     screen.altName()+".RowPlacementDirection"),
+-    m_col_direction(screen.resourceManager(), TOPBOTTOM, 
+-                    screen.name()+".colPlacementDirection", 
++    m_col_direction(screen.resourceManager(), TOPBOTTOM,
++                    screen.name()+".colPlacementDirection",
+                     screen.altName()+".ColPlacementDirection"),
+-    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT, 
+-                       screen.name()+".windowPlacement", 
++    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT,
++                       screen.name()+".windowPlacement",
+                        screen.altName()+".WindowPlacement"),
+     m_old_policy(ROWSMARTPLACEMENT),
+     m_screen(screen)
+diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
+index 0f210d94..f1234983 100644
+--- a/src/ScreenPlacement.hh
++++ b/src/ScreenPlacement.hh
+@@ -34,7 +34,7 @@ class BScreen;
+ 
+ /**
+  * Main class for strategy handling
+- * This is a bridge between screen and 
++ * This is a bridge between screen and
+  * the real placement strategy (rowcol, undermouse etc)
+  * The placeWindow function in this class is guaranteed to succeed.
+  * It holds a pointer to the real placement strategy which is
+@@ -42,8 +42,8 @@ class BScreen;
+  */
+ class ScreenPlacement: public PlacementStrategy {
+ public:
+-    enum PlacementPolicy { 
+-        ROWSMARTPLACEMENT, 
++    enum PlacementPolicy {
++        ROWSMARTPLACEMENT,
+         COLSMARTPLACEMENT,
+         COLMINOVERLAPPLACEMENT,
+         ROWMINOVERLAPPLACEMENT,
+@@ -52,11 +52,11 @@ public:
+         AUTOTABPLACEMENT
+     };
+ 
+-    enum RowDirection { 
++    enum RowDirection {
+         LEFTRIGHT, ///< from left to right
+         RIGHTLEFT  ///< from right to left
+     };
+-    enum ColumnDirection { 
++    enum ColumnDirection {
+         TOPBOTTOM,  ///< from top to bottom
+         BOTTOMTOP   ///< from bottom to top
+     };
+-- 
+2.37.1
+
+
+From 6e05f44c94fa4bfc0e44e8f42a9d24665a95840f Mon Sep 17 00:00:00 2001
+From: zlice <zlice555@gmail.com>
+Date: Fri, 22 Jul 2022 21:27:25 -0400
+Subject: [PATCH 2/2] new feature: CenterPlacement. Places new windows in
+ center of the current workspace
+
+---
+ doc/asciidoc/fluxbox.txt |  1 +
+ src/CenterPlacement.cc   | 43 ++++++++++++++++++++++++++++++++++++++++
+ src/CenterPlacement.hh   | 37 ++++++++++++++++++++++++++++++++++
+ src/Makemodule.am        |  2 ++
+ src/ScreenPlacement.cc   |  8 ++++++++
+ src/ScreenPlacement.hh   |  1 +
+ 6 files changed, 92 insertions(+)
+ create mode 100644 src/CenterPlacement.cc
+ create mode 100644 src/CenterPlacement.hh
+
+diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
+index 0e3f27b9..46ca2861 100644
+--- a/doc/asciidoc/fluxbox.txt
++++ b/doc/asciidoc/fluxbox.txt
+@@ -1141,6 +1141,7 @@ Available strategies:;;
+ - RowSmartPlacement: tries to place windows in rows without overlapping
+ - ColSmartPlacement: tries to place windows in columns without overlapping
+ - CascadePlacement: places windows below the titlebar of the previous one
++- CenterPlacement: places windows in the center of the current workspace
+ - UnderMousePlacement: places new windows underneath the mouse
+ - RowMinOverlapPlacement: place windows in rows with minimal overlapping
+ - ColMinOverlapPlacement: place windows in columns with minimal overlapping
+diff --git a/src/CenterPlacement.cc b/src/CenterPlacement.cc
+new file mode 100644
+index 00000000..efaf76b9
+--- /dev/null
++++ b/src/CenterPlacement.cc
+@@ -0,0 +1,43 @@
++// CenterPlacement.cc
++// Copyright (c) 2006 Fluxbox Team (fluxgen at fluxbox dot org)
++//
++// Permission is hereby granted, free of charge, to any person obtaining a
++// copy of this software and associated documentation files (the "Software"),
++// to deal in the Software without restriction, including without limitation
++// the rights to use, copy, modify, merge, publish, distribute, sublicense,
++// and/or sell copies of the Software, and to permit persons to whom the
++// Software is furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++
++#include "CenterPlacement.hh"
++
++#include "FbTk/App.hh"
++#include "Screen.hh"
++#include "Window.hh"
++
++bool CenterPlacement::placeWindow(const FluxboxWindow &win, int head,
++                                      int &place_x, int &place_y) {
++
++    int cent_x = (signed) win.screen().maxRight(head) - (signed) win.screen().maxLeft(head);
++    int cent_y = (signed) win.screen().maxBottom(head) - (signed) win.screen().maxTop(head);
++
++    // border on 1 side, dividing in half
++    // with rounding, this will probably favor top left
++    int win_half_w = (win.width() / 2) + win.fbWindow().borderWidth(),
++        win_half_h = (win.height() / 2) + win.fbWindow().borderWidth();
++
++    place_x = cent_x - win_half_w;
++    place_y = cent_y - win_half_h;
++
++    return true;
++}
+diff --git a/src/CenterPlacement.hh b/src/CenterPlacement.hh
+new file mode 100644
+index 00000000..9f70a6c8
+--- /dev/null
++++ b/src/CenterPlacement.hh
+@@ -0,0 +1,37 @@
++// CenterPlacement.hh
++// Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org)
++//
++// Permission is hereby granted, free of charge, to any person obtaining a
++// copy of this software and associated documentation files (the "Software"),
++// to deal in the Software without restriction, including without limitation
++// the rights to use, copy, modify, merge, publish, distribute, sublicense,
++// and/or sell copies of the Software, and to permit persons to whom the
++// Software is furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++
++#ifndef CENTERPLACEMENT_HH
++#define CENTERPLACEMENT_HH
++
++#include "ScreenPlacement.hh"
++
++class CenterPlacement: public PlacementStrategy {
++public:
++    CenterPlacement() { };
++
++    bool placeWindow(const FluxboxWindow &win, int head,
++                     int &place_x, int &place_y);
++
++private:
++};
++
++#endif // CENTERPLACEMENT_HH
+diff --git a/src/Makemodule.am b/src/Makemodule.am
+index 5be5692c..53d35e8e 100644
+--- a/src/Makemodule.am
++++ b/src/Makemodule.am
+@@ -165,6 +165,8 @@ fluxbox_SOURCES = \
+ 	src/AttentionNoticeHandler.hh \
+ 	src/CascadePlacement.cc \
+ 	src/CascadePlacement.hh \
++	src/CenterPlacement.cc \
++	src/CenterPlacement.hh \
+ 	src/ClientMenu.cc \
+ 	src/ClientMenu.hh \
+ 	src/ClientPattern.cc \
+diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
+index ca58d83f..ce47a910 100644
+--- a/src/ScreenPlacement.cc
++++ b/src/ScreenPlacement.cc
+@@ -24,6 +24,7 @@
+ #include "RowSmartPlacement.hh"
+ #include "MinOverlapPlacement.hh"
+ #include "UnderMousePlacement.hh"
++#include "CenterPlacement.hh"
+ #include "ColSmartPlacement.hh"
+ #include "CascadePlacement.hh"
+ 
+@@ -82,6 +83,9 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
+         case UNDERMOUSEPLACEMENT:
+             m_strategy.reset(new UnderMousePlacement());
+             break;
++        case CENTERPLACEMENT:
++            m_strategy.reset(new CenterPlacement());
++            break;
+         case AUTOTABPLACEMENT:
+             m_strategy.reset(0);
+             break;
+@@ -197,6 +201,8 @@ std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const
+         return "ColMinOverlapPlacement";
+     case ScreenPlacement::UNDERMOUSEPLACEMENT:
+         return "UnderMousePlacement";
++    case ScreenPlacement::CENTERPLACEMENT:
++        return "CenterPlacement";
+     case ScreenPlacement::CASCADEPLACEMENT:
+         return "CascadePlacement";
+     case ScreenPlacement::AUTOTABPLACEMENT:
+@@ -218,6 +224,8 @@ void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char
+         *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
+     else if (strcasecmp("UnderMousePlacement", str) == 0)
+         *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
++    else if (strcasecmp("CenterPlacement", str) == 0)
++        *(*this) = ScreenPlacement::CENTERPLACEMENT;
+     else if (strcasecmp("CascadePlacement", str) == 0)
+         *(*this) = ScreenPlacement::CASCADEPLACEMENT;
+     else if (strcasecmp("AutotabPlacement", str) == 0)
+diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
+index f1234983..a5c9b885 100644
+--- a/src/ScreenPlacement.hh
++++ b/src/ScreenPlacement.hh
+@@ -49,6 +49,7 @@ public:
+         ROWMINOVERLAPPLACEMENT,
+         CASCADEPLACEMENT,
+         UNDERMOUSEPLACEMENT,
++        CENTERPLACEMENT,
+         AUTOTABPLACEMENT
+     };
+ 
+-- 
+2.37.1
+
diff --git a/srcpkgs/fluxbox/patches/container_locks.patch b/srcpkgs/fluxbox/patches/container_locks.patch
new file mode 100644
index 000000000000..498ab44a23c6
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/container_locks.patch
@@ -0,0 +1,325 @@
+diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
+index 00bc1187..f8a4c475 100644
+--- a/src/FbWinFrame.cc
++++ b/src/FbWinFrame.cc
+@@ -148,6 +148,11 @@ FbWinFrame::FbWinFrame(BScreen &screen, unsigned int client_depth,
+     m_button_size(1),
+     m_shape(m_window, theme->shapePlace()) {
+ 
++    m_locker_timer.setTimeout(timerVal() ); // 10millisec
++    m_locker_timer.fireOnce(true);
++    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<FbWinFrame>(*this, &FbWinFrame::unlockSig));
++    m_locker_timer.setCommand(usig);
++
+     init();
+ }
+ 
+@@ -156,6 +161,27 @@ FbWinFrame::~FbWinFrame() {
+     removeAllButtons();
+ }
+ 
++// for incremental changes, back off for a bit
++// prevents slowdown from say, making 200 windows
++void FbWinFrame::resetLock() {
++    m_lock_gfx = true;
++    m_locker_timer.start();
++}
++
++void FbWinFrame::unlockSig() {
++    m_lock_gfx = false;
++    // this is what we wanted to do
++    FbTk::Container& tabs = tabcontainer();
++    tabs.setUpdateLock(m_lock_gfx);
++    renderTabContainer();
++    applyTabContainer();
++
++    tabs.clear();
++    tabs.raise();
++    tabs.show();
++}
++
++
+ bool FbWinFrame::setTabMode(TabMode tabmode) {
+     if (m_tabmode == tabmode)
+         return false;
+@@ -187,6 +213,7 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
+ 
+     } else {
+         tabs.setUpdateLock(true);
++        resetLock();
+ 
+         tabs.setAlignment(FbTk::Container::RELATIVE);
+         tabs.setOrientation(FbTk::ROT0);
+@@ -200,9 +227,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
+         }
+         tabs.setBorderWidth(0);
+         tabs.setMaxTotalSize(0);
+-        tabs.setUpdateLock(false);
++        tabs.setUpdateLock(m_lock_gfx);
+         tabs.setMaxSizePerClient(0);
+ 
++        if (m_lock_gfx)
++            return false;
++
+         renderTabContainer();
+         applyTabContainer();
+ 
+diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
+index 617b9b91..725c84a0 100644
+--- a/src/FbWinFrame.hh
++++ b/src/FbWinFrame.hh
+@@ -33,6 +33,7 @@
+ #include "FbTk/Container.hh"
+ #include "FbTk/Shape.hh"
+ #include "FbTk/Signal.hh"
++#include "FbTk/Timer.hh"
+ 
+ #include <vector>
+ #include <memory>
+@@ -176,6 +177,12 @@ public:
+     void setShapingClient(FbTk::FbWindow *win, bool always_update);
+     void updateShape() { m_shape.update(); }
+ 
++    void resetLock();
++    void unlockSig();
++    FbTk::Timer m_locker_timer;
++    static unsigned int timerVal() { return 10 * FbTk::FbTime::IN_MILLISECONDS; }
++    bool m_lock_gfx = false;
++
+     /**
+        @name accessors
+     */
+diff --git a/src/IconButton.cc b/src/IconButton.cc
+index 1290c2aa..2ea7af9e 100644
+--- a/src/IconButton.cc
++++ b/src/IconButton.cc
+@@ -71,8 +71,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent,
+ 
+     FbTk::EventManager::instance()->add(*this, m_icon_window);
+ 
+-    reconfigTheme();
+-    refreshEverything(false);
++    //reconfigTheme();
++    //refreshEverything(false);
+ }
+ 
+ IconButton::~IconButton() {
+@@ -163,12 +163,12 @@ void IconButton::reconfigTheme() {
+                            width(), height(), m_theme->texture(),
+                            orientation()));
+         setBackgroundPixmap(m_pm);
+-    } else{
++    } else {
+         m_pm.reset(0);
+         setBackgroundColor(m_theme->texture().color());
+     }
+ 
+-    updateBackground(false);
++    //updateBackground(false);
+ }
+ 
+ void IconButton::reconfigAndClear() {
+@@ -181,7 +181,8 @@ void IconButton::refreshEverything(bool setup) {
+     Display *display = FbTk::App::instance()->display();
+     int screen = m_win.screen().screenNumber();
+ 
+-    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None) {
++    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None &&
++                                     width() > m_icon_window.width() ) {
+         // setup icon window
+         m_icon_window.show();
+         unsigned int w = width();
+@@ -242,7 +243,6 @@ void IconButton::refreshEverything(bool setup) {
+         m_icon_window.clear();
+     }
+ 
+-
+ }
+ 
+ void IconButton::clientTitleChanged() {
+@@ -251,24 +251,30 @@ void IconButton::clientTitleChanged() {
+ 
+     if (m_has_tooltip)
+         showTooltip();
++
+ }
+ 
+ void IconButton::setupWindow() {
+     m_icon_window.clear();
++    //FbTk::FbString title = "wtf2";
+     FbTk::FbString title = m_win.title().logical();
+-    if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
+-        title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
++    //#if USE_TOOLBAR
++    //if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
++    //    title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
++    //#endif
+     setText(title);
+     FbTk::TextButton::clear();
+ }
+ 
+ void IconButton::drawText(int x, int y, FbTk::FbDrawable *drawable) {
+ 
+-    // offset text
+-    if (m_icon_pixmap.drawable() != 0)
+-        FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
+-    else
+-        FbTk::TextButton::drawText(1, y, drawable);
++    if (width() > m_icon_window.width() ) {
++      // offset text
++      if (m_icon_pixmap.drawable() != 0)
++          FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
++      else
++          FbTk::TextButton::drawText(1, y, drawable);
++    }
+ }
+ 
+ bool IconButton::setOrientation(FbTk::Orientation orient) {
+diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
+index 027ab1c6..f64a4cf6 100644
+--- a/src/IconbarTool.cc
++++ b/src/IconbarTool.cc
+@@ -300,6 +300,11 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
+     FbTk::RefCount<FbTk::Command<void> > ers(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::emitResizeSig));
+     m_resizeSig_timer.setCommand(ers);
+ 
++    m_locker_timer.setTimeout(IconButton::updateLaziness() / 10); // 10millisec
++    m_locker_timer.fireOnce(true);
++    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::unlockSig));
++    m_locker_timer.setCommand(usig);
++
+     themeReconfigured();
+ }
+ 
+@@ -325,7 +330,7 @@ void IconbarTool::updateMaxSizes(unsigned int width, unsigned int height) {
+ 
+ void IconbarTool::resize(unsigned int width, unsigned int height) {
+     m_icon_container.resize(width, height);
+-    updateMaxSizes(width, height);
++    //updateMaxSizes(width, height);
+     renderTheme();
+ }
+ 
+@@ -333,7 +338,7 @@ void IconbarTool::moveResize(int x, int y,
+                              unsigned int width, unsigned int height) {
+ 
+     m_icon_container.moveResize(x, y, width, height);
+-    updateMaxSizes(width, height);
++    //updateMaxSizes(width, height);
+     renderTheme();
+ }
+ 
+@@ -393,6 +398,25 @@ void IconbarTool::setMode(string mode) {
+     m_menu.reconfigure();
+ }
+ 
++// for incremental changes, back off for a bit
++// prevents slowdown from say, making 200 windows
++void IconbarTool::resetLock() {
++    m_lock_gfx = true;
++    m_locker_timer.start();
++}
++
++void IconbarTool::unlockSig() {
++    m_lock_gfx = false;
++    //resizeSig().emit();
++    // this is what we wanted to do
++    m_icon_container.setUpdateLock(false);
++    m_icon_container.update();
++    m_icon_container.showSubwindows();
++    renderTheme();
++    update(ALIGN, NULL);
++    m_resizeSig_timer.start();
++}
++
+ void IconbarTool::emitResizeSig() {
+     resizeSig().emit();
+ }
+@@ -441,9 +465,11 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
+     switch(reason) {
+         case LIST_ADD: case LIST_ORDER:
+             insertWindow(*win);
++            resetLock();
+             break;
+         case LIST_REMOVE:
+             removeWindow(*win);
++            resetLock();
+             break;
+         case LIST_RESET:
+             reset();
+@@ -455,6 +481,10 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
+     m_resizeSig_timer.start();
+ 
+     updateMaxSizes(width(), height());
++
++    if (m_lock_gfx)
++        return;
++
+     // unlock container and update graphics
+     m_icon_container.setUpdateLock(false);
+     m_icon_container.update();
+@@ -496,13 +526,13 @@ void IconbarTool::insertWindow(Focusable &win, int pos) {
+         button = makeButton(win);
+     if (!button) return;
+ 
+-    if (pos == -2) {
+-        pos = 0;
+-        list<Focusable *>::iterator it = m_winlist->clientList().begin(),
+-                                    it_end = m_winlist->clientList().end();
+-        for (; it != it_end && *it != &win; ++it)
+-            pos++;
+-    }
++    //if (pos == -2) {
++    //    pos = 0;
++    //    list<Focusable *>::iterator it = m_winlist->clientList().begin(),
++    //                                it_end = m_winlist->clientList().end();
++    //    for (; it != it_end && *it != &win; ++it)
++    //        pos++;
++    //}
+ 
+     m_icon_container.insertItem(button, pos);
+     m_tracker.join(button->titleChanged(), FbTk::MemFun(m_resizeSig_timer, &FbTk::Timer::start));
+@@ -517,9 +547,9 @@ void IconbarTool::updateSizing() {
+     m_icon_container.setBorderWidth(m_theme.border().width());
+     m_icon_container.setBorderColor(m_theme.border().color());
+ 
+-    FbTk::STLUtil::forAll(m_icons, 
+-            FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
+-                FbTk::Select2nd<IconMap::value_type>()));
++    //FbTk::STLUtil::forAll(m_icons, 
++    //        FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
++    //            FbTk::Select2nd<IconMap::value_type>()));
+ 
+ }
+ 
+@@ -560,7 +590,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear) {
+ 
+     button.setPixmap(*m_rc_use_pixmap);
+     button.setTextPadding(*m_rc_client_padding);
+-    button.reconfigTheme();
++    //button.reconfigTheme();
+     if (clear)
+         button.clear(); // the clear also updates transparent
+ }
+diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
+index df6d9a65..1c2101ac 100644
+--- a/src/IconbarTool.hh
++++ b/src/IconbarTool.hh
+@@ -106,6 +106,9 @@ private:
+ 
+     void themeReconfigured();
+ 
++    void resetLock();
++    void unlockSig();
++    FbTk::Timer m_locker_timer;
+     FbTk::Timer m_resizeSig_timer;
+     void emitResizeSig();
+ 
+@@ -128,6 +131,7 @@ private:
+     FbMenu m_menu;
+     int m_alpha;
+     static std::string s_iconifiedDecoration[2];
++    bool m_lock_gfx = false;
+ };
+ 
+ #endif // ICONBARTOOL_HH
diff --git a/srcpkgs/fluxbox/patches/container_relative_relative.patch b/srcpkgs/fluxbox/patches/container_relative_relative.patch
new file mode 100644
index 000000000000..dc3ddb5181b5
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/container_relative_relative.patch
@@ -0,0 +1,15 @@
+diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
+index cea761b3..0e050a0b 100644
+--- a/src/FbTk/Container.cc
++++ b/src/FbTk/Container.cc
+@@ -365,6 +365,9 @@ void Container::repositionItems() {
+     const ItemList::iterator it_end = end();
+
+     int rounding_error = 0;
++    if (align == RELATIVE || total_width == m_max_total_size) {
++        rounding_error = total_width - ((max_width_per_client + borderW)* num_items - borderW);
++    }
+
+     int next_x = -borderW; // zero so the border of the first shows
+     int extra = 0;
+
diff --git a/srcpkgs/fluxbox/patches/flux_improve.patch b/srcpkgs/fluxbox/patches/flux_improve.patch
new file mode 100644
index 000000000000..13a1aeba621c
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/flux_improve.patch
@@ -0,0 +1,205 @@
+diff --git a/src/Ewmh.cc b/src/Ewmh.cc
+index e12a7923..db1ddd45 100644
+--- a/src/Ewmh.cc
++++ b/src/Ewmh.cc
+@@ -1096,15 +1096,19 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
+         // ce.data.l[0] = the action (remove, add or toggle)
+         // ce.data.l[1] = the first property to alter
+         // ce.data.l[2] = second property to alter (can be zero)
+-        if (ce.data.l[0] == STATE_REMOVE) {
+-            setState(win, ce.data.l[1], false, *winclient);
+-            setState(win, ce.data.l[2], false, *winclient);
+-        } else if (ce.data.l[0] == STATE_ADD) {
+-            setState(win, ce.data.l[1], true, *winclient);
+-            setState(win, ce.data.l[2], true, *winclient);
+-        } else if (ce.data.l[0] == STATE_TOGGLE) {
+-            toggleState(win, ce.data.l[1]);
+-            toggleState(win, ce.data.l[2]);
++        bool addremove = false; // add true, remove false
++
++        switch (ce.data.l[0]) {
++          case STATE_TOGGLE:
++              toggleState(win, ce.data.l[1]);
++              toggleState(win, ce.data.l[2]);
++              break;
++          case STATE_ADD:
++              addremove = true;
++          case STATE_REMOVE:
++              setState(win, ce.data.l[1], addremove, *winclient);
++              setState(win, ce.data.l[2], addremove, *winclient);
++              break;
+         }
+         return true;
+     } else if (ce.message_type == m_net->number_of_desktops) {
+diff --git a/src/FbMenuParser.cc b/src/FbMenuParser.cc
+index 716ced29..5a56e6f5 100644
+--- a/src/FbMenuParser.cc
++++ b/src/FbMenuParser.cc
+@@ -33,9 +33,9 @@ bool FbMenuParser::open(const std::string &filename) {
+ }
+ 
+ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
+-    if (eof()) {        
++    if (eof()) {
+         out = FbTk::Parser::s_empty_item;
+-        return *this; 
++        return *this;
+     }
+ 
+     if (m_curr_line.empty())
+@@ -69,20 +69,26 @@ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
+         return (*this)>>out;
+         break;
+     }
+-    
++
+     std::string key;
+     int err = FbTk::StringUtil::
+         getStringBetween(key, m_curr_line.c_str() + m_curr_pos,
+                          first, second);
+-    if (err <= 0) {        
+-        if (m_curr_token == TYPE)
++    if (err <= 0) {
++        switch (m_curr_token) {
++          case TYPE:
+             m_curr_token = NAME;
+-        else if (m_curr_token == NAME)
++            break;
++          case NAME:
+             m_curr_token = ARGUMENT;
+-        else if (m_curr_token == ARGUMENT)
++            break;
++          case ARGUMENT:
+             m_curr_token = ICON;
+-        else if (m_curr_token == ICON)
++            break;
++          case ICON:
+             m_curr_token = DONE;
++            break;
++        }
+ 
+         out = FbTk::Parser::s_empty_item;
+         return *this;
+diff --git a/src/Remember.cc b/src/Remember.cc
+index 49e61062..4f0ba3db 100644
+--- a/src/Remember.cc
++++ b/src/Remember.cc
+@@ -802,39 +802,41 @@ void Remember::reload() {
+             int pos = getStringBetween(key, line.c_str(), '[', ']');
+             string lc_key = toLower(key);
+ 
+-            if (pos > 0 && (lc_key == "app" || lc_key == "transient")) {
+-                ClientPattern *pat = new ClientPattern(line.c_str() + pos);
+-                if (!in_group) {
+-                    if ((err = pat->error()) == 0) {
+-                        bool transient = (lc_key == "transient");
+-                        Application *app = findMatchingPatterns(pat,
+-                                               old_pats, transient, false);
+-                        if (app) {
+-                            app->reset();
+-                            reused_apps.insert(app);
++            if (pos > 0) {
++                if (lc_key == "app" || lc_key == "transient") {
++                    ClientPattern *pat = new ClientPattern(line.c_str() + pos);
++                    if (!in_group) {
++                        if ((err = pat->error()) == 0) {
++                            bool transient = (lc_key == "transient");
++                            Application *app = findMatchingPatterns(pat,
++                                                   old_pats, transient, false);
++                            if (app) {
++                                app->reset();
++                                reused_apps.insert(app);
++                            } else {
++                                app = new Application(transient, false);
++                            }
++
++                            m_pats->push_back(make_pair(pat, app));
++                            row += parseApp(apps_file, *app);
+                         } else {
+-                            app = new Application(transient, false);
++                            cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
++                            delete pat; // since it didn't work
+                         }
+-
+-                        m_pats->push_back(make_pair(pat, app));
+-                        row += parseApp(apps_file, *app);
+                     } else {
+-                        cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
+-                        delete pat; // since it didn't work
++                        grouped_pats.push_back(pat);
+                     }
+-                } else {
+-                    grouped_pats.push_back(pat);
+-                }
+-            } else if (pos > 0 && lc_key == "startup" && fb.isStartup()) {
+-                if (!handleStartupItem(line, pos)) {
+-                    cerr<<"Error reading apps file at line "<<row<<"."<<endl;
++                } else if (lc_key == "startup" && fb.isStartup()) {
++                    if (!handleStartupItem(line, pos)) {
++                        cerr<<"Error reading apps file at line "<<row<<"."<<endl;
++                    }
++                    // save the item even if it was bad (aren't we nice)
++                    m_startups.push_back(line.substr(pos));
++                } else if (lc_key == "group") {
++                    in_group = true;
++                    if (line.find('(') != string::npos)
++                        pat = new ClientPattern(line.c_str() + pos);
+                 }
+-                // save the item even if it was bad (aren't we nice)
+-                m_startups.push_back(line.substr(pos));
+-            } else if (pos > 0 && lc_key == "group") {
+-                in_group = true;
+-                if (line.find('(') != string::npos)
+-                    pat = new ClientPattern(line.c_str() + pos);
+             } else if (in_group) {
+                 // otherwise assume that it is the start of the attributes
+                 Application *app = 0;
+diff --git a/src/SystemTray.cc b/src/SystemTray.cc
+index 8c42877a..1fc2b0a8 100644
+--- a/src/SystemTray.cc
++++ b/src/SystemTray.cc
+@@ -550,10 +550,12 @@ void SystemTray::rearrangeClients() {
+     ClientList::iterator client_it = m_clients.begin();
+     ClientList::iterator client_it_end = m_clients.end();
+     int next_x = bw;
++    int x, y;
+     for (; client_it != client_it_end; ++client_it) {
+         if (!(*client_it)->isVisible())
+             continue;
+-        int x = next_x, y = bw;
++        x = next_x;
++        y = bw;
+         next_x += h_rot0+bw;
+         translateCoords(orientation(), x, y, w_rot0, h_rot0);
+         translatePosition(orientation(), x, y, h_rot0, h_rot0, 0);
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..713d1510 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -3267,14 +3267,18 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top, bool resize) {
+ FluxboxWindow::ReferenceCorner FluxboxWindow::getResizeDirection(int x, int y,
+         ResizeModel model, int corner_size_px, int corner_size_pc) const
+ {
+-    if (model == TOPLEFTRESIZE)     return LEFTTOP;
+-    if (model == TOPRESIZE)         return TOP;
+-    if (model == TOPRIGHTRESIZE)    return RIGHTTOP;
+-    if (model == LEFTRESIZE)        return LEFT;
+-    if (model == RIGHTRESIZE)       return RIGHT;
+-    if (model == BOTTOMLEFTRESIZE)  return LEFTBOTTOM;
+-    if (model == BOTTOMRESIZE)      return BOTTOM;
+-    if (model == CENTERRESIZE)      return CENTER;
++    switch (model) {
++    case TOPLEFTRESIZE:     return LEFTTOP;
++    case TOPRESIZE:         return TOP;
++    case TOPRIGHTRESIZE:    return RIGHTTOP;
++    case LEFTRESIZE:        return LEFT;
++    case RIGHTRESIZE:       return RIGHT;
++    case BOTTOMLEFTRESIZE:  return LEFTBOTTOM;
++    case BOTTOMRESIZE:      return BOTTOM;
++    case CENTERRESIZE:      return CENTER;
++    default:
++    break;
++    }
+ 
+     if (model == EDGEORCORNERRESIZE)
+     {
diff --git a/srcpkgs/fluxbox/patches/flux_oversize.patch b/srcpkgs/fluxbox/patches/flux_oversize.patch
new file mode 100644
index 000000000000..98d70d3b037e
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/flux_oversize.patch
@@ -0,0 +1,24 @@
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..02d10e90 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -532,19 +532,14 @@ void FluxboxWindow::init() {
+     if (!m_state.fullscreen) {
+         unsigned int new_width = 0, new_height = 0;
+         if (m_client->width() >= screen().width()) {
+-            m_state.maximized |= WindowState::MAX_HORZ;
+             new_width = 2 * screen().width() / 3;
+         }
+         if (m_client->height() >= screen().height()) {
+-            m_state.maximized |= WindowState::MAX_VERT;
+             new_height = 2 * screen().height() / 3;
+         }
+         if (new_width || new_height) {
+-            const int maximized = m_state.maximized;
+-            m_state.maximized = WindowState::MAX_NONE;
+             resize(new_width ? new_width : width(), new_height ? new_height : height());
+             m_placed = false;
+-            m_state.maximized = maximized;
+         }
+     }
+ 
diff --git a/srcpkgs/fluxbox/patches/focus_close_menu.patch b/srcpkgs/fluxbox/patches/focus_close_menu.patch
new file mode 100644
index 000000000000..01830cf53460
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/focus_close_menu.patch
@@ -0,0 +1,17 @@
+diff --git a/src/FocusControl.cc b/src/FocusControl.cc
+index 54c3d46c..7e49ff51 100644
+--- a/src/FocusControl.cc
++++ b/src/FocusControl.cc
+@@ -247,11 +247,7 @@ void FocusControl::stopCyclingFocus() {
+ 
+     // put currently focused window to top
+     if (s_focused_window) {
+-        // re-focus last window to give the client a chance to redistribute the
+-        // focus internally (client-side only modality)
+-        s_focused_window->focus();
+-        if (s_focused_window)
+-            setScreenFocusedWindow(*s_focused_window);
++        setScreenFocusedWindow(*s_focused_window);
+         if (s_focused_fbwindow)
+             s_focused_fbwindow->raise();
+     } else
diff --git a/srcpkgs/fluxbox/patches/slit_raise.patch b/srcpkgs/fluxbox/patches/slit_raise.patch
new file mode 100644
index 000000000000..a3bc01c7ac85
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/slit_raise.patch
@@ -0,0 +1,16 @@
+diff --git a/src/Slit.cc b/src/Slit.cc
+index 9baecf21..63ed8269 100644
+--- a/src/Slit.cc
++++ b/src/Slit.cc
+@@ -958,8 +958,8 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
+         return;
+     }
+
+-    if (be.button == 1)
+-        frame.window.raise();
++    //if (be.button == 1)
++    //    frame.window.raise();
+
+     if (be.button != Button3) {
+         XAllowEvents(dpy, ReplayPointer, CurrentTime);
+
diff --git a/srcpkgs/fluxbox/patches/toolbar_redo.patch b/srcpkgs/fluxbox/patches/toolbar_redo.patch
new file mode 100644
index 000000000000..ca95486583ce
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/toolbar_redo.patch
@@ -0,0 +1,228 @@
+diff --git a/src/Toolbar.cc b/src/Toolbar.cc
+index aa9bc121..ee8b8bfc 100644
+--- a/src/Toolbar.cc
++++ b/src/Toolbar.cc
+@@ -74,7 +74,7 @@ using FbTk::STLUtil::forAll;
+ 
+ namespace {
+ 
+-const struct { 
++const struct {
+     Toolbar::Placement placement;
+     const char* str;
+     FbTk::Orientation orient;
+@@ -362,13 +362,16 @@ void Toolbar::lower() {
+ }
+ 
+ void Toolbar::screenChanged(BScreen &screen) {
+-    reconfigure();
++    //reconfigure();
+ }
+ 
+ void Toolbar::relayout() {
+-    forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
+-    rearrangeItems();
+-    forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
++    //for (auto it : m_item_list)    (*item_it)->updateSizing();
++    //rearrangeItems();
++    //for (auto it : m_item_list)    (*item_it)->renderTheme(alpha());
++    //forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
++    //rearrangeItems();
++    //forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
+ }
+ 
+ void Toolbar::reconfigure() {
+@@ -557,12 +560,16 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
+ }
+ 
+ void Toolbar::updateCrossingState() {
+-    Window wr, wc;
+-    int rx, ry, x, y;
++    //Window wr, wc;
++    //int rx, ry, x, y;
++    //unsigned int mask;
++    Window wrc;
++    int rxy, x, y;
+     unsigned int mask;
+     const int bw = -theme()->border().width();
+     bool hovered = false;
+-    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
++    //if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
++    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wrc, &wrc, &rxy, &rxy, &x, &y, &mask))
+         hovered = x >= bw && y >= bw && x < int(width()) && y < int(height());
+     if (hovered) {
+         if (m_rc_auto_raise)
+@@ -910,25 +917,26 @@ void Toolbar::rearrangeItems() {
+     // lock this
+     m_resize_lock = true;
+     // calculate size for fixed items
+-    ItemList::iterator item_it = m_item_list.begin();
+-    ItemList::iterator item_it_end = m_item_list.end();
++    //ItemList::iterator item_it = m_item_list.begin();
++    //ItemList::iterator item_it_end = m_item_list.end();
+     int bevel_width = theme()->bevelWidth();
+     int fixed_width = bevel_width; // combined size of all fixed items
+     int relative_width = 0; // combined *desired* size of all relative items
+-    int stretch_items = 0;
+     int relative_items = 0;
+     int last_bw = 0; // we show the largest border of adjoining items
+     bool first = true;
++    int leftover_width = 0;
+ 
+     unsigned int width = this->width(), height = this->height();
+     unsigned int tmpw, tmph;
+     FbTk::translateSize(orient, width, height);
+ 
+-    for (; item_it != item_it_end; ++item_it) {
+-        if (!(*item_it)->active())
++    //for (; item_it != item_it_end; ++item_it) {
++    for (auto item_it : m_item_list) {
++        if (!(*item_it).active())
+             continue;
+ 
+-        int borderW = (*item_it)->borderWidth();
++        int borderW = (*item_it).borderWidth();
+ 
+         if (bevel_width > 0) {
+             // the bevel and border are fixed whether relative or not
+@@ -943,35 +951,35 @@ void Toolbar::rearrangeItems() {
+ 
+         last_bw = borderW;
+ 
+-        tmpw = (*item_it)->preferredWidth();
+-        tmph = (*item_it)->height();
++        tmpw = (*item_it).preferredWidth();
++        tmph = (*item_it).height();
+         FbTk::translateSize(orient, tmpw, tmph);
+ 
+-        if ((*item_it)->type() == ToolbarItem::FIXED) {
+-            fixed_width += tmpw;
+-        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
+-            fixed_width += height;
+-            if (bevel_width)
+-                fixed_width -= 2*(borderW + bevel_width);
+-        } else {
+-            ++relative_items;
+-            relative_width += tmpw;
+-            if (!tmpw)
+-                ++stretch_items;
++        switch ( (*item_it).type() ) {
++            case ToolbarItem::FIXED:
++                fixed_width += tmpw;
++                break;
++            case ToolbarItem::SQUARE:
++                fixed_width += height;
++                if (bevel_width)
++                    fixed_width -= 2*(borderW + bevel_width);
++                break;
++            case ToolbarItem::RELATIVE:
++                ++relative_items;
++                relative_width += tmpw;
++                break;
++            default:
++                break;
+         }
+     }
+ 
+     // calculate what's going to be left over to the relative sized items
+-    float stretch_factor = 1.0f;
+     if (relative_items) {
+-        if (relative_width <= width - fixed_width && stretch_items) {
+-            relative_width = int(width - fixed_width - relative_width)/stretch_items;
+-        } else if (relative_width) {
+-            stretch_factor = float(width - fixed_width)/relative_width;
+-            relative_width = 0;
+-        }
++        relative_width = (width - fixed_width) / relative_items;
++        leftover_width = width - fixed_width - relative_items * relative_width;
+     }
+ 
++
+     // now move and resize the items
+     // borderWidth added back on straight away
+     int next_x = -m_item_list.front()->borderWidth(); // list isn't empty
+@@ -979,19 +987,22 @@ void Toolbar::rearrangeItems() {
+         next_x = 0;
+ 
+     last_bw = 0;
+-    for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
+-        int borderW = (*item_it)->borderWidth();
+-        if (!(*item_it)->active()) {
+-            (*item_it)->hide();
++    int borderW, offset, size_offset, tmpx, tmpy;
++
++    //for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
++    for (auto item_it : m_item_list) {
++        borderW = (*item_it).borderWidth();
++        if (!(*item_it).active()) {
++            (*item_it).hide();
+             // make sure it still gets told the toolbar height
+             tmpw = 1; tmph = height - 2*(bevel_width+borderW);
+             if (tmph >= (1<<30)) tmph = 1;
+             FbTk::translateSize(orient, tmpw, tmph);
+-            (*item_it)->resize(tmpw, tmph);  // width of 0 changes to 1 anyway
++            (*item_it).resize(tmpw, tmph);  // width of 0 changes to 1 anyway
+             continue;
+         }
+-        int offset = bevel_width;
+-        int size_offset = 2*(borderW + bevel_width);
++        offset = bevel_width;
++        size_offset = 2*(borderW + bevel_width);
+ 
+         if (bevel_width == 0) {
+             offset = -borderW;
+@@ -1000,22 +1011,28 @@ void Toolbar::rearrangeItems() {
+         }
+         last_bw = borderW;
+ 
+-        int tmpx = next_x + offset,
+-            tmpy = offset;
+-
+-        if ((*item_it)->type() == ToolbarItem::RELATIVE) {
+-            unsigned int itemw = (*item_it)->preferredWidth(), itemh = (*item_it)->height();
+-            FbTk::translateSize(orient, itemw, itemh);
+-            tmpw = itemw ? std::floor(stretch_factor * itemw) : relative_width;
+-            tmph = height - size_offset;
+-        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
+-            tmpw = tmph = height - size_offset;
+-        } else { // fixed size
+-            unsigned int itemw = (*item_it)->width(), itemh = (*item_it)->height();
+-            FbTk::translateSize(orient, itemw, itemh);
+-            tmpw = itemw;
+-            tmph = height - size_offset;
++        tmpx = next_x + offset,
++        tmpy = offset;
++        tmph = height - size_offset;
++
++        switch ( (*item_it).type() ) {
++            case ToolbarItem::SQUARE:
++                tmpw = tmph;
++                break;
++            case ToolbarItem::RELATIVE:
++                tmpw = relative_width;
++                if (leftover_width) {
++                    --leftover_width;
++                    ++tmpw;
++                }
++                break;
++            case ToolbarItem::FIXED:
++                unsigned int itemw = (*item_it).width(), itemh = (*item_it).height();
++                FbTk::translateSize(orient, itemw, itemh);
++                tmpw = itemw;
++                break;
+         }
++
+         if (tmpw >= (1<<30)) tmpw = 1;
+         if (tmph >= (1<<30)) tmph = 1;
+         next_x += tmpw + bevel_width;
+@@ -1025,8 +1042,8 @@ void Toolbar::rearrangeItems() {
+         FbTk::translateCoords(orient, tmpx, tmpy, width, height);
+         FbTk::translatePosition(orient, tmpx, tmpy, tmpw, tmph, borderW);
+         FbTk::translateSize(orient, tmpw, tmph);
+-        (*item_it)->moveResize(tmpx, tmpy, tmpw, tmph);
+-        (*item_it)->show();
++        (*item_it).moveResize(tmpx, tmpy, tmpw, tmph);
++        //(*item_it).show();
+ 
+     }
+     // unlock
diff --git a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
new file mode 100644
index 000000000000..189a314607bd
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
@@ -0,0 +1,350 @@
+diff --git a/src/FbTk/EventManager.cc b/src/FbTk/EventManager.cc
+index 3df56de5..501766cc 100644
+--- a/src/FbTk/EventManager.cc
++++ b/src/FbTk/EventManager.cc
+@@ -194,23 +194,22 @@ void EventManager::dispatch(Window win, XEvent &ev, bool parent) {
+ 
+     // find out which window is the parent and
+     // dispatch event
+-    Window root, parent_win, *children = 0;
+-    unsigned int num_children;
+-    if (XQueryTree(FbTk::App::instance()->display(), win,
+-                   &root, &parent_win, &children, &num_children) != 0) {
+-        if (children != 0)
+-            XFree(children);
+-
+-        if (parent_win != 0 &&
+-            parent_win != root) {
+-            if (m_parent[parent_win] == 0)
+-                return;
+-
+-            // dispatch event to parent
+-            dispatch(parent_win, ev, true);
+-        }
+-    }
+-
++//    Window root, parent_win, *children = 0;
++//    unsigned int num_children;
++//    if (XQueryTree(FbTk::App::instance()->display(), win,
++//                   &root, &parent_win, &children, &num_children) != 0) {
++//        if (children != 0)
++//            XFree(children);
++//
++//        if (parent_win != 0 &&
++//            parent_win != root) {
++//            if (m_parent[parent_win] == 0)
++//                return;
++//
++//            // dispatch event to parent
++//            dispatch(parent_win, ev, true);
++//        }
++//    }
+ }
+ 
+ } // end namespace FbTk
+diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc
+index 73f2ea06..cf863021 100644
+--- a/src/FbTk/KeyUtil.cc
++++ b/src/FbTk/KeyUtil.cc
+@@ -141,13 +141,14 @@ void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win,
+     const unsigned int scrollmod = instance().scrolllock();
+ 
+     // Grab with numlock, capslock and scrlock
+-    for (int i = 0; i < 8; i++) {
+-        XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
+-                    (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
+-                    win, False, event_mask, GrabModeSync, GrabModeAsync,
+-                    None, cursor);
+-    }
+-
++    //for (int i = 0; i < 8; i++) {
++    //    XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
++    //                (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
++    //                win, True, event_mask, GrabModeSync, GrabModeAsync,
++    //                None, cursor);
++    //}
++    XGrabButton(display, button, mod, win, True, event_mask,
++                GrabModeSync, GrabModeAsync, None, cursor);
+ }
+ 
+ /**
+diff --git a/src/Keys.cc b/src/Keys.cc
+index 86591371..c27037e2 100644
+--- a/src/Keys.cc
++++ b/src/Keys.cc
+@@ -277,7 +277,7 @@ void Keys::grabWindow(Window win) {
+     if (win_it == m_window_map.end())
+         return;
+ 
+-    m_handler_map[win]->grabButtons();
++    //m_handler_map[win]->grabButtons();
+     t_key::keylist_t::iterator it = m_keylist->keylist.begin();
+     t_key::keylist_t::iterator it_end = m_keylist->keylist.end();
+     for (; it != it_end; ++it) {
+@@ -586,16 +586,16 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+         isdouble = double_click;
+     }
+ 
+-    auto resetKeyChain = [&]() {
+-        first_key_time = 0;
+-        next_key.reset();
+-        if (saved_keymode) {
+-            setKeyMode(saved_keymode);
+-            saved_keymode.reset();
+-        }
+-    };
+-    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
+-        resetKeyChain();
++//    auto resetKeyChain = [&]() {
++//        first_key_time = 0;
++//        next_key.reset();
++//        if (saved_keymode) {
++//            setKeyMode(saved_keymode);
++//            saved_keymode.reset();
++//        }
++//    };
++//    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
++//        resetKeyChain();
+ 
+     if (!next_key)
+         next_key = m_keylist;
+@@ -612,29 +612,29 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+         next_key->find(MotionNotify, mods, key, context, false))
+         return true; // if there's a motion action, prevent replay to the client (but do nothing)
+ 
+-    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
+-        if (!saved_keymode) {
+-            first_key_time = time;
+-            saved_keymode = m_keylist;
+-        }
+-        next_key = temp_key;
+-        setKeyMode(next_key);
+-        return true;
+-    }
++//    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
++//        if (!saved_keymode) {
++//            first_key_time = time;
++//            saved_keymode = m_keylist;
++//        }
++//        next_key = temp_key;
++//        setKeyMode(next_key);
++//        return true;
++//    }
++
+     if (!temp_key || temp_key->m_command == 0) {
+-        if (type == KeyPress &&
+-            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
+-            // if we're in the middle of an emacs-style keychain, exit it
+-            resetKeyChain();
+-        }
++//        if (type == KeyPress &&
++//            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
++//            // if we're in the middle of an emacs-style keychain, exit it
++//            resetKeyChain();
++//        }
+         return false;
+     }
+ 
+     // if focus changes, windows will get NotifyWhileGrabbed,
+     // which they tend to ignore
+-    if (type == KeyPress) {
++    if (type == KeyPress)
+         XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
+-    }
+ 
+     WinClient *old = WindowCmd<void>::client();
+     WindowCmd<void>::setClient(current);
+@@ -650,12 +650,13 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
+     temp_key->m_command->execute();
+     WindowCmd<void>::setClient(old);
+ 
+-    if (saved_keymode) {
+-        if (next_key == m_keylist) // don't reset keymode if command changed it
+-            setKeyMode(saved_keymode);
+-        saved_keymode.reset();
+-    }
+-    next_key.reset();
++//    if (saved_keymode) {
++//        if (next_key == m_keylist) // don't reset keymode if command changed it
++//            setKeyMode(saved_keymode);
++//        saved_keymode.reset();
++//    }
++//    next_key.reset();
++
+     return true;
+ }
+ 
+@@ -685,15 +686,16 @@ void Keys::reconfigure() {
+ }
+ 
+ void Keys::regrab() {
+-    setKeyMode(m_keylist);
++    //setKeyMode(m_keylist);
+ }
+ 
+ void Keys::keyMode(const string& keyMode) {
+-    keyspace_t::iterator it = m_map.find(keyMode + ":");
+-    if (it == m_map.end())
++    //keyspace_t::iterator it = m_map.find(keyMode + ":");
++    //if (it == m_map.end())
++    //    setKeyMode(m_map["default:"]);
++    //else
++    //    setKeyMode(it->second);
+         setKeyMode(m_map["default:"]);
+-    else
+-        setKeyMode(it->second);
+ }
+ 
+ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
+@@ -701,10 +703,10 @@ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
+     ungrabButtons();
+ 
+     // notify handlers that their buttons have been ungrabbed
+-    HandlerMap::iterator h_it = m_handler_map.begin(),
+-                         h_it_end  = m_handler_map.end();
+-    for (; h_it != h_it_end; ++h_it)
+-        h_it->second->grabButtons();
++    //HandlerMap::iterator h_it = m_handler_map.begin(),
++    //                     h_it_end  = m_handler_map.end();
++    //for (; h_it != h_it_end; ++h_it)
++    //    h_it->second->grabButtons();
+ 
+     t_key::keylist_t::iterator it = keyMode->keylist.begin();
+     t_key::keylist_t::iterator it_end = keyMode->keylist.end();
+diff --git a/src/Window.cc b/src/Window.cc
+index 342e4885..457c30c6 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -1133,13 +1133,25 @@ void FluxboxWindow::updateSizeHints() {
+ }
+ 
+ void FluxboxWindow::grabButtons() {
+-
++//NOGRAB
++    //if (m_client->window() != frame().window().window() ) return;
+     // needed for click to focus
+-    XGrabButton(display, Button1, AnyModifier,
+-                frame().window().window(), True, ButtonPressMask,
+-                GrabModeSync, GrabModeSync, None, None);
+-    XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
+-                  frame().window().window());
++    // grabbing async here breaks mouse1
++    //XGrabButton(display, Button1, AnyModifier,
++    //            frame().window().window(), True, ButtonPressMask,
++    //            GrabModeSync, GrabModeSync, None, None);
++    //            //GrabModeAsync, GrabModeAsync, None, None);
++    //XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
++    //              frame().window().window());
++    //XGrabPointer(display,
++    //             frame().window().window(),
++    //             True,
++    //             ButtonPressMask,
++    //             GrabModeAsync, GrabModeAsync,
++    //             None,
++    //             None,
++    //             CurrentTime);
++    //XUngrabPointer(display, CurrentTime);
+ }
+ 
+ 
+@@ -2429,63 +2441,41 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
+     m_last_pressed_button = be.button;
+ 
+     FbTk::Menu::hideShownMenu();
+-
++//FIX ALLOW
+     Keys *k = Fluxbox::instance()->keys();
+     int context = 0;
+     context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);
+     if (!context && be.subwindow)
+         context = frame().getContext(be.window);
+ 
+-    if (k->doAction(be.type, be.state, be.button, context, &winClient(), be.time)) {
+-        XAllowEvents(display, SyncPointer, CurrentTime);
+-        return;
+-    }
+-
+-    WinClient *client = 0;
+-    if (!screen().focusControl().isMouseTabFocus()) {
+-        // determine if we're in a label button (tab)
+-        client = winClientOfLabelButtonWindow(be.window);
+-    }
+-
+-
+-    // - refeed the event into the queue so the app or titlebar subwindow gets it
+-    if (be.subwindow)
+-        XAllowEvents(display, ReplayPointer, CurrentTime);
+-    else
+-        XAllowEvents(display, SyncPointer, CurrentTime);
+-
+-    // if nothing was bound via keys-file then
+-    // - raise() if clickRaise is enabled
+-    // - hide open menues
+-    // - focus on clickFocus
+-    if (frame().window().window() == be.window) {
+-        if (screen().clickRaises())
+-            raise();
+-
+-        m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
+-        m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
+-    }
+-
+-    if (!m_focused && acceptsFocus() && m_click_focus)
+-        focus();
+-
+-    if (!screen().focusControl().isMouseTabFocus() &&
+-        client && client != m_client &&
+-        !screen().focusControl().isIgnored(be.x_root, be.y_root) ) {
+-        setCurrentClient(*client, isFocused());
+-    }
+-
+-
+-
++std::cout << "button window: " << be.window << "\nbutton subwindow: " << be.subwindow << "\n";
++k->doAction(be.type, be.state, be.button, context, &winClient(), CurrentTime); // w/o this, no mouse cmds
++XAllowEvents(display, ReplayPointer, CurrentTime); // w/o this, no mouse
++// ultimately none of the below matters
++    // infinite loop
++    //if (be.subwindow) {
++    //  //XEvent omfg = (XEvent *)&be;
++    //  //be.window = be.subwindow;
++    //  //be.subwindow = 0;
++    //  int huh = XSendEvent(display, be.window, False, ButtonPressMask, (XEvent*)&be);
++    //  std::cout << "xsendevent: " << huh << "\n";
++    //}
++    //XSync(display, 0);
++    //int wtf = XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
++    //std::cout << "xallowevents: " << wtf << "\n";
++    //XSync(display, 0);
++    //XAllowEvents(display, ReplayPointer, be.time); // time means squat - works but not for menus
++    //XAllowEvents(display, SyncPointer, CurrentTime); // sync will not doubleclick or act proper
++    //XAllowEvents(display, AsyncPointer, CurrentTime); // ^^ same
++    //if (be.subwindow)
++    //  XFlush(display);
++    //  //XSync(display, True);
+ }
+ 
+ const unsigned int DEADZONE = 4;
+ 
+ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
+ 
+-    if (m_last_pressed_button == static_cast<int>(re.button)) {
+-        m_last_pressed_button = 0;
+-    }
+ 
+     if (isMoving())
+         stopMoving();
+@@ -2502,6 +2492,13 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
+ 
+         Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button,
+                                               context, &winClient(), re.time);
++      // syncs dont make a difference?
++      //XSync(display, 0);
++      XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
++      //XSync(display, 0);
++    }
++    if (m_last_pressed_button == static_cast<int>(re.button)) {
++        m_last_pressed_button = 0;
+     }
+ }
+ 
diff --git a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
new file mode 100644
index 000000000000..36c572cea4ff
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
@@ -0,0 +1,65 @@
+diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
+index c2e49485..9b4058c8 100644
+--- a/src/WorkspaceCmd.cc
++++ b/src/WorkspaceCmd.cc
+@@ -521,22 +521,24 @@ void ArrangeWindowsCmd::execute() {
+     const unsigned int cal_width = max_width/cols; // width ratio (width of every window)
+     const unsigned int cal_height = max_height/rows; // height ratio (height of every window)
+
++    int cell_center_x = 0, cell_center_y = 0, win_center_x = 0, win_center_y = 0, x = 0, y = 0;
++    unsigned int closest_dist = ~0, dist = 0, w = 0, h = 0;
+     // Resizes and sets windows positions in columns and rows.
+     for (i = 0; i < rows; ++i) {
+         x_offs = orig_x_offs;
+         for (j = 0; j < cols && !normal_windows.empty(); ++j) {
+
+
+-            int cell_center_x = x_offs + (x_offs + cal_width) / 2;
+-            int cell_center_y = y_offs + (y_offs + cal_height) / 2;
+-            unsigned int closest_dist = ~0;
++            cell_center_x = x_offs + (x_offs + cal_width) / 2;
++            cell_center_y = y_offs + (y_offs + cal_height) / 2;
++            int closest_dist = ~0;
+
+             Workspace::Windows::iterator closest = normal_windows.end();
+             for (win = normal_windows.begin(); win != normal_windows.end(); ++win) {
+
+-                int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
+-                int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
+-                unsigned int dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
++                win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
++                win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
++                dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
+                                     (win_center_y - cell_center_y) * (win_center_y - cell_center_y);
+
+                 if (dist < closest_dist) {
+@@ -545,10 +547,10 @@ void ArrangeWindowsCmd::execute() {
+                 }
+             }
+
+-            int x = x_offs + (*closest)->xOffset();
+-            int y = y_offs + (*closest)->yOffset();
+-            unsigned int w = cal_width - (*closest)->widthOffset();
+-            unsigned int h = cal_height - (*closest)->heightOffset();
++            x = x_offs + (*closest)->xOffset();
++            y = y_offs + (*closest)->yOffset();
++            w = cal_width - (*closest)->widthOffset();
++            h = cal_height - (*closest)->heightOffset();
+
+             // the last window gets everything that is left.
+             if (normal_windows.size() == 1) {
+@@ -620,12 +622,9 @@ void UnclutterCmd::execute() {
+         return;
+
+     // place
+-    MinOverlapPlacement mopp;
+     int x, y;
+-    for (win = placed_windows.begin(); win != placed_windows.end(); ++win) {
+-        mopp.placeWindow(**win, head, x, y);
+-        (*win)->move(x, y);
+-    }
++    for (win = placed_windows.begin(); win != placed_windows.end(); ++win)
++        (*win)->placeWindow((*win)->getOnHead());
+ }
+
+ REGISTER_COMMAND(showdesktop, ShowDesktopCmd, void);
diff --git a/srcpkgs/fluxbox/patches/zor_loops.patch b/srcpkgs/fluxbox/patches/zor_loops.patch
new file mode 100644
index 000000000000..95d992f9071d
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/zor_loops.patch
@@ -0,0 +1,87 @@
+diff --git a/src/FbTk/STLUtil.hh b/src/FbTk/STLUtil.hh
+index abc54729..9c9c27f9 100644
+--- a/src/FbTk/STLUtil.hh
++++ b/src/FbTk/STLUtil.hh
+@@ -48,46 +48,63 @@ struct IfThenElse<false, Ta, Tb> {
+ /// calls delete on each item in the container and then clears the container
+ template <typename A>
+ void destroyAndClear(A &a) {
+-    typedef typename A::iterator iterator;
+-    iterator it = a.begin();
+-    iterator it_end = a.end();
+-    for (; it != it_end; ++it)
+-        delete (*it);
++    //typedef typename A::iterator iterator;
++    //iterator it = a.begin();
++    //iterator it_end = a.end();
++    //for (; it != it_end; ++it)
++    //    delete (*it);
+ 
++    //a.clear();
++    typedef typename A::iterator iterator;
++    for (auto it : a)
++        delete it;
+     a.clear();
+ }
+ 
+ /// calls delete on each item value in the map and then clears the map
+ template <typename A>
+ void destroyAndClearSecond(A &a) {
++    //typedef typename A::iterator iterator;
++    //iterator it = a.begin();
++    //iterator it_end = a.end();
++    //for (; it != it_end; ++it)
++    //    delete it->second;
++    //a.clear();
+     typedef typename A::iterator iterator;
+-    iterator it = a.begin();
+-    iterator it_end = a.end();
+-    for (; it != it_end; ++it)
+-        delete it->second;
++    for (auto it : a)
++        delete it.second;
+     a.clear();
+ }
+ 
+ 
+ template <typename C, typename F>
+ F forAll(C& c, F f) {
++    //typedef typename C::iterator iterator;
++    //iterator i = c.begin();
++    //iterator e = c.end();
++    //for (; i != e; i++) {
++    //    f(*i);
++    //}
+     typedef typename C::iterator iterator;
+-    iterator i = c.begin();
+-    iterator e = c.end();
+-    for (; i != e; i++) {
+-        f(*i);
+-    }
++    for (auto i : c)
++        f(i);
+     return f;
+ }
+ 
+ template <typename C, typename I, typename F>
+ F forAllIf(C& c, I i, F f) {
++    //typedef typename C::iterator iterator;
++    //iterator it = c.begin();
++    //iterator end = c.end();
++    //for (; it != end; ++it) {
++    //    if (i(*it))
++    //        f(*it);
++    //}
++    //return f;
+     typedef typename C::iterator iterator;
+-    iterator it = c.begin();
+-    iterator end = c.end();
+-    for (; it != end; ++it) {
+-        if (i(*it))
+-            f(*it);
++    for (auto it : c) {
++        if (i(it))
++            f(it);
+     }
+     return f;
+ }
diff --git a/srcpkgs/fluxbox/template b/srcpkgs/fluxbox/template
index e10b426c4924..6b0e4cd260cb 100644
--- a/srcpkgs/fluxbox/template
+++ b/srcpkgs/fluxbox/template
@@ -1,29 +1,56 @@
 # Template file for 'fluxbox'
 pkgname=fluxbox
-version=1.3.7
-revision=4
+version=1.3.8
+#nostrip=nostrip
+_commit=e2cbd179ecb2ef2d76e0ad1fde84b44325305799
+revision=0
+wrksrc=fluxbox-${_commit}
 build_style=gnu-configure
-configure_args="--enable-nls
+configure_args="--disable-nls --disable-xinerama --disable-shape --disable-xrender
+ --disable-fribidi --disable-slit
  ac_cv_lib_X11_XOpenDisplay=yes ac_cv_lib_Xft_XftFontOpen=yes
  ac_cv_lib_Xrender_XRenderCreatePicture=yes ac_cv_lib_Xpm_XpmReadFileToPixmap=yes
- ac_cv_lib_Xinerama_XineramaQueryScreens=yes ac_cv_lib_Xext_XShapeCombineShape=yes
+ ac_cv_lib_Xext_XShapeCombineShape=no
  ac_cv_lib_Xrandr_XRRQueryExtension=yes ac_cv_lib_fribidi_fribidi_version_info=yes"
-hostmakedepends="pkg-config automake libtool gettext gettext-devel"
+hostmakedepends="pkg-config automake libtool gettext gettext-devel clang llvm"
 makedepends="libSM-devel libXrender-devel libXft-devel libXpm-devel imlib2-devel
- libXext-devel libXinerama-devel libXrandr-devel fribidi-devel"
+ libXext-devel libXrandr-devel fribidi-devel"
 short_desc="Highly configurable and low resource X11 Window manager"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="http://www.fluxbox.org"
-distfiles="https://github.com/fluxbox/fluxbox/archive/refs/tags/Release-${version//./_}.tar.gz"
-checksum=990414ae342a35c5703e5025a8bf019b0b4dada55d57071c51d3d498abb5cd36
+distfiles="https://github.com/fluxbox/fluxbox/archive/${_commit}.tar.gz"
+checksum=6740d9cd4a3e631e0130cbcbc91ccac6af6335dc120f9adc5ebbc8dc9d3259a0
+
+nopie=yes
+X11_FLAGS="-Os -pipe"
+#FRIBIDI_CFLAGS="-Os -pipe"
+XRANDR_CFLAGS="-Os -pipe"
+AM_CPPFLAGS="-Os -pipe"
+CFLAGS="-Os -pipe"
+CXXFLAGS="-Os -pipe -std=c++11"
+CC="clang"
+CXX="clang++"
+HOST_CC=clang
+HOST_CXX=clang++
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) configure_args="${configure_args/enable-nls/disable-nls}" ;;
 esac
 
 pre_configure() {
-	./autogen.sh
+  export X11_FLAGS="-Os -pipe"
+  # export FRIBIDI_CFLAGS="-Os -pipe"
+  export XRANDR_CFLAGS="-Os -pipe"
+  export AM_CPPFLAGS="-Os -pipe"
+  export CFLAGS="-Os -pipe"
+  export CXXFLAGS="-Os -pipe -std=c++11"
+  export CC="clang"
+  export CXX="clang++"
+  export HOST_CC=clang
+  export HOST_CXX=clang++
+  export PREFIX=/usr
+  ./autogen.sh
 }
 
 post_install() {
diff --git a/srcpkgs/libavcodec4 b/srcpkgs/libavcodec4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavcodec4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavdevice4 b/srcpkgs/libavdevice4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavdevice4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavfilter4 b/srcpkgs/libavfilter4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavfilter4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavformat4 b/srcpkgs/libavformat4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavformat4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample b/srcpkgs/libavresample
index a9f1eea092d5..887f354e7c6b 120000
--- a/srcpkgs/libavresample
+++ b/srcpkgs/libavresample
@@ -1 +1 @@
-ffmpeg
\ No newline at end of file
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample4 b/srcpkgs/libavresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavutil4 b/srcpkgs/libavutil4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavutil4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libpostproc4 b/srcpkgs/libpostproc4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libpostproc4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswresample4 b/srcpkgs/libswresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswscale4 b/srcpkgs/libswscale4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswscale4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..bdeb22b13aaa 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,12 +1,13 @@
 # Template file for 'mesa'
 pkgname=mesa
-version=22.3.5
+version=23.0.0
 revision=1
+#wrksrc="Mesa-dg2-20230125"
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
  -Dlmsensors=enabled -Dplatforms=x11$(vopt_if wayland ,wayland)
- -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++14"
+ -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++17"
 hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
@@ -22,11 +23,23 @@ license="MIT, LGPL-2.1-or-later"
 homepage="https://www.mesa3d.org/"
 changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
-checksum=3eed2ecae2bc674494566faab9fcc9beb21cd804c7ba2b59a1694f3d7236e6a9
+checksum=01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4
+# intel dg2 jan 25
+#checksum=4ec8ec65dbdb1ee9444dba72970890128a19543a58cf05931bd6f54f124e117f
+#checksum=37a1ddaf03f41919ee3c89c97cff41e87de96e00e9d3247959cc8279d8294593
+#distfiles="https://github.com/intel-gpu/Mesa/archive/refs/tags/dg2-20230125.tar.gz"
+#checksum=22203186779222ec5244ecb74fbae706d3557588c82089b18c7bf77a54799a59
 
 build_options="wayland"
 build_options_default="wayland"
 
+export CC=clang
+export CXX=clang++
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -Duse-elf-tls=false"
+fi
+
 # only use llvmpipe on targets where it's supported and reliable
 # especially on big endian it's all kinds of broken, and e.g. on
 # 32-bit powerpc it does not work at all, so fall back to softpipe
@@ -91,7 +104,7 @@ fi
 if [ "$_have_intel" ]; then
 	_have_vulkan=yes
 	_gallium_drivers+=",crocus,iris,i915"
-	_vulkan_drivers+=",intel,intel_hasvk"
+	_vulkan_drivers+=",intel"
 	subpackages+=" mesa-vulkan-intel"
 	# transitional dummy packages
 	subpackages+=" mesa-intel-dri"
@@ -140,10 +153,10 @@ fi
 
 # enabled currently by amd drivers
 if [ "$_have_opencl" ]; then
-	hostmakedepends+=" clang rust rust-bindgen"
-	makedepends+=" clang libclc rust SPIRV-LLVM-Translator-devel SPIRV-Tools-devel"
+	hostmakedepends+=" clang"
+	makedepends+=" clang libclc"
 	subpackages+=" mesa-opencl"
-	configure_args+=" -Dgallium-opencl=icd -Dgallium-rusticl=true -Drust_std=2021"
+	configure_args+=" -Dgallium-opencl=icd"
 fi
 
 if [ "$_have_hwdec" ]; then
@@ -187,7 +200,6 @@ esac
 post_configure() {
 	if [ "$CROSS_BUILD" ]; then
 		find -iname "*.ninja" -exec sed -i "{}" \
-			-e "/rustc/s; --sysroot ${XBPS_CROSS_BASE}/usr;;g" \
 			-e "s; /usr/lib/; ${XBPS_CROSS_BASE}/usr/lib/;g" \
 			-e "s;-L/usr/lib;-L${XBPS_CROSS_BASE}/usr/lib;g" \
 			-e "s;-I/usr/include;-I${XBPS_CROSS_BASE}/usr/include;g" \
@@ -286,7 +298,6 @@ MesaLib-devel_package() {
 		fi
 		if [ "$_have_opencl" ]; then
 			vmove usr/lib/libMesaOpenCL.so
-			vmove usr/lib/libRusticlOpenCL.so
 		fi
 	}
 }
@@ -305,7 +316,6 @@ mesa-opencl_package() {
 		vmove etc/OpenCL
 		vmove usr/lib/gallium-pipe
 		vmove "usr/lib/libMesaOpenCL.so.*"
-		vmove "usr/lib/libRusticlOpenCL.so.*"
 	}
 }
 
@@ -336,15 +346,14 @@ mesa-vdpau_package() {
 mesa-vulkan-intel_package() {
 	short_desc="Mesa Intel Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/vulkan/icd.d/intel*.json"
-		vmove "usr/lib/libvulkan_intel*.so"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
 mesa-vulkan-radeon_package() {
 	short_desc="Mesa Radeon Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/drirc.d/00-radv-defaults.conf"
 		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
 		vmove "usr/lib/libvulkan_radeon.so"
 	}

From 67b2aefebf41e6c55d20094c6ed107ac3e6f64d8 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 17:41:38 -0400
Subject: [PATCH 2/4] opencv: update to 4.7.0.

---
 common/shlibs                            | 104 +++++++++++------------
 srcpkgs/actiona/template                 |   2 +-
 srcpkgs/digikam/template                 |   2 +-
 srcpkgs/gmic/template                    |   2 +-
 srcpkgs/goldendict/patches/ffmpeg4.patch |  21 -----
 srcpkgs/nomacs/template                  |   2 +-
 srcpkgs/opencv/template                  |   8 +-
 srcpkgs/qimgv/template                   |   2 +-
 srcpkgs/retroshare/template              |   2 +-
 srcpkgs/siril/template                   |   2 +-
 srcpkgs/waifu2x-converter-cpp/template   |   2 +-
 11 files changed, 64 insertions(+), 85 deletions(-)
 delete mode 100644 srcpkgs/goldendict/patches/ffmpeg4.patch

diff --git a/common/shlibs b/common/shlibs
index aab66c83f4b3..a9d1c6a16ec6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2128,58 +2128,58 @@ libcapstone.so.4 capstone-4.0_1
 libhavege.so.2 libhaveged-1.9.11_1
 libnih.so.1 libnih-1.0.3_1
 libnih-dbus.so.1 libnih-1.0.3_1
-libopencv_quality.so.406 libopencv-4.6.0_1
-libopencv_reg.so.406 libopencv-4.6.0_1
-libopencv_surface_matching.so.406 libopencv-4.6.0_1
-libopencv_xphoto.so.406 libopencv-4.6.0_1
-libopencv_freetype.so.406 libopencv-4.6.0_1
-libopencv_fuzzy.so.406 libopencv-4.6.0_1
-libopencv_hfs.so.406 libopencv-4.6.0_1
-libopencv_img_hash.so.406 libopencv-4.6.0_1
-libopencv_line_descriptor.so.406 libopencv-4.6.0_1
-libopencv_saliency.so.406 libopencv-4.6.0_1
-libopencv_structured_light.so.406 libopencv-4.6.0_1
-libopencv_aruco.so.406 libopencv-4.6.0_1
-libopencv_bgsegm.so.406 libopencv-4.6.0_1
-libopencv_bioinspired.so.406 libopencv-4.6.0_1
-libopencv_ccalib.so.406 libopencv-4.6.0_1
-libopencv_face.so.406 libopencv-4.6.0_1
-libopencv_tracking.so.406 libopencv-4.6.0_1
-libopencv_xfeatures2d.so.406 libopencv-4.6.0_1
-libopencv_optflow.so.406 libopencv-4.6.0_1
-libopencv_ximgproc.so.406 libopencv-4.6.0_1
-libopencv_plot.so.406 libopencv-4.6.0_1
-libopencv_text.so.406 libopencv-4.6.0_1
-libopencv_ml.so.406 libopencv-4.6.0_1
-libopencv_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn.so.406 libopencv-4.6.0_1
-libopencv_shape.so.406 libopencv-4.6.0_1
-libopencv_stitching.so.406 libopencv-4.6.0_1
-libopencv_photo.so.406 libopencv-4.6.0_1
-libopencv_video.so.406 libopencv-4.6.0_1
-libopencv_calib3d.so.406 libopencv-4.6.0_1
-libopencv_features2d.so.406 libopencv-4.6.0_1
-libopencv_flann.so.406 libopencv-4.6.0_1
-libopencv_highgui.so.406 libopencv-4.6.0_1
-libopencv_videoio.so.406 libopencv-4.6.0_1
-libopencv_imgcodecs.so.406 libopencv-4.6.0_1
-libopencv_imgproc.so.406 libopencv-4.6.0_1
-libopencv_core.so.406 libopencv-4.6.0_1
-libopencv_superres.so.406 libopencv-4.6.0_1
-libopencv_videostab.so.406 libopencv-4.6.0_1
-libopencv_gapi.so.406 libopencv-4.6.0_1
-libopencv_xobjdetect.so.406 libopencv-4.6.0_1
-libopencv_datasets.so.406 libopencv-4.6.0_1
-libopencv_dnn_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn_superres.so.406 libopencv-4.6.0_1
-libopencv_dpm.so.406 libopencv-4.6.0_1
-libopencv_phase_unwrapping.so.406 libopencv-4.6.0_1
-libopencv_stereo.so.406 libopencv-4.6.0_1
-libopencv_rapid.so.406 libopencv-4.6.0_1
-libopencv_intensity_transform.so.406 libopencv-4.6.0_1
-libopencv_alphamat.so.406 libopencv-4.6.0_1
-libopencv_barcode.so.406 libopencv-4.6.0_1
-libopencv_mcc.so.406 libopencv-4.6.0_1
+libopencv_quality.so.407 libopencv-4.7.0_1
+libopencv_reg.so.407 libopencv-4.7.0_1
+libopencv_surface_matching.so.407 libopencv-4.7.0_1
+libopencv_xphoto.so.407 libopencv-4.7.0_1
+libopencv_freetype.so.407 libopencv-4.7.0_1
+libopencv_fuzzy.so.407 libopencv-4.7.0_1
+libopencv_hfs.so.407 libopencv-4.7.0_1
+libopencv_img_hash.so.407 libopencv-4.7.0_1
+libopencv_line_descriptor.so.407 libopencv-4.7.0_1
+libopencv_saliency.so.407 libopencv-4.7.0_1
+libopencv_structured_light.so.407 libopencv-4.7.0_1
+libopencv_aruco.so.407 libopencv-4.7.0_1
+libopencv_bgsegm.so.407 libopencv-4.7.0_1
+libopencv_bioinspired.so.407 libopencv-4.7.0_1
+libopencv_ccalib.so.407 libopencv-4.7.0_1
+libopencv_face.so.407 libopencv-4.7.0_1
+libopencv_tracking.so.407 libopencv-4.7.0_1
+libopencv_xfeatures2d.so.407 libopencv-4.7.0_1
+libopencv_optflow.so.407 libopencv-4.7.0_1
+libopencv_ximgproc.so.407 libopencv-4.7.0_1
+libopencv_plot.so.407 libopencv-4.7.0_1
+libopencv_text.so.407 libopencv-4.7.0_1
+libopencv_ml.so.407 libopencv-4.7.0_1
+libopencv_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn.so.407 libopencv-4.7.0_1
+libopencv_shape.so.407 libopencv-4.7.0_1
+libopencv_stitching.so.407 libopencv-4.7.0_1
+libopencv_photo.so.407 libopencv-4.7.0_1
+libopencv_video.so.407 libopencv-4.7.0_1
+libopencv_calib3d.so.407 libopencv-4.7.0_1
+libopencv_features2d.so.407 libopencv-4.7.0_1
+libopencv_flann.so.407 libopencv-4.7.0_1
+libopencv_highgui.so.407 libopencv-4.7.0_1
+libopencv_videoio.so.407 libopencv-4.7.0_1
+libopencv_imgcodecs.so.407 libopencv-4.7.0_1
+libopencv_imgproc.so.407 libopencv-4.7.0_1
+libopencv_core.so.407 libopencv-4.7.0_1
+libopencv_superres.so.407 libopencv-4.7.0_1
+libopencv_videostab.so.407 libopencv-4.7.0_1
+libopencv_gapi.so.407 libopencv-4.7.0_1
+libopencv_xobjdetect.so.407 libopencv-4.7.0_1
+libopencv_datasets.so.407 libopencv-4.7.0_1
+libopencv_dnn_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn_superres.so.407 libopencv-4.7.0_1
+libopencv_dpm.so.407 libopencv-4.7.0_1
+libopencv_phase_unwrapping.so.407 libopencv-4.7.0_1
+libopencv_stereo.so.407 libopencv-4.7.0_1
+libopencv_rapid.so.407 libopencv-4.7.0_1
+libopencv_intensity_transform.so.407 libopencv-4.7.0_1
+libopencv_alphamat.so.407 libopencv-4.7.0_1
+libopencv_barcode.so.407 libopencv-4.7.0_1
+libopencv_mcc.so.407 libopencv-4.7.0_1
 libuniconf.so.4.6 wvstreams-4.6.1_20
 libwvbase.so.4.6 wvstreams-4.6.1_20
 libwvutils.so.4.6 wvstreams-4.6.1_20
diff --git a/srcpkgs/actiona/template b/srcpkgs/actiona/template
index cf5f0b7a2ae6..0d899311e6df 100644
--- a/srcpkgs/actiona/template
+++ b/srcpkgs/actiona/template
@@ -1,7 +1,7 @@
 # Template file for 'actiona'
 pkgname=actiona
 version=3.10.1
-revision=2
+revision=3
 build_style=qmake
 configure_args="PKGCONFIG_OPENCV=opencv4"
 hostmakedepends="pkg-config qt5-plugin-mysql qt5-qmake qt5-host-tools"
diff --git a/srcpkgs/digikam/template b/srcpkgs/digikam/template
index e8ec4961457b..0a8984db85bc 100644
--- a/srcpkgs/digikam/template
+++ b/srcpkgs/digikam/template
@@ -1,7 +1,7 @@
 # Template file for 'digikam'
 pkgname=digikam
 version=7.10.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext pkg-config bison flex qt5-qmake
diff --git a/srcpkgs/gmic/template b/srcpkgs/gmic/template
index 8e3b80047f26..43c6e0672a2b 100644
--- a/srcpkgs/gmic/template
+++ b/srcpkgs/gmic/template
@@ -1,7 +1,7 @@
 # Template file for 'gmic'
 pkgname=gmic
 version=3.1.6
-revision=1
+revision=2
 _zart_hash=34ebf6cce0bafb98abe57cec83c4a02cd1abeca0
 create_wrksrc=yes
 build_wrksrc="src"
diff --git a/srcpkgs/goldendict/patches/ffmpeg4.patch b/srcpkgs/goldendict/patches/ffmpeg4.patch
deleted file mode 100644
index f045fa27f54b..000000000000
--- a/srcpkgs/goldendict/patches/ffmpeg4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ffmpegaudio.cc.orig 2018-05-09 22:16:13.480659958 +0200
-+++ b/ffmpegaudio.cc      2018-05-09 22:16:50.748322790 +0200
-@@ -143,7 +143,7 @@
-     return false;
-   }
-
--  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
-+  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
-   if ( !avioBuffer )
-   {
-     errorString = QObject::tr( "av_malloc() failed." );
-@@ -380,7 +380,7 @@
-   }
-
-   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
--       codecContext_->codec->capabilities & CODEC_CAP_DELAY )
-+       codecContext_->codec->capabilities & AV_CODEC_CAP_DELAY )
-   {
-     av_init_packet( &packet );
-     int gotFrame = 0;
-
diff --git a/srcpkgs/nomacs/template b/srcpkgs/nomacs/template
index 895e83071a8a..ce4e7f7093da 100644
--- a/srcpkgs/nomacs/template
+++ b/srcpkgs/nomacs/template
@@ -1,7 +1,7 @@
 # Template file for 'nomacs'
 pkgname=nomacs
 version=3.16.224
-revision=3
+revision=4
 build_wrksrc=ImageLounge
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_TRANSLATIONS=1
diff --git a/srcpkgs/opencv/template b/srcpkgs/opencv/template
index a09b8dd0d449..41f3183f1582 100644
--- a/srcpkgs/opencv/template
+++ b/srcpkgs/opencv/template
@@ -1,7 +1,7 @@
 # Template file for 'opencv'
 pkgname=opencv
-version=4.6.0
-revision=3
+version=4.7.0
+revision=1
 create_wrksrc=yes
 build_wrksrc=${pkgname}-${version}
 build_style=cmake
@@ -24,8 +24,8 @@ homepage="https://opencv.org"
 changelog="https://github.com/opencv/opencv/wiki/ChangeLog"
 distfiles="https://github.com/opencv/opencv/archive/${version}.tar.gz
  https://github.com/opencv/opencv_contrib/archive/${version}.tar.gz>contrib.tar.gz"
-checksum="1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
- 1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7"
+checksum="8df0079cdbe179748a18d44731af62a245a45ebf5085223dc03133954c662973
+ 42df840cf9055e59d0e22c249cfb19f04743e1bdad113d31b1573d3934d62584"
 patch_args="-Np1 -d ${build_wrksrc}"
 # tests hang indenfinitely, even with test data included
 make_check=no
diff --git a/srcpkgs/qimgv/template b/srcpkgs/qimgv/template
index 7eb30db33992..dd341dfe1bfc 100644
--- a/srcpkgs/qimgv/template
+++ b/srcpkgs/qimgv/template
@@ -1,7 +1,7 @@
 # Template file for 'qimgv'
 pkgname=qimgv
 version=1.0.2
-revision=2
+revision=3
 build_style=cmake
 configure_args="$(vopt_if video -DVIDEO_SUPPORT=ON -DVIDEO_SUPPORT=OFF)
  $(vopt_if scale -DOPENCV_SUPPORT=ON -DOPENCV_SUPPORT=OFF)
diff --git a/srcpkgs/retroshare/template b/srcpkgs/retroshare/template
index 8a0786c21a08..72023fa98b75 100644
--- a/srcpkgs/retroshare/template
+++ b/srcpkgs/retroshare/template
@@ -1,7 +1,7 @@
 # Template file for 'retroshare'
 pkgname=retroshare
 version=0.6.6
-revision=2
+revision=4
 build_style=qmake
 #XXX broadcast feature requires an ancient udp-discovery-cpp which either needs
 # to be fetched+patched (FTBFS) here or packaged :/
diff --git a/srcpkgs/siril/template b/srcpkgs/siril/template
index e06aa5d0559c..84332f79d060 100644
--- a/srcpkgs/siril/template
+++ b/srcpkgs/siril/template
@@ -1,7 +1,7 @@
 # Template file for 'siril'
 pkgname=siril
 version=0.9.12
-revision=8
+revision=10
 build_style=gnu-configure
 hostmakedepends="pkg-config intltool autoconf automake gettext-devel"
 makedepends="fftw-devel libconfig-devel libopencv-devel libffms2-devel
diff --git a/srcpkgs/waifu2x-converter-cpp/template b/srcpkgs/waifu2x-converter-cpp/template
index 8c095d0d7bab..aa52d8c981a8 100644
--- a/srcpkgs/waifu2x-converter-cpp/template
+++ b/srcpkgs/waifu2x-converter-cpp/template
@@ -1,7 +1,7 @@
 # Template file for 'waifu2x-converter-cpp'
 pkgname=waifu2x-converter-cpp
 version=5.2.4
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DINSTALL_MODELS=ON"
 hostmakedepends="pkg-config"

From deb1b4d1f9786d58c3fad3807b9cb7a1a46b119c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 18:07:58 -0400
Subject: [PATCH 3/4] ffmpeg4 bumps

---
 srcpkgs/osg/template      | 4 ++--
 srcpkgs/vlc/template      | 4 ++--
 srcpkgs/xine-lib/template | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index 1a031448b3cf..755793f7e11b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,14 +1,14 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms
 configure_args="-DLIB_POSTFIX="
 hostmakedepends="pkg-config xrandr"
 makedepends="MesaLib-devel gtkglext-devel libcurl-devel giflib-devel librsvg-devel
- jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg-devel xine-lib-devel
+ jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg4-devel xine-lib-devel
  SDL2-devel gst-plugins-base1-devel
  $(vopt_if openexr libopenexr-devel)
  $(vopt_if poppler poppler-glib-devel)
diff --git a/srcpkgs/vlc/template b/srcpkgs/vlc/template
index 210762b0a7e2..855ca5238662 100644
--- a/srcpkgs/vlc/template
+++ b/srcpkgs/vlc/template
@@ -1,7 +1,7 @@
 # Template file for 'vlc'
 pkgname=vlc
 version=3.0.18
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-gme --disable-libtar --enable-jack
  --enable-live555 --disable-fluidsynth --enable-dvdread
@@ -25,7 +25,7 @@ lib32disabled=yes
 hostmakedepends="automake libtool pkg-config flex gettext libgcrypt-devel
  live555-devel gettext-devel $(vopt_if lua lua52) $(vopt_if chromecast protobuf)"
 makedepends="
- avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg-devel freefont-ttf
+ avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg4-devel freefont-ttf
  gnutls-devel jack-devel liba52-devel libass-devel libbluray-devel
  libcdio-devel libdca-devel libdvbpsi-devel libdvdnav-devel libmad-devel
  libmatroska-devel libmodplug-devel libmpcdec-devel libmpeg2-devel
diff --git a/srcpkgs/xine-lib/template b/srcpkgs/xine-lib/template
index f713eff49b07..ed6194c17d11 100644
--- a/srcpkgs/xine-lib/template
+++ b/srcpkgs/xine-lib/template
@@ -1,6 +1,6 @@
 # Template file for 'xine-lib'
 pkgname=xine-lib
-version=1.2.12
+version=1.2.13
 revision=1
 build_style=gnu-configure
 configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
@@ -8,7 +8,7 @@ configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
 hostmakedepends="automake gettext-devel libtool pkg-config perl"
 makedepends="
  zlib-devel alsa-lib-devel libxcb-devel libSM-devel libXext-devel libXv-devel
- libXvMC-devel liba52-devel libmad-devel ffmpeg-devel pulseaudio-devel
+ libXvMC-devel liba52-devel libmad-devel ffmpeg4-devel pulseaudio-devel
  jack-devel samba-devel libflac-devel libmodplug-devel libmpcdec-devel
  speex-devel libtheora-devel libvorbis-devel libdca-devel faad2-devel
  libcdio-devel libbluray-devel aalib-devel libcaca-devel libXinerama-devel
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="http://www.xine-project.org"
 changelog="https://sourceforge.net/projects/xine/files/xine-lib/${version}/README.txt/view"
 distfiles="${SOURCEFORGE_SITE}/xine/${pkgname}-${version}.tar.xz"
-checksum=d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098
+checksum=5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f
 
 case "$XBPS_TARGET_MACHINE" in
 	i686-musl)

From cd0b8242f8b5d71f7344c3b370a3827c41bcc2b2 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 18:08:05 -0400
Subject: [PATCH 4/4] ffmpeg5 bumps

---
 srcpkgs/QMPlay2/template                      |   2 +-
 srcpkgs/alsa-plugins/template                 |   2 +-
 srcpkgs/arcan/template                        |   2 +-
 srcpkgs/attract/template                      |   2 +-
 srcpkgs/aubio/patches/ffmpeg5.patch           |  37 ++
 srcpkgs/aubio/template                        |   2 +-
 .../audacious-plugins/patches/ffmpeg5.patch   |  43 ++
 srcpkgs/audacious-plugins/template            |   2 +-
 srcpkgs/audacity/template                     |   3 +-
 srcpkgs/avidemux/template                     |   2 +-
 srcpkgs/baresip/template                      |   2 +-
 srcpkgs/blender/template                      |   2 +-
 srcpkgs/cantata/template                      |   2 +-
 srcpkgs/ccextractor/template                  |   2 +-
 srcpkgs/chromaprint/patches/ffmpeg5.patch     | 569 ++++++++++++++++++
 srcpkgs/chromaprint/template                  |   2 +-
 srcpkgs/chromium/template                     |   2 +-
 srcpkgs/cmus/template                         |   2 +-
 srcpkgs/cyanrip/template                      |   2 +-
 srcpkgs/deadbeef/template                     |   2 +-
 srcpkgs/dolphin-emu/template                  |   2 +-
 srcpkgs/droidcam-obs-plugin/template          |   2 +-
 srcpkgs/droidcam/template                     |   2 +-
 srcpkgs/electron19/template                   |   2 +-
 srcpkgs/ffmpeg/template                       | 166 +++--
 srcpkgs/ffmpeg4/ffmpeg4                       |   1 -
 srcpkgs/ffmpeg4/template                      |  46 +-
 srcpkgs/ffmpegthumbnailer/template            |   6 +-
 srcpkgs/ffmpegthumbs/template                 |   2 +-
 srcpkgs/ffms2/patches/ffmpeg5.patch           | 419 +++++++++++++
 srcpkgs/ffms2/template                        |   2 +-
 ...Fix-infinite-loop-in-Menu-cycleitems.patch |  60 --
 ...6c4d30f5b289c429c5ca88d800200db4fc4f.patch |  22 +
 .../MinOverlapPlacement.cc_improve.patch      |  29 -
 srcpkgs/fluxbox/patches/center.patch          | 307 ----------
 srcpkgs/fluxbox/patches/container_locks.patch | 325 ----------
 .../patches/container_relative_relative.patch |  15 -
 srcpkgs/fluxbox/patches/flux_improve.patch    | 205 -------
 srcpkgs/fluxbox/patches/flux_oversize.patch   |  24 -
 .../fluxbox/patches/focus_close_menu.patch    |  17 -
 srcpkgs/fluxbox/patches/slit_raise.patch      |  16 -
 srcpkgs/fluxbox/patches/toolbar_redo.patch    | 228 -------
 .../fluxbox/patches/tremor_graboid_hell.patch | 350 -----------
 .../patches/unclutter_fix_workspacecmd.patch  |  65 --
 srcpkgs/fluxbox/patches/zor_loops.patch       |  87 ---
 srcpkgs/fluxbox/template                      |  45 +-
 srcpkgs/freerdp/template                      |   2 +-
 srcpkgs/gerbera/template                      |   2 +-
 srcpkgs/goldendict/patches/ffmpeg5-1.patch    | 232 +++++++
 srcpkgs/goldendict/patches/ffmpeg5-2.patch    |  33 +
 srcpkgs/goldendict/patches/ffmpeg5-3.patch    |  25 +
 srcpkgs/goldendict/template                   |   2 +-
 srcpkgs/gst-libav/template                    |   2 +-
 srcpkgs/gst-plugins-bad1/template             |   2 +-
 srcpkgs/gst-rtsp-server/template              |   2 +-
 srcpkgs/gtk4/template                         |   2 +-
 srcpkgs/guvcview/template                     |   2 +-
 srcpkgs/handbrake/template                    |   2 +-
 srcpkgs/hedgewars/template                    |   2 +-
 srcpkgs/idjc/template                         |   2 +-
 srcpkgs/kfilemetadata5/template               |   2 +-
 srcpkgs/kid3/template                         |   2 +-
 srcpkgs/kodi/template                         |   2 +-
 srcpkgs/kpipewire/template                    |   2 +-
 srcpkgs/libavresample                         |   2 +-
 srcpkgs/libextractor/template                 |   2 +-
 srcpkgs/libopenal/template                    |   2 +-
 srcpkgs/libopenshot/template                  |   2 +-
 srcpkgs/loudgain/template                     |   2 +-
 srcpkgs/mediastreamer/template                |   2 +-
 srcpkgs/mesa/template                         |  35 +-
 srcpkgs/mgba/patches/ffmpeg5.patch            | 117 ++++
 srcpkgs/mgba/template                         |   2 +-
 srcpkgs/minidlna/template                     |   2 +-
 srcpkgs/mixxx/template                        |   2 +-
 srcpkgs/mlt/template                          |   2 +-
 srcpkgs/mlt7/template                         |   2 +-
 srcpkgs/moc/template                          |   2 +-
 srcpkgs/motion/template                       |   2 +-
 srcpkgs/mpd/template                          |   2 +-
 srcpkgs/mpv/template                          |   2 +-
 srcpkgs/musikcube/template                    |   2 +-
 srcpkgs/notcurses/template                    |   2 +-
 srcpkgs/obs/template                          |   2 +-
 srcpkgs/olive/template                        |   2 +-
 srcpkgs/omxplayer/template                    |   2 +-
 srcpkgs/openimageio/template                  |   2 +-
 srcpkgs/openmw/template                       |   2 +-
 srcpkgs/openshot/template                     |   2 +-
 srcpkgs/opentoonz/template                    |   2 +-
 srcpkgs/pianobar/template                     |   2 +-
 srcpkgs/ppsspp/template                       |   2 +-
 srcpkgs/pqiv/template                         |   2 +-
 srcpkgs/qmmp/template                         |   2 +-
 srcpkgs/qt5-webengine/template                |   2 +-
 srcpkgs/qt5/template                          |   2 +-
 srcpkgs/qt6-multimedia/template               |   2 +-
 srcpkgs/qt6-webengine/template                |   2 +-
 srcpkgs/qtav/template                         |   2 +-
 srcpkgs/qtox/patches/ffmpeg5.patch            |  79 +++
 srcpkgs/qtox/template                         |   2 +-
 srcpkgs/retroarch/template                    |   2 +-
 srcpkgs/scrcpy/template                       |   2 +-
 srcpkgs/spek-alternative/template             |   2 +-
 srcpkgs/ssr/template                          |   2 +-
 srcpkgs/sumo/template                         |   2 +-
 srcpkgs/synfig/template                       |   2 +-
 srcpkgs/telegram-desktop/template             |   2 +-
 srcpkgs/tg_owt/template                       |   2 +-
 srcpkgs/timg/template                         |   2 +-
 srcpkgs/tracker-miners/template               |   2 +-
 srcpkgs/tvheadend/template                    |   2 +-
 srcpkgs/unpaper/template                      |   2 +-
 srcpkgs/vba-m/template                        |   2 +-
 srcpkgs/vice/template                         |   2 +-
 srcpkgs/waypipe/template                      |   2 +-
 srcpkgs/wf-recorder/template                  |   2 +-
 srcpkgs/xpra/template                         |   2 +-
 118 files changed, 1765 insertions(+), 2017 deletions(-)
 create mode 100644 srcpkgs/aubio/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/audacious-plugins/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/chromaprint/patches/ffmpeg5.patch
 delete mode 120000 srcpkgs/ffmpeg4/ffmpeg4
 create mode 100644 srcpkgs/ffms2/patches/ffmpeg5.patch
 delete mode 100644 srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
 create mode 100644 srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
 delete mode 100644 srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
 delete mode 100644 srcpkgs/fluxbox/patches/center.patch
 delete mode 100644 srcpkgs/fluxbox/patches/container_locks.patch
 delete mode 100644 srcpkgs/fluxbox/patches/container_relative_relative.patch
 delete mode 100644 srcpkgs/fluxbox/patches/flux_improve.patch
 delete mode 100644 srcpkgs/fluxbox/patches/flux_oversize.patch
 delete mode 100644 srcpkgs/fluxbox/patches/focus_close_menu.patch
 delete mode 100644 srcpkgs/fluxbox/patches/slit_raise.patch
 delete mode 100644 srcpkgs/fluxbox/patches/toolbar_redo.patch
 delete mode 100644 srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
 delete mode 100644 srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
 delete mode 100644 srcpkgs/fluxbox/patches/zor_loops.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-1.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-2.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-3.patch
 create mode 100644 srcpkgs/mgba/patches/ffmpeg5.patch
 create mode 100644 srcpkgs/qtox/patches/ffmpeg5.patch

diff --git a/srcpkgs/QMPlay2/template b/srcpkgs/QMPlay2/template
index ad73cbb01bae..55284c051161 100644
--- a/srcpkgs/QMPlay2/template
+++ b/srcpkgs/QMPlay2/template
@@ -1,7 +1,7 @@
 # Template file for 'QMPlay2'
 pkgname=QMPlay2
 version=23.02.05
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="alsa-lib-devel ffmpeg-devel libass-devel libcdio-devel libgme-devel
diff --git a/srcpkgs/alsa-plugins/template b/srcpkgs/alsa-plugins/template
index 0bfa6d9fd264..a5708a7d82a8 100644
--- a/srcpkgs/alsa-plugins/template
+++ b/srcpkgs/alsa-plugins/template
@@ -1,7 +1,7 @@
 # Template file for 'alsa-plugins'
 pkgname=alsa-plugins
 version=1.2.7.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-maemo-plugin"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/arcan/template b/srcpkgs/arcan/template
index 7be9652eccf3..ccc7df11ceac 100644
--- a/srcpkgs/arcan/template
+++ b/srcpkgs/arcan/template
@@ -2,7 +2,7 @@
 # !! keep synced with: acfgfs aclip aloadimage
 pkgname=arcan
 version=0.6.2.1
-revision=1
+revision=2
 create_wrksrc=yes
 build_wrksrc=arcan/src
 build_style=cmake
diff --git a/srcpkgs/attract/template b/srcpkgs/attract/template
index 26144e931a3c..24017d2bacc2 100644
--- a/srcpkgs/attract/template
+++ b/srcpkgs/attract/template
@@ -1,7 +1,7 @@
 # Template file for 'attract'
 pkgname=attract
 version=2.6.2
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="VERBOSE=1"
 make_use_env=yes
diff --git a/srcpkgs/aubio/patches/ffmpeg5.patch b/srcpkgs/aubio/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a2c8e11ecff0
--- /dev/null
+++ b/srcpkgs/aubio/patches/ffmpeg5.patch
@@ -0,0 +1,37 @@
+commit 35eee003f034a1a2097cd4557deb773eacb18f7b
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:11 2022 +0100
+
+    aubio: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/aubio/patches/ffmpeg-5.0.patch b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..aace41a6e6
+--- /dev/null
++++ b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,25 @@
++From 8a05420e5dd8c7b8b2447f82dc919765876511b3 Mon Sep 17 00:00:00 2001
++From: Paul Brossier <piem@piem.org>
++Date: Tue, 25 Jan 2022 18:30:27 +0100
++Subject: [PATCH] [source_avcodec] define FF_API_LAVF_AVCTX for libavcodec >
++ 59, thx @berolinux (closes gh-353)
++
++---
++ src/io/source_avcodec.c | 4 ++++
++ 1 file changed, 4 insertions(+)
++
++diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c
++index e0ae93b5..1421bd9a 100644
++--- a/src/io/source_avcodec.c
+++++ b/src/io/source_avcodec.c
++@@ -68,6 +68,10 @@
++ #define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
++ #endif
++ 
+++#if LIBAVCODEC_VERSION_MAJOR >= 59
+++#define FF_API_LAVF_AVCTX 1
+++#endif
+++
++ struct _aubio_source_avcodec_t {
++   uint_t hop_size;
++   uint_t samplerate;
diff --git a/srcpkgs/aubio/template b/srcpkgs/aubio/template
index ad1c4b256991..7d875cc02541 100644
--- a/srcpkgs/aubio/template
+++ b/srcpkgs/aubio/template
@@ -1,7 +1,7 @@
 # Template file for 'aubio'
 pkgname=aubio
 version=0.4.9
-revision=1
+revision=2
 build_style=waf3
 # XXX lash, pure and swig support.
 hostmakedepends="pkg-config txt2man"
diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg5.patch b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..4e5e34099d71
--- /dev/null
+++ b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
@@ -0,0 +1,43 @@
+commit 298aa371c56c2f52c25a33d9bdec4918b11cebdc
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:12 2022 +0100
+
+    audacious-plugins: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..617c11215b
+--- /dev/null
++++ b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,31 @@
++From f60beb400eeb1e4778bbfd738bc4a4ccef3de539 Mon Sep 17 00:00:00 2001
++From: John Lindgren <john@jlindgren.net>
++Date: Sat, 5 Mar 2022 12:05:34 -0500
++Subject: [PATCH] Fix build with FFmpeg 5.0
++
++---
++ src/ffaudio/ffaudio-core.cc | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/src/ffaudio/ffaudio-core.cc b/src/ffaudio/ffaudio-core.cc
++index 16dc63e3a..a2b95fd6c 100644
++--- a/src/ffaudio/ffaudio-core.cc
+++++ b/src/ffaudio/ffaudio-core.cc
++@@ -274,7 +274,7 @@ static AVInputFormat * get_format_by_content (const char * name, VFSFile & file)
++         AVProbeData d = {name, buf, filled};
++         score = target;
++ 
++-        f = av_probe_input_format2 (& d, true, & score);
+++        f = (AVInputFormat *) av_probe_input_format2 (& d, true, & score);
++         if (f)
++             break;
++ 
++@@ -347,7 +347,7 @@ static bool find_codec (AVFormatContext * c, CodecInfo * cinfo)
++ #endif
++         if (stream && stream->codecpar && stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
++         {
++-            AVCodec * codec = avcodec_find_decoder (stream->codecpar->codec_id);
+++            AVCodec * codec = (AVCodec *) avcodec_find_decoder (stream->codecpar->codec_id);
++ 
++             if (codec)
++             {
diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template
index 910ec0d1891f..def0678bc611 100644
--- a/srcpkgs/audacious-plugins/template
+++ b/srcpkgs/audacious-plugins/template
@@ -2,7 +2,7 @@
 #Keep in sync with audacious!
 pkgname=audacious-plugins
 version=4.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="$(vopt_enable gtk) $(vopt_enable qt)"
 hostmakedepends="gettext pkg-config glib-devel"
diff --git a/srcpkgs/audacity/template b/srcpkgs/audacity/template
index d509c0a89407..c18a4eeb0a73 100644
--- a/srcpkgs/audacity/template
+++ b/srcpkgs/audacity/template
@@ -1,7 +1,7 @@
 # Template file for 'audacity'
 pkgname=audacity
 version=2.4.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--with-ffmpeg=system --with-libsndfile=system --with-expat=system
  --with-libsoxr=system --with-lame=system --with-lv2=system ac_cv_path_WX_CONFIG=wx-config-gtk3"
@@ -33,5 +33,4 @@ post_install() {
 	vcopy plug-ins /usr/share/audacity
 
 	rm ${DESTDIR}/usr/share/doc/audacity/LICENSE.txt
-	vlicense LICENSE.txt LICENSE
 }
diff --git a/srcpkgs/avidemux/template b/srcpkgs/avidemux/template
index 253a0243e225..557285982d2b 100644
--- a/srcpkgs/avidemux/template
+++ b/srcpkgs/avidemux/template
@@ -1,7 +1,7 @@
 # Template file for 'avidemux'
 pkgname=avidemux
 version=2.8.0
-revision=2
+revision=3
 # Can't be compiled for aarch64, arm* or mips*
 archs="x86_64* i686*"
 hostmakedepends="cmake pkg-config qt5-host-tools qt5-devel tar yasm"
diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index f1bd1817048b..b21e22334316 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=2.10.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel
diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index a3255cddbc95..4ec73e05acf5 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
 # Template file for 'blender'
 pkgname=blender
 version=3.4.1
-revision=1
+revision=2
 archs="x86_64* ppc64*"
 build_style="cmake"
 pycompile_dirs="/usr/share/blender/${version%.*}/scripts"
diff --git a/srcpkgs/cantata/template b/srcpkgs/cantata/template
index 4b417d80d5c2..8a90aaa4c07a 100644
--- a/srcpkgs/cantata/template
+++ b/srcpkgs/cantata/template
@@ -1,7 +1,7 @@
 # Template file for 'cantata'
 pkgname=cantata
 version=2.5.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools qt5-tools"
 makedepends="qt5-devel qt5-tools-devel qt5-svg-devel qt5-xmlpatterns-devel
diff --git a/srcpkgs/ccextractor/template b/srcpkgs/ccextractor/template
index 9abcd82852b2..7fe2ba4f27b6 100644
--- a/srcpkgs/ccextractor/template
+++ b/srcpkgs/ccextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'ccextractor'
 pkgname=ccextractor
 version=0.93
-revision=1
+revision=2
 build_wrksrc="linux"
 build_style=gnu-configure
 configure_args="--enable-ocr --enable-hardsubx"
diff --git a/srcpkgs/chromaprint/patches/ffmpeg5.patch b/srcpkgs/chromaprint/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a9fd307a23c8
--- /dev/null
+++ b/srcpkgs/chromaprint/patches/ffmpeg5.patch
@@ -0,0 +1,569 @@
+From 8ccad6937177b1b92e40ab8f4447ea27bac009a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
+Date: Fri, 4 Nov 2022 21:47:38 +0100
+Subject: [PATCH] Use FFmpeg 5.x (#120)
+
+* Use FFmpeg 5.1.2 for CI builds
+
+* Build on Ubuntu 20.04
+
+* Upgrade code to FFmpeg 5.x APIs
+
+* Only set FFmpeg include dirs if building tools
+
+* No longer needed
+
+* Use ubuntu 20.04
+---
+ .github/workflows/build.yml                   |   6 +-
+ CMakeLists.txt                                |  16 --
+ package/build.sh                              |   4 +-
+ src/audio/ffmpeg_audio_processor.h            |   2 -
+ src/audio/ffmpeg_audio_processor_avresample.h |  72 -------
+ src/audio/ffmpeg_audio_processor_swresample.h |  18 +-
+ src/audio/ffmpeg_audio_reader.h               | 197 +++++++++---------
+ tests/CMakeLists.txt                          |   6 +
+ 8 files changed, 122 insertions(+), 199 deletions(-)
+ delete mode 100644 src/audio/ffmpeg_audio_processor_avresample.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8d6a32..4da2405 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -84,9 +84,6 @@ find_package(FFmpeg)
+ if(FFMPEG_LIBRARIES)
+ 	cmake_push_check_state(RESET)
+ 	set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lm)
+-	check_function_exists(av_packet_unref HAVE_AV_PACKET_UNREF)
+-	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
+-	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
+ 	cmake_pop_check_state()
+ endif()
+
+@@ -163,14 +160,11 @@ message(STATUS "Using ${FFT_LIB} for FFT calculations")
+ if(NOT AUDIO_PROCESSOR_LIB)
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+ 		set(AUDIO_PROCESSOR_LIB "swresample")
+-	elseif(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(AUDIO_PROCESSOR_LIB "avresample")
+ 	endif()
+ endif()
+
+ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE OFF)
+ 		set(USE_SWRESAMPLE ON)
+ 		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+ 		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS})
+@@ -178,16 +172,6 @@ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+ 	endif()
+ 	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+-elseif(AUDIO_PROCESSOR_LIB STREQUAL "avresample")
+-	if(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE ON)
+-		set(USE_SWRESAMPLE OFF)
+-		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBAVRESAMPLE_LIBRARIES})
+-		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS})
+-	else()
+-		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+-	endif()
+-	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+ else()
+ 	message(STATUS "Building without audio conversion support, please install FFmpeg with libswresample")
+ endif()
+diff --git a/package/build.sh b/package/build.sh
+index da631ae..b41d36e 100755
+--- a/package/build.sh
++++ b/package/build.sh
+@@ -7,8 +7,8 @@ set -eux
+
+ BASE_DIR=$(cd $(dirname $0)/.. && pwd)
+
+-FFMPEG_VERSION=4.4.1
+-FFMPEG_BUILD_TAG=v4.4.1-1
++FFMPEG_VERSION=5.1.2
++FFMPEG_BUILD_TAG=v${FFMPEG_VERSION}-1
+
+ TMP_BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX)
+ trap 'rm -rf $TMP_BUILD_DIR' EXIT
+diff --git a/src/audio/ffmpeg_audio_processor.h b/src/audio/ffmpeg_audio_processor.h
+index 7628fc7..39f4f6d 100644
+--- a/src/audio/ffmpeg_audio_processor.h
++++ b/src/audio/ffmpeg_audio_processor.h
+@@ -10,8 +10,6 @@
+
+ #if defined(USE_SWRESAMPLE)
+ #include "audio/ffmpeg_audio_processor_swresample.h"
+-#elif defined(USE_AVRESAMPLE)
+-#include "audio/ffmpeg_audio_processor_avresample.h"
+ #else
+ #error "no audio processing library"
+ #endif
+diff --git a/src/audio/ffmpeg_audio_processor_avresample.h b/src/audio/ffmpeg_audio_processor_avresample.h
+deleted file mode 100644
+index bd85f92..0000000
+--- a/src/audio/ffmpeg_audio_processor_avresample.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-// Copyright (C) 2016  Lukas Lalinsky
+-// Distributed under the MIT license, see the LICENSE file for details.
+-
+-#ifndef CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-#define CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-
+-extern "C" {
+-#include <libavresample/avresample.h>
+-}
+-
+-namespace chromaprint {
+-
+-class FFmpegAudioProcessor {
+-public:
+-	FFmpegAudioProcessor() {
+-		m_resample_ctx = avresample_alloc_context();
+-	}
+-
+-	~FFmpegAudioProcessor() {
+-		avresample_free(&m_resample_ctx);
+-	}
+-
+-	void SetCompatibleMode() {
+-		av_opt_set_int(m_resample_ctx, "filter_size", 16, 0);
+-		av_opt_set_int(m_resample_ctx, "phase_shift", 8, 0);
+-		av_opt_set_int(m_resample_ctx, "linear_interp", 1, 0);
+-		av_opt_set_double(m_resample_ctx, "cutoff", 0.8, 0);
+-	}
+-
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "in_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_rate", sample_rate, 0);
+-	}
+-
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "out_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_rate, 0);
+-	}
+-
+-	int Init() {
+-		return avresample_open(m_resample_ctx);
+-	}
+-
+-	int Convert(uint8_t **out, int out_count, const uint8_t **in, int in_count) {
+-		return avresample_convert(m_resample_ctx, out, 0, out_count, (uint8_t **) in, 0, in_count);
+-	}
+-
+-	int Flush(uint8_t **out, int out_count) {
+-		return avresample_read(m_resample_ctx, out, out_count);
+-	}
+-
+-private:
+-	AVAudioResampleContext *m_resample_ctx = nullptr;
+-};
+-
+-}; // namespace chromaprint
+-
+-#endif
+diff --git a/src/audio/ffmpeg_audio_processor_swresample.h b/src/audio/ffmpeg_audio_processor_swresample.h
+index b86266b..b1d4bea 100644
+--- a/src/audio/ffmpeg_audio_processor_swresample.h
++++ b/src/audio/ffmpeg_audio_processor_swresample.h
+@@ -28,30 +28,28 @@ public:
+ 		av_opt_set_double(m_swr_ctx, "cutoff", 0.8, 0);
+ 	}
+
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "icl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "ich", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetInputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "isf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "in_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "isr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "in_sample_rate", sample_rate, 0);
+ 	}
+
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "ocl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "och", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "osf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "out_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "osr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "out_sample_rate", sample_rate, 0);
+ 	}
+
+ 	int Init() {
+diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h
+index 5550164..1c6b346 100644
+--- a/src/audio/ffmpeg_audio_reader.h
++++ b/src/audio/ffmpeg_audio_reader.h
+@@ -62,7 +62,7 @@ public:
+ 	bool Read(const int16_t **data, size_t *size);
+
+ 	bool IsOpen() const { return m_opened; }
+-	bool IsFinished() const { return m_finished && !m_got_frame; }
++	bool IsFinished() const { return !m_has_more_packets && !m_has_more_frames; }
+
+ 	std::string GetError() const { return m_error; }
+ 	int GetErrorCode() const { return m_error_code; }
+@@ -74,20 +74,19 @@ private:
+ 	uint8_t *m_convert_buffer[1] = { nullptr };
+ 	int m_convert_buffer_nb_samples = 0;
+
+-	AVInputFormat *m_input_fmt = nullptr;
++	const AVInputFormat *m_input_fmt = nullptr;
+ 	AVDictionary *m_input_opts = nullptr;
+
+ 	AVFormatContext *m_format_ctx = nullptr;
+ 	AVCodecContext *m_codec_ctx = nullptr;
+-	AVFrame *m_frame = nullptr;
+ 	int m_stream_index = -1;
+ 	std::string m_error;
+ 	int m_error_code = 0;
+-	bool m_finished = false;
+ 	bool m_opened = false;
+-	int m_got_frame = 0;
+-	AVPacket m_packet;
+-	AVPacket m_packet0;
++	bool m_has_more_packets = true;
++	bool m_has_more_frames = true;
++	AVPacket *m_packet = nullptr;
++	AVFrame *m_frame = nullptr;
+
+ 	int m_output_sample_rate = 0;
+ 	int m_output_channels = 0;
+@@ -98,19 +97,12 @@ private:
+
+ inline FFmpegAudioReader::FFmpegAudioReader() {
+ 	av_log_set_level(AV_LOG_QUIET);
+-
+-	av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
+ }
+
+ inline FFmpegAudioReader::~FFmpegAudioReader() {
+ 	Close();
+ 	av_dict_free(&m_input_opts);
+ 	av_freep(&m_convert_buffer[0]);
+-	av_packet_unref(&m_packet0);
+ }
+
+ inline bool FFmpegAudioReader::SetInputFormat(const char *name) {
+@@ -135,11 +127,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ 	Close();
+
+-    av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
++	m_packet = av_packet_alloc();
++	if (!m_packet) {
++		return false;
++	}
+
+ 	ret = avformat_open_input(&m_format_ctx, file_name.c_str(), m_input_fmt, &m_input_opts);
+ 	if (ret < 0) {
+@@ -153,26 +144,31 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		return false;
+ 	}
+
+-	AVCodec *codec;
++	const AVCodec *codec;
+ 	ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
+ 	if (ret < 0) {
+ 		SetError("Could not find any audio stream in the file", ret);
+ 		return false;
+ 	}
+ 	m_stream_index = ret;
++	auto stream = m_format_ctx->streams[m_stream_index];
+
+-	m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec;
++	m_codec_ctx = avcodec_alloc_context3(codec);
+ 	m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
+
++	ret = avcodec_parameters_to_context(m_codec_ctx, stream->codecpar);
++	if (ret < 0) {
++		SetError("Could not copy the stream parameters", ret);
++		return false;
++	}
++
+ 	ret = avcodec_open2(m_codec_ctx, codec, nullptr);
+ 	if (ret < 0) {
+ 		SetError("Could not open the codec", ret);
+ 		return false;
+ 	}
+
+-	if (!m_codec_ctx->channel_layout) {
+-		m_codec_ctx->channel_layout = av_get_default_channel_layout(m_codec_ctx->channels);
+-	}
++	av_dump_format(m_format_ctx, 0, "foo", 0);
+
+ 	m_frame = av_frame_alloc();
+ 	if (!m_frame) {
+@@ -183,19 +179,23 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		m_output_sample_rate = m_codec_ctx->sample_rate;
+ 	}
+
+-	if (!m_output_channels) {
+-		m_output_channels = m_codec_ctx->channels;
++	AVChannelLayout output_channel_layout;
++	if (m_output_channels) {
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
++	} else {
++		m_output_channels = m_codec_ctx->ch_layout.nb_channels;
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
+ 	}
+
+-	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
++	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
+ 		m_converter.reset(new FFmpegAudioProcessor());
+ 		m_converter->SetCompatibleMode();
+ 		m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
+ 		m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
+-		m_converter->SetInputChannelLayout(m_codec_ctx->channel_layout);
++		m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
+ 		m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
+ 		m_converter->SetOutputSampleRate(m_output_sample_rate);
+-		m_converter->SetOutputChannelLayout(av_get_default_channel_layout(m_output_channels));
++		m_converter->SetOutputChannelLayout(&output_channel_layout);
+ 		auto ret = m_converter->Init();
+ 		if (ret != 0) {
+ 			SetError("Could not create an audio converter instance", ret);
+@@ -203,10 +203,11 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		}
+ 	}
+
++	av_channel_layout_uninit(&output_channel_layout);
++
+ 	m_opened = true;
+-	m_finished = false;
+-	m_got_frame = 0;
+-	m_nb_packets = 0;
++	m_has_more_packets = true;
++	m_has_more_frames = true;
+ 	m_decode_error = 0;
+
+ 	return true;
+@@ -214,6 +215,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ inline void FFmpegAudioReader::Close() {
+ 	av_frame_free(&m_frame);
++	av_packet_free(&m_packet);
+
+ 	m_stream_index = -1;
+
+@@ -252,91 +254,98 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
+ 		return false;
+ 	}
+
++	*data = nullptr;
++	*size = 0;
++
+ 	int ret;
++	bool needs_packet = false;
+ 	while (true) {
+-		while (m_packet.size <= 0) {
+-			av_packet_unref(&m_packet0);
+-			av_init_packet(&m_packet);
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			ret = av_read_frame(m_format_ctx, &m_packet);
++		while (needs_packet && m_packet->size == 0) {
++			ret = av_read_frame(m_format_ctx, m_packet);
+ 			if (ret < 0) {
+ 				if (ret == AVERROR_EOF) {
+-					m_finished = true;
++					needs_packet = false;
++					m_has_more_packets = false;
+ 					break;
+-				} else {
++				}
++				SetError("Error reading from the audio source", ret);
++				return false;
++			}
++			if (m_packet->stream_index == m_stream_index) {
++				needs_packet = false;
++			} else {
++				av_packet_unref(m_packet);
++			}
++		}
++
++		if (m_packet->size != 0) {
++			ret = avcodec_send_packet(m_codec_ctx, m_packet);
++			if (ret < 0) {
++				if (ret != AVERROR(EAGAIN)) {
+ 					SetError("Error reading from the audio source", ret);
+ 					return false;
+ 				}
+-			}
+-			m_packet0 = m_packet;
+-			if (m_packet.stream_index != m_stream_index) {
+-				m_packet.data = nullptr;
+-				m_packet.size = 0;
+ 			} else {
+-				m_nb_packets++;
++				av_packet_unref(m_packet);
+ 			}
+ 		}
+
+-		ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet);
++		ret = avcodec_receive_frame(m_codec_ctx, m_frame);
+ 		if (ret < 0) {
+-			if (m_decode_error) {
+-				SetError("Error decoding audio frame", m_decode_error);
+-				return false;
++			if (ret == AVERROR_EOF) {
++				m_has_more_frames = false;
++			} else if (ret == AVERROR(EAGAIN)) {
++				if (m_has_more_packets) {
++					needs_packet = true;
++					continue;
++				} else {
++					m_has_more_frames = false;
++				}
+ 			}
+-			m_decode_error = ret;
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			continue;
++			SetError("Error decoding the audio source", ret);
++			return false;
+ 		}
+
+-		break;
+-	}
+-
+-	m_decode_error = 0;
+-
+-	const int decoded = std::min(ret, m_packet.size);
+-	m_packet.data += decoded;
+-	m_packet.size -= decoded;
+-
+-	if (m_got_frame) {
+-		if (m_converter) {
+-			if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
+-				int linsize;
+-				av_freep(&m_convert_buffer[0]);
+-				m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
+-				ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
+-				if (ret < 0) {
+-					SetError("Couldn't allocate audio converter buffer", ret);
++		if (m_frame->nb_samples > 0) {
++			if (m_converter) {
++				if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
++					int linsize;
++					av_freep(&m_convert_buffer[0]);
++					m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
++					ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
++					if (ret < 0) {
++						SetError("Couldn't allocate audio converter buffer", ret);
++						return false;
++					}
++				}
++				auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
++				if (nb_samples < 0) {
++					SetError("Couldn't convert audio", ret);
+ 					return false;
+ 				}
+-			}
+-			auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			}
+-			*data = (const int16_t *) m_convert_buffer[0];
+-			*size = nb_samples;
+-		} else {
+-			*data = (const int16_t *) m_frame->data[0];
+-			*size = m_frame->nb_samples;
+-		}
+-	} else {
+-		if (m_finished && m_converter) {
+-			auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			} else if (nb_samples > 0) {
+-				m_got_frame = 1;
+ 				*data = (const int16_t *) m_convert_buffer[0];
+ 				*size = nb_samples;
++			} else {
++				*data = (const int16_t *) m_frame->data[0];
++				*size = m_frame->nb_samples;
++			}
++		} else {
++			if (m_converter) {
++				if (IsFinished()) {
++					auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
++					if (nb_samples < 0) {
++						SetError("Couldn't convert audio", ret);
++						return false;
++					} else if (nb_samples > 0) {
++						*data = (const int16_t *) m_convert_buffer[0];
++						*size = nb_samples;
++					}
++				}
+ 			}
+ 		}
+-	}
+
+-	return true;
++		return true;
++	}
+ }
+
+ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index a2b517b..123e643 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -38,6 +38,12 @@ set(SRCS
+
+ if(BUILD_TOOLS)
+ 	set(SRCS ${SRCS} ../src/audio/ffmpeg_audio_reader_test.cpp)
++    include_directories(
++        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
++        ${AUDIO_PROCESSOR_INCLUDE_DIRS}
++    )
+ 	link_libraries(fpcalc_libs)
+ endif()
+
+-- 
+2.38.1
+
+
diff --git a/srcpkgs/chromaprint/template b/srcpkgs/chromaprint/template
index 7ef7838949f3..1f7bbc70a22c 100644
--- a/srcpkgs/chromaprint/template
+++ b/srcpkgs/chromaprint/template
@@ -1,7 +1,7 @@
 # Template file for 'chromaprint'
 pkgname=chromaprint
 version=1.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TOOLS=ON"
 make_check_target="check"
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 3c1c1caf3765..1f28cde5d3c1 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,7 +2,7 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=111.0.5563.64
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
  $(vopt_if clang "clang lld llvm12")
diff --git a/srcpkgs/cmus/template b/srcpkgs/cmus/template
index 0fcb424ce336..05b77d0fecae 100644
--- a/srcpkgs/cmus/template
+++ b/srcpkgs/cmus/template
@@ -1,7 +1,7 @@
 # Template file for 'cmus'
 pkgname=cmus
 version=2.10.0
-revision=1
+revision=2
 build_style=configure
 configure_args="prefix=/usr LD=$CC"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/cyanrip/template b/srcpkgs/cyanrip/template
index 9796e3461601..5db30e020d17 100644
--- a/srcpkgs/cyanrip/template
+++ b/srcpkgs/cyanrip/template
@@ -1,7 +1,7 @@
 # Template file for 'cyanrip'
 pkgname=cyanrip
 version=0.9.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="ffmpeg-devel libcdio-devel libcdio-paranoia-devel libcurl-devel libmusicbrainz5-devel"
diff --git a/srcpkgs/deadbeef/template b/srcpkgs/deadbeef/template
index b664bb1b9bd9..f0fcced864be 100644
--- a/srcpkgs/deadbeef/template
+++ b/srcpkgs/deadbeef/template
@@ -1,7 +1,7 @@
 # Template file for 'deadbeef'
 pkgname=deadbeef
 version=1.8.8
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-oss --disable-lfm --disable-notify --disable-gtk2"
diff --git a/srcpkgs/dolphin-emu/template b/srcpkgs/dolphin-emu/template
index 7ea197ceb2a8..7aeb0a5b645e 100644
--- a/srcpkgs/dolphin-emu/template
+++ b/srcpkgs/dolphin-emu/template
@@ -1,7 +1,7 @@
 # Template file for 'dolphin-emu'
 pkgname=dolphin-emu
 version=5.0.16101
-revision=1
+revision=2
 _dolphin_commit=8ecfa537a242de74d2e372e30d9d79b14584b2fb
 _mgba_commit=40d4c430fc36caeb7ea32fd39624947ed487d2f2
 #Version/hash pair can be found at https://dolphin-emu.org/download/
diff --git a/srcpkgs/droidcam-obs-plugin/template b/srcpkgs/droidcam-obs-plugin/template
index fc9c9bf6b9d5..fb0480754df4 100644
--- a/srcpkgs/droidcam-obs-plugin/template
+++ b/srcpkgs/droidcam-obs-plugin/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam-obs-plugin'
 pkgname=droidcam-obs-plugin
 version=2.0.1
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=yes
 make_build_args="ALLOW_STATIC=no"
diff --git a/srcpkgs/droidcam/template b/srcpkgs/droidcam/template
index 1c3f1b8b1fc6..32a9220b79a4 100644
--- a/srcpkgs/droidcam/template
+++ b/srcpkgs/droidcam/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam'
 pkgname=droidcam
 version=1.8.2
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="USBMUXD=-lusbmuxd-2.0 JPEG=-lturbojpeg"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/electron19/template b/srcpkgs/electron19/template
index 068136be7623..32ce301e730c 100644
--- a/srcpkgs/electron19/template
+++ b/srcpkgs/electron19/template
@@ -1,7 +1,7 @@
 # Template file for 'electron19'
 pkgname=electron19
 version=19.0.8
-revision=2
+revision=3
 _nodever=16.14.2
 _chromiumver=102.0.5005.125
 archs="x86_64* aarch64* ppc64le*"
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 38978c5085a3..1ac1e4b8df49 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -12,25 +12,31 @@ distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
 checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
-makedepends="chromaprint-devel libgcrypt-devel ladspa-sdk lcms2-devel libaom-devel
- alsa-lib-devel bzip2-devel libxcb-devel liblzma-devel SDL2-devel sndio-devel zlib-devel
- frei0r-plugins libcdio-paranoia-devel rubberband-devel libvidstab-devel x264-devel x265-devel
- xvidcore-devel fdk-aac-devel libtls-devel gmp-devel libass-devel libbluray-devel libcaca-devel
- celt-devel codec2-devel libdav1d-devel libdrm-devel fontconfig-devel freetype-devel
- fribidi-devel glslang-devel SPIRV-Tools-devel libgme-devel libgsm-devel jack-devel
- libmodplug-devel lame-devel libopencv4-devel libopenjpeg2-devel libopenmpt-devel opus-devel
- libplacebo-devel libpulseaudio rabbitmq-c-devel librist-devel librsvg-devel librtmp-devel
- snappy-devel libsoxr-devel speex-devel srt-devel libssh-devel libtheora-devel twolame-devel
- libvorbis-devel libvpx6-devel libwebp-devel libxml2-devel zimg-devel lilv-devel lv2
- libopenal-devel mesa openssl-devel vapoursynth-devel ocl-icd-devel libmysofa-devel vulkan-loader
- $(vopt_if vaapi libva-devel)
- $(vopt_if vdpau libvdpau-devel)
- $(vopt_if nvenc nv-codec-headers)
- $(vopt_if nvdec nv-codec-headers)
- $(vopt_if svtav1 libsvt-av1-devel)
-"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
 depends="ffplay>=${version}_${revision}"
-build_options="vaapi vdpau nvenc nvdec svtav1"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
@@ -46,6 +52,22 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
 do_configure() {
 	# Fix gcc on x86_64-musl only
 	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
@@ -76,47 +98,39 @@ do_configure() {
 		_args+=" --extra-libs=-latomic"
 	fi
 
-	./configure \
-		--prefix='/usr' \
-		--extra-cflags='-I/opt/cuda/include' \
-		--extra-ldflags='-L/opt/cuda/lib64' \
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
 		--disable-stripping \
-		--enable-shared --enable-static \
-		--enable-nonfree --enable-gpl \
-		--enable-version3 --enable-libxcb \
-		--enable-frei0r --enable-libcdio \
-		--enable-librubberband --enable-libvidstab \
-		--enable-libx264 --enable-libx265 --enable-libxvid \
-		--enable-libfdk-aac --enable-libtls --enable-gmp \
-		--enable-chromaprint --enable-gcrypt --enable-ladspa \
-		--enable-lcms2 --enable-libaom --enable-libass \
-		--enable-libbluray --enable-libcaca --enable-libcelt \
-		--enable-libcodec2 --enable-libdav1d --enable-libdrm \
-		--enable-libfontconfig --enable-libfreetype \
-		--enable-libfribidi --enable-libglslang \
-		--enable-libgme --enable-libgsm \
-		--enable-vapoursynth --enable-openssl --enable-opengl \
-		--enable-openal --enable-lv2 --enable-libzimg \
-		--enable-libxml2 --enable-libwebp --enable-libvorbis \
-		--enable-libtwolame --enable-libtheora --enable-libssh \
-		--enable-libsrt --enable-libspeex --enable-libsoxr \
-		--enable-librtmp --enable-librsvg --enable-librist \
-		--enable-librabbitmq --enable-libpulse --enable-libplacebo \
-		--enable-libopus --enable-libopenmpt --enable-libopenjpeg \
-		--enable-libmp3lame --enable-libmodplug --enable-libjack \
-		--enable-opencl --enable-libvpx --enable-libmysofa \
-		$(vopt_enable vaapi) \
-		$(vopt_enable vdpau) \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
 		$(vopt_if nvenc '--enable-nvenc') \
-		$(vopt_if nvdec '--enable-nvdec') \
-		$(vopt_enable svtav1 libsvtav1)
+		$(vopt_if nvdec '--enable-nvdec')
 }
-
 do_build() {
 	make ${makejobs}
 	make doc/ff{mpeg,play}.1
 }
-
 do_install() {
 	make DESTDIR=${DESTDIR} install install-man
 }
@@ -133,6 +147,10 @@ libavdevice_package() {
 		vmove "usr/lib/libavdevice.so.*"
 	}
 }
+libavresample_package() {
+	short_desc="Package deprecated, removal needed"
+	build_style=meta
+}
 libavformat_package() {
 	short_desc="FFmpeg file format library"
 	pkg_install() {
@@ -180,47 +198,7 @@ ffmpeg-devel_package() {
 		libswscale>=${version}_${revision}
 		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
-	alternatives="
-	 ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec5.3
-	 ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice5.3
-	 ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter5.3
-	 ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat5.3
-	 ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil5.3
-	 ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample5.3
-	 ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale5.3
-	 ffmpeg-devel:libavcodec:/usr/include/libavcodec5
-	 ffmpeg-devel:libavdevice:/usr/include/libavdevice5
-	 ffmpeg-devel:libavformat:/usr/include/libavformat5
-	 ffmpeg-devel:libavutil:/usr/include/libavutil5
-	 ffmpeg-devel:libavpostproc:/usr/include/libavpostproc5
-	 ffmpeg-devel:libswresample:/usr/include/libswresample5
-	 ffmpeg-devel:libswcaale:/usr/include/libswscale5
-	 ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec5.pc
-	 ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice5.pc
-	 ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter5.pc
-	 ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat5.pc
-	 ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil5.pc
-	 ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc5.pc
-	 ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample5.pc
-	 ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale5.pc
-	 ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec5.a
-	 ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec5.so
-	 ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice5.a
-	 ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice5.so
-	 ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter5.a
-	 ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter5.so
-	 ffmpeg-devel:libavformat.a:/usr/lib/libavformat5.a
-	 ffmpeg-devel:libavformat.so:/usr/lib/libavformat5.so
-	 ffmpeg-devel:libavutil.a:/usr/lib/libavutil5.a
-	 ffmpeg-devel:libavutil.so:/usr/lib/libavutil5.so
-	 ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc5.a
-	 ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc5.so
-	 ffmpeg-devel:libswresample.a:/usr/lib/libswresample5.a
-	 ffmpeg-devel:libswresample.so:/usr/lib/libswresample5.so
-	 ffmpeg-devel:libswscale.a:/usr/lib/libswscale5.a
-	 ffmpeg-devel:libswscale.so:/usr/lib/libswscale5.so
-	 ffmpeg-devel:ffmpeg:/usr/share/ffmpeg5
-	"
+	conflicts="ffmpeg4-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
@@ -231,7 +209,7 @@ ffmpeg-devel_package() {
 	}
 }
 ffplay_package() {
-	short_desc="Simple media player using FFmpeg and SDL2"
+	short_desc="Simple video player using FFmpeg and SDL2"
 	pkg_install() {
 		vmove usr/bin/ffplay
 		vmove "usr/share/man/man1/ffplay*"
diff --git a/srcpkgs/ffmpeg4/ffmpeg4 b/srcpkgs/ffmpeg4/ffmpeg4
deleted file mode 120000
index 887f354e7c6b..000000000000
--- a/srcpkgs/ffmpeg4/ffmpeg4
+++ /dev/null
@@ -1 +0,0 @@
-ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
index cd9154978b3e..7bc64bb39f41 100644
--- a/srcpkgs/ffmpeg4/template
+++ b/srcpkgs/ffmpeg4/template
@@ -2,8 +2,8 @@
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg4
 version=4.4.3
-revision=3
-short_desc="ffmpeg4 libraries only - Decoding, encoding and streaming software"
+revision=1
+short_desc="Decoding, encoding and streaming software - ffmpeg4 libraries only"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
@@ -202,47 +202,7 @@ ffmpeg4-devel_package() {
 		libswresample4>=${version}_${revision}
 		libavresample4>=${version}_${revision}"
 	short_desc+=" - development files"
-	alternatives="
-		ffmpeg-devel:libavcodec.3:/usr/share/man/man3/libavcodec4.3
-		ffmpeg-devel:libavdevice.3:/usr/share/man/man3/libavdevice4.3
-		ffmpeg-devel:libavfilter.3:/usr/share/man/man3/libavfilter4.3
-		ffmpeg-devel:liblibavformat.3:/usr/share/man/man3/libavformat4.3
-		ffmpeg-devel:libavutil.3:/usr/share/man/man3/libavutil4.3
-		ffmpeg-devel:libswresample.3:/usr/share/man/man3/libswresample4.3
-		ffmpeg-devel:libswscale.3:/usr/share/man/man3/libswscale4.3
-		ffmpeg-devel:libavcodec:/usr/include/libavcodec4
-		ffmpeg-devel:libavdevice:/usr/include/libavdevice4
-		ffmpeg-devel:libavformat:/usr/include/libavformat4
-		ffmpeg-devel:libavutil:/usr/include/libavutil4
-		ffmpeg-devel:libavpostproc:/usr/include/libavpostproc4
-		ffmpeg-devel:libswresample:/usr/include/libswresample4
-		ffmpeg-devel:libswcaale:/usr/include/libswscale4
-		ffmpeg-devel:libavcodec.pc:/usr/lib/pkgconfig/libavcodec4.pc
-		ffmpeg-devel:libavdevice.pc:/usr/lib/pkgconfig/libavdevice4.pc
-		ffmpeg-devel:libavfilter.pc:/usr/lib/pkgconfig/libavfilter4.pc
-		ffmpeg-devel:libavformat.pc:/usr/lib/pkgconfig/libavformat4.pc
-		ffmpeg-devel:libavutil.pc:/usr/lib/pkgconfig/libavutil4.pc
-		ffmpeg-devel:libpostproc.pc:/usr/lib/pkgconfig/libpostproc4.pc
-		ffmpeg-devel:libswresample.pc:/usr/lib/pkgconfig/libswresample4.pc
-		ffmpeg-devel:libswscale.pc:/usr/lib/pkgconfig/libswscale4.pc
-		ffmpeg-devel:libavcodec.a:/usr/lib/libavcodec4.a
-		ffmpeg-devel:libavcodec.so:/usr/lib/libavcodec4.so
-		ffmpeg-devel:libavdevice.a:/usr/lib/libavdevice4.a
-		ffmpeg-devel:libavdevice.so:/usr/lib/libavdevice4.so
-		ffmpeg-devel:libavfilter.a:/usr/lib/libavfilter4.a
-		ffmpeg-devel:libavfilter.so:/usr/lib/libavfilter4.so
-		ffmpeg-devel:libavformat.a:/usr/lib/libavformat4.a
-		ffmpeg-devel:libavformat.so:/usr/lib/libavformat4.so
-		ffmpeg-devel:libavutil.a:/usr/lib/libavutil4.a
-		ffmpeg-devel:libavutil.so:/usr/lib/libavutil4.so
-		ffmpeg-devel:libpostproc.a:/usr/lib/libpostproc4.a
-		ffmpeg-devel:libpostproc.so:/usr/lib/libpostproc4.so
-		ffmpeg-devel:libswresample.a:/usr/lib/libswresample4.a
-		ffmpeg-devel:libswresample.so:/usr/lib/libswresample4.so
-		ffmpeg-devel:libswscale.a:/usr/lib/libswscale4.a
-		ffmpeg-devel:libswscale.so:/usr/lib/libswscale4.so
-		ffmpeg-devel:ffmpeg:/usr/share/ffmpeg4
-	"
+	conflicts="ffmpeg-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
diff --git a/srcpkgs/ffmpegthumbnailer/template b/srcpkgs/ffmpegthumbnailer/template
index 039eea7622b3..35d546018d12 100644
--- a/srcpkgs/ffmpegthumbnailer/template
+++ b/srcpkgs/ffmpegthumbnailer/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbnailer'
 pkgname=ffmpegthumbnailer
 version=2.2.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libpng-devel libjpeg-turbo-devel ffmpeg-devel"
@@ -9,8 +9,8 @@ depends="ffmpeg"
 short_desc="Lightweight video thumbnailer"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
-homepage="https://github.com/dirkvdb/${pkgname}"
-distfiles="${homepage}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
+homepage="https://github.com/dirkvdb"
+distfiles="${homepage}/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
 checksum=1cb24059c38223f657b300c84dd80491b7040d4b69471c4fea69be862bc99b5b
 
 post_install() {
diff --git a/srcpkgs/ffmpegthumbs/template b/srcpkgs/ffmpegthumbs/template
index 5f0b9414dada..11b88193528f 100644
--- a/srcpkgs/ffmpegthumbs/template
+++ b/srcpkgs/ffmpegthumbs/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbs'
 pkgname=ffmpegthumbs
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules kcoreaddons kconfig-devel
  pkg-config qt5-host-tools qt5-qmake gettext"
diff --git a/srcpkgs/ffms2/patches/ffmpeg5.patch b/srcpkgs/ffms2/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..0766db172473
--- /dev/null
+++ b/srcpkgs/ffms2/patches/ffmpeg5.patch
@@ -0,0 +1,419 @@
+From 28fc493fda2fa2064afeeb0a5d85fdc42db05dcf Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:12:41 +0100
+Subject: [PATCH 1/3] all: Update AVPacket API usage
+
+AVPackets must all be on the heap now, since it is no longer
+part of the libav* ABI.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 16 ++++++----
+ src/core/indexing.cpp    | 63 ++++++++++++++++++++++------------------
+ src/core/indexing.h      |  4 +--
+ src/core/utils.cpp       |  6 ----
+ src/core/utils.h         |  1 -
+ src/core/videosource.cpp | 30 ++++++++++---------
+ 6 files changed, 64 insertions(+), 56 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index 37cf9aeef..e4ce97cdb 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -285,10 +285,15 @@ FFMS_AudioSource::AudioBlock *FFMS_AudioSource::CacheBlock(CacheIterator &pos) {
+ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     CurrentFrame = &Frames[PacketNumber];
+
+-    AVPacket Packet;
+-    if (!ReadPacket(&Packet))
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++    if (!ReadPacket(Packet)) {
++        av_packet_free(&Packet);
+         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_UNKNOWN,
+             "ReadPacket unexpectedly failed to read a packet");
++    }
+
+     // ReadPacket may have changed the packet number
+     CurrentFrame = &Frames[PacketNumber];
+@@ -297,8 +302,9 @@ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     int NumberOfSamples = 0;
+     AudioBlock *CachedBlock = nullptr;
+
+-    int Ret = avcodec_send_packet(CodecContext, &Packet);
+-    av_packet_unref(&Packet);
++    int Ret = avcodec_send_packet(CodecContext, Packet);
++    av_packet_unref(Packet);
++    av_packet_free(&Packet);
+
+     av_frame_unref(DecodeFrame);
+     Ret = avcodec_receive_frame(CodecContext, DecodeFrame);
+@@ -513,8 +519,6 @@ void FFMS_AudioSource::Seek() {
+ }
+
+ bool FFMS_AudioSource::ReadPacket(AVPacket *Packet) {
+-    InitNullPacket(*Packet);
+-
+     while (av_read_frame(FormatContext, Packet) >= 0) {
+         if (Packet->stream_index == TrackNumber) {
+             // Required because not all audio packets, especially in ogg, have a pts. Use the previous valid packet's pts instead.
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index 23fb95b12..e547c5abf 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -320,7 +320,7 @@ void FFMS_Indexer::CheckAudioProperties(int Track, AVCodecContext *Context) {
+     }
+ }
+
+-void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict,
++void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict,
+                                     int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct) {
+     if (VideoContext.Parser) {
+         uint8_t *OB;
+@@ -330,8 +330,8 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+         av_parser_parse2(VideoContext.Parser,
+             VideoContext.CodecContext,
+             &OB, &OBSize,
+-            pkt.data, pkt.size,
+-            pkt.pts, pkt.dts, pkt.pos);
++            pkt->data, pkt->size,
++            pkt->pts, pkt->dts, pkt->pos);
+
+         // H.264 (PAFF) and HEVC may have one field per packet, so we need to track
+         // when we have a full or half frame available, and mark one of them as
+@@ -351,15 +351,15 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+
+         *RepeatPict = VideoContext.Parser->repeat_pict;
+         *FrameType = VideoContext.Parser->pict_type;
+-        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt.flags & AV_PKT_FLAG_DISCARD));
++        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt->flags & AV_PKT_FLAG_DISCARD));
+     } else {
+-        *Invisible = !!(pkt.flags & AV_PKT_FLAG_DISCARD);
++        *Invisible = !!(pkt->flags & AV_PKT_FLAG_DISCARD);
+     }
+
+     if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP8)
+-        ParseVP8(pkt.data[0], Invisible, FrameType);
++        ParseVP8(pkt->data[0], Invisible, FrameType);
+     else if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP9)
+-        ParseVP9(pkt.data[0], Invisible, FrameType);
++        ParseVP9(pkt->data[0], Invisible, FrameType);
+ }
+
+ void FFMS_Indexer::Free() {
+@@ -458,32 +458,36 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+         }
+     }
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
+     std::vector<int64_t> LastValidTS(FormatContext->nb_streams, AV_NOPTS_VALUE);
+
+     int64_t filesize = avio_size(FormatContext->pb);
+     enum AVPictureStructure LastPicStruct = AV_PICTURE_STRUCTURE_UNKNOWN;
+-    while (av_read_frame(FormatContext, &Packet) >= 0) {
++    while (av_read_frame(FormatContext, Packet) >= 0) {
+         // Update progress
+         // FormatContext->pb can apparently be NULL when opening images.
+         if (IC && FormatContext->pb) {
+-            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate))
++            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate)) {
++                av_packet_free(&Packet);
+                 throw FFMS_Exception(FFMS_ERROR_CANCELLED, FFMS_ERROR_USER,
+                     "Cancelled by user");
++            }
+         }
+-        if (!IndexMask.count(Packet.stream_index)) {
+-            av_packet_unref(&Packet);
++        if (!IndexMask.count(Packet->stream_index)) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+-        int Track = Packet.stream_index;
++        int Track = Packet->stream_index;
+         FFMS_Track &TrackInfo = (*TrackIndices)[Track];
+-        bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
++        bool KeyFrame = !!(Packet->flags & AV_PKT_FLAG_KEY);
+         ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
+
+         if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            int64_t PTS = TrackInfo.UseDTS ? Packet.dts : Packet.pts;
++            int64_t PTS = TrackInfo.UseDTS ? Packet->dts : Packet->pts;
+             if (PTS == AV_NOPTS_VALUE) {
+                 // VPx alt-refs are output as packets which lack timestmps or durations, since
+                 // they are invisible. Currently, the timestamp mangling code in libavformat
+@@ -495,9 +499,11 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 // FFMS2 currently sorts packets by PTS, which will break decoding, otherwise.
+                 bool HasAltRefs = (FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP8 ||
+                                    FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP9);
+-                if (Packet.duration == 0 && !HasAltRefs)
++                if (Packet->duration == 0 && !HasAltRefs) {
++                    av_packet_free(&Packet);
+                     throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER,
+                         "Invalid packet pts, dts, and duration");
++                }
+
+                 if (TrackInfo.empty())
+                     PTS = 0;
+@@ -513,7 +519,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             ParseVideoPacket(AVContexts[Track], Packet, &RepeatPict, &FrameType, &Invisible, &LastPicStruct);
+
+             TrackInfo.AddVideoFrame(PTS, RepeatPict, KeyFrame,
+-                FrameType, Packet.pos, Invisible);
++                FrameType, Packet->pos, Invisible);
+         } else if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+             // For video seeking timestamps are used only if all packets have
+             // timestamps, while for audio they're used if any have timestamps,
+@@ -522,28 +528,29 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 TrackInfo.HasTS = true;
+
+             int64_t StartSample = AVContexts[Track].CurrentSample;
+-            uint32_t SampleCount = IndexAudioPacket(Track, &Packet, AVContexts[Track], *TrackIndices);
++            uint32_t SampleCount = IndexAudioPacket(Track, Packet, AVContexts[Track], *TrackIndices);
+             TrackInfo.SampleRate = AVContexts[Track].CodecContext->sample_rate;
+
+             TrackInfo.AddAudioFrame(LastValidTS[Track],
+-                StartSample, SampleCount, KeyFrame, Packet.pos, Packet.flags & AV_PKT_FLAG_DISCARD);
++                StartSample, SampleCount, KeyFrame, Packet->pos, Packet->flags & AV_PKT_FLAG_DISCARD);
+         }
+
+-        if (!(Packet.flags & AV_PKT_FLAG_DISCARD))
+-            TrackInfo.LastDuration = Packet.duration;
++        if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
++            TrackInfo.LastDuration = Packet->duration;
+
+-        av_packet_unref(&Packet);
++        av_packet_unref(Packet);
+     }
++    av_packet_free(&Packet);
+
+     TrackIndices->Finalize(AVContexts, FormatContext->iformat->name);
+     return TrackIndices.release();
+ }
+
+-void FFMS_Indexer::ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS) {
+-    if (!UseDTS && Packet.pts != AV_NOPTS_VALUE)
+-        TS = Packet.pts;
++void FFMS_Indexer::ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS) {
++    if (!UseDTS && Packet->pts != AV_NOPTS_VALUE)
++        TS = Packet->pts;
+     if (TS == AV_NOPTS_VALUE)
+         UseDTS = true;
+-    if (UseDTS && Packet.dts != AV_NOPTS_VALUE)
+-        TS = Packet.dts;
++    if (UseDTS && Packet->dts != AV_NOPTS_VALUE)
++        TS = Packet->dts;
+ }
+diff --git a/src/core/indexing.h b/src/core/indexing.h
+index 3cfc3c30b..5c0686889 100644
+--- a/src/core/indexing.h
++++ b/src/core/indexing.h
+@@ -80,10 +80,10 @@ struct FFMS_Indexer {
+     int64_t Filesize;
+     uint8_t Digest[20];
+
+-    void ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS);
++    void ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS);
+     void CheckAudioProperties(int Track, AVCodecContext *Context);
+     uint32_t IndexAudioPacket(int Track, AVPacket *Packet, SharedAVContext &Context, FFMS_Index &TrackIndices);
+-    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
++    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
+     void Free();
+ public:
+     FFMS_Indexer(const char *Filename);
+diff --git a/src/core/utils.cpp b/src/core/utils.cpp
+index ce67533fd..8a2e99710 100644
+--- a/src/core/utils.cpp
++++ b/src/core/utils.cpp
+@@ -62,12 +62,6 @@ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo) {
+     }
+ }
+
+-void InitNullPacket(AVPacket &pkt) {
+-    av_init_packet(&pkt);
+-    pkt.data = nullptr;
+-    pkt.size = 0;
+-}
+-
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames) {
+     AP.SampleFormat = static_cast<FFMS_SampleFormat>(av_get_packed_sample_fmt(CTX->sample_fmt));
+     AP.BitsPerSample = av_get_bytes_per_sample(CTX->sample_fmt) * 8;
+diff --git a/src/core/utils.h b/src/core/utils.h
+index 9819dc7c9..003ab794e 100644
+--- a/src/core/utils.h
++++ b/src/core/utils.h
+@@ -58,7 +58,6 @@ std::unique_ptr<T> make_unique(Args&&... args) {
+ }
+
+ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo);
+-void InitNullPacket(AVPacket &pkt);
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames);
+
+ void LAVFOpenFile(const char *SourceFile, AVFormatContext *&FormatContext, int Track);
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index 06bd1610e..b889970e2 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -673,30 +673,34 @@ void FFMS_VideoSource::DecodeNextFrame(int64_t &AStartTime, int64_t &Pos) {
+     if (HasPendingDelayedFrames())
+         return;
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
+-
+-    while (ReadFrame(&Packet) >= 0) {
+-        if (Packet.stream_index != VideoTrack) {
+-            av_packet_unref(&Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++
++    while (ReadFrame(Packet) >= 0) {
++        if (Packet->stream_index != VideoTrack) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+         if (AStartTime < 0)
+-            AStartTime = Frames.UseDTS ? Packet.dts : Packet.pts;
++            AStartTime = Frames.UseDTS ? Packet->dts : Packet->pts;
+
+         if (Pos < 0)
+-            Pos = Packet.pos;
++            Pos = Packet->pos;
+
+-        bool FrameFinished = DecodePacket(&Packet);
+-        av_packet_unref(&Packet);
+-        if (FrameFinished)
++        bool FrameFinished = DecodePacket(Packet);
++        av_packet_unref(Packet);
++        if (FrameFinished) {
++            av_packet_free(&Packet);
+             return;
++        }
+     }
+
+     // Flush final frames
+-    InitNullPacket(Packet);
+-    DecodePacket(&Packet);
++    DecodePacket(Packet);
++    av_packet_free(&Packet);
+ }
+
+ bool FFMS_VideoSource::SeekTo(int n, int SeekOffset) {
+
+From bf9e03e9e08534c024e5a744a6437c4aac160201 Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:20:47 +0100
+Subject: [PATCH 2/3] configure: Remove deprecated API use
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b35ef80bc..d19714d0f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,10 +102,10 @@ CFLAGS="$_CFLAGS $FFMPEG_CFLAGS"
+
+ AC_DEFUN([TEST_FFMPEG],
+          [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-            #include <libavcodec/avcodec.h>
++            #include <libavformat/avformat.h>
+             #include <libswscale/swscale.h>
+             ]],[[
+-                avcodec_register_all();
++                avformat_network_init();
+                 swscale_version();
+             ]])], [eval $1=yes], [eval $1=no])
+         ])
+
+From a18c8296687e267b20ec90ef81671b77d393a36e Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:41:21 +0100
+Subject: [PATCH 3/3] Use auto for AVCodec
+
+The geniuses over at FFmpeg decided to constify this API, so old
+versions of the library will return AVCodec *, while new versions
+of the libary will return const AVCodec *, which, in C++, are not
+OK to convert between.
+
+Rather than use some macro hell in ffmscompat.h, we can work around
+this by using auto.
+
+Gross.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 2 +-
+ src/core/indexing.cpp    | 6 +++---
+ src/core/videosource.cpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index e4ce97cdb..ac0966636 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -469,7 +469,7 @@ void FFMS_AudioSource::OpenFile() {
+
+     LAVFOpenFile(SourceFile.c_str(), FormatContext, TrackNumber);
+
+-    AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
++    auto *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
+     if (Codec == nullptr)
+         throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+             "Audio codec not found");
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index e547c5abf..59fb4e8ea 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -384,7 +384,7 @@ FFMS_TrackType FFMS_Indexer::GetTrackType(int Track) {
+ }
+
+ const char *FFMS_Indexer::GetTrackCodec(int Track) {
+-    AVCodec *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
++    auto *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
+     return codec ? codec->name : nullptr;
+ }
+
+@@ -402,7 +402,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             UseDTS);
+
+         if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (!VideoCodec) {
+                 FormatContext->streams[i]->discard = AVDISCARD_ALL;
+                 IndexMask.erase(i);
+@@ -433,7 +433,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 IndexMask.insert(i);
+             }
+         } else if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+-            AVCodec *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (AudioCodec == nullptr)
+                 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
+                     "Audio codec not found");
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index b889970e2..8956c2256 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -171,7 +171,7 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in
+
+         LAVFOpenFile(SourceFile, FormatContext, VideoTrack);
+
+-        AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
++        auto *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
+         if (Codec == nullptr)
+             throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+                 "Video codec not found");
diff --git a/srcpkgs/ffms2/template b/srcpkgs/ffms2/template
index 68e8a0c14bce..2acfadac44b3 100644
--- a/srcpkgs/ffms2/template
+++ b/srcpkgs/ffms2/template
@@ -1,7 +1,7 @@
 # Template file for 'ffms2'
 pkgname=ffms2
 version=2.40
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--enable-shared --disable-static"
 hostmakedepends="pkg-config autoconf automake libtool"
diff --git a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch b/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
deleted file mode 100644
index 4c450fd45bfb..000000000000
--- a/srcpkgs/fluxbox/patches/0001-Fix-infinite-loop-in-Menu-cycleitems.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 9d8202f32338a3f08d3fa39057dc5eec5d97be4e Mon Sep 17 00:00:00 2001
-From: Mathias Gumz <akira@fluxbox.org>
-Date: Sat, 28 May 2022 11:13:43 +0200
-Subject: [PATCH] Fix infinite loop in Menu::cycleitems()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When a menu contains no selectable item (example given: a "list" of user
-styles and the only available one is already selected), cycling through
-the menu will lead to an infinite loop and thus a disfunctional fluxbox.
-
-This commit addresses the issue by checking if there is any selectable
-item before entering the cycling stage.
-
-Discovered by Sébastien Ballet[1].
-
-[1]: https://sourceforge.net/p/fluxbox/bugs/1185/
----
- src/FbTk/Menu.cc | 21 +++++++++++++++------
- 1 file changed, 15 insertions(+), 6 deletions(-)
-
-diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
-index 6b2db3a4..ff040bae 100644
---- a/src/FbTk/Menu.cc
-+++ b/src/FbTk/Menu.cc
-@@ -320,15 +320,24 @@ void Menu::lower() {
- 
- void Menu::cycleItems(bool reverse) {
- 
--    if (m_items.empty())
--        return;
--
--    int offset = reverse ? -1 : 1;
-     int l = m_items.size();
--    int i = m_active_index;
-+    int i;
-+    int offset = reverse ? -1 : 1;
-     size_t ignore;
- 
--    for (i += offset; i != m_active_index; i += offset ) {
-+    // check if there is _any_ selectable item
-+    for (i = 0; i < l; i++) {
-+        if (isItemSelectable(i)) {
-+            break;
-+        }
-+    }
-+
-+    // no selectable item
-+    if (i >= l) {
-+        return;
-+    }
-+
-+    for (i = m_active_index + offset; i != m_active_index; i += offset ) {
-         if (i < 0) {
-             i = l - 1;
-         } else if (i >= l) {
--- 
-2.39.0
-
diff --git a/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
new file mode 100644
index 000000000000..dc151643cb45
--- /dev/null
+++ b/srcpkgs/fluxbox/patches/22866c4d30f5b289c429c5ca88d800200db4fc4f.patch
@@ -0,0 +1,22 @@
+From 22866c4d30f5b289c429c5ca88d800200db4fc4f Mon Sep 17 00:00:00 2001
+From: John Sennesael <john@aminking.com>
+Date: Mon, 2 Nov 2015 15:14:32 -0600
+Subject: [PATCH] fixes bug #1138
+
+---
+ util/fluxbox-remote.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc
+index 59852e6a7..504015b50 100644
+--- a/util/fluxbox-remote.cc
++++ b/util/fluxbox-remote.cc
+@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
+     if (strcmp(cmd, "result") == 0) {
+         XTextProperty text_prop;
+         if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
+-            && text_prop.value > 0
++            && text_prop.value != 0
+             && text_prop.nitems > 0) {
+ 
+             printf("%s", text_prop.value);
diff --git a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch b/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
deleted file mode 100644
index 5b64b11ab2a8..000000000000
--- a/srcpkgs/fluxbox/patches/MinOverlapPlacement.cc_improve.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/src/MinOverlapPlacement.cc  2015-02-08 05:44:34.000000000 -0500
-+++ b/src/MinOverlapPlacement.cc  2022-07-18 15:14:41.012275200 -0400
-@@ -196,19 +196,21 @@
-     std::set<Area>::iterator min_reg = areas.end();
-
-     std::set<Area>::iterator ar_it = areas.begin();
-+    int overlap = 0, min_right = 0, min_bottom = 0, max_left = 0, max_top = 0;
-+
-     for (; ar_it != areas.end(); ++ar_it) {
-
--        int overlap = 0;
-+        overlap = 0;
-         it = const_windowlist.rbegin();
-         for (; it != it_end; ++it) {
-
-             getWindowDimensions(*(*it), left, top, right, bottom);
-
-             // get the coordinates of the overlap region
--            int min_right = std::min(right, ar_it->x + win_w);
--            int min_bottom = std::min(bottom, ar_it->y + win_h);
--            int max_left = std::max(left, ar_it->x);
--            int max_top = std::max(top, ar_it->y);
-+            min_right = std::min(right, ar_it->x + win_w);
-+            min_bottom = std::min(bottom, ar_it->y + win_h);
-+            max_left = std::max(left, ar_it->x);
-+            max_top = std::max(top, ar_it->y);
-
-             // now compute the overlap and add to running total
-             if (min_right > max_left && min_bottom > max_top)
diff --git a/srcpkgs/fluxbox/patches/center.patch b/srcpkgs/fluxbox/patches/center.patch
deleted file mode 100644
index 39e3e4c7f37e..000000000000
--- a/srcpkgs/fluxbox/patches/center.patch
+++ /dev/null
@@ -1,307 +0,0 @@
-From ec83993c236de9c9442e2fcd31c08aae852a5a16 Mon Sep 17 00:00:00 2001
-From: zlice <zlice555@gmail.com>
-Date: Fri, 22 Jul 2022 21:21:33 -0400
-Subject: [PATCH 1/2] whitespace cleanup
-
----
- doc/asciidoc/fluxbox.txt |  8 ++++----
- src/ScreenPlacement.cc   | 12 ++++++------
- src/ScreenPlacement.hh   | 10 +++++-----
- 3 files changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
-index 95624842..0e3f27b9 100644
---- a/doc/asciidoc/fluxbox.txt
-+++ b/doc/asciidoc/fluxbox.txt
-@@ -4,7 +4,7 @@ Henrik Kinnunen <fluxgen@fluxbox.org>
- v1.3.7, 08 February 2015
- :man source:   fluxbox.txt
- :man version:  {revision}
--:man manual:   Fluxbox Manual  
-+:man manual:   Fluxbox Manual
- 
- NAME
- ----
-@@ -475,7 +475,7 @@ By default, this menu contains:
- 
- *Remember...*:::
- Specify which window settings should be stored in the `apps' file and
--resumed the next time this window is opened. 
-+resumed the next time this window is opened.
- +
- Specifically the setting you may store are:
- +
-@@ -740,7 +740,7 @@ There are three more settings in the ``Focus Model'' menu:
- 
- TAB OPTIONS
- -----------
--This section of fluxbox configuration menu lets you configure many features of 
-+This section of fluxbox configuration menu lets you configure many features of
- tabs. Inside of it there are three main options:
- 
- *Placement*:::
-@@ -1060,7 +1060,7 @@ whenever the mouse moves over them, but only when the mouse is moving. With
- area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc.
- +
- Default: *ClickToFocus*
--      
-+
- *session.screen0.autoRaise*: 'boolean'::
- When True, this setting automatically raises any window that gains focus.
- +
-diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
-index 19ddf78a..ca58d83f 100644
---- a/src/ScreenPlacement.cc
-+++ b/src/ScreenPlacement.cc
-@@ -43,14 +43,14 @@ using std::cerr;
- using std::endl;
- 
- ScreenPlacement::ScreenPlacement(BScreen &screen):
--    m_row_direction(screen.resourceManager(), LEFTRIGHT, 
--                    screen.name()+".rowPlacementDirection", 
-+    m_row_direction(screen.resourceManager(), LEFTRIGHT,
-+                    screen.name()+".rowPlacementDirection",
-                     screen.altName()+".RowPlacementDirection"),
--    m_col_direction(screen.resourceManager(), TOPBOTTOM, 
--                    screen.name()+".colPlacementDirection", 
-+    m_col_direction(screen.resourceManager(), TOPBOTTOM,
-+                    screen.name()+".colPlacementDirection",
-                     screen.altName()+".ColPlacementDirection"),
--    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT, 
--                       screen.name()+".windowPlacement", 
-+    m_placement_policy(screen.resourceManager(), ROWMINOVERLAPPLACEMENT,
-+                       screen.name()+".windowPlacement",
-                        screen.altName()+".WindowPlacement"),
-     m_old_policy(ROWSMARTPLACEMENT),
-     m_screen(screen)
-diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
-index 0f210d94..f1234983 100644
---- a/src/ScreenPlacement.hh
-+++ b/src/ScreenPlacement.hh
-@@ -34,7 +34,7 @@ class BScreen;
- 
- /**
-  * Main class for strategy handling
-- * This is a bridge between screen and 
-+ * This is a bridge between screen and
-  * the real placement strategy (rowcol, undermouse etc)
-  * The placeWindow function in this class is guaranteed to succeed.
-  * It holds a pointer to the real placement strategy which is
-@@ -42,8 +42,8 @@ class BScreen;
-  */
- class ScreenPlacement: public PlacementStrategy {
- public:
--    enum PlacementPolicy { 
--        ROWSMARTPLACEMENT, 
-+    enum PlacementPolicy {
-+        ROWSMARTPLACEMENT,
-         COLSMARTPLACEMENT,
-         COLMINOVERLAPPLACEMENT,
-         ROWMINOVERLAPPLACEMENT,
-@@ -52,11 +52,11 @@ public:
-         AUTOTABPLACEMENT
-     };
- 
--    enum RowDirection { 
-+    enum RowDirection {
-         LEFTRIGHT, ///< from left to right
-         RIGHTLEFT  ///< from right to left
-     };
--    enum ColumnDirection { 
-+    enum ColumnDirection {
-         TOPBOTTOM,  ///< from top to bottom
-         BOTTOMTOP   ///< from bottom to top
-     };
--- 
-2.37.1
-
-
-From 6e05f44c94fa4bfc0e44e8f42a9d24665a95840f Mon Sep 17 00:00:00 2001
-From: zlice <zlice555@gmail.com>
-Date: Fri, 22 Jul 2022 21:27:25 -0400
-Subject: [PATCH 2/2] new feature: CenterPlacement. Places new windows in
- center of the current workspace
-
----
- doc/asciidoc/fluxbox.txt |  1 +
- src/CenterPlacement.cc   | 43 ++++++++++++++++++++++++++++++++++++++++
- src/CenterPlacement.hh   | 37 ++++++++++++++++++++++++++++++++++
- src/Makemodule.am        |  2 ++
- src/ScreenPlacement.cc   |  8 ++++++++
- src/ScreenPlacement.hh   |  1 +
- 6 files changed, 92 insertions(+)
- create mode 100644 src/CenterPlacement.cc
- create mode 100644 src/CenterPlacement.hh
-
-diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
-index 0e3f27b9..46ca2861 100644
---- a/doc/asciidoc/fluxbox.txt
-+++ b/doc/asciidoc/fluxbox.txt
-@@ -1141,6 +1141,7 @@ Available strategies:;;
- - RowSmartPlacement: tries to place windows in rows without overlapping
- - ColSmartPlacement: tries to place windows in columns without overlapping
- - CascadePlacement: places windows below the titlebar of the previous one
-+- CenterPlacement: places windows in the center of the current workspace
- - UnderMousePlacement: places new windows underneath the mouse
- - RowMinOverlapPlacement: place windows in rows with minimal overlapping
- - ColMinOverlapPlacement: place windows in columns with minimal overlapping
-diff --git a/src/CenterPlacement.cc b/src/CenterPlacement.cc
-new file mode 100644
-index 00000000..efaf76b9
---- /dev/null
-+++ b/src/CenterPlacement.cc
-@@ -0,0 +1,43 @@
-+// CenterPlacement.cc
-+// Copyright (c) 2006 Fluxbox Team (fluxgen at fluxbox dot org)
-+//
-+// Permission is hereby granted, free of charge, to any person obtaining a
-+// copy of this software and associated documentation files (the "Software"),
-+// to deal in the Software without restriction, including without limitation
-+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+// and/or sell copies of the Software, and to permit persons to whom the
-+// Software is furnished to do so, subject to the following conditions:
-+//
-+// The above copyright notice and this permission notice shall be included in
-+// all copies or substantial portions of the Software.
-+//
-+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+// DEALINGS IN THE SOFTWARE.
-+
-+#include "CenterPlacement.hh"
-+
-+#include "FbTk/App.hh"
-+#include "Screen.hh"
-+#include "Window.hh"
-+
-+bool CenterPlacement::placeWindow(const FluxboxWindow &win, int head,
-+                                      int &place_x, int &place_y) {
-+
-+    int cent_x = (signed) win.screen().maxRight(head) - (signed) win.screen().maxLeft(head);
-+    int cent_y = (signed) win.screen().maxBottom(head) - (signed) win.screen().maxTop(head);
-+
-+    // border on 1 side, dividing in half
-+    // with rounding, this will probably favor top left
-+    int win_half_w = (win.width() / 2) + win.fbWindow().borderWidth(),
-+        win_half_h = (win.height() / 2) + win.fbWindow().borderWidth();
-+
-+    place_x = cent_x - win_half_w;
-+    place_y = cent_y - win_half_h;
-+
-+    return true;
-+}
-diff --git a/src/CenterPlacement.hh b/src/CenterPlacement.hh
-new file mode 100644
-index 00000000..9f70a6c8
---- /dev/null
-+++ b/src/CenterPlacement.hh
-@@ -0,0 +1,37 @@
-+// CenterPlacement.hh
-+// Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org)
-+//
-+// Permission is hereby granted, free of charge, to any person obtaining a
-+// copy of this software and associated documentation files (the "Software"),
-+// to deal in the Software without restriction, including without limitation
-+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+// and/or sell copies of the Software, and to permit persons to whom the
-+// Software is furnished to do so, subject to the following conditions:
-+//
-+// The above copyright notice and this permission notice shall be included in
-+// all copies or substantial portions of the Software.
-+//
-+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+// DEALINGS IN THE SOFTWARE.
-+
-+#ifndef CENTERPLACEMENT_HH
-+#define CENTERPLACEMENT_HH
-+
-+#include "ScreenPlacement.hh"
-+
-+class CenterPlacement: public PlacementStrategy {
-+public:
-+    CenterPlacement() { };
-+
-+    bool placeWindow(const FluxboxWindow &win, int head,
-+                     int &place_x, int &place_y);
-+
-+private:
-+};
-+
-+#endif // CENTERPLACEMENT_HH
-diff --git a/src/Makemodule.am b/src/Makemodule.am
-index 5be5692c..53d35e8e 100644
---- a/src/Makemodule.am
-+++ b/src/Makemodule.am
-@@ -165,6 +165,8 @@ fluxbox_SOURCES = \
- 	src/AttentionNoticeHandler.hh \
- 	src/CascadePlacement.cc \
- 	src/CascadePlacement.hh \
-+	src/CenterPlacement.cc \
-+	src/CenterPlacement.hh \
- 	src/ClientMenu.cc \
- 	src/ClientMenu.hh \
- 	src/ClientPattern.cc \
-diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
-index ca58d83f..ce47a910 100644
---- a/src/ScreenPlacement.cc
-+++ b/src/ScreenPlacement.cc
-@@ -24,6 +24,7 @@
- #include "RowSmartPlacement.hh"
- #include "MinOverlapPlacement.hh"
- #include "UnderMousePlacement.hh"
-+#include "CenterPlacement.hh"
- #include "ColSmartPlacement.hh"
- #include "CascadePlacement.hh"
- 
-@@ -82,6 +83,9 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
-         case UNDERMOUSEPLACEMENT:
-             m_strategy.reset(new UnderMousePlacement());
-             break;
-+        case CENTERPLACEMENT:
-+            m_strategy.reset(new CenterPlacement());
-+            break;
-         case AUTOTABPLACEMENT:
-             m_strategy.reset(0);
-             break;
-@@ -197,6 +201,8 @@ std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const
-         return "ColMinOverlapPlacement";
-     case ScreenPlacement::UNDERMOUSEPLACEMENT:
-         return "UnderMousePlacement";
-+    case ScreenPlacement::CENTERPLACEMENT:
-+        return "CenterPlacement";
-     case ScreenPlacement::CASCADEPLACEMENT:
-         return "CascadePlacement";
-     case ScreenPlacement::AUTOTABPLACEMENT:
-@@ -218,6 +224,8 @@ void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char
-         *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
-     else if (strcasecmp("UnderMousePlacement", str) == 0)
-         *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
-+    else if (strcasecmp("CenterPlacement", str) == 0)
-+        *(*this) = ScreenPlacement::CENTERPLACEMENT;
-     else if (strcasecmp("CascadePlacement", str) == 0)
-         *(*this) = ScreenPlacement::CASCADEPLACEMENT;
-     else if (strcasecmp("AutotabPlacement", str) == 0)
-diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh
-index f1234983..a5c9b885 100644
---- a/src/ScreenPlacement.hh
-+++ b/src/ScreenPlacement.hh
-@@ -49,6 +49,7 @@ public:
-         ROWMINOVERLAPPLACEMENT,
-         CASCADEPLACEMENT,
-         UNDERMOUSEPLACEMENT,
-+        CENTERPLACEMENT,
-         AUTOTABPLACEMENT
-     };
- 
--- 
-2.37.1
-
diff --git a/srcpkgs/fluxbox/patches/container_locks.patch b/srcpkgs/fluxbox/patches/container_locks.patch
deleted file mode 100644
index 498ab44a23c6..000000000000
--- a/srcpkgs/fluxbox/patches/container_locks.patch
+++ /dev/null
@@ -1,325 +0,0 @@
-diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
-index 00bc1187..f8a4c475 100644
---- a/src/FbWinFrame.cc
-+++ b/src/FbWinFrame.cc
-@@ -148,6 +148,11 @@ FbWinFrame::FbWinFrame(BScreen &screen, unsigned int client_depth,
-     m_button_size(1),
-     m_shape(m_window, theme->shapePlace()) {
- 
-+    m_locker_timer.setTimeout(timerVal() ); // 10millisec
-+    m_locker_timer.fireOnce(true);
-+    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<FbWinFrame>(*this, &FbWinFrame::unlockSig));
-+    m_locker_timer.setCommand(usig);
-+
-     init();
- }
- 
-@@ -156,6 +161,27 @@ FbWinFrame::~FbWinFrame() {
-     removeAllButtons();
- }
- 
-+// for incremental changes, back off for a bit
-+// prevents slowdown from say, making 200 windows
-+void FbWinFrame::resetLock() {
-+    m_lock_gfx = true;
-+    m_locker_timer.start();
-+}
-+
-+void FbWinFrame::unlockSig() {
-+    m_lock_gfx = false;
-+    // this is what we wanted to do
-+    FbTk::Container& tabs = tabcontainer();
-+    tabs.setUpdateLock(m_lock_gfx);
-+    renderTabContainer();
-+    applyTabContainer();
-+
-+    tabs.clear();
-+    tabs.raise();
-+    tabs.show();
-+}
-+
-+
- bool FbWinFrame::setTabMode(TabMode tabmode) {
-     if (m_tabmode == tabmode)
-         return false;
-@@ -187,6 +213,7 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
- 
-     } else {
-         tabs.setUpdateLock(true);
-+        resetLock();
- 
-         tabs.setAlignment(FbTk::Container::RELATIVE);
-         tabs.setOrientation(FbTk::ROT0);
-@@ -200,9 +227,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
-         }
-         tabs.setBorderWidth(0);
-         tabs.setMaxTotalSize(0);
--        tabs.setUpdateLock(false);
-+        tabs.setUpdateLock(m_lock_gfx);
-         tabs.setMaxSizePerClient(0);
- 
-+        if (m_lock_gfx)
-+            return false;
-+
-         renderTabContainer();
-         applyTabContainer();
- 
-diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
-index 617b9b91..725c84a0 100644
---- a/src/FbWinFrame.hh
-+++ b/src/FbWinFrame.hh
-@@ -33,6 +33,7 @@
- #include "FbTk/Container.hh"
- #include "FbTk/Shape.hh"
- #include "FbTk/Signal.hh"
-+#include "FbTk/Timer.hh"
- 
- #include <vector>
- #include <memory>
-@@ -176,6 +177,12 @@ public:
-     void setShapingClient(FbTk::FbWindow *win, bool always_update);
-     void updateShape() { m_shape.update(); }
- 
-+    void resetLock();
-+    void unlockSig();
-+    FbTk::Timer m_locker_timer;
-+    static unsigned int timerVal() { return 10 * FbTk::FbTime::IN_MILLISECONDS; }
-+    bool m_lock_gfx = false;
-+
-     /**
-        @name accessors
-     */
-diff --git a/src/IconButton.cc b/src/IconButton.cc
-index 1290c2aa..2ea7af9e 100644
---- a/src/IconButton.cc
-+++ b/src/IconButton.cc
-@@ -71,8 +71,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent,
- 
-     FbTk::EventManager::instance()->add(*this, m_icon_window);
- 
--    reconfigTheme();
--    refreshEverything(false);
-+    //reconfigTheme();
-+    //refreshEverything(false);
- }
- 
- IconButton::~IconButton() {
-@@ -163,12 +163,12 @@ void IconButton::reconfigTheme() {
-                            width(), height(), m_theme->texture(),
-                            orientation()));
-         setBackgroundPixmap(m_pm);
--    } else{
-+    } else {
-         m_pm.reset(0);
-         setBackgroundColor(m_theme->texture().color());
-     }
- 
--    updateBackground(false);
-+    //updateBackground(false);
- }
- 
- void IconButton::reconfigAndClear() {
-@@ -181,7 +181,8 @@ void IconButton::refreshEverything(bool setup) {
-     Display *display = FbTk::App::instance()->display();
-     int screen = m_win.screen().screenNumber();
- 
--    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None) {
-+    if (m_use_pixmap && m_win.icon().pixmap().drawable() != None &&
-+                                     width() > m_icon_window.width() ) {
-         // setup icon window
-         m_icon_window.show();
-         unsigned int w = width();
-@@ -242,7 +243,6 @@ void IconButton::refreshEverything(bool setup) {
-         m_icon_window.clear();
-     }
- 
--
- }
- 
- void IconButton::clientTitleChanged() {
-@@ -251,24 +251,30 @@ void IconButton::clientTitleChanged() {
- 
-     if (m_has_tooltip)
-         showTooltip();
-+
- }
- 
- void IconButton::setupWindow() {
-     m_icon_window.clear();
-+    //FbTk::FbString title = "wtf2";
-     FbTk::FbString title = m_win.title().logical();
--    if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
--        title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
-+    //#if USE_TOOLBAR
-+    //if (m_win.fbwindow() && m_win.fbwindow()->isIconic())
-+    //    title = IconbarTool::iconifiedPrefix() + title + IconbarTool::iconifiedSuffix();
-+    //#endif
-     setText(title);
-     FbTk::TextButton::clear();
- }
- 
- void IconButton::drawText(int x, int y, FbTk::FbDrawable *drawable) {
- 
--    // offset text
--    if (m_icon_pixmap.drawable() != 0)
--        FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
--    else
--        FbTk::TextButton::drawText(1, y, drawable);
-+    if (width() > m_icon_window.width() ) {
-+      // offset text
-+      if (m_icon_pixmap.drawable() != 0)
-+          FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y, drawable);
-+      else
-+          FbTk::TextButton::drawText(1, y, drawable);
-+    }
- }
- 
- bool IconButton::setOrientation(FbTk::Orientation orient) {
-diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
-index 027ab1c6..f64a4cf6 100644
---- a/src/IconbarTool.cc
-+++ b/src/IconbarTool.cc
-@@ -300,6 +300,11 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
-     FbTk::RefCount<FbTk::Command<void> > ers(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::emitResizeSig));
-     m_resizeSig_timer.setCommand(ers);
- 
-+    m_locker_timer.setTimeout(IconButton::updateLaziness() / 10); // 10millisec
-+    m_locker_timer.fireOnce(true);
-+    FbTk::RefCount<FbTk::Command<void> > usig(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::unlockSig));
-+    m_locker_timer.setCommand(usig);
-+
-     themeReconfigured();
- }
- 
-@@ -325,7 +330,7 @@ void IconbarTool::updateMaxSizes(unsigned int width, unsigned int height) {
- 
- void IconbarTool::resize(unsigned int width, unsigned int height) {
-     m_icon_container.resize(width, height);
--    updateMaxSizes(width, height);
-+    //updateMaxSizes(width, height);
-     renderTheme();
- }
- 
-@@ -333,7 +338,7 @@ void IconbarTool::moveResize(int x, int y,
-                              unsigned int width, unsigned int height) {
- 
-     m_icon_container.moveResize(x, y, width, height);
--    updateMaxSizes(width, height);
-+    //updateMaxSizes(width, height);
-     renderTheme();
- }
- 
-@@ -393,6 +398,25 @@ void IconbarTool::setMode(string mode) {
-     m_menu.reconfigure();
- }
- 
-+// for incremental changes, back off for a bit
-+// prevents slowdown from say, making 200 windows
-+void IconbarTool::resetLock() {
-+    m_lock_gfx = true;
-+    m_locker_timer.start();
-+}
-+
-+void IconbarTool::unlockSig() {
-+    m_lock_gfx = false;
-+    //resizeSig().emit();
-+    // this is what we wanted to do
-+    m_icon_container.setUpdateLock(false);
-+    m_icon_container.update();
-+    m_icon_container.showSubwindows();
-+    renderTheme();
-+    update(ALIGN, NULL);
-+    m_resizeSig_timer.start();
-+}
-+
- void IconbarTool::emitResizeSig() {
-     resizeSig().emit();
- }
-@@ -441,9 +465,11 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
-     switch(reason) {
-         case LIST_ADD: case LIST_ORDER:
-             insertWindow(*win);
-+            resetLock();
-             break;
-         case LIST_REMOVE:
-             removeWindow(*win);
-+            resetLock();
-             break;
-         case LIST_RESET:
-             reset();
-@@ -455,6 +481,10 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
-     m_resizeSig_timer.start();
- 
-     updateMaxSizes(width(), height());
-+
-+    if (m_lock_gfx)
-+        return;
-+
-     // unlock container and update graphics
-     m_icon_container.setUpdateLock(false);
-     m_icon_container.update();
-@@ -496,13 +526,13 @@ void IconbarTool::insertWindow(Focusable &win, int pos) {
-         button = makeButton(win);
-     if (!button) return;
- 
--    if (pos == -2) {
--        pos = 0;
--        list<Focusable *>::iterator it = m_winlist->clientList().begin(),
--                                    it_end = m_winlist->clientList().end();
--        for (; it != it_end && *it != &win; ++it)
--            pos++;
--    }
-+    //if (pos == -2) {
-+    //    pos = 0;
-+    //    list<Focusable *>::iterator it = m_winlist->clientList().begin(),
-+    //                                it_end = m_winlist->clientList().end();
-+    //    for (; it != it_end && *it != &win; ++it)
-+    //        pos++;
-+    //}
- 
-     m_icon_container.insertItem(button, pos);
-     m_tracker.join(button->titleChanged(), FbTk::MemFun(m_resizeSig_timer, &FbTk::Timer::start));
-@@ -517,9 +547,9 @@ void IconbarTool::updateSizing() {
-     m_icon_container.setBorderWidth(m_theme.border().width());
-     m_icon_container.setBorderColor(m_theme.border().color());
- 
--    FbTk::STLUtil::forAll(m_icons, 
--            FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
--                FbTk::Select2nd<IconMap::value_type>()));
-+    //FbTk::STLUtil::forAll(m_icons, 
-+    //        FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme), 
-+    //            FbTk::Select2nd<IconMap::value_type>()));
- 
- }
- 
-@@ -560,7 +590,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear) {
- 
-     button.setPixmap(*m_rc_use_pixmap);
-     button.setTextPadding(*m_rc_client_padding);
--    button.reconfigTheme();
-+    //button.reconfigTheme();
-     if (clear)
-         button.clear(); // the clear also updates transparent
- }
-diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
-index df6d9a65..1c2101ac 100644
---- a/src/IconbarTool.hh
-+++ b/src/IconbarTool.hh
-@@ -106,6 +106,9 @@ private:
- 
-     void themeReconfigured();
- 
-+    void resetLock();
-+    void unlockSig();
-+    FbTk::Timer m_locker_timer;
-     FbTk::Timer m_resizeSig_timer;
-     void emitResizeSig();
- 
-@@ -128,6 +131,7 @@ private:
-     FbMenu m_menu;
-     int m_alpha;
-     static std::string s_iconifiedDecoration[2];
-+    bool m_lock_gfx = false;
- };
- 
- #endif // ICONBARTOOL_HH
diff --git a/srcpkgs/fluxbox/patches/container_relative_relative.patch b/srcpkgs/fluxbox/patches/container_relative_relative.patch
deleted file mode 100644
index dc3ddb5181b5..000000000000
--- a/srcpkgs/fluxbox/patches/container_relative_relative.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
-index cea761b3..0e050a0b 100644
---- a/src/FbTk/Container.cc
-+++ b/src/FbTk/Container.cc
-@@ -365,6 +365,9 @@ void Container::repositionItems() {
-     const ItemList::iterator it_end = end();
-
-     int rounding_error = 0;
-+    if (align == RELATIVE || total_width == m_max_total_size) {
-+        rounding_error = total_width - ((max_width_per_client + borderW)* num_items - borderW);
-+    }
-
-     int next_x = -borderW; // zero so the border of the first shows
-     int extra = 0;
-
diff --git a/srcpkgs/fluxbox/patches/flux_improve.patch b/srcpkgs/fluxbox/patches/flux_improve.patch
deleted file mode 100644
index 13a1aeba621c..000000000000
--- a/srcpkgs/fluxbox/patches/flux_improve.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/src/Ewmh.cc b/src/Ewmh.cc
-index e12a7923..db1ddd45 100644
---- a/src/Ewmh.cc
-+++ b/src/Ewmh.cc
-@@ -1096,15 +1096,19 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
-         // ce.data.l[0] = the action (remove, add or toggle)
-         // ce.data.l[1] = the first property to alter
-         // ce.data.l[2] = second property to alter (can be zero)
--        if (ce.data.l[0] == STATE_REMOVE) {
--            setState(win, ce.data.l[1], false, *winclient);
--            setState(win, ce.data.l[2], false, *winclient);
--        } else if (ce.data.l[0] == STATE_ADD) {
--            setState(win, ce.data.l[1], true, *winclient);
--            setState(win, ce.data.l[2], true, *winclient);
--        } else if (ce.data.l[0] == STATE_TOGGLE) {
--            toggleState(win, ce.data.l[1]);
--            toggleState(win, ce.data.l[2]);
-+        bool addremove = false; // add true, remove false
-+
-+        switch (ce.data.l[0]) {
-+          case STATE_TOGGLE:
-+              toggleState(win, ce.data.l[1]);
-+              toggleState(win, ce.data.l[2]);
-+              break;
-+          case STATE_ADD:
-+              addremove = true;
-+          case STATE_REMOVE:
-+              setState(win, ce.data.l[1], addremove, *winclient);
-+              setState(win, ce.data.l[2], addremove, *winclient);
-+              break;
-         }
-         return true;
-     } else if (ce.message_type == m_net->number_of_desktops) {
-diff --git a/src/FbMenuParser.cc b/src/FbMenuParser.cc
-index 716ced29..5a56e6f5 100644
---- a/src/FbMenuParser.cc
-+++ b/src/FbMenuParser.cc
-@@ -33,9 +33,9 @@ bool FbMenuParser::open(const std::string &filename) {
- }
- 
- FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
--    if (eof()) {        
-+    if (eof()) {
-         out = FbTk::Parser::s_empty_item;
--        return *this; 
-+        return *this;
-     }
- 
-     if (m_curr_line.empty())
-@@ -69,20 +69,26 @@ FbTk::Parser &FbMenuParser::operator >> (FbTk::Parser::Item &out) {
-         return (*this)>>out;
-         break;
-     }
--    
-+
-     std::string key;
-     int err = FbTk::StringUtil::
-         getStringBetween(key, m_curr_line.c_str() + m_curr_pos,
-                          first, second);
--    if (err <= 0) {        
--        if (m_curr_token == TYPE)
-+    if (err <= 0) {
-+        switch (m_curr_token) {
-+          case TYPE:
-             m_curr_token = NAME;
--        else if (m_curr_token == NAME)
-+            break;
-+          case NAME:
-             m_curr_token = ARGUMENT;
--        else if (m_curr_token == ARGUMENT)
-+            break;
-+          case ARGUMENT:
-             m_curr_token = ICON;
--        else if (m_curr_token == ICON)
-+            break;
-+          case ICON:
-             m_curr_token = DONE;
-+            break;
-+        }
- 
-         out = FbTk::Parser::s_empty_item;
-         return *this;
-diff --git a/src/Remember.cc b/src/Remember.cc
-index 49e61062..4f0ba3db 100644
---- a/src/Remember.cc
-+++ b/src/Remember.cc
-@@ -802,39 +802,41 @@ void Remember::reload() {
-             int pos = getStringBetween(key, line.c_str(), '[', ']');
-             string lc_key = toLower(key);
- 
--            if (pos > 0 && (lc_key == "app" || lc_key == "transient")) {
--                ClientPattern *pat = new ClientPattern(line.c_str() + pos);
--                if (!in_group) {
--                    if ((err = pat->error()) == 0) {
--                        bool transient = (lc_key == "transient");
--                        Application *app = findMatchingPatterns(pat,
--                                               old_pats, transient, false);
--                        if (app) {
--                            app->reset();
--                            reused_apps.insert(app);
-+            if (pos > 0) {
-+                if (lc_key == "app" || lc_key == "transient") {
-+                    ClientPattern *pat = new ClientPattern(line.c_str() + pos);
-+                    if (!in_group) {
-+                        if ((err = pat->error()) == 0) {
-+                            bool transient = (lc_key == "transient");
-+                            Application *app = findMatchingPatterns(pat,
-+                                                   old_pats, transient, false);
-+                            if (app) {
-+                                app->reset();
-+                                reused_apps.insert(app);
-+                            } else {
-+                                app = new Application(transient, false);
-+                            }
-+
-+                            m_pats->push_back(make_pair(pat, app));
-+                            row += parseApp(apps_file, *app);
-                         } else {
--                            app = new Application(transient, false);
-+                            cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
-+                            delete pat; // since it didn't work
-                         }
--
--                        m_pats->push_back(make_pair(pat, app));
--                        row += parseApp(apps_file, *app);
-                     } else {
--                        cerr<<"Error reading apps file at line "<<row<<", column "<<(err+pos)<<"."<<endl;
--                        delete pat; // since it didn't work
-+                        grouped_pats.push_back(pat);
-                     }
--                } else {
--                    grouped_pats.push_back(pat);
--                }
--            } else if (pos > 0 && lc_key == "startup" && fb.isStartup()) {
--                if (!handleStartupItem(line, pos)) {
--                    cerr<<"Error reading apps file at line "<<row<<"."<<endl;
-+                } else if (lc_key == "startup" && fb.isStartup()) {
-+                    if (!handleStartupItem(line, pos)) {
-+                        cerr<<"Error reading apps file at line "<<row<<"."<<endl;
-+                    }
-+                    // save the item even if it was bad (aren't we nice)
-+                    m_startups.push_back(line.substr(pos));
-+                } else if (lc_key == "group") {
-+                    in_group = true;
-+                    if (line.find('(') != string::npos)
-+                        pat = new ClientPattern(line.c_str() + pos);
-                 }
--                // save the item even if it was bad (aren't we nice)
--                m_startups.push_back(line.substr(pos));
--            } else if (pos > 0 && lc_key == "group") {
--                in_group = true;
--                if (line.find('(') != string::npos)
--                    pat = new ClientPattern(line.c_str() + pos);
-             } else if (in_group) {
-                 // otherwise assume that it is the start of the attributes
-                 Application *app = 0;
-diff --git a/src/SystemTray.cc b/src/SystemTray.cc
-index 8c42877a..1fc2b0a8 100644
---- a/src/SystemTray.cc
-+++ b/src/SystemTray.cc
-@@ -550,10 +550,12 @@ void SystemTray::rearrangeClients() {
-     ClientList::iterator client_it = m_clients.begin();
-     ClientList::iterator client_it_end = m_clients.end();
-     int next_x = bw;
-+    int x, y;
-     for (; client_it != client_it_end; ++client_it) {
-         if (!(*client_it)->isVisible())
-             continue;
--        int x = next_x, y = bw;
-+        x = next_x;
-+        y = bw;
-         next_x += h_rot0+bw;
-         translateCoords(orientation(), x, y, w_rot0, h_rot0);
-         translatePosition(orientation(), x, y, h_rot0, h_rot0, 0);
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..713d1510 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -3267,14 +3267,18 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top, bool resize) {
- FluxboxWindow::ReferenceCorner FluxboxWindow::getResizeDirection(int x, int y,
-         ResizeModel model, int corner_size_px, int corner_size_pc) const
- {
--    if (model == TOPLEFTRESIZE)     return LEFTTOP;
--    if (model == TOPRESIZE)         return TOP;
--    if (model == TOPRIGHTRESIZE)    return RIGHTTOP;
--    if (model == LEFTRESIZE)        return LEFT;
--    if (model == RIGHTRESIZE)       return RIGHT;
--    if (model == BOTTOMLEFTRESIZE)  return LEFTBOTTOM;
--    if (model == BOTTOMRESIZE)      return BOTTOM;
--    if (model == CENTERRESIZE)      return CENTER;
-+    switch (model) {
-+    case TOPLEFTRESIZE:     return LEFTTOP;
-+    case TOPRESIZE:         return TOP;
-+    case TOPRIGHTRESIZE:    return RIGHTTOP;
-+    case LEFTRESIZE:        return LEFT;
-+    case RIGHTRESIZE:       return RIGHT;
-+    case BOTTOMLEFTRESIZE:  return LEFTBOTTOM;
-+    case BOTTOMRESIZE:      return BOTTOM;
-+    case CENTERRESIZE:      return CENTER;
-+    default:
-+    break;
-+    }
- 
-     if (model == EDGEORCORNERRESIZE)
-     {
diff --git a/srcpkgs/fluxbox/patches/flux_oversize.patch b/srcpkgs/fluxbox/patches/flux_oversize.patch
deleted file mode 100644
index 98d70d3b037e..000000000000
--- a/srcpkgs/fluxbox/patches/flux_oversize.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..02d10e90 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -532,19 +532,14 @@ void FluxboxWindow::init() {
-     if (!m_state.fullscreen) {
-         unsigned int new_width = 0, new_height = 0;
-         if (m_client->width() >= screen().width()) {
--            m_state.maximized |= WindowState::MAX_HORZ;
-             new_width = 2 * screen().width() / 3;
-         }
-         if (m_client->height() >= screen().height()) {
--            m_state.maximized |= WindowState::MAX_VERT;
-             new_height = 2 * screen().height() / 3;
-         }
-         if (new_width || new_height) {
--            const int maximized = m_state.maximized;
--            m_state.maximized = WindowState::MAX_NONE;
-             resize(new_width ? new_width : width(), new_height ? new_height : height());
-             m_placed = false;
--            m_state.maximized = maximized;
-         }
-     }
- 
diff --git a/srcpkgs/fluxbox/patches/focus_close_menu.patch b/srcpkgs/fluxbox/patches/focus_close_menu.patch
deleted file mode 100644
index 01830cf53460..000000000000
--- a/srcpkgs/fluxbox/patches/focus_close_menu.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/src/FocusControl.cc b/src/FocusControl.cc
-index 54c3d46c..7e49ff51 100644
---- a/src/FocusControl.cc
-+++ b/src/FocusControl.cc
-@@ -247,11 +247,7 @@ void FocusControl::stopCyclingFocus() {
- 
-     // put currently focused window to top
-     if (s_focused_window) {
--        // re-focus last window to give the client a chance to redistribute the
--        // focus internally (client-side only modality)
--        s_focused_window->focus();
--        if (s_focused_window)
--            setScreenFocusedWindow(*s_focused_window);
-+        setScreenFocusedWindow(*s_focused_window);
-         if (s_focused_fbwindow)
-             s_focused_fbwindow->raise();
-     } else
diff --git a/srcpkgs/fluxbox/patches/slit_raise.patch b/srcpkgs/fluxbox/patches/slit_raise.patch
deleted file mode 100644
index a3bc01c7ac85..000000000000
--- a/srcpkgs/fluxbox/patches/slit_raise.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/src/Slit.cc b/src/Slit.cc
-index 9baecf21..63ed8269 100644
---- a/src/Slit.cc
-+++ b/src/Slit.cc
-@@ -958,8 +958,8 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
-         return;
-     }
-
--    if (be.button == 1)
--        frame.window.raise();
-+    //if (be.button == 1)
-+    //    frame.window.raise();
-
-     if (be.button != Button3) {
-         XAllowEvents(dpy, ReplayPointer, CurrentTime);
-
diff --git a/srcpkgs/fluxbox/patches/toolbar_redo.patch b/srcpkgs/fluxbox/patches/toolbar_redo.patch
deleted file mode 100644
index ca95486583ce..000000000000
--- a/srcpkgs/fluxbox/patches/toolbar_redo.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-diff --git a/src/Toolbar.cc b/src/Toolbar.cc
-index aa9bc121..ee8b8bfc 100644
---- a/src/Toolbar.cc
-+++ b/src/Toolbar.cc
-@@ -74,7 +74,7 @@ using FbTk::STLUtil::forAll;
- 
- namespace {
- 
--const struct { 
-+const struct {
-     Toolbar::Placement placement;
-     const char* str;
-     FbTk::Orientation orient;
-@@ -362,13 +362,16 @@ void Toolbar::lower() {
- }
- 
- void Toolbar::screenChanged(BScreen &screen) {
--    reconfigure();
-+    //reconfigure();
- }
- 
- void Toolbar::relayout() {
--    forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
--    rearrangeItems();
--    forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
-+    //for (auto it : m_item_list)    (*item_it)->updateSizing();
-+    //rearrangeItems();
-+    //for (auto it : m_item_list)    (*item_it)->renderTheme(alpha());
-+    //forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
-+    //rearrangeItems();
-+    //forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
- }
- 
- void Toolbar::reconfigure() {
-@@ -557,12 +560,16 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
- }
- 
- void Toolbar::updateCrossingState() {
--    Window wr, wc;
--    int rx, ry, x, y;
-+    //Window wr, wc;
-+    //int rx, ry, x, y;
-+    //unsigned int mask;
-+    Window wrc;
-+    int rxy, x, y;
-     unsigned int mask;
-     const int bw = -theme()->border().width();
-     bool hovered = false;
--    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
-+    //if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wr, &wc, &rx, &ry, &x, &y, &mask))
-+    if (XQueryPointer(Fluxbox::instance()->display(), window().window(), &wrc, &wrc, &rxy, &rxy, &x, &y, &mask))
-         hovered = x >= bw && y >= bw && x < int(width()) && y < int(height());
-     if (hovered) {
-         if (m_rc_auto_raise)
-@@ -910,25 +917,26 @@ void Toolbar::rearrangeItems() {
-     // lock this
-     m_resize_lock = true;
-     // calculate size for fixed items
--    ItemList::iterator item_it = m_item_list.begin();
--    ItemList::iterator item_it_end = m_item_list.end();
-+    //ItemList::iterator item_it = m_item_list.begin();
-+    //ItemList::iterator item_it_end = m_item_list.end();
-     int bevel_width = theme()->bevelWidth();
-     int fixed_width = bevel_width; // combined size of all fixed items
-     int relative_width = 0; // combined *desired* size of all relative items
--    int stretch_items = 0;
-     int relative_items = 0;
-     int last_bw = 0; // we show the largest border of adjoining items
-     bool first = true;
-+    int leftover_width = 0;
- 
-     unsigned int width = this->width(), height = this->height();
-     unsigned int tmpw, tmph;
-     FbTk::translateSize(orient, width, height);
- 
--    for (; item_it != item_it_end; ++item_it) {
--        if (!(*item_it)->active())
-+    //for (; item_it != item_it_end; ++item_it) {
-+    for (auto item_it : m_item_list) {
-+        if (!(*item_it).active())
-             continue;
- 
--        int borderW = (*item_it)->borderWidth();
-+        int borderW = (*item_it).borderWidth();
- 
-         if (bevel_width > 0) {
-             // the bevel and border are fixed whether relative or not
-@@ -943,35 +951,35 @@ void Toolbar::rearrangeItems() {
- 
-         last_bw = borderW;
- 
--        tmpw = (*item_it)->preferredWidth();
--        tmph = (*item_it)->height();
-+        tmpw = (*item_it).preferredWidth();
-+        tmph = (*item_it).height();
-         FbTk::translateSize(orient, tmpw, tmph);
- 
--        if ((*item_it)->type() == ToolbarItem::FIXED) {
--            fixed_width += tmpw;
--        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
--            fixed_width += height;
--            if (bevel_width)
--                fixed_width -= 2*(borderW + bevel_width);
--        } else {
--            ++relative_items;
--            relative_width += tmpw;
--            if (!tmpw)
--                ++stretch_items;
-+        switch ( (*item_it).type() ) {
-+            case ToolbarItem::FIXED:
-+                fixed_width += tmpw;
-+                break;
-+            case ToolbarItem::SQUARE:
-+                fixed_width += height;
-+                if (bevel_width)
-+                    fixed_width -= 2*(borderW + bevel_width);
-+                break;
-+            case ToolbarItem::RELATIVE:
-+                ++relative_items;
-+                relative_width += tmpw;
-+                break;
-+            default:
-+                break;
-         }
-     }
- 
-     // calculate what's going to be left over to the relative sized items
--    float stretch_factor = 1.0f;
-     if (relative_items) {
--        if (relative_width <= width - fixed_width && stretch_items) {
--            relative_width = int(width - fixed_width - relative_width)/stretch_items;
--        } else if (relative_width) {
--            stretch_factor = float(width - fixed_width)/relative_width;
--            relative_width = 0;
--        }
-+        relative_width = (width - fixed_width) / relative_items;
-+        leftover_width = width - fixed_width - relative_items * relative_width;
-     }
- 
-+
-     // now move and resize the items
-     // borderWidth added back on straight away
-     int next_x = -m_item_list.front()->borderWidth(); // list isn't empty
-@@ -979,19 +987,22 @@ void Toolbar::rearrangeItems() {
-         next_x = 0;
- 
-     last_bw = 0;
--    for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
--        int borderW = (*item_it)->borderWidth();
--        if (!(*item_it)->active()) {
--            (*item_it)->hide();
-+    int borderW, offset, size_offset, tmpx, tmpy;
-+
-+    //for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
-+    for (auto item_it : m_item_list) {
-+        borderW = (*item_it).borderWidth();
-+        if (!(*item_it).active()) {
-+            (*item_it).hide();
-             // make sure it still gets told the toolbar height
-             tmpw = 1; tmph = height - 2*(bevel_width+borderW);
-             if (tmph >= (1<<30)) tmph = 1;
-             FbTk::translateSize(orient, tmpw, tmph);
--            (*item_it)->resize(tmpw, tmph);  // width of 0 changes to 1 anyway
-+            (*item_it).resize(tmpw, tmph);  // width of 0 changes to 1 anyway
-             continue;
-         }
--        int offset = bevel_width;
--        int size_offset = 2*(borderW + bevel_width);
-+        offset = bevel_width;
-+        size_offset = 2*(borderW + bevel_width);
- 
-         if (bevel_width == 0) {
-             offset = -borderW;
-@@ -1000,22 +1011,28 @@ void Toolbar::rearrangeItems() {
-         }
-         last_bw = borderW;
- 
--        int tmpx = next_x + offset,
--            tmpy = offset;
--
--        if ((*item_it)->type() == ToolbarItem::RELATIVE) {
--            unsigned int itemw = (*item_it)->preferredWidth(), itemh = (*item_it)->height();
--            FbTk::translateSize(orient, itemw, itemh);
--            tmpw = itemw ? std::floor(stretch_factor * itemw) : relative_width;
--            tmph = height - size_offset;
--        } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
--            tmpw = tmph = height - size_offset;
--        } else { // fixed size
--            unsigned int itemw = (*item_it)->width(), itemh = (*item_it)->height();
--            FbTk::translateSize(orient, itemw, itemh);
--            tmpw = itemw;
--            tmph = height - size_offset;
-+        tmpx = next_x + offset,
-+        tmpy = offset;
-+        tmph = height - size_offset;
-+
-+        switch ( (*item_it).type() ) {
-+            case ToolbarItem::SQUARE:
-+                tmpw = tmph;
-+                break;
-+            case ToolbarItem::RELATIVE:
-+                tmpw = relative_width;
-+                if (leftover_width) {
-+                    --leftover_width;
-+                    ++tmpw;
-+                }
-+                break;
-+            case ToolbarItem::FIXED:
-+                unsigned int itemw = (*item_it).width(), itemh = (*item_it).height();
-+                FbTk::translateSize(orient, itemw, itemh);
-+                tmpw = itemw;
-+                break;
-         }
-+
-         if (tmpw >= (1<<30)) tmpw = 1;
-         if (tmph >= (1<<30)) tmph = 1;
-         next_x += tmpw + bevel_width;
-@@ -1025,8 +1042,8 @@ void Toolbar::rearrangeItems() {
-         FbTk::translateCoords(orient, tmpx, tmpy, width, height);
-         FbTk::translatePosition(orient, tmpx, tmpy, tmpw, tmph, borderW);
-         FbTk::translateSize(orient, tmpw, tmph);
--        (*item_it)->moveResize(tmpx, tmpy, tmpw, tmph);
--        (*item_it)->show();
-+        (*item_it).moveResize(tmpx, tmpy, tmpw, tmph);
-+        //(*item_it).show();
- 
-     }
-     // unlock
diff --git a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch b/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
deleted file mode 100644
index 189a314607bd..000000000000
--- a/srcpkgs/fluxbox/patches/tremor_graboid_hell.patch
+++ /dev/null
@@ -1,350 +0,0 @@
-diff --git a/src/FbTk/EventManager.cc b/src/FbTk/EventManager.cc
-index 3df56de5..501766cc 100644
---- a/src/FbTk/EventManager.cc
-+++ b/src/FbTk/EventManager.cc
-@@ -194,23 +194,22 @@ void EventManager::dispatch(Window win, XEvent &ev, bool parent) {
- 
-     // find out which window is the parent and
-     // dispatch event
--    Window root, parent_win, *children = 0;
--    unsigned int num_children;
--    if (XQueryTree(FbTk::App::instance()->display(), win,
--                   &root, &parent_win, &children, &num_children) != 0) {
--        if (children != 0)
--            XFree(children);
--
--        if (parent_win != 0 &&
--            parent_win != root) {
--            if (m_parent[parent_win] == 0)
--                return;
--
--            // dispatch event to parent
--            dispatch(parent_win, ev, true);
--        }
--    }
--
-+//    Window root, parent_win, *children = 0;
-+//    unsigned int num_children;
-+//    if (XQueryTree(FbTk::App::instance()->display(), win,
-+//                   &root, &parent_win, &children, &num_children) != 0) {
-+//        if (children != 0)
-+//            XFree(children);
-+//
-+//        if (parent_win != 0 &&
-+//            parent_win != root) {
-+//            if (m_parent[parent_win] == 0)
-+//                return;
-+//
-+//            // dispatch event to parent
-+//            dispatch(parent_win, ev, true);
-+//        }
-+//    }
- }
- 
- } // end namespace FbTk
-diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc
-index 73f2ea06..cf863021 100644
---- a/src/FbTk/KeyUtil.cc
-+++ b/src/FbTk/KeyUtil.cc
-@@ -141,13 +141,14 @@ void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win,
-     const unsigned int scrollmod = instance().scrolllock();
- 
-     // Grab with numlock, capslock and scrlock
--    for (int i = 0; i < 8; i++) {
--        XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
--                    (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
--                    win, False, event_mask, GrabModeSync, GrabModeAsync,
--                    None, cursor);
--    }
--
-+    //for (int i = 0; i < 8; i++) {
-+    //    XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
-+    //                (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
-+    //                win, True, event_mask, GrabModeSync, GrabModeAsync,
-+    //                None, cursor);
-+    //}
-+    XGrabButton(display, button, mod, win, True, event_mask,
-+                GrabModeSync, GrabModeAsync, None, cursor);
- }
- 
- /**
-diff --git a/src/Keys.cc b/src/Keys.cc
-index 86591371..c27037e2 100644
---- a/src/Keys.cc
-+++ b/src/Keys.cc
-@@ -277,7 +277,7 @@ void Keys::grabWindow(Window win) {
-     if (win_it == m_window_map.end())
-         return;
- 
--    m_handler_map[win]->grabButtons();
-+    //m_handler_map[win]->grabButtons();
-     t_key::keylist_t::iterator it = m_keylist->keylist.begin();
-     t_key::keylist_t::iterator it_end = m_keylist->keylist.end();
-     for (; it != it_end; ++it) {
-@@ -586,16 +586,16 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-         isdouble = double_click;
-     }
- 
--    auto resetKeyChain = [&]() {
--        first_key_time = 0;
--        next_key.reset();
--        if (saved_keymode) {
--            setKeyMode(saved_keymode);
--            saved_keymode.reset();
--        }
--    };
--    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
--        resetKeyChain();
-+//    auto resetKeyChain = [&]() {
-+//        first_key_time = 0;
-+//        next_key.reset();
-+//        if (saved_keymode) {
-+//            setKeyMode(saved_keymode);
-+//            saved_keymode.reset();
-+//        }
-+//    };
-+//    if (type == KeyPress && first_key_time && time - first_key_time > 5000)
-+//        resetKeyChain();
- 
-     if (!next_key)
-         next_key = m_keylist;
-@@ -612,29 +612,29 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-         next_key->find(MotionNotify, mods, key, context, false))
-         return true; // if there's a motion action, prevent replay to the client (but do nothing)
- 
--    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
--        if (!saved_keymode) {
--            first_key_time = time;
--            saved_keymode = m_keylist;
--        }
--        next_key = temp_key;
--        setKeyMode(next_key);
--        return true;
--    }
-+//    if (temp_key && !temp_key->keylist.empty()) { // emacs-style
-+//        if (!saved_keymode) {
-+//            first_key_time = time;
-+//            saved_keymode = m_keylist;
-+//        }
-+//        next_key = temp_key;
-+//        setKeyMode(next_key);
-+//        return true;
-+//    }
-+
-     if (!temp_key || temp_key->m_command == 0) {
--        if (type == KeyPress &&
--            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
--            // if we're in the middle of an emacs-style keychain, exit it
--            resetKeyChain();
--        }
-+//        if (type == KeyPress &&
-+//            !FbTk::KeyUtil::instance().keycodeToModmask(key)) {
-+//            // if we're in the middle of an emacs-style keychain, exit it
-+//            resetKeyChain();
-+//        }
-         return false;
-     }
- 
-     // if focus changes, windows will get NotifyWhileGrabbed,
-     // which they tend to ignore
--    if (type == KeyPress) {
-+    if (type == KeyPress)
-         XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
--    }
- 
-     WinClient *old = WindowCmd<void>::client();
-     WindowCmd<void>::setClient(current);
-@@ -650,12 +650,13 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
-     temp_key->m_command->execute();
-     WindowCmd<void>::setClient(old);
- 
--    if (saved_keymode) {
--        if (next_key == m_keylist) // don't reset keymode if command changed it
--            setKeyMode(saved_keymode);
--        saved_keymode.reset();
--    }
--    next_key.reset();
-+//    if (saved_keymode) {
-+//        if (next_key == m_keylist) // don't reset keymode if command changed it
-+//            setKeyMode(saved_keymode);
-+//        saved_keymode.reset();
-+//    }
-+//    next_key.reset();
-+
-     return true;
- }
- 
-@@ -685,15 +686,16 @@ void Keys::reconfigure() {
- }
- 
- void Keys::regrab() {
--    setKeyMode(m_keylist);
-+    //setKeyMode(m_keylist);
- }
- 
- void Keys::keyMode(const string& keyMode) {
--    keyspace_t::iterator it = m_map.find(keyMode + ":");
--    if (it == m_map.end())
-+    //keyspace_t::iterator it = m_map.find(keyMode + ":");
-+    //if (it == m_map.end())
-+    //    setKeyMode(m_map["default:"]);
-+    //else
-+    //    setKeyMode(it->second);
-         setKeyMode(m_map["default:"]);
--    else
--        setKeyMode(it->second);
- }
- 
- void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
-@@ -701,10 +703,10 @@ void Keys::setKeyMode(const FbTk::RefCount<t_key> &keyMode) {
-     ungrabButtons();
- 
-     // notify handlers that their buttons have been ungrabbed
--    HandlerMap::iterator h_it = m_handler_map.begin(),
--                         h_it_end  = m_handler_map.end();
--    for (; h_it != h_it_end; ++h_it)
--        h_it->second->grabButtons();
-+    //HandlerMap::iterator h_it = m_handler_map.begin(),
-+    //                     h_it_end  = m_handler_map.end();
-+    //for (; h_it != h_it_end; ++h_it)
-+    //    h_it->second->grabButtons();
- 
-     t_key::keylist_t::iterator it = keyMode->keylist.begin();
-     t_key::keylist_t::iterator it_end = keyMode->keylist.end();
-diff --git a/src/Window.cc b/src/Window.cc
-index 342e4885..457c30c6 100644
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -1133,13 +1133,25 @@ void FluxboxWindow::updateSizeHints() {
- }
- 
- void FluxboxWindow::grabButtons() {
--
-+//NOGRAB
-+    //if (m_client->window() != frame().window().window() ) return;
-     // needed for click to focus
--    XGrabButton(display, Button1, AnyModifier,
--                frame().window().window(), True, ButtonPressMask,
--                GrabModeSync, GrabModeSync, None, None);
--    XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
--                  frame().window().window());
-+    // grabbing async here breaks mouse1
-+    //XGrabButton(display, Button1, AnyModifier,
-+    //            frame().window().window(), True, ButtonPressMask,
-+    //            GrabModeSync, GrabModeSync, None, None);
-+    //            //GrabModeAsync, GrabModeAsync, None, None);
-+    //XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask,
-+    //              frame().window().window());
-+    //XGrabPointer(display,
-+    //             frame().window().window(),
-+    //             True,
-+    //             ButtonPressMask,
-+    //             GrabModeAsync, GrabModeAsync,
-+    //             None,
-+    //             None,
-+    //             CurrentTime);
-+    //XUngrabPointer(display, CurrentTime);
- }
- 
- 
-@@ -2429,63 +2441,41 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
-     m_last_pressed_button = be.button;
- 
-     FbTk::Menu::hideShownMenu();
--
-+//FIX ALLOW
-     Keys *k = Fluxbox::instance()->keys();
-     int context = 0;
-     context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);
-     if (!context && be.subwindow)
-         context = frame().getContext(be.window);
- 
--    if (k->doAction(be.type, be.state, be.button, context, &winClient(), be.time)) {
--        XAllowEvents(display, SyncPointer, CurrentTime);
--        return;
--    }
--
--    WinClient *client = 0;
--    if (!screen().focusControl().isMouseTabFocus()) {
--        // determine if we're in a label button (tab)
--        client = winClientOfLabelButtonWindow(be.window);
--    }
--
--
--    // - refeed the event into the queue so the app or titlebar subwindow gets it
--    if (be.subwindow)
--        XAllowEvents(display, ReplayPointer, CurrentTime);
--    else
--        XAllowEvents(display, SyncPointer, CurrentTime);
--
--    // if nothing was bound via keys-file then
--    // - raise() if clickRaise is enabled
--    // - hide open menues
--    // - focus on clickFocus
--    if (frame().window().window() == be.window) {
--        if (screen().clickRaises())
--            raise();
--
--        m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
--        m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
--    }
--
--    if (!m_focused && acceptsFocus() && m_click_focus)
--        focus();
--
--    if (!screen().focusControl().isMouseTabFocus() &&
--        client && client != m_client &&
--        !screen().focusControl().isIgnored(be.x_root, be.y_root) ) {
--        setCurrentClient(*client, isFocused());
--    }
--
--
--
-+std::cout << "button window: " << be.window << "\nbutton subwindow: " << be.subwindow << "\n";
-+k->doAction(be.type, be.state, be.button, context, &winClient(), CurrentTime); // w/o this, no mouse cmds
-+XAllowEvents(display, ReplayPointer, CurrentTime); // w/o this, no mouse
-+// ultimately none of the below matters
-+    // infinite loop
-+    //if (be.subwindow) {
-+    //  //XEvent omfg = (XEvent *)&be;
-+    //  //be.window = be.subwindow;
-+    //  //be.subwindow = 0;
-+    //  int huh = XSendEvent(display, be.window, False, ButtonPressMask, (XEvent*)&be);
-+    //  std::cout << "xsendevent: " << huh << "\n";
-+    //}
-+    //XSync(display, 0);
-+    //int wtf = XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
-+    //std::cout << "xallowevents: " << wtf << "\n";
-+    //XSync(display, 0);
-+    //XAllowEvents(display, ReplayPointer, be.time); // time means squat - works but not for menus
-+    //XAllowEvents(display, SyncPointer, CurrentTime); // sync will not doubleclick or act proper
-+    //XAllowEvents(display, AsyncPointer, CurrentTime); // ^^ same
-+    //if (be.subwindow)
-+    //  XFlush(display);
-+    //  //XSync(display, True);
- }
- 
- const unsigned int DEADZONE = 4;
- 
- void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
- 
--    if (m_last_pressed_button == static_cast<int>(re.button)) {
--        m_last_pressed_button = 0;
--    }
- 
-     if (isMoving())
-         stopMoving();
-@@ -2502,6 +2492,13 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
- 
-         Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button,
-                                               context, &winClient(), re.time);
-+      // syncs dont make a difference?
-+      //XSync(display, 0);
-+      XAllowEvents(display, ReplayPointer, CurrentTime); // time means squat - works but not for menus
-+      //XSync(display, 0);
-+    }
-+    if (m_last_pressed_button == static_cast<int>(re.button)) {
-+        m_last_pressed_button = 0;
-     }
- }
- 
diff --git a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch b/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
deleted file mode 100644
index 36c572cea4ff..000000000000
--- a/srcpkgs/fluxbox/patches/unclutter_fix_workspacecmd.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
-index c2e49485..9b4058c8 100644
---- a/src/WorkspaceCmd.cc
-+++ b/src/WorkspaceCmd.cc
-@@ -521,22 +521,24 @@ void ArrangeWindowsCmd::execute() {
-     const unsigned int cal_width = max_width/cols; // width ratio (width of every window)
-     const unsigned int cal_height = max_height/rows; // height ratio (height of every window)
-
-+    int cell_center_x = 0, cell_center_y = 0, win_center_x = 0, win_center_y = 0, x = 0, y = 0;
-+    unsigned int closest_dist = ~0, dist = 0, w = 0, h = 0;
-     // Resizes and sets windows positions in columns and rows.
-     for (i = 0; i < rows; ++i) {
-         x_offs = orig_x_offs;
-         for (j = 0; j < cols && !normal_windows.empty(); ++j) {
-
-
--            int cell_center_x = x_offs + (x_offs + cal_width) / 2;
--            int cell_center_y = y_offs + (y_offs + cal_height) / 2;
--            unsigned int closest_dist = ~0;
-+            cell_center_x = x_offs + (x_offs + cal_width) / 2;
-+            cell_center_y = y_offs + (y_offs + cal_height) / 2;
-+            int closest_dist = ~0;
-
-             Workspace::Windows::iterator closest = normal_windows.end();
-             for (win = normal_windows.begin(); win != normal_windows.end(); ++win) {
-
--                int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
--                int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
--                unsigned int dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
-+                win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2);
-+                win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2);
-+                dist = (win_center_x - cell_center_x) * (win_center_x - cell_center_x) +
-                                     (win_center_y - cell_center_y) * (win_center_y - cell_center_y);
-
-                 if (dist < closest_dist) {
-@@ -545,10 +547,10 @@ void ArrangeWindowsCmd::execute() {
-                 }
-             }
-
--            int x = x_offs + (*closest)->xOffset();
--            int y = y_offs + (*closest)->yOffset();
--            unsigned int w = cal_width - (*closest)->widthOffset();
--            unsigned int h = cal_height - (*closest)->heightOffset();
-+            x = x_offs + (*closest)->xOffset();
-+            y = y_offs + (*closest)->yOffset();
-+            w = cal_width - (*closest)->widthOffset();
-+            h = cal_height - (*closest)->heightOffset();
-
-             // the last window gets everything that is left.
-             if (normal_windows.size() == 1) {
-@@ -620,12 +622,9 @@ void UnclutterCmd::execute() {
-         return;
-
-     // place
--    MinOverlapPlacement mopp;
-     int x, y;
--    for (win = placed_windows.begin(); win != placed_windows.end(); ++win) {
--        mopp.placeWindow(**win, head, x, y);
--        (*win)->move(x, y);
--    }
-+    for (win = placed_windows.begin(); win != placed_windows.end(); ++win)
-+        (*win)->placeWindow((*win)->getOnHead());
- }
-
- REGISTER_COMMAND(showdesktop, ShowDesktopCmd, void);
diff --git a/srcpkgs/fluxbox/patches/zor_loops.patch b/srcpkgs/fluxbox/patches/zor_loops.patch
deleted file mode 100644
index 95d992f9071d..000000000000
--- a/srcpkgs/fluxbox/patches/zor_loops.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-diff --git a/src/FbTk/STLUtil.hh b/src/FbTk/STLUtil.hh
-index abc54729..9c9c27f9 100644
---- a/src/FbTk/STLUtil.hh
-+++ b/src/FbTk/STLUtil.hh
-@@ -48,46 +48,63 @@ struct IfThenElse<false, Ta, Tb> {
- /// calls delete on each item in the container and then clears the container
- template <typename A>
- void destroyAndClear(A &a) {
--    typedef typename A::iterator iterator;
--    iterator it = a.begin();
--    iterator it_end = a.end();
--    for (; it != it_end; ++it)
--        delete (*it);
-+    //typedef typename A::iterator iterator;
-+    //iterator it = a.begin();
-+    //iterator it_end = a.end();
-+    //for (; it != it_end; ++it)
-+    //    delete (*it);
- 
-+    //a.clear();
-+    typedef typename A::iterator iterator;
-+    for (auto it : a)
-+        delete it;
-     a.clear();
- }
- 
- /// calls delete on each item value in the map and then clears the map
- template <typename A>
- void destroyAndClearSecond(A &a) {
-+    //typedef typename A::iterator iterator;
-+    //iterator it = a.begin();
-+    //iterator it_end = a.end();
-+    //for (; it != it_end; ++it)
-+    //    delete it->second;
-+    //a.clear();
-     typedef typename A::iterator iterator;
--    iterator it = a.begin();
--    iterator it_end = a.end();
--    for (; it != it_end; ++it)
--        delete it->second;
-+    for (auto it : a)
-+        delete it.second;
-     a.clear();
- }
- 
- 
- template <typename C, typename F>
- F forAll(C& c, F f) {
-+    //typedef typename C::iterator iterator;
-+    //iterator i = c.begin();
-+    //iterator e = c.end();
-+    //for (; i != e; i++) {
-+    //    f(*i);
-+    //}
-     typedef typename C::iterator iterator;
--    iterator i = c.begin();
--    iterator e = c.end();
--    for (; i != e; i++) {
--        f(*i);
--    }
-+    for (auto i : c)
-+        f(i);
-     return f;
- }
- 
- template <typename C, typename I, typename F>
- F forAllIf(C& c, I i, F f) {
-+    //typedef typename C::iterator iterator;
-+    //iterator it = c.begin();
-+    //iterator end = c.end();
-+    //for (; it != end; ++it) {
-+    //    if (i(*it))
-+    //        f(*it);
-+    //}
-+    //return f;
-     typedef typename C::iterator iterator;
--    iterator it = c.begin();
--    iterator end = c.end();
--    for (; it != end; ++it) {
--        if (i(*it))
--            f(*it);
-+    for (auto it : c) {
-+        if (i(it))
-+            f(it);
-     }
-     return f;
- }
diff --git a/srcpkgs/fluxbox/template b/srcpkgs/fluxbox/template
index 6b0e4cd260cb..e10b426c4924 100644
--- a/srcpkgs/fluxbox/template
+++ b/srcpkgs/fluxbox/template
@@ -1,56 +1,29 @@
 # Template file for 'fluxbox'
 pkgname=fluxbox
-version=1.3.8
-#nostrip=nostrip
-_commit=e2cbd179ecb2ef2d76e0ad1fde84b44325305799
-revision=0
-wrksrc=fluxbox-${_commit}
+version=1.3.7
+revision=4
 build_style=gnu-configure
-configure_args="--disable-nls --disable-xinerama --disable-shape --disable-xrender
- --disable-fribidi --disable-slit
+configure_args="--enable-nls
  ac_cv_lib_X11_XOpenDisplay=yes ac_cv_lib_Xft_XftFontOpen=yes
  ac_cv_lib_Xrender_XRenderCreatePicture=yes ac_cv_lib_Xpm_XpmReadFileToPixmap=yes
- ac_cv_lib_Xext_XShapeCombineShape=no
+ ac_cv_lib_Xinerama_XineramaQueryScreens=yes ac_cv_lib_Xext_XShapeCombineShape=yes
  ac_cv_lib_Xrandr_XRRQueryExtension=yes ac_cv_lib_fribidi_fribidi_version_info=yes"
-hostmakedepends="pkg-config automake libtool gettext gettext-devel clang llvm"
+hostmakedepends="pkg-config automake libtool gettext gettext-devel"
 makedepends="libSM-devel libXrender-devel libXft-devel libXpm-devel imlib2-devel
- libXext-devel libXrandr-devel fribidi-devel"
+ libXext-devel libXinerama-devel libXrandr-devel fribidi-devel"
 short_desc="Highly configurable and low resource X11 Window manager"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="http://www.fluxbox.org"
-distfiles="https://github.com/fluxbox/fluxbox/archive/${_commit}.tar.gz"
-checksum=6740d9cd4a3e631e0130cbcbc91ccac6af6335dc120f9adc5ebbc8dc9d3259a0
-
-nopie=yes
-X11_FLAGS="-Os -pipe"
-#FRIBIDI_CFLAGS="-Os -pipe"
-XRANDR_CFLAGS="-Os -pipe"
-AM_CPPFLAGS="-Os -pipe"
-CFLAGS="-Os -pipe"
-CXXFLAGS="-Os -pipe -std=c++11"
-CC="clang"
-CXX="clang++"
-HOST_CC=clang
-HOST_CXX=clang++
+distfiles="https://github.com/fluxbox/fluxbox/archive/refs/tags/Release-${version//./_}.tar.gz"
+checksum=990414ae342a35c5703e5025a8bf019b0b4dada55d57071c51d3d498abb5cd36
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) configure_args="${configure_args/enable-nls/disable-nls}" ;;
 esac
 
 pre_configure() {
-  export X11_FLAGS="-Os -pipe"
-  # export FRIBIDI_CFLAGS="-Os -pipe"
-  export XRANDR_CFLAGS="-Os -pipe"
-  export AM_CPPFLAGS="-Os -pipe"
-  export CFLAGS="-Os -pipe"
-  export CXXFLAGS="-Os -pipe -std=c++11"
-  export CC="clang"
-  export CXX="clang++"
-  export HOST_CC=clang
-  export HOST_CXX=clang++
-  export PREFIX=/usr
-  ./autogen.sh
+	./autogen.sh
 }
 
 post_install() {
diff --git a/srcpkgs/freerdp/template b/srcpkgs/freerdp/template
index 53e67690f863..1b50e9a86bb2 100644
--- a/srcpkgs/freerdp/template
+++ b/srcpkgs/freerdp/template
@@ -1,7 +1,7 @@
 # Template file for 'freerdp'
 pkgname=freerdp
 version=2.9.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_ALSA=ON -DWITH_CUPS=OFF -DWITH_FFMPEG=ON
  -DWITH_GSTREAMER_0_10=OFF -DWITH_GSTREAMER_1_0=OFF -DWITH_JPEG=ON
diff --git a/srcpkgs/gerbera/template b/srcpkgs/gerbera/template
index ae14f35c767c..2dc0ac0ce03b 100644
--- a/srcpkgs/gerbera/template
+++ b/srcpkgs/gerbera/template
@@ -1,7 +1,7 @@
 # Template file for 'gerbera'
 pkgname=gerbera
 version=1.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_SYSTEMD=0 -DWITH_AVCODEC=1"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-1.patch b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
new file mode 100644
index 000000000000..7cfc98ada368
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
@@ -0,0 +1,232 @@
+From 03bbe01b79a1f07a6780cb60f23a087104c5d77b Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 30 Mar 2018 22:53:24 +0300
+Subject: [PATCH] Fix warnings while compile with FFMpeg 3.4.2 (issue #978)
+
+---
+ ffmpegaudio.cc | 68 +++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 62 insertions(+), 6 deletions(-)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index ed1172bdd..56e8f788e 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -91,6 +91,7 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++  AVCodec * codec_;
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
+@@ -114,6 +115,7 @@ DecoderContext::DecoderContext( QByteArray const & audioData, QAtomicInt & isCan
+   audioData_( audioData ),
+   audioDataStream_( audioData_ ),
+   formatContext_( NULL ),
++  codec_( NULL ),
+   codecContext_( NULL ),
+   avioContext_( NULL ),
+   audioStream_( NULL ),
+@@ -143,7 +145,11 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 56 || ( LIBAVCODEC_VERSION_MAJOR == 56 && LIBAVCODEC_VERSION_MINOR < 56 )
+   unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
++#else
++  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
++#endif
+   if ( !avioBuffer )
+   {
+     errorString = QObject::tr( "av_malloc() failed." );
+@@ -186,7 +192,11 @@ bool DecoderContext::openCodec( QString & errorString )
+   // Find audio stream, use the first audio stream if available
+   for ( unsigned i = 0; i < formatContext_->nb_streams; i++ )
+   {
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+     if ( formatContext_->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO )
++#else
++      if ( formatContext_->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO )
++#endif
+     {
+       audioStream_ = formatContext_->streams[i];
+       break;
+@@ -198,22 +208,38 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+   codecContext_ = audioStream_->codec;
+-  AVCodec * codec = avcodec_find_decoder( codecContext_->codec_id );
+-  if ( !codec )
++  codec_ = avcodec_find_decoder( codecContext_->codec_id );
++  if ( !codec_ )
+   {
+     errorString = QObject::tr( "Codec [id: %1] not found." ).arg( codecContext_->codec_id );
+     return false;
+   }
++#else
++  codec_ = avcodec_find_decoder( audioStream_->codecpar->codec_id );
++  if ( !codec_ )
++  {
++    errorString = QObject::tr( "Codec [id: %1] not found." ).arg( audioStream_->codecpar->codec_id );
++    return false;
++  }
++  codecContext_ = avcodec_alloc_context3( codec_ );
++  if ( !codecContext_ )
++  {
++    errorString = QObject::tr( "avcodec_alloc_context3() failed." );
++    return false;
++  }
++  avcodec_parameters_to_context( codecContext_, audioStream_->codecpar );
++#endif
+
+-  ret = avcodec_open2( codecContext_, codec, NULL );
++  ret = avcodec_open2( codecContext_, codec_, NULL );
+   if ( ret < 0 )
+   {
+     errorString = QObject::tr( "avcodec_open2() failed: %1." ).arg( avErrorString( ret ) );
+     return false;
+   }
+
+-  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec->long_name,
++  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec_->long_name,
+           codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
+   return true;
+ }
+@@ -252,10 +278,13 @@ void DecoderContext::closeCodec()
+
+   // Closing a codec context without prior avcodec_open2() will result in
+   // a crash in ffmpeg
+-  if ( audioStream_ && audioStream_->codec && audioStream_->codec->codec )
++  if ( audioStream_ && codecContext_ && codec_ )
+   {
+     audioStream_->discard = AVDISCARD_ALL;
+-    avcodec_close( audioStream_->codec );
++    avcodec_close( codecContext_ );
++#if LIBAVCODEC_VERSION_MAJOR > 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR >= 33 )
++    avcodec_free_context( &codecContext_ );
++#endif
+   }
+
+   avformat_close_input( &formatContext_ );
+@@ -356,6 +385,7 @@ bool DecoderContext::play( QString & errorString )
+     if ( packet.stream_index == audioStream_->index )
+     {
+       AVPacket pack = packet;
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+       int gotFrame = 0;
+       do
+       {
+@@ -370,6 +400,19 @@ bool DecoderContext::play( QString & errorString )
+         pack.data += len;
+       }
+       while( pack.size > 0 );
++#else
++      int ret = avcodec_send_packet( codecContext_, &pack );
++      /* read all the output frames (in general there may be any number of them) */
++      while( ret >= 0 )
++      {
++        ret = avcodec_receive_frame( codecContext_, frame);
++
++        if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++          break;
++
++        playFrame( frame );
++      }
++#endif
+     }
+     // av_free_packet() must be called after each call to av_read_frame()
+ #if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 )
+@@ -379,6 +422,7 @@ bool DecoderContext::play( QString & errorString )
+ #endif
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
+        codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+   {
+@@ -391,6 +435,18 @@ bool DecoderContext::play( QString & errorString )
+       playFrame( frame );
+     }
+   }
++#else
++  /* flush the decoder */
++  av_init_packet( &packet );
++  int ret = avcodec_send_packet(codecContext_, &packet );
++  while( ret >= 0 )
++  {
++    ret = avcodec_receive_frame(codecContext_, frame);
++    if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++      break;
++    playFrame( frame );
++  }
++#endif
+
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+   av_free( frame );
+32
+srcpkgs/goldendict/patches/ffmpeg5-2.patch
+Comment on this file
+@@ -0,0 +1,32 @@
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
+25
+srcpkgs/goldendict/patches/ffmpeg5-3.patch
+Comment on this file
+@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-2.patch b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
new file mode 100644
index 000000000000..9c477b0c1347
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
@@ -0,0 +1,33 @@
+
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-3.patch b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
new file mode 100644
index 000000000000..72101903d1d1
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/template b/srcpkgs/goldendict/template
index f41b5b2c6899..4544ae710ee6 100644
--- a/srcpkgs/goldendict/template
+++ b/srcpkgs/goldendict/template
@@ -1,7 +1,7 @@
 # Template file for 'goldendict'
 pkgname=goldendict
 version=1.5.0RC2
-revision=5
+revision=6
 build_style=qmake
 configure_args="CONFIG+=zim_support"
 hostmakedepends="qt5-qmake pkg-config qt5-host-tools"
diff --git a/srcpkgs/gst-libav/template b/srcpkgs/gst-libav/template
index e9a79dc650a5..f082bd211c65 100644
--- a/srcpkgs/gst-libav/template
+++ b/srcpkgs/gst-libav/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-libav'
 pkgname=gst-libav
 version=1.20.3
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config yasm"
 makedepends="orc-devel gst-plugins-base1-devel ffmpeg-devel"
diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index bb9c4d87f4c6..f55f82fd4c77 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.20.3
-revision=2
+revision=3
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled
diff --git a/srcpkgs/gst-rtsp-server/template b/srcpkgs/gst-rtsp-server/template
index 33cd64ceb95e..8ceea8d34b4b 100644
--- a/srcpkgs/gst-rtsp-server/template
+++ b/srcpkgs/gst-rtsp-server/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-rtsp-server'
 pkgname=gst-rtsp-server
 version=1.20.3
-revision=2
+revision=3
 build_style=meson
 hostmakedepends="pkg-config python3"
 makedepends="glib-devel gst-plugins-bad1-devel gobject-introspection
diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 6a50567f53a9..6976aee84817 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
 # Template file for 'gtk4'
 pkgname=gtk4
 version=4.10.1
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dman-pages=true -Dgtk_doc=true
diff --git a/srcpkgs/guvcview/template b/srcpkgs/guvcview/template
index 345cf6006f24..d42fd38fa4ad 100644
--- a/srcpkgs/guvcview/template
+++ b/srcpkgs/guvcview/template
@@ -1,7 +1,7 @@
 # Template file for 'guvcview'
 pkgname=guvcview
 version=2.0.7
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-static --disable-debian-menu"
diff --git a/srcpkgs/handbrake/template b/srcpkgs/handbrake/template
index ca5e4571e49c..188a79f2bf5c 100644
--- a/srcpkgs/handbrake/template
+++ b/srcpkgs/handbrake/template
@@ -1,7 +1,7 @@
 # Template file for 'handbrake'
 pkgname=handbrake
 version=1.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--force --disable-gtk-update-checks --disable-df-fetch --harden
  $(vopt_enable fdk_aac fdk-aac) $(vopt_enable nvenc)"
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index 419f29b98b44..a343b3172a72 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,7 +1,7 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
  -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
diff --git a/srcpkgs/idjc/template b/srcpkgs/idjc/template
index df60318b3db9..b205e74745fe 100644
--- a/srcpkgs/idjc/template
+++ b/srcpkgs/idjc/template
@@ -1,7 +1,7 @@
 # Template file for 'idjc'
 pkgname=idjc
 version=0.9.1
-revision=3
+revision=4
 build_style=gnu-configure
 hostmakedepends="pkg-config git python3 automake gettext-devel libtool"
 makedepends="libvorbis-devel libogg-devel jack-devel libsamplerate-devel
diff --git a/srcpkgs/kfilemetadata5/template b/srcpkgs/kfilemetadata5/template
index 83f4d583bcb7..b90ef056a196 100644
--- a/srcpkgs/kfilemetadata5/template
+++ b/srcpkgs/kfilemetadata5/template
@@ -1,7 +1,7 @@
 # Template file for 'kfilemetadata5'
 pkgname=kfilemetadata5
 version=5.103.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="kcoreaddons extra-cmake-modules pkg-config qt5-host-tools qt5-qmake
  gettext kcoreaddons python3"
diff --git a/srcpkgs/kid3/template b/srcpkgs/kid3/template
index 456206d90e16..f32f9decb0e7 100644
--- a/srcpkgs/kid3/template
+++ b/srcpkgs/kid3/template
@@ -1,7 +1,7 @@
 # Template file for 'kid3'
 pkgname=kid3
 version=3.9.1
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DWITH_APPS='CLI;$(vopt_if KDE KDE Qt)'
  -DWITH_DOCBOOKDIR=/usr/share/xsl/docbook -DWITH_FLAC=$(vopt_if flac ON OFF)
diff --git a/srcpkgs/kodi/template b/srcpkgs/kodi/template
index 8057964d78a3..991325f6c477 100644
--- a/srcpkgs/kodi/template
+++ b/srcpkgs/kodi/template
@@ -1,7 +1,7 @@
 # Template file for 'kodi'
 pkgname=kodi
 version=19.4
-revision=6
+revision=7
 _codename="Matrix"
 build_style=cmake
 configure_args="-DWITH_FFMPEG=/usr -DENABLE_LDGOLD=OFF
diff --git a/srcpkgs/kpipewire/template b/srcpkgs/kpipewire/template
index 1d1e963f296d..07cdc0c7384a 100644
--- a/srcpkgs/kpipewire/template
+++ b/srcpkgs/kpipewire/template
@@ -1,7 +1,7 @@
 # Template file for 'kpipewire'
 pkgname=kpipewire
 version=5.27.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules plasma-wayland-protocols gettext
  qt5-qmake qt5-host-tools pkg-config wayland-devel kcoreaddons
diff --git a/srcpkgs/libavresample b/srcpkgs/libavresample
index 887f354e7c6b..a9f1eea092d5 120000
--- a/srcpkgs/libavresample
+++ b/srcpkgs/libavresample
@@ -1 +1 @@
-ffmpeg4
\ No newline at end of file
+ffmpeg
\ No newline at end of file
diff --git a/srcpkgs/libextractor/template b/srcpkgs/libextractor/template
index 29d5b8df01f8..ddd4790f93e8 100644
--- a/srcpkgs/libextractor/template
+++ b/srcpkgs/libextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'libextractor'
 pkgname=libextractor
 version=1.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/libopenal/template b/srcpkgs/libopenal/template
index 77218f9e539d..3f49ed75a1fd 100644
--- a/srcpkgs/libopenal/template
+++ b/srcpkgs/libopenal/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenal'
 pkgname=libopenal
 version=1.22.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DALSOFT_EXAMPLES=OFF"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template
index db831f69b474..81aa0d7136d9 100644
--- a/srcpkgs/libopenshot/template
+++ b/srcpkgs/libopenshot/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenshot'
 pkgname=libopenshot
 version=0.3.0
-revision=1
+revision=2
 build_style=cmake
 # Builds fail with Ruby-2.4.1
 configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON"
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index da4f2d56e94c..4d6bf29efb4f 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
diff --git a/srcpkgs/mediastreamer/template b/srcpkgs/mediastreamer/template
index d0e97e858e29..d29210c1bf9c 100644
--- a/srcpkgs/mediastreamer/template
+++ b/srcpkgs/mediastreamer/template
@@ -1,7 +1,7 @@
 # Template file for 'mediastreamer'
 pkgname=mediastreamer
 version=5.2.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_STRICT=0 -DENABLE_UNIT_TESTS=0"
 hostmakedepends="python3"
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index bdeb22b13aaa..d9ff0b2ff23d 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,13 +1,12 @@
 # Template file for 'mesa'
 pkgname=mesa
-version=23.0.0
+version=22.3.5
 revision=1
-#wrksrc="Mesa-dg2-20230125"
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
  -Dlmsensors=enabled -Dplatforms=x11$(vopt_if wayland ,wayland)
- -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++17"
+ -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++14"
 hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
@@ -23,23 +22,11 @@ license="MIT, LGPL-2.1-or-later"
 homepage="https://www.mesa3d.org/"
 changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
-checksum=01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4
-# intel dg2 jan 25
-#checksum=4ec8ec65dbdb1ee9444dba72970890128a19543a58cf05931bd6f54f124e117f
-#checksum=37a1ddaf03f41919ee3c89c97cff41e87de96e00e9d3247959cc8279d8294593
-#distfiles="https://github.com/intel-gpu/Mesa/archive/refs/tags/dg2-20230125.tar.gz"
-#checksum=22203186779222ec5244ecb74fbae706d3557588c82089b18c7bf77a54799a59
+checksum=3eed2ecae2bc674494566faab9fcc9beb21cd804c7ba2b59a1694f3d7236e6a9
 
 build_options="wayland"
 build_options_default="wayland"
 
-export CC=clang
-export CXX=clang++
-
-if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	configure_args+=" -Duse-elf-tls=false"
-fi
-
 # only use llvmpipe on targets where it's supported and reliable
 # especially on big endian it's all kinds of broken, and e.g. on
 # 32-bit powerpc it does not work at all, so fall back to softpipe
@@ -104,7 +91,7 @@ fi
 if [ "$_have_intel" ]; then
 	_have_vulkan=yes
 	_gallium_drivers+=",crocus,iris,i915"
-	_vulkan_drivers+=",intel"
+	_vulkan_drivers+=",intel,intel_hasvk"
 	subpackages+=" mesa-vulkan-intel"
 	# transitional dummy packages
 	subpackages+=" mesa-intel-dri"
@@ -153,10 +140,10 @@ fi
 
 # enabled currently by amd drivers
 if [ "$_have_opencl" ]; then
-	hostmakedepends+=" clang"
-	makedepends+=" clang libclc"
+	hostmakedepends+=" clang rust rust-bindgen"
+	makedepends+=" clang libclc rust SPIRV-LLVM-Translator-devel SPIRV-Tools-devel"
 	subpackages+=" mesa-opencl"
-	configure_args+=" -Dgallium-opencl=icd"
+	configure_args+=" -Dgallium-opencl=icd -Dgallium-rusticl=true -Drust_std=2021"
 fi
 
 if [ "$_have_hwdec" ]; then
@@ -200,6 +187,7 @@ esac
 post_configure() {
 	if [ "$CROSS_BUILD" ]; then
 		find -iname "*.ninja" -exec sed -i "{}" \
+			-e "/rustc/s; --sysroot ${XBPS_CROSS_BASE}/usr;;g" \
 			-e "s; /usr/lib/; ${XBPS_CROSS_BASE}/usr/lib/;g" \
 			-e "s;-L/usr/lib;-L${XBPS_CROSS_BASE}/usr/lib;g" \
 			-e "s;-I/usr/include;-I${XBPS_CROSS_BASE}/usr/include;g" \
@@ -298,6 +286,7 @@ MesaLib-devel_package() {
 		fi
 		if [ "$_have_opencl" ]; then
 			vmove usr/lib/libMesaOpenCL.so
+			vmove usr/lib/libRusticlOpenCL.so
 		fi
 	}
 }
@@ -316,6 +305,7 @@ mesa-opencl_package() {
 		vmove etc/OpenCL
 		vmove usr/lib/gallium-pipe
 		vmove "usr/lib/libMesaOpenCL.so.*"
+		vmove "usr/lib/libRusticlOpenCL.so.*"
 	}
 }
 
@@ -346,14 +336,15 @@ mesa-vdpau_package() {
 mesa-vulkan-intel_package() {
 	short_desc="Mesa Intel Vulkan driver"
 	pkg_install() {
-		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
-		vmove "usr/lib/libvulkan_intel.so"
+		vmove "usr/share/vulkan/icd.d/intel*.json"
+		vmove "usr/lib/libvulkan_intel*.so"
 	}
 }
 
 mesa-vulkan-radeon_package() {
 	short_desc="Mesa Radeon Vulkan driver"
 	pkg_install() {
+		vmove "usr/share/drirc.d/00-radv-defaults.conf"
 		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
 		vmove "usr/lib/libvulkan_radeon.so"
 	}
diff --git a/srcpkgs/mgba/patches/ffmpeg5.patch b/srcpkgs/mgba/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..ad7049efcac3
--- /dev/null
+++ b/srcpkgs/mgba/patches/ffmpeg5.patch
@@ -0,0 +1,117 @@
+From cdc753516798882a805db1d2042dbce8313382bf Mon Sep 17 00:00:00 2001
+From: Ryan Tandy <ryan@nardis.ca>
+Date: Thu, 3 Feb 2022 19:02:52 -0800
+Subject: [PATCH] FFmpeg: Support FFmpeg 5.0
+
+---
+ src/feature/ffmpeg/ffmpeg-decoder.c |  3 ++-
+ src/feature/ffmpeg/ffmpeg-encoder.c | 25 ++++++++++++++-----------
+ 2 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/src/feature/ffmpeg/ffmpeg-decoder.c b/src/feature/ffmpeg/ffmpeg-decoder.c
+index c3bb6d1c5c..daa47fbf2c 100644
+--- a/src/feature/ffmpeg/ffmpeg-decoder.c
++++ b/src/feature/ffmpeg/ffmpeg-decoder.c
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ #include "ffmpeg-decoder.h"
+
++#include <libavcodec/avcodec.h>
+ #include <libswscale/swscale.h>
+
+ void FFmpegDecoderInit(struct FFmpegDecoder* decoder) {
+@@ -38,7 +39,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) {
+ #else
+ 		enum AVMediaType type = decoder->context->streams[i]->codec->codec_type;
+ #endif
+-		struct AVCodec* codec;
++		const struct AVCodec* codec;
+ 		struct AVCodecContext* context = NULL;
+ 		if (type == AVMEDIA_TYPE_VIDEO && decoder->videoStream < 0) {
+ 			decoder->video = avcodec_alloc_context3(NULL);
+diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c
+index ad76ca57b2..be6bd3af5e 100644
+--- a/src/feature/ffmpeg/ffmpeg-encoder.c
++++ b/src/feature/ffmpeg/ffmpeg-encoder.c
+@@ -12,6 +12,9 @@
+
+ #include <libavcodec/version.h>
+ #include <libavcodec/avcodec.h>
++#if LIBAVCODEC_VERSION_MAJOR >= 58
++#include <libavcodec/bsf.h>
++#endif
+
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+@@ -121,7 +124,7 @@ bool FFmpegEncoderSetAudio(struct FFmpegEncoder* encoder, const char* acodec, un
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(acodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(acodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -193,7 +196,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -213,7 +216,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 	if (encoder->pixFormat == AV_PIX_FMT_NONE) {
+ 		return false;
+ 	}
+-	if (vbr < 0 && !av_opt_find(&codec->priv_class, "crf", NULL, 0, 0)) {
++	if (vbr < 0 && !av_opt_find((void*) &codec->priv_class, "crf", NULL, 0, 0)) {
+ 		return false;
+ 	}
+ 	encoder->videoCodec = vcodec;
+@@ -223,7 +226,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ }
+
+ bool FFmpegEncoderSetContainer(struct FFmpegEncoder* encoder, const char* container) {
+-	AVOutputFormat* oformat = av_guess_format(container, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(container, 0, 0);
+ 	if (!oformat) {
+ 		return false;
+ 	}
+@@ -241,9 +244,9 @@ void FFmpegEncoderSetLooping(struct FFmpegEncoder* encoder, bool loop) {
+ }
+
+ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !oformat || (!acodec && !vcodec)) {
+ 		return false;
+ 	}
+@@ -257,8 +260,8 @@ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+ }
+
+ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !FFmpegEncoderVerifyContainer(encoder)) {
+ 		return false;
+ 	}
+@@ -272,9 +275,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+ 	encoder->currentVideoFrame = 0;
+ 	encoder->skipResidue = 0;
+
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+ #ifndef USE_LIBAV
+-	avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile);
++	avformat_alloc_output_context2(&encoder->context, (AVOutputFormat*) oformat, 0, outfile);
+ #else
+ 	encoder->context = avformat_alloc_context();
+ 	strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1);
diff --git a/srcpkgs/mgba/template b/srcpkgs/mgba/template
index 05bca15c1750..f5b6b8464428 100644
--- a/srcpkgs/mgba/template
+++ b/srcpkgs/mgba/template
@@ -1,7 +1,7 @@
 # Template file for 'mgba'
 pkgname=mgba
 version=0.10.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake desktop-file-utils"
 makedepends="SDL2-devel ffmpeg-devel libedit-devel libepoxy-devel libmagick-devel
diff --git a/srcpkgs/minidlna/template b/srcpkgs/minidlna/template
index e8081b1cbc67..9ee9714861fd 100644
--- a/srcpkgs/minidlna/template
+++ b/srcpkgs/minidlna/template
@@ -1,7 +1,7 @@
 # Template file for 'minidlna'
 pkgname=minidlna
 version=1.3.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --sbindir=/usr/bin
diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template
index 619ddca0d332..4b9ea00d3fb3 100644
--- a/srcpkgs/mixxx/template
+++ b/srcpkgs/mixxx/template
@@ -1,7 +1,7 @@
 # Template file for 'mixxx'
 pkgname=mixxx
 version=2.3.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="extra-cmake-modules pkg-config protobuf qt5-host-tools qt5-devel"
diff --git a/srcpkgs/mlt/template b/srcpkgs/mlt/template
index 8933eb4e7bb9..ed6b27503f9a 100644
--- a/srcpkgs/mlt/template
+++ b/srcpkgs/mlt/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt'
 pkgname=mlt
 version=6.26.1
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --libdir=/usr/lib$XBPS_TARGET_WORDSIZE
  --enable-gpl --enable-gpl3 --disable-swfdec --without-kde
diff --git a/srcpkgs/mlt7/template b/srcpkgs/mlt7/template
index e5972cc0411b..d0e9ec02e58a 100644
--- a/srcpkgs/mlt7/template
+++ b/srcpkgs/mlt7/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt7'
 pkgname=mlt7
 version=7.12.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSWIG_PYTHON=ON"
 hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which
diff --git a/srcpkgs/moc/template b/srcpkgs/moc/template
index c42be650a1d2..4b95426599bf 100644
--- a/srcpkgs/moc/template
+++ b/srcpkgs/moc/template
@@ -1,7 +1,7 @@
 # Template file for 'moc'
 pkgname=moc
 version=2.5.2
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg-devel
diff --git a/srcpkgs/motion/template b/srcpkgs/motion/template
index 3cf3c3035c5b..7dca12d851e3 100644
--- a/srcpkgs/motion/template
+++ b/srcpkgs/motion/template
@@ -1,7 +1,7 @@
 # Template file for 'motion'
 pkgname=motion
 version=4.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake pkg-config gettext-devel tar"
 makedepends="ffmpeg-devel libmicrohttpd-devel v4l-utils-devel gettext-devel"
diff --git a/srcpkgs/mpd/template b/srcpkgs/mpd/template
index 63701b7d56b1..df35e751ea60 100644
--- a/srcpkgs/mpd/template
+++ b/srcpkgs/mpd/template
@@ -1,7 +1,7 @@
 # Template file for 'mpd'
 pkgname=mpd
 version=0.23.12
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true
  -Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled
diff --git a/srcpkgs/mpv/template b/srcpkgs/mpv/template
index e163c496c6eb..d4fefbf5e3c7 100644
--- a/srcpkgs/mpv/template
+++ b/srcpkgs/mpv/template
@@ -1,7 +1,7 @@
 # Template file for 'mpv'
 pkgname=mpv
 version=0.35.1
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled
  -Dlibmpv=true -Dcplugins=enabled
diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template
index 4b7930041126..7cd65cf76b77 100644
--- a/srcpkgs/musikcube/template
+++ b/srcpkgs/musikcube/template
@@ -1,7 +1,7 @@
 # Template file for 'musikcube'
 pkgname=musikcube
 version=0.99.4
-revision=1
+revision=2
 build_style=cmake
 make_cmd=make
 configure_args="-DNO_NCURSESW=1"
diff --git a/srcpkgs/notcurses/template b/srcpkgs/notcurses/template
index 6dd8a091319f..3110c30c9aff 100644
--- a/srcpkgs/notcurses/template
+++ b/srcpkgs/notcurses/template
@@ -1,7 +1,7 @@
 # Template file for 'notcurses'
 pkgname=notcurses
 version=3.0.9
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_STATIC=ON $(vopt_bool man USE_PANDOC)"
 hostmakedepends="pkg-config $(vopt_if man pandoc)"
diff --git a/srcpkgs/obs/template b/srcpkgs/obs/template
index 1a7132ae832f..078feba62bbb 100644
--- a/srcpkgs/obs/template
+++ b/srcpkgs/obs/template
@@ -1,7 +1,7 @@
 # Template file for 'obs'
 pkgname=obs
 version=29.0.2
-revision=1
+revision=2
 archs="i686* x86_64* ppc64le* aarch64*"
 build_style=cmake
 configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON
diff --git a/srcpkgs/olive/template b/srcpkgs/olive/template
index 12a46936c990..5290d8e5aacd 100644
--- a/srcpkgs/olive/template
+++ b/srcpkgs/olive/template
@@ -1,7 +1,7 @@
 # Template file for 'olive'
 pkgname=olive
 version=0.1.2
-revision=2
+revision=3
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools pkg-config"
 makedepends="qt5-devel qt5-multimedia-devel qt5-svg-devel ffmpeg-devel frei0r-plugins"
diff --git a/srcpkgs/omxplayer/template b/srcpkgs/omxplayer/template
index e70bf7873d4d..80abdefe77b4 100644
--- a/srcpkgs/omxplayer/template
+++ b/srcpkgs/omxplayer/template
@@ -1,7 +1,7 @@
 # Template file for 'omxplayer'
 pkgname=omxplayer
 version=20190102
-revision=1
+revision=2
 short_desc="Commandline OMX player for the Raspberry Pi"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2"
diff --git a/srcpkgs/openimageio/template b/srcpkgs/openimageio/template
index cc9d7a33984e..ee988ae2ce07 100644
--- a/srcpkgs/openimageio/template
+++ b/srcpkgs/openimageio/template
@@ -1,7 +1,7 @@
 # Template file for 'openimageio'
 pkgname=openimageio
 version=2.3.18.0
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="-DUSE_OPENGL=0 -DUSE_QT=0 -DUSE_PYTHON=0 -DOIIO_BUILD_TESTS=1
diff --git a/srcpkgs/openmw/template b/srcpkgs/openmw/template
index 5251a0283dc1..e3771c7aaf1a 100644
--- a/srcpkgs/openmw/template
+++ b/srcpkgs/openmw/template
@@ -1,7 +1,7 @@
 # Template file for 'openmw'
 pkgname=openmw
 version=0.47.0
-revision=4
+revision=5
 build_style=cmake
 _recast_commit=e75adf86f91eb3082220085e42dda62679f9a3ea
 _bullet_tag=3.17
diff --git a/srcpkgs/openshot/template b/srcpkgs/openshot/template
index 322717d40abc..c074e0338773 100644
--- a/srcpkgs/openshot/template
+++ b/srcpkgs/openshot/template
@@ -1,7 +1,7 @@
 # Template file for 'openshot'
 pkgname=openshot
 version=3.0.0
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3 python3-setuptools"
 makedepends="ffmpeg-devel python3-PyQt5"
diff --git a/srcpkgs/opentoonz/template b/srcpkgs/opentoonz/template
index ee9f7603f55f..3e81834ca0ed 100644
--- a/srcpkgs/opentoonz/template
+++ b/srcpkgs/opentoonz/template
@@ -1,7 +1,7 @@
 # Template file for 'opentoonz'
 pkgname=opentoonz
 version=1.6.0
-revision=2
+revision=3
 build_wrksrc="toonz/sources"
 build_style=cmake
 make_cmd=make
diff --git a/srcpkgs/pianobar/template b/srcpkgs/pianobar/template
index a9b29e91993f..81efcd122c4d 100644
--- a/srcpkgs/pianobar/template
+++ b/srcpkgs/pianobar/template
@@ -1,7 +1,7 @@
 # Template file for 'pianobar'
 pkgname=pianobar
 version=2022.04.01
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="V=1"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/ppsspp/template b/srcpkgs/ppsspp/template
index 7984a733d4be..db9c95d0784c 100644
--- a/srcpkgs/ppsspp/template
+++ b/srcpkgs/ppsspp/template
@@ -1,7 +1,7 @@
 # Template file for 'ppsspp'
 pkgname=ppsspp
 version=1.14.4
-revision=1
+revision=2
 _glslang_commit=dc11adde23c455a24e13dd54de9b4ede8bdd7db8
 _SPIRV_Cross_commit=9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1
 _armips_commit=6719edebaae03330ee5441d9b28280672edf00d5
diff --git a/srcpkgs/pqiv/template b/srcpkgs/pqiv/template
index 542fc27a2d32..9308d949b6a1 100644
--- a/srcpkgs/pqiv/template
+++ b/srcpkgs/pqiv/template
@@ -1,7 +1,7 @@
 # Template file for 'pqiv'
 pkgname=pqiv
 version=2.12
-revision=1
+revision=2
 build_style=gnu-makefile
 hostmakedepends="pkg-config"
 makedepends="glib-devel gtk+3-devel $(vopt_if ffmpeg ffmpeg-devel)
diff --git a/srcpkgs/qmmp/template b/srcpkgs/qmmp/template
index 26c661ed16be..a150d7441c7a 100644
--- a/srcpkgs/qmmp/template
+++ b/srcpkgs/qmmp/template
@@ -1,7 +1,7 @@
 # Template file for 'qmmp'
 pkgname=qmmp
 version=1.6.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_HAL:BOOL=FALSE -DQMMP_DEFAULT_UI:STRING=simple"
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake"
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index f9d78eced929..0a71484208bc 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
 version=5.15.11
-revision=1
+revision=2
 _version="${version}-lts"
 _chromium_commit=be349eaf62e77955791d7bf29f893f1e8a37daf4
 archs="x86_64* i686* armv[67]* ppc64* aarch64*"
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"
diff --git a/srcpkgs/qt6-multimedia/template b/srcpkgs/qt6-multimedia/template
index d89e7d54eb5a..aae15e57ca7b 100644
--- a/srcpkgs/qt6-multimedia/template
+++ b/srcpkgs/qt6-multimedia/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-multimedia'
 pkgname=qt6-multimedia
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DQT_FEATURE_gstreamer=ON"
 hostmakedepends="perl qt6-declarative-host-tools pkg-config qt6-shadertools"
diff --git a/srcpkgs/qt6-webengine/template b/srcpkgs/qt6-webengine/template
index 99012732b53a..96846feaee83 100644
--- a/srcpkgs/qt6-webengine/template
+++ b/srcpkgs/qt6-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-webengine'
 pkgname=qt6-webengine
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DQT_FEATURE_webengine_system_ffmpeg=ON
diff --git a/srcpkgs/qtav/template b/srcpkgs/qtav/template
index 34c30b2c0c78..775d5a139a9e 100644
--- a/srcpkgs/qtav/template
+++ b/srcpkgs/qtav/template
@@ -1,7 +1,7 @@
 # Template file for 'qtav'
 pkgname=qtav
 version=1.13.0
-revision=1
+revision=2
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel libass-devel libopenal-devel
diff --git a/srcpkgs/qtox/patches/ffmpeg5.patch b/srcpkgs/qtox/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..3babe1c98447
--- /dev/null
+++ b/srcpkgs/qtox/patches/ffmpeg5.patch
@@ -0,0 +1,79 @@
+From 15673a52b6b4805d482b69281e21947fb7096e05 Mon Sep 17 00:00:00 2001
+From: Anthony Bilinski <me@abilinski.com>
+Date: Thu, 10 Feb 2022 17:24:38 -0800
+Subject: [PATCH] fix(macOS): Update video API usage for newer libavcodec
+
+Newer version of avformat_open_input, av_find_input_format,
+avcodec_find_decoder previously used non-const pointers that are now
+const. Support both version for compatibiltiy with other platforms.
+---
+ src/video/cameradevice.cpp | 9 ++++++---
+ src/video/cameradevice.h   | 1 -
+ src/video/camerasource.cpp | 3 +--
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/video/cameradevice.cpp b/src/video/cameradevice.cpp
+index 3b07968b32..a012a0f78d 100644
+--- a/src/video/cameradevice.cpp
++++ b/src/video/cameradevice.cpp
+@@ -31,6 +31,9 @@ extern "C" {
+ #include "cameradevice.h"
+ #include "src/persistence/settings.h"
+
++// no longer needed when avformat version < 59 is no longer supported
++using AvFindInputFormatRet = decltype(av_find_input_format(""));
++
+ #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
+ #define USING_V4L 1
+ #else
+@@ -71,8 +74,8 @@ extern "C" {
+
+ QHash<QString, CameraDevice*> CameraDevice::openDevices;
+ QMutex CameraDevice::openDeviceLock, CameraDevice::iformatLock;
+-AVInputFormat* CameraDevice::iformat{nullptr};
+-AVInputFormat* CameraDevice::idesktopFormat{nullptr};
++static AvFindInputFormatRet idesktopFormat{nullptr};
++static AvFindInputFormatRet iformat{nullptr};
+
+ CameraDevice::CameraDevice(const QString& devName, AVFormatContext* context)
+     : devName{devName}
+@@ -92,7 +95,7 @@ CameraDevice* CameraDevice::open(QString devName, AVDictionary** options)
+         goto out;
+     }
+
+-    AVInputFormat* format;
++    AvFindInputFormatRet format;
+     if (devName.startsWith("x11grab#")) {
+         devName = devName.mid(8);
+         format = idesktopFormat;
+diff --git a/src/video/cameradevice.h b/src/video/cameradevice.h
+index 910873325b..c05f1dbed4 100644
+--- a/src/video/cameradevice.h
++++ b/src/video/cameradevice.h
+@@ -64,5 +64,4 @@ class CameraDevice
+     std::atomic_int refcount;
+     static QHash<QString, CameraDevice*> openDevices;
+     static QMutex openDeviceLock, iformatLock;
+-    static AVInputFormat *iformat, *idesktopFormat;
+ };
+diff --git a/src/video/camerasource.cpp b/src/video/camerasource.cpp
+index 134bc49afc..3a899f11d0 100644
+--- a/src/video/camerasource.cpp
++++ b/src/video/camerasource.cpp
+@@ -278,7 +278,6 @@ void CameraSource::openDevice()
+     }
+
+     // We need to create a new CameraDevice
+-    AVCodec* codec;
+     device = CameraDevice::open(deviceName, mode);
+
+     if (!device) {
+@@ -322,7 +321,7 @@ void CameraSource::openDevice()
+     AVCodecParameters* cparams = device->context->streams[videoStreamIndex]->codecpar;
+     codecId = cparams->codec_id;
+ #endif
+-    codec = avcodec_find_decoder(codecId);
++    const AVCodec* codec = avcodec_find_decoder(codecId);
+     if (!codec) {
+         qWarning() << "Codec not found";
+         emit openFailed();
diff --git a/srcpkgs/qtox/template b/srcpkgs/qtox/template
index 16019d7eaec9..5cea0b11b697 100644
--- a/srcpkgs/qtox/template
+++ b/srcpkgs/qtox/template
@@ -1,7 +1,7 @@
 # Template file for 'qtox'
 pkgname=qtox
 version=1.17.6
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DUPDATE_CHECK=OFF
  -DGIT_DESCRIBE=${version}
diff --git a/srcpkgs/retroarch/template b/srcpkgs/retroarch/template
index 240d3df9db00..6d0b16ae2598 100644
--- a/srcpkgs/retroarch/template
+++ b/srcpkgs/retroarch/template
@@ -1,7 +1,7 @@
 # Template file for 'retroarch'
 pkgname=retroarch
 version=1.14.0
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking
  --enable-udev --disable-builtinflac --disable-builtinglslang
diff --git a/srcpkgs/scrcpy/template b/srcpkgs/scrcpy/template
index ee6e698e387f..8ada5ca4323f 100644
--- a/srcpkgs/scrcpy/template
+++ b/srcpkgs/scrcpy/template
@@ -1,7 +1,7 @@
 # Template file for 'scrcpy'
 pkgname=scrcpy
 version=2.0
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dcompile_server=false
  -Dprebuilt_server=/usr/share/scrcpy/scrcpy-server-v${version}"
diff --git a/srcpkgs/spek-alternative/template b/srcpkgs/spek-alternative/template
index d65086b8f008..72747cbb0a02 100644
--- a/srcpkgs/spek-alternative/template
+++ b/srcpkgs/spek-alternative/template
@@ -1,7 +1,7 @@
 # Template file for 'spek-alternative'
 pkgname=spek-alternative
 version=0.8.2.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake gettext-devel intltool libtool pkg-config wxWidgets-common"
 makedepends="ffmpeg-devel wxWidgets-gtk3-devel"
diff --git a/srcpkgs/ssr/template b/srcpkgs/ssr/template
index b055b9ec0774..842b2423aad1 100644
--- a/srcpkgs/ssr/template
+++ b/srcpkgs/ssr/template
@@ -1,7 +1,7 @@
 # Template file for 'ssr'
 pkgname=ssr
 version=0.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_QT5=ON"
 hostmakedepends="pkg-config"
diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template
index 0f9b9ec815f5..a3fe134aa5ac 100644
--- a/srcpkgs/sumo/template
+++ b/srcpkgs/sumo/template
@@ -1,7 +1,7 @@
 # Template file for 'sumo'
 pkgname=sumo
 version=1.12.0
-revision=5
+revision=6
 build_style=cmake
 hostmakedepends="libgdal-tools pkg-config swig python3-setuptools"
 makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel
diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template
index 182dc3cd280f..29afb3572e47 100644
--- a/srcpkgs/synfig/template
+++ b/srcpkgs/synfig/template
@@ -2,7 +2,7 @@
 # Should be kept in sync with 'synfigstudio' and 'ETL'
 pkgname=synfig
 version=1.4.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib"
 hostmakedepends="boost-build ImageMagick pkg-config intltool"
diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index aae9f3135100..7943b36f0b8a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=4.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 configure_args="-DTDESKTOP_API_ID=209235
diff --git a/srcpkgs/tg_owt/template b/srcpkgs/tg_owt/template
index 97d195ddb34a..551614b24956 100644
--- a/srcpkgs/tg_owt/template
+++ b/srcpkgs/tg_owt/template
@@ -1,7 +1,7 @@
 # Template file for 'tg_owt'
 pkgname=tg_owt
 version=0.0.0.20230107
-revision=1
+revision=2
 _commit=5098730b9eb6173f0b52068fe2555b7c1015123a
 _libyuv_commit=00950840d1c9bcbb3eb6ebc5aac5793e71166c8b
 _abseil_commit=8c0b94e793a66495e0b1f34a5eb26bd7dc672db0
diff --git a/srcpkgs/timg/template b/srcpkgs/timg/template
index 91f1516b2597..334443d3f9bb 100644
--- a/srcpkgs/timg/template
+++ b/srcpkgs/timg/template
@@ -1,7 +1,7 @@
 # Template file for 'timg'
 pkgname=timg
 version=1.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_OPENSLIDE_SUPPORT=off -Wno-dev"
 hostmakedepends="pkg-config git"
diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index 3e7966c2b4a9..285425ba1851 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.4.3
-revision=1
+revision=2
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss
diff --git a/srcpkgs/tvheadend/template b/srcpkgs/tvheadend/template
index e6b16d7ccf3b..a2004480332b 100644
--- a/srcpkgs/tvheadend/template
+++ b/srcpkgs/tvheadend/template
@@ -1,7 +1,7 @@
 # Template file for 'tvheadend'
 pkgname=tvheadend
 version=4.2.8
-revision=6
+revision=7
 build_style=gnu-configure
 configure_args="--enable-dvbscan --disable-ffmpeg_static
 --disable-hdhomerun_static --disable-bintray_cache --disable-libx264_static
diff --git a/srcpkgs/unpaper/template b/srcpkgs/unpaper/template
index 38ed47a58401..b05920d13101 100644
--- a/srcpkgs/unpaper/template
+++ b/srcpkgs/unpaper/template
@@ -1,7 +1,7 @@
 # Template file for 'unpaper'
 pkgname=unpaper
 version=6.1
-revision=3
+revision=4
 build_style=gnu-configure
 maintainer="Orphaned <orphan@voidlinux.org>"
 hostmakedepends="pkg-config libxslt"
diff --git a/srcpkgs/vba-m/template b/srcpkgs/vba-m/template
index ba153e0b58ca..aa6093645e97 100644
--- a/srcpkgs/vba-m/template
+++ b/srcpkgs/vba-m/template
@@ -2,7 +2,7 @@
 pkgname=vba-m
 reverts=1292_2
 version=2.1.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GTK=TRUE -DENABLE_FFMPEG=TRUE -DENABLE_LINK=TRUE -DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="gettext pkg-config unzip zip yasm wxWidgets-gtk3-devel"
diff --git a/srcpkgs/vice/template b/srcpkgs/vice/template
index 0924767cfcfb..ffa95384f64a 100644
--- a/srcpkgs/vice/template
+++ b/srcpkgs/vice/template
@@ -1,7 +1,7 @@
 # Template file for 'vice'
 pkgname=vice
 version=3.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
 	$(vopt_enable sdl2 sdlui2)
diff --git a/srcpkgs/waypipe/template b/srcpkgs/waypipe/template
index 5c4161900060..1a46fe27f7d8 100644
--- a/srcpkgs/waypipe/template
+++ b/srcpkgs/waypipe/template
@@ -1,7 +1,7 @@
 # Template file for 'waypipe'
 pkgname=waypipe
 version=0.8.4
-revision=1
+revision=2
 build_style=meson
 # lto is off because it causes linking errors in armv6l and armv7l (due to NEON)
 configure_args="-Dwerror=false -Dwith_dmabuf=enabled -Dwith_lz4=enabled
diff --git a/srcpkgs/wf-recorder/template b/srcpkgs/wf-recorder/template
index e278eb001600..5d014a5f28af 100644
--- a/srcpkgs/wf-recorder/template
+++ b/srcpkgs/wf-recorder/template
@@ -1,7 +1,7 @@
 # Template file for 'wf-recorder'
 pkgname=wf-recorder
 version=0.3.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config scdoc wayland-devel"
 makedepends="wayland-protocols wayland-devel ffmpeg-devel x264-devel
diff --git a/srcpkgs/xpra/template b/srcpkgs/xpra/template
index 38f83283b1e5..b6e01ff0a813 100644
--- a/srcpkgs/xpra/template
+++ b/srcpkgs/xpra/template
@@ -1,7 +1,7 @@
 # Template file for 'xpra'
 pkgname=xpra
 version=4.4.4
-revision=1
+revision=2
 build_style=python3-module
 make_build_args="--without-cuda_kernels --without-cuda_rebuild"
 make_install_args="$(vopt_with docs) ${make_build_args}"

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (12 preceding siblings ...)
  2023-03-22 23:33 ` [PR PATCH] [Updated] " zlice
@ 2023-03-22 23:36 ` zlice
  2023-03-23  0:15 ` [PR PATCH] [Updated] " zlice
                   ` (15 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-22 23:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New review comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#discussion_r1145522398

Comment:
switched to the branch i was using instead of another, not intended again sorry

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (13 preceding siblings ...)
  2023-03-22 23:36 ` [PR REVIEW] " zlice
@ 2023-03-23  0:15 ` zlice
  2023-03-23  2:05 ` sgn
                   ` (14 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-23  0:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3197 bytes --]

There is an updated pull request by zlice against master on the void-packages repository

https://github.com/zlice/void-packages ffmpeg5-split
https://github.com/void-linux/void-packages/pull/42936

draft: ffmpeg5 split
[ci skip]

#### Testing the changes

- I tested the changes in this PR: **NO**

I have conflicting changes from [intel packages](https://github.com/void-linux/void-packages/pull/41132) and don't want to mess with my system. If it makes sense I'll move these changes here like I originally intended. ffmpeg5 makes Intel vaapi easier and only rely on oneVPL iirc.

I do not use 80%+ of these packages. I may be able to run Blender, and I use shotcut.


#### New package

- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**



#### Local build testing

- I built this PR locally for my native architecture, **x86_64**


#### Discussion

Continuation of https://github.com/void-linux/void-packages/pull/36315 - thx tibequadorian :)

It was suggested to make `ffmpeg` version 5 and 'copy' (create a new?) `ffmpeg4` package, and that seems to work well.

As stated, I haven't and probably won't test most of these packages, hoping for others to voice in on what's working. 

A few months back (and now) afaict everything has been compiling with ffmpeg5 except for the few problem packages still using ffmpeg4 (below). Can add to the ffmpeg4 list as a incompatible package is found.

`libavresample` is deprecated, but marked as a dependency when trying to build other packages and install `ffmpeg`(5). I think the right way to handle this is make a meta package and the add to removals?

[gstreamer 1.22.1 updates](https://github.com/void-linux/void-packages/pull/42861) could go before this

##### Commit naming / misc

`ffpmeg4` isn't "new", not sure what the commit messages should be really for the 4 and 5 split. Additionally xlint complains about `ffmpeg4` revision being 3 and not 1 because it's a "new" package, I assume that's right but not sure.

Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?

I wouldn't mind moving the [intel packages](https://github.com/void-linux/void-packages/pull/41132) into here under another commit. That just got a potential fix that may allow merging but I imagine moving to ffmpeg5 will change and even remove some of those packages. (I won't really test these changes without Intel vaapi either way.)

Maintainer for previous ffmpeg(4) was orphaned, I can put my name in there if that matters, though I don't exactly see myself keeping up on ffmpeg.


##### still ffmpeg4

- `vlc` (vlc4 will support ffmpeg5, there's a patch to build 3.x with ffmpeg5 but it will lack vaapi)
- `osg` (OpenSceneGraph plus `xine-lib`)
- `ytmdl` ? not sure but it uses `python3-ffmpeg-python` which being 6-8yr old I imagine is ffmpeg4


A patch file from https://github.com/void-linux/void-packages/pull/42936.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ffmpeg5-split-42936.patch --]
[-- Type: text/x-diff, Size: 164376 bytes --]

From 36816597fd72a4e58b6081e6f8af2378a1c737b3 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:55:46 -0400
Subject: [PATCH 001/103] ffmpeg: update to 5.1.2.

---
 srcpkgs/ffmpeg/files/altivec.patch            | 60 -------------------
 .../patches/armv5tel-floating-point.patch     | 18 ------
 .../workaround-mesa-readeon-vaapi-bug.patch   | 28 ---------
 srcpkgs/ffmpeg/template                       | 20 +++----
 4 files changed, 9 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/ffmpeg/files/altivec.patch
 delete mode 100644 srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
 delete mode 100644 srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch

diff --git a/srcpkgs/ffmpeg/files/altivec.patch b/srcpkgs/ffmpeg/files/altivec.patch
deleted file mode 100644
index 9c5720046332..000000000000
--- a/srcpkgs/ffmpeg/files/altivec.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-revert some altivec specific change on all ppc* except ppc64le*
-
-q66: "We should also throw in a revert of FFmpeg/FFmpeg@3a557c5 but only
-conditionally, for ppc* but not ppc64le* (the new code is valid for
-POWER8 VSX which LE targets as a baseline but not BE)"
-
-
-This reverts commit 3a557c5d88b7b15b5954ba2743febb055549b536.
----
- libswscale/ppc/yuv2rgb_altivec.c | 24 ++++++++++++++++++++----
- 1 file changed, 20 insertions(+), 4 deletions(-)
-
-diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
-index 536545293d..c1e2852adb 100644
---- a/libswscale/ppc/yuv2rgb_altivec.c
-+++ b/libswscale/ppc/yuv2rgb_altivec.c
-@@ -305,6 +305,9 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
-     vector signed short R1, G1, B1;                                           \
-     vector unsigned char R, G, B;                                             \
-                                                                               \
-+    const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP;                  \
-+    vector unsigned char align_perm;                                          \
-+                                                                              \
-     vector signed short lCY       = c->CY;                                    \
-     vector signed short lOY       = c->OY;                                    \
-     vector signed short lCRV      = c->CRV;                                   \
-@@ -335,13 +338,26 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
-         vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1);       \
-                                                                               \
-         for (j = 0; j < w / 16; j++) {                                        \
--            y0 = vec_xl(0, y1i);                                              \
-+            y1ivP = (const vector unsigned char *) y1i;                       \
-+            y2ivP = (const vector unsigned char *) y2i;                       \
-+            uivP  = (const vector unsigned char *) ui;                        \
-+            vivP  = (const vector unsigned char *) vi;                        \
-+                                                                              \
-+            align_perm = vec_lvsl(0, y1i);                                    \
-+            y0 = (vector unsigned char)                                       \
-+                     vec_perm(y1ivP[0], y1ivP[1], align_perm);                \
-                                                                               \
--            y1 = vec_xl(0, y2i);                                              \
-+            align_perm = vec_lvsl(0, y2i);                                    \
-+            y1 = (vector unsigned char)                                       \
-+                     vec_perm(y2ivP[0], y2ivP[1], align_perm);                \
-                                                                               \
--            u = (vector signed char) vec_xl(0, ui);                           \
-+            align_perm = vec_lvsl(0, ui);                                     \
-+            u = (vector signed char)                                          \
-+                    vec_perm(uivP[0], uivP[1], align_perm);                   \
-                                                                               \
--            v = (vector signed char) vec_xl(0, vi);                           \
-+            align_perm = vec_lvsl(0, vi);                                     \
-+            v = (vector signed char)                                          \
-+                    vec_perm(vivP[0], vivP[1], align_perm);                   \
-                                                                               \
-             u = (vector signed char)                                          \
-                     vec_sub(u,                                                \
--- 
-2.27.0
-
diff --git a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
deleted file mode 100644
index 9a55178c74f0..000000000000
--- a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- a/libavfilter/vf_drawtext.c	2017-10-26 21:03:03.000000000 +0200
-+++ b/libavfilter/vf_drawtext.c	2017-11-21 11:06:49.602284422 +0100
-@@ -39,6 +39,15 @@
- #endif
- #include <fenv.h>
- 
-+#if (FE_ALL_EXCEPT == 0)
-+/* E.g. ARM soft float does not define these */
-+#define FE_INVALID    0
-+#define FE_DIVBYZERO  0
-+#define FE_OVERFLOW   0
-+#define FE_UNDERFLOW  0
-+#define FE_INEXACT    0
-+#endif
-+
- #if CONFIG_LIBFONTCONFIG
- #include <fontconfig/fontconfig.h>
- #endif
diff --git a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
deleted file mode 100644
index 00e3f68a415b..000000000000
--- a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 811d290844206fc73dc39c3e5b67d5d895baedf8 Mon Sep 17 00:00:00 2001
-From: Rainer Hochecker <fernetmenta@online.de>
-Date: Sat, 26 Jan 2019 19:48:35 +0100
-Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices
-
-This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
-It was hit frequently when watching h264 channels received via DVB-X.
-Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704
----
- libavcodec/vaapi_h264.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
-index 5854587a255..f12fdc457a4 100644
---- a/libavcodec/vaapi_h264.c
-+++ b/libavcodec/vaapi_h264.c
-@@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
-     H264SliceContext *sl = &h->slice_ctx[0];
-     int ret;
- 
-+    if (pic->nb_slices == 0) {
-+        ret = AVERROR_INVALIDDATA;
-+        goto finish;
-+    }
-+
-     ret = ff_vaapi_decode_issue(avctx, pic);
-     if (ret < 0)
-         goto finish;
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 23a3d5c9967b..1ac1e4b8df49 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -1,15 +1,15 @@
 # Template file for 'ffmpeg'
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg
-version=4.4.3
-revision=2
+version=5.1.2
+revision=1
 short_desc="Decoding, encoding and streaming software"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
 changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
 distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
-checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
 makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
@@ -26,7 +26,7 @@ makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-deve
  $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
  $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
  $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
- $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers')
  $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
 depends="ffplay>=${version}_${revision}"
 
@@ -114,7 +114,7 @@ do_configure() {
 		$(vopt_enable x265 libx265) \
 		$(vopt_enable v4l2 libv4l2) \
 		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
-		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		--enable-libbs2b --enable-libvidstab \
 		$(vopt_enable dav1d libdav1d) \
 		$(vopt_enable zimg libzimg) \
 		$(vopt_enable webp libwebp) \
@@ -148,10 +148,8 @@ libavdevice_package() {
 	}
 }
 libavresample_package() {
-	short_desc="FFmpeg audio resampling library"
-	pkg_install() {
-		vmove "usr/lib/libavresample.so.*"
-	}
+	short_desc="Package deprecated, removal needed"
+	build_style=meta
 }
 libavformat_package() {
 	short_desc="FFmpeg file format library"
@@ -198,9 +196,9 @@ ffmpeg-devel_package() {
 		libavfilter>=${version}_${revision}
 		libpostproc>=${version}_${revision}
 		libswscale>=${version}_${revision}
-		libswresample>=${version}_${revision}
-		libavresample>=${version}_${revision}"
+		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
+	conflicts="ffmpeg4-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig

From 255a32045804b66f0bfd59c38fdfd83ec7745bcb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:56:22 -0400
Subject: [PATCH 002/103] New package: ffmpeg4-4.4.3.

---
 srcpkgs/ffmpeg4-devel                         |   1 +
 srcpkgs/ffmpeg4/files/altivec.patch           |  60 +++++
 .../patches/armv5tel-floating-point.patch     |  18 ++
 .../workaround-mesa-readeon-vaapi-bug.patch   |  28 +++
 srcpkgs/ffmpeg4/template                      | 214 ++++++++++++++++++
 srcpkgs/libavcodec4                           |   1 +
 srcpkgs/libavdevice4                          |   1 +
 srcpkgs/libavfilter4                          |   1 +
 srcpkgs/libavformat4                          |   1 +
 srcpkgs/libavresample4                        |   1 +
 srcpkgs/libavutil4                            |   1 +
 srcpkgs/libpostproc4                          |   1 +
 srcpkgs/libswresample4                        |   1 +
 srcpkgs/libswscale4                           |   1 +
 14 files changed, 330 insertions(+)
 create mode 120000 srcpkgs/ffmpeg4-devel
 create mode 100644 srcpkgs/ffmpeg4/files/altivec.patch
 create mode 100644 srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
 create mode 100644 srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
 create mode 100644 srcpkgs/ffmpeg4/template
 create mode 120000 srcpkgs/libavcodec4
 create mode 120000 srcpkgs/libavdevice4
 create mode 120000 srcpkgs/libavfilter4
 create mode 120000 srcpkgs/libavformat4
 create mode 120000 srcpkgs/libavresample4
 create mode 120000 srcpkgs/libavutil4
 create mode 120000 srcpkgs/libpostproc4
 create mode 120000 srcpkgs/libswresample4
 create mode 120000 srcpkgs/libswscale4

diff --git a/srcpkgs/ffmpeg4-devel b/srcpkgs/ffmpeg4-devel
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4-devel
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg4/files/altivec.patch b/srcpkgs/ffmpeg4/files/altivec.patch
new file mode 100644
index 000000000000..9c5720046332
--- /dev/null
+++ b/srcpkgs/ffmpeg4/files/altivec.patch
@@ -0,0 +1,60 @@
+revert some altivec specific change on all ppc* except ppc64le*
+
+q66: "We should also throw in a revert of FFmpeg/FFmpeg@3a557c5 but only
+conditionally, for ppc* but not ppc64le* (the new code is valid for
+POWER8 VSX which LE targets as a baseline but not BE)"
+
+
+This reverts commit 3a557c5d88b7b15b5954ba2743febb055549b536.
+---
+ libswscale/ppc/yuv2rgb_altivec.c | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
+index 536545293d..c1e2852adb 100644
+--- a/libswscale/ppc/yuv2rgb_altivec.c
++++ b/libswscale/ppc/yuv2rgb_altivec.c
+@@ -305,6 +305,9 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
+     vector signed short R1, G1, B1;                                           \
+     vector unsigned char R, G, B;                                             \
+                                                                               \
++    const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP;                  \
++    vector unsigned char align_perm;                                          \
++                                                                              \
+     vector signed short lCY       = c->CY;                                    \
+     vector signed short lOY       = c->OY;                                    \
+     vector signed short lCRV      = c->CRV;                                   \
+@@ -335,13 +338,26 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
+         vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1);       \
+                                                                               \
+         for (j = 0; j < w / 16; j++) {                                        \
+-            y0 = vec_xl(0, y1i);                                              \
++            y1ivP = (const vector unsigned char *) y1i;                       \
++            y2ivP = (const vector unsigned char *) y2i;                       \
++            uivP  = (const vector unsigned char *) ui;                        \
++            vivP  = (const vector unsigned char *) vi;                        \
++                                                                              \
++            align_perm = vec_lvsl(0, y1i);                                    \
++            y0 = (vector unsigned char)                                       \
++                     vec_perm(y1ivP[0], y1ivP[1], align_perm);                \
+                                                                               \
+-            y1 = vec_xl(0, y2i);                                              \
++            align_perm = vec_lvsl(0, y2i);                                    \
++            y1 = (vector unsigned char)                                       \
++                     vec_perm(y2ivP[0], y2ivP[1], align_perm);                \
+                                                                               \
+-            u = (vector signed char) vec_xl(0, ui);                           \
++            align_perm = vec_lvsl(0, ui);                                     \
++            u = (vector signed char)                                          \
++                    vec_perm(uivP[0], uivP[1], align_perm);                   \
+                                                                               \
+-            v = (vector signed char) vec_xl(0, vi);                           \
++            align_perm = vec_lvsl(0, vi);                                     \
++            v = (vector signed char)                                          \
++                    vec_perm(vivP[0], vivP[1], align_perm);                   \
+                                                                               \
+             u = (vector signed char)                                          \
+                     vec_sub(u,                                                \
+-- 
+2.27.0
+
diff --git a/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
new file mode 100644
index 000000000000..9a55178c74f0
--- /dev/null
+++ b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
@@ -0,0 +1,18 @@
+--- a/libavfilter/vf_drawtext.c	2017-10-26 21:03:03.000000000 +0200
++++ b/libavfilter/vf_drawtext.c	2017-11-21 11:06:49.602284422 +0100
+@@ -39,6 +39,15 @@
+ #endif
+ #include <fenv.h>
+ 
++#if (FE_ALL_EXCEPT == 0)
++/* E.g. ARM soft float does not define these */
++#define FE_INVALID    0
++#define FE_DIVBYZERO  0
++#define FE_OVERFLOW   0
++#define FE_UNDERFLOW  0
++#define FE_INEXACT    0
++#endif
++
+ #if CONFIG_LIBFONTCONFIG
+ #include <fontconfig/fontconfig.h>
+ #endif
diff --git a/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
new file mode 100644
index 000000000000..00e3f68a415b
--- /dev/null
+++ b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
@@ -0,0 +1,28 @@
+From 811d290844206fc73dc39c3e5b67d5d895baedf8 Mon Sep 17 00:00:00 2001
+From: Rainer Hochecker <fernetmenta@online.de>
+Date: Sat, 26 Jan 2019 19:48:35 +0100
+Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices
+
+This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
+It was hit frequently when watching h264 channels received via DVB-X.
+Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704
+---
+ libavcodec/vaapi_h264.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
+index 5854587a255..f12fdc457a4 100644
+--- a/libavcodec/vaapi_h264.c
++++ b/libavcodec/vaapi_h264.c
+@@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
+     H264SliceContext *sl = &h->slice_ctx[0];
+     int ret;
+ 
++    if (pic->nb_slices == 0) {
++        ret = AVERROR_INVALIDDATA;
++        goto finish;
++    }
++
+     ret = ff_vaapi_decode_issue(avctx, pic);
+     if (ret < 0)
+         goto finish;
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
new file mode 100644
index 000000000000..7bc64bb39f41
--- /dev/null
+++ b/srcpkgs/ffmpeg4/template
@@ -0,0 +1,214 @@
+# Template file for 'ffmpeg4'
+# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
+pkgname=ffmpeg4
+version=4.4.3
+revision=1
+short_desc="Decoding, encoding and streaming software - ffmpeg4 libraries only"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.ffmpeg.org"
+changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
+distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
+checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+
+hostmakedepends="pkg-config perl yasm"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
+
+case "$XBPS_TARGET_MACHINE" in
+	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
+	ppc64*) build_options_default+=" vaapi vdpau";;
+	mips*) CFLAGS="-mnan=legacy";;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" != "32" ]; then
+	build_options_default+=" svtav1"
+fi
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
+do_configure() {
+	# Fix gcc on x86_64-musl only
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
+		sed -i configure -e "s;_cflags_speed='-O3';_cflags_speed='-O2';"
+	fi
+
+	if [ "$CROSS_BUILD" ]; then
+		case "$XBPS_TARGET_MACHINE" in
+			arm*) _arch="arm";;
+			aarch64*) _arch="aarch64";;
+			mips*) _arch="mips";;
+			ppc64*) _arch="ppc64";;
+			ppc*) _arch="ppc";;
+			*) _arch="${XBPS_TARGET_MACHINE%%-musl}";;
+		esac
+
+		_args+=" --enable-cross-compile
+			--sysroot=$XBPS_CROSS_BASE
+			--cross-prefix=${XBPS_CROSS_TRIPLET}-
+			--target-os=linux --arch=${_arch}"
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc|ppc-musl) _args+=" --disable-altivec";;
+	esac
+
+	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+		_args+=" --extra-libs=-latomic"
+	fi
+
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+		--disable-stripping \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
+		$(vopt_if nvenc '--enable-nvenc') \
+		$(vopt_if nvdec '--enable-nvdec')
+}
+do_build() {
+	make ${makejobs}
+	make doc/ff{mpeg,play}.1
+}
+do_install() {
+	make DESTDIR=${DESTDIR} install install-man
+	rm -rf ${DESTDIR}/usr/bin
+}
+
+libavcodec4_package() {
+	short_desc="FFmpeg codec library"
+	pkg_install() {
+		vmove "usr/lib/libavcodec.so.*"
+	}
+}
+libavdevice4_package() {
+	short_desc="FFmpeg device handling library"
+	pkg_install() {
+		vmove "usr/lib/libavdevice.so.*"
+	}
+}
+libavresample4_package() {
+	short_desc="FFmpeg audio resampling library"
+	pkg_install() {
+		vmove "usr/lib/libavresample.so.*"
+	}
+}
+libavformat4_package() {
+	short_desc="FFmpeg file format library"
+	pkg_install() {
+		vmove "usr/lib/libavformat.so.*"
+	}
+}
+libavutil4_package() {
+	short_desc="FFmpeg utility library"
+	pkg_install() {
+		vmove "usr/lib/libavutil.so.*"
+	}
+}
+libavfilter4_package() {
+	short_desc="FFmpeg audio/video filter library"
+	pkg_install() {
+		vmove "usr/lib/libavfilter.so.*"
+	}
+}
+libpostproc4_package() {
+	short_desc="FFmpeg video postprocessing library"
+	pkg_install() {
+		vmove "usr/lib/libpostproc.so.*"
+	}
+}
+libswscale4_package() {
+	short_desc="FFmpeg video scaling library"
+	pkg_install() {
+		vmove "usr/lib/libswscale.so.*"
+	}
+}
+libswresample4_package() {
+	short_desc="FFmpeg video resampling library"
+	pkg_install() {
+		vmove "usr/lib/libswresample.so.*"
+	}
+}
+ffmpeg4-devel_package() {
+	depends="
+		libavcodec4>=${version}_${revision}
+		libavdevice4>=${version}_${revision}
+		libavformat4>=${version}_${revision}
+		libavutil4>=${version}_${revision}
+		libavfilter4>=${version}_${revision}
+		libpostproc4>=${version}_${revision}
+		libswscale4>=${version}_${revision}
+		libswresample4>=${version}_${revision}
+		libavresample4>=${version}_${revision}"
+	short_desc+=" - development files"
+	conflicts="ffmpeg-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/*.a
+		vmove usr/lib/*.so
+		vmove usr/share/ffmpeg/examples
+		vmove usr/share/man/man3
+	}
+}
diff --git a/srcpkgs/libavcodec4 b/srcpkgs/libavcodec4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavcodec4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavdevice4 b/srcpkgs/libavdevice4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavdevice4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavfilter4 b/srcpkgs/libavfilter4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavfilter4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavformat4 b/srcpkgs/libavformat4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavformat4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample4 b/srcpkgs/libavresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavutil4 b/srcpkgs/libavutil4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavutil4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libpostproc4 b/srcpkgs/libpostproc4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libpostproc4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswresample4 b/srcpkgs/libswresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswscale4 b/srcpkgs/libswscale4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswscale4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file

From 7c3a980c4a05662d7f0b28f4cedaa1615385e33f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:04 -0400
Subject: [PATCH 003/103] opencv: update to 4.7.0.

---
 srcpkgs/opencv/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/opencv/template b/srcpkgs/opencv/template
index a09b8dd0d449..41f3183f1582 100644
--- a/srcpkgs/opencv/template
+++ b/srcpkgs/opencv/template
@@ -1,7 +1,7 @@
 # Template file for 'opencv'
 pkgname=opencv
-version=4.6.0
-revision=3
+version=4.7.0
+revision=1
 create_wrksrc=yes
 build_wrksrc=${pkgname}-${version}
 build_style=cmake
@@ -24,8 +24,8 @@ homepage="https://opencv.org"
 changelog="https://github.com/opencv/opencv/wiki/ChangeLog"
 distfiles="https://github.com/opencv/opencv/archive/${version}.tar.gz
  https://github.com/opencv/opencv_contrib/archive/${version}.tar.gz>contrib.tar.gz"
-checksum="1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
- 1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7"
+checksum="8df0079cdbe179748a18d44731af62a245a45ebf5085223dc03133954c662973
+ 42df840cf9055e59d0e22c249cfb19f04743e1bdad113d31b1573d3934d62584"
 patch_args="-Np1 -d ${build_wrksrc}"
 # tests hang indenfinitely, even with test data included
 make_check=no

From e8225c28d0090cc7dbe76d075522f066fa953952 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 004/103] actiona: revbump for opencv-4.7.0

---
 srcpkgs/actiona/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/actiona/template b/srcpkgs/actiona/template
index cf5f0b7a2ae6..0d899311e6df 100644
--- a/srcpkgs/actiona/template
+++ b/srcpkgs/actiona/template
@@ -1,7 +1,7 @@
 # Template file for 'actiona'
 pkgname=actiona
 version=3.10.1
-revision=2
+revision=3
 build_style=qmake
 configure_args="PKGCONFIG_OPENCV=opencv4"
 hostmakedepends="pkg-config qt5-plugin-mysql qt5-qmake qt5-host-tools"

From e76e54c57c2d2fafc8f2982a700370d02ed1df5c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 005/103] digikam: revbump for opencv-4.7.0

---
 srcpkgs/digikam/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/digikam/template b/srcpkgs/digikam/template
index e8ec4961457b..0a8984db85bc 100644
--- a/srcpkgs/digikam/template
+++ b/srcpkgs/digikam/template
@@ -1,7 +1,7 @@
 # Template file for 'digikam'
 pkgname=digikam
 version=7.10.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext pkg-config bison flex qt5-qmake

From 17b83ee21ff92d7990f415fd88fbc3e212f68115 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 006/103] gmic: revbump for opencv-4.7.0

---
 srcpkgs/gmic/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gmic/template b/srcpkgs/gmic/template
index 8e3b80047f26..43c6e0672a2b 100644
--- a/srcpkgs/gmic/template
+++ b/srcpkgs/gmic/template
@@ -1,7 +1,7 @@
 # Template file for 'gmic'
 pkgname=gmic
 version=3.1.6
-revision=1
+revision=2
 _zart_hash=34ebf6cce0bafb98abe57cec83c4a02cd1abeca0
 create_wrksrc=yes
 build_wrksrc="src"

From afad3c15ada0082c62930e9eaacd4a26f1be1eea Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 007/103] nomacs: revbump for opencv-4.7.0

---
 srcpkgs/nomacs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/nomacs/template b/srcpkgs/nomacs/template
index 895e83071a8a..ce4e7f7093da 100644
--- a/srcpkgs/nomacs/template
+++ b/srcpkgs/nomacs/template
@@ -1,7 +1,7 @@
 # Template file for 'nomacs'
 pkgname=nomacs
 version=3.16.224
-revision=3
+revision=4
 build_wrksrc=ImageLounge
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_TRANSLATIONS=1

From 81626c22b96778117d16fed0d562b865279fa3ae Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 008/103] qimgv: revbump for opencv-4.7.0

---
 srcpkgs/qimgv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qimgv/template b/srcpkgs/qimgv/template
index 7eb30db33992..dd341dfe1bfc 100644
--- a/srcpkgs/qimgv/template
+++ b/srcpkgs/qimgv/template
@@ -1,7 +1,7 @@
 # Template file for 'qimgv'
 pkgname=qimgv
 version=1.0.2
-revision=2
+revision=3
 build_style=cmake
 configure_args="$(vopt_if video -DVIDEO_SUPPORT=ON -DVIDEO_SUPPORT=OFF)
  $(vopt_if scale -DOPENCV_SUPPORT=ON -DOPENCV_SUPPORT=OFF)

From 2f13531d7828b3e9d97b6dd701a4482751771d37 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 009/103] retroshare: revbump for opencv-4.7.0

---
 srcpkgs/retroshare/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/retroshare/template b/srcpkgs/retroshare/template
index 8a0786c21a08..72023fa98b75 100644
--- a/srcpkgs/retroshare/template
+++ b/srcpkgs/retroshare/template
@@ -1,7 +1,7 @@
 # Template file for 'retroshare'
 pkgname=retroshare
 version=0.6.6
-revision=2
+revision=4
 build_style=qmake
 #XXX broadcast feature requires an ancient udp-discovery-cpp which either needs
 # to be fetched+patched (FTBFS) here or packaged :/

From 1eb8fc5afdb2f8ff09c2ac117480b5d56c8adf87 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 010/103] siril: revbump for opencv-4.7.0

---
 srcpkgs/siril/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/siril/template b/srcpkgs/siril/template
index e06aa5d0559c..84332f79d060 100644
--- a/srcpkgs/siril/template
+++ b/srcpkgs/siril/template
@@ -1,7 +1,7 @@
 # Template file for 'siril'
 pkgname=siril
 version=0.9.12
-revision=8
+revision=10
 build_style=gnu-configure
 hostmakedepends="pkg-config intltool autoconf automake gettext-devel"
 makedepends="fftw-devel libconfig-devel libopencv-devel libffms2-devel

From 08df475659ed1bd6fc2af9c317e026833efb4e96 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 011/103] waifu2x-converter-cpp: revbump for opencv-4.7.0

---
 srcpkgs/waifu2x-converter-cpp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/waifu2x-converter-cpp/template b/srcpkgs/waifu2x-converter-cpp/template
index 8c095d0d7bab..aa52d8c981a8 100644
--- a/srcpkgs/waifu2x-converter-cpp/template
+++ b/srcpkgs/waifu2x-converter-cpp/template
@@ -1,7 +1,7 @@
 # Template file for 'waifu2x-converter-cpp'
 pkgname=waifu2x-converter-cpp
 version=5.2.4
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DINSTALL_MODELS=ON"
 hostmakedepends="pkg-config"

From 2cd5b3fd4e05c41c58460a98e8bac26c80a03254 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:00:38 -0400
Subject: [PATCH 012/103] vlc: revbump for ffmpeg4-4.4.3

---
 srcpkgs/vlc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/vlc/template b/srcpkgs/vlc/template
index 210762b0a7e2..855ca5238662 100644
--- a/srcpkgs/vlc/template
+++ b/srcpkgs/vlc/template
@@ -1,7 +1,7 @@
 # Template file for 'vlc'
 pkgname=vlc
 version=3.0.18
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-gme --disable-libtar --enable-jack
  --enable-live555 --disable-fluidsynth --enable-dvdread
@@ -25,7 +25,7 @@ lib32disabled=yes
 hostmakedepends="automake libtool pkg-config flex gettext libgcrypt-devel
  live555-devel gettext-devel $(vopt_if lua lua52) $(vopt_if chromecast protobuf)"
 makedepends="
- avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg-devel freefont-ttf
+ avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg4-devel freefont-ttf
  gnutls-devel jack-devel liba52-devel libass-devel libbluray-devel
  libcdio-devel libdca-devel libdvbpsi-devel libdvdnav-devel libmad-devel
  libmatroska-devel libmodplug-devel libmpcdec-devel libmpeg2-devel

From 2d287b23e246b3fb977ab70d4a4fd44ae591cd94 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:00:55 -0400
Subject: [PATCH 013/103] osg: revbump for ffmpeg4-4.4.3

---
 srcpkgs/osg/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index 1a031448b3cf..755793f7e11b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,14 +1,14 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms
 configure_args="-DLIB_POSTFIX="
 hostmakedepends="pkg-config xrandr"
 makedepends="MesaLib-devel gtkglext-devel libcurl-devel giflib-devel librsvg-devel
- jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg-devel xine-lib-devel
+ jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg4-devel xine-lib-devel
  SDL2-devel gst-plugins-base1-devel
  $(vopt_if openexr libopenexr-devel)
  $(vopt_if poppler poppler-glib-devel)

From 5e65f02f0fb010298cbec07c7443df658f1e71fe Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:13 -0400
Subject: [PATCH 014/103] xine-lib: revbump for ffmpeg4-4.4.3

---
 srcpkgs/xine-lib/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/xine-lib/template b/srcpkgs/xine-lib/template
index f713eff49b07..ed6194c17d11 100644
--- a/srcpkgs/xine-lib/template
+++ b/srcpkgs/xine-lib/template
@@ -1,6 +1,6 @@
 # Template file for 'xine-lib'
 pkgname=xine-lib
-version=1.2.12
+version=1.2.13
 revision=1
 build_style=gnu-configure
 configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
@@ -8,7 +8,7 @@ configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
 hostmakedepends="automake gettext-devel libtool pkg-config perl"
 makedepends="
  zlib-devel alsa-lib-devel libxcb-devel libSM-devel libXext-devel libXv-devel
- libXvMC-devel liba52-devel libmad-devel ffmpeg-devel pulseaudio-devel
+ libXvMC-devel liba52-devel libmad-devel ffmpeg4-devel pulseaudio-devel
  jack-devel samba-devel libflac-devel libmodplug-devel libmpcdec-devel
  speex-devel libtheora-devel libvorbis-devel libdca-devel faad2-devel
  libcdio-devel libbluray-devel aalib-devel libcaca-devel libXinerama-devel
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="http://www.xine-project.org"
 changelog="https://sourceforge.net/projects/xine/files/xine-lib/${version}/README.txt/view"
 distfiles="${SOURCEFORGE_SITE}/xine/${pkgname}-${version}.tar.xz"
-checksum=d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098
+checksum=5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f
 
 case "$XBPS_TARGET_MACHINE" in
 	i686-musl)

From 66b36d5f18ec6eaa4dc45a102e399c8fea5f345a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 015/103] QMPlay2: revbump for ffmpeg-5.1.2

---
 srcpkgs/QMPlay2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/QMPlay2/template b/srcpkgs/QMPlay2/template
index ad73cbb01bae..55284c051161 100644
--- a/srcpkgs/QMPlay2/template
+++ b/srcpkgs/QMPlay2/template
@@ -1,7 +1,7 @@
 # Template file for 'QMPlay2'
 pkgname=QMPlay2
 version=23.02.05
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="alsa-lib-devel ffmpeg-devel libass-devel libcdio-devel libgme-devel

From 18e78fb1c624a9164e8fffc7b35992bde062ca8d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 016/103] alsa-plugins: revbump for ffmpeg-5.1.2

---
 srcpkgs/alsa-plugins/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/alsa-plugins/template b/srcpkgs/alsa-plugins/template
index 0bfa6d9fd264..a5708a7d82a8 100644
--- a/srcpkgs/alsa-plugins/template
+++ b/srcpkgs/alsa-plugins/template
@@ -1,7 +1,7 @@
 # Template file for 'alsa-plugins'
 pkgname=alsa-plugins
 version=1.2.7.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-maemo-plugin"
 hostmakedepends="pkg-config"

From d7632eaeb9e981bbff6d0371b40fd9ee481396a2 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 017/103] arcan: revbump for ffmpeg-5.1.2

---
 srcpkgs/arcan/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/arcan/template b/srcpkgs/arcan/template
index 7be9652eccf3..ccc7df11ceac 100644
--- a/srcpkgs/arcan/template
+++ b/srcpkgs/arcan/template
@@ -2,7 +2,7 @@
 # !! keep synced with: acfgfs aclip aloadimage
 pkgname=arcan
 version=0.6.2.1
-revision=1
+revision=2
 create_wrksrc=yes
 build_wrksrc=arcan/src
 build_style=cmake

From 8704582c38f20188e98c6fa5a24a8e447db5033a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 018/103] attract: revbump for ffmpeg-5.1.2

---
 srcpkgs/attract/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/attract/template b/srcpkgs/attract/template
index 26144e931a3c..24017d2bacc2 100644
--- a/srcpkgs/attract/template
+++ b/srcpkgs/attract/template
@@ -1,7 +1,7 @@
 # Template file for 'attract'
 pkgname=attract
 version=2.6.2
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="VERBOSE=1"
 make_use_env=yes

From 33275fb88f631ac09d49220ce552d377f4a75c79 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 019/103] aubio: revbump for ffmpeg-5.1.2

---
 srcpkgs/aubio/patches/ffmpeg5.patch | 37 +++++++++++++++++++++++++++++
 srcpkgs/aubio/template              |  2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/aubio/patches/ffmpeg5.patch

diff --git a/srcpkgs/aubio/patches/ffmpeg5.patch b/srcpkgs/aubio/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a2c8e11ecff0
--- /dev/null
+++ b/srcpkgs/aubio/patches/ffmpeg5.patch
@@ -0,0 +1,37 @@
+commit 35eee003f034a1a2097cd4557deb773eacb18f7b
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:11 2022 +0100
+
+    aubio: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/aubio/patches/ffmpeg-5.0.patch b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..aace41a6e6
+--- /dev/null
++++ b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,25 @@
++From 8a05420e5dd8c7b8b2447f82dc919765876511b3 Mon Sep 17 00:00:00 2001
++From: Paul Brossier <piem@piem.org>
++Date: Tue, 25 Jan 2022 18:30:27 +0100
++Subject: [PATCH] [source_avcodec] define FF_API_LAVF_AVCTX for libavcodec >
++ 59, thx @berolinux (closes gh-353)
++
++---
++ src/io/source_avcodec.c | 4 ++++
++ 1 file changed, 4 insertions(+)
++
++diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c
++index e0ae93b5..1421bd9a 100644
++--- a/src/io/source_avcodec.c
+++++ b/src/io/source_avcodec.c
++@@ -68,6 +68,10 @@
++ #define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
++ #endif
++ 
+++#if LIBAVCODEC_VERSION_MAJOR >= 59
+++#define FF_API_LAVF_AVCTX 1
+++#endif
+++
++ struct _aubio_source_avcodec_t {
++   uint_t hop_size;
++   uint_t samplerate;
diff --git a/srcpkgs/aubio/template b/srcpkgs/aubio/template
index ad1c4b256991..7d875cc02541 100644
--- a/srcpkgs/aubio/template
+++ b/srcpkgs/aubio/template
@@ -1,7 +1,7 @@
 # Template file for 'aubio'
 pkgname=aubio
 version=0.4.9
-revision=1
+revision=2
 build_style=waf3
 # XXX lash, pure and swig support.
 hostmakedepends="pkg-config txt2man"

From 78b5e23ca0ceb810d2f84ff77f3bd3fc7d3d1ead Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 020/103] audacious-plugins: revbump for ffmpeg-5.1.2

---
 .../audacious-plugins/patches/ffmpeg5.patch   | 43 +++++++++++++++++++
 srcpkgs/audacious-plugins/template            |  2 +-
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/audacious-plugins/patches/ffmpeg5.patch

diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg5.patch b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..4e5e34099d71
--- /dev/null
+++ b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
@@ -0,0 +1,43 @@
+commit 298aa371c56c2f52c25a33d9bdec4918b11cebdc
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:12 2022 +0100
+
+    audacious-plugins: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..617c11215b
+--- /dev/null
++++ b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,31 @@
++From f60beb400eeb1e4778bbfd738bc4a4ccef3de539 Mon Sep 17 00:00:00 2001
++From: John Lindgren <john@jlindgren.net>
++Date: Sat, 5 Mar 2022 12:05:34 -0500
++Subject: [PATCH] Fix build with FFmpeg 5.0
++
++---
++ src/ffaudio/ffaudio-core.cc | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/src/ffaudio/ffaudio-core.cc b/src/ffaudio/ffaudio-core.cc
++index 16dc63e3a..a2b95fd6c 100644
++--- a/src/ffaudio/ffaudio-core.cc
+++++ b/src/ffaudio/ffaudio-core.cc
++@@ -274,7 +274,7 @@ static AVInputFormat * get_format_by_content (const char * name, VFSFile & file)
++         AVProbeData d = {name, buf, filled};
++         score = target;
++ 
++-        f = av_probe_input_format2 (& d, true, & score);
+++        f = (AVInputFormat *) av_probe_input_format2 (& d, true, & score);
++         if (f)
++             break;
++ 
++@@ -347,7 +347,7 @@ static bool find_codec (AVFormatContext * c, CodecInfo * cinfo)
++ #endif
++         if (stream && stream->codecpar && stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
++         {
++-            AVCodec * codec = avcodec_find_decoder (stream->codecpar->codec_id);
+++            AVCodec * codec = (AVCodec *) avcodec_find_decoder (stream->codecpar->codec_id);
++ 
++             if (codec)
++             {
diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template
index 910ec0d1891f..def0678bc611 100644
--- a/srcpkgs/audacious-plugins/template
+++ b/srcpkgs/audacious-plugins/template
@@ -2,7 +2,7 @@
 #Keep in sync with audacious!
 pkgname=audacious-plugins
 version=4.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="$(vopt_enable gtk) $(vopt_enable qt)"
 hostmakedepends="gettext pkg-config glib-devel"

From a061e9fccbf080e539fa174851e011fcc1f324bf Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 021/103] audacity: revbump for ffmpeg-5.1.2

---
 srcpkgs/audacity/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/audacity/template b/srcpkgs/audacity/template
index d509c0a89407..c18a4eeb0a73 100644
--- a/srcpkgs/audacity/template
+++ b/srcpkgs/audacity/template
@@ -1,7 +1,7 @@
 # Template file for 'audacity'
 pkgname=audacity
 version=2.4.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--with-ffmpeg=system --with-libsndfile=system --with-expat=system
  --with-libsoxr=system --with-lame=system --with-lv2=system ac_cv_path_WX_CONFIG=wx-config-gtk3"
@@ -33,5 +33,4 @@ post_install() {
 	vcopy plug-ins /usr/share/audacity
 
 	rm ${DESTDIR}/usr/share/doc/audacity/LICENSE.txt
-	vlicense LICENSE.txt LICENSE
 }

From af9054f5d774df07dd830d86dbba84c9eba89c2c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 022/103] avidemux: revbump for ffmpeg-5.1.2

---
 srcpkgs/avidemux/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/avidemux/template b/srcpkgs/avidemux/template
index 253a0243e225..557285982d2b 100644
--- a/srcpkgs/avidemux/template
+++ b/srcpkgs/avidemux/template
@@ -1,7 +1,7 @@
 # Template file for 'avidemux'
 pkgname=avidemux
 version=2.8.0
-revision=2
+revision=3
 # Can't be compiled for aarch64, arm* or mips*
 archs="x86_64* i686*"
 hostmakedepends="cmake pkg-config qt5-host-tools qt5-devel tar yasm"

From d9129b2f1ad785e82ac85b53f11a2fde9f69d5f4 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 023/103] baresip: revbump for ffmpeg-5.1.2

---
 srcpkgs/baresip/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index f1bd1817048b..b21e22334316 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=2.10.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel

From af6520f935273a0efdec6967095cf2aad5c23d00 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 024/103] blender: revbump for ffmpeg-5.1.2

---
 srcpkgs/blender/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index a3255cddbc95..4ec73e05acf5 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
 # Template file for 'blender'
 pkgname=blender
 version=3.4.1
-revision=1
+revision=2
 archs="x86_64* ppc64*"
 build_style="cmake"
 pycompile_dirs="/usr/share/blender/${version%.*}/scripts"

From 1f9def5da75202ab551e3ef5da9b045df15a1a77 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 025/103] cantata: revbump for ffmpeg-5.1.2

---
 srcpkgs/cantata/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cantata/template b/srcpkgs/cantata/template
index 4b417d80d5c2..8a90aaa4c07a 100644
--- a/srcpkgs/cantata/template
+++ b/srcpkgs/cantata/template
@@ -1,7 +1,7 @@
 # Template file for 'cantata'
 pkgname=cantata
 version=2.5.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools qt5-tools"
 makedepends="qt5-devel qt5-tools-devel qt5-svg-devel qt5-xmlpatterns-devel

From b4394643ddfb9b7f92352d246c4193e028922257 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 026/103] ccextractor: revbump for ffmpeg-5.1.2

---
 srcpkgs/ccextractor/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccextractor/template b/srcpkgs/ccextractor/template
index 9abcd82852b2..7fe2ba4f27b6 100644
--- a/srcpkgs/ccextractor/template
+++ b/srcpkgs/ccextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'ccextractor'
 pkgname=ccextractor
 version=0.93
-revision=1
+revision=2
 build_wrksrc="linux"
 build_style=gnu-configure
 configure_args="--enable-ocr --enable-hardsubx"

From 4f55a5cef210da366cd34eca96c425976667950c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 027/103] chromaprint: revbump for ffmpeg-5.1.2

---
 srcpkgs/chromaprint/patches/ffmpeg5.patch | 569 ++++++++++++++++++++++
 srcpkgs/chromaprint/template              |   2 +-
 2 files changed, 570 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/chromaprint/patches/ffmpeg5.patch

diff --git a/srcpkgs/chromaprint/patches/ffmpeg5.patch b/srcpkgs/chromaprint/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a9fd307a23c8
--- /dev/null
+++ b/srcpkgs/chromaprint/patches/ffmpeg5.patch
@@ -0,0 +1,569 @@
+From 8ccad6937177b1b92e40ab8f4447ea27bac009a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
+Date: Fri, 4 Nov 2022 21:47:38 +0100
+Subject: [PATCH] Use FFmpeg 5.x (#120)
+
+* Use FFmpeg 5.1.2 for CI builds
+
+* Build on Ubuntu 20.04
+
+* Upgrade code to FFmpeg 5.x APIs
+
+* Only set FFmpeg include dirs if building tools
+
+* No longer needed
+
+* Use ubuntu 20.04
+---
+ .github/workflows/build.yml                   |   6 +-
+ CMakeLists.txt                                |  16 --
+ package/build.sh                              |   4 +-
+ src/audio/ffmpeg_audio_processor.h            |   2 -
+ src/audio/ffmpeg_audio_processor_avresample.h |  72 -------
+ src/audio/ffmpeg_audio_processor_swresample.h |  18 +-
+ src/audio/ffmpeg_audio_reader.h               | 197 +++++++++---------
+ tests/CMakeLists.txt                          |   6 +
+ 8 files changed, 122 insertions(+), 199 deletions(-)
+ delete mode 100644 src/audio/ffmpeg_audio_processor_avresample.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8d6a32..4da2405 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -84,9 +84,6 @@ find_package(FFmpeg)
+ if(FFMPEG_LIBRARIES)
+ 	cmake_push_check_state(RESET)
+ 	set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lm)
+-	check_function_exists(av_packet_unref HAVE_AV_PACKET_UNREF)
+-	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
+-	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
+ 	cmake_pop_check_state()
+ endif()
+
+@@ -163,14 +160,11 @@ message(STATUS "Using ${FFT_LIB} for FFT calculations")
+ if(NOT AUDIO_PROCESSOR_LIB)
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+ 		set(AUDIO_PROCESSOR_LIB "swresample")
+-	elseif(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(AUDIO_PROCESSOR_LIB "avresample")
+ 	endif()
+ endif()
+
+ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE OFF)
+ 		set(USE_SWRESAMPLE ON)
+ 		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+ 		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS})
+@@ -178,16 +172,6 @@ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+ 	endif()
+ 	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+-elseif(AUDIO_PROCESSOR_LIB STREQUAL "avresample")
+-	if(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE ON)
+-		set(USE_SWRESAMPLE OFF)
+-		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBAVRESAMPLE_LIBRARIES})
+-		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS})
+-	else()
+-		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+-	endif()
+-	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+ else()
+ 	message(STATUS "Building without audio conversion support, please install FFmpeg with libswresample")
+ endif()
+diff --git a/package/build.sh b/package/build.sh
+index da631ae..b41d36e 100755
+--- a/package/build.sh
++++ b/package/build.sh
+@@ -7,8 +7,8 @@ set -eux
+
+ BASE_DIR=$(cd $(dirname $0)/.. && pwd)
+
+-FFMPEG_VERSION=4.4.1
+-FFMPEG_BUILD_TAG=v4.4.1-1
++FFMPEG_VERSION=5.1.2
++FFMPEG_BUILD_TAG=v${FFMPEG_VERSION}-1
+
+ TMP_BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX)
+ trap 'rm -rf $TMP_BUILD_DIR' EXIT
+diff --git a/src/audio/ffmpeg_audio_processor.h b/src/audio/ffmpeg_audio_processor.h
+index 7628fc7..39f4f6d 100644
+--- a/src/audio/ffmpeg_audio_processor.h
++++ b/src/audio/ffmpeg_audio_processor.h
+@@ -10,8 +10,6 @@
+
+ #if defined(USE_SWRESAMPLE)
+ #include "audio/ffmpeg_audio_processor_swresample.h"
+-#elif defined(USE_AVRESAMPLE)
+-#include "audio/ffmpeg_audio_processor_avresample.h"
+ #else
+ #error "no audio processing library"
+ #endif
+diff --git a/src/audio/ffmpeg_audio_processor_avresample.h b/src/audio/ffmpeg_audio_processor_avresample.h
+deleted file mode 100644
+index bd85f92..0000000
+--- a/src/audio/ffmpeg_audio_processor_avresample.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-// Copyright (C) 2016  Lukas Lalinsky
+-// Distributed under the MIT license, see the LICENSE file for details.
+-
+-#ifndef CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-#define CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-
+-extern "C" {
+-#include <libavresample/avresample.h>
+-}
+-
+-namespace chromaprint {
+-
+-class FFmpegAudioProcessor {
+-public:
+-	FFmpegAudioProcessor() {
+-		m_resample_ctx = avresample_alloc_context();
+-	}
+-
+-	~FFmpegAudioProcessor() {
+-		avresample_free(&m_resample_ctx);
+-	}
+-
+-	void SetCompatibleMode() {
+-		av_opt_set_int(m_resample_ctx, "filter_size", 16, 0);
+-		av_opt_set_int(m_resample_ctx, "phase_shift", 8, 0);
+-		av_opt_set_int(m_resample_ctx, "linear_interp", 1, 0);
+-		av_opt_set_double(m_resample_ctx, "cutoff", 0.8, 0);
+-	}
+-
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "in_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_rate", sample_rate, 0);
+-	}
+-
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "out_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_rate, 0);
+-	}
+-
+-	int Init() {
+-		return avresample_open(m_resample_ctx);
+-	}
+-
+-	int Convert(uint8_t **out, int out_count, const uint8_t **in, int in_count) {
+-		return avresample_convert(m_resample_ctx, out, 0, out_count, (uint8_t **) in, 0, in_count);
+-	}
+-
+-	int Flush(uint8_t **out, int out_count) {
+-		return avresample_read(m_resample_ctx, out, out_count);
+-	}
+-
+-private:
+-	AVAudioResampleContext *m_resample_ctx = nullptr;
+-};
+-
+-}; // namespace chromaprint
+-
+-#endif
+diff --git a/src/audio/ffmpeg_audio_processor_swresample.h b/src/audio/ffmpeg_audio_processor_swresample.h
+index b86266b..b1d4bea 100644
+--- a/src/audio/ffmpeg_audio_processor_swresample.h
++++ b/src/audio/ffmpeg_audio_processor_swresample.h
+@@ -28,30 +28,28 @@ public:
+ 		av_opt_set_double(m_swr_ctx, "cutoff", 0.8, 0);
+ 	}
+
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "icl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "ich", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetInputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "isf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "in_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "isr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "in_sample_rate", sample_rate, 0);
+ 	}
+
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "ocl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "och", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "osf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "out_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "osr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "out_sample_rate", sample_rate, 0);
+ 	}
+
+ 	int Init() {
+diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h
+index 5550164..1c6b346 100644
+--- a/src/audio/ffmpeg_audio_reader.h
++++ b/src/audio/ffmpeg_audio_reader.h
+@@ -62,7 +62,7 @@ public:
+ 	bool Read(const int16_t **data, size_t *size);
+
+ 	bool IsOpen() const { return m_opened; }
+-	bool IsFinished() const { return m_finished && !m_got_frame; }
++	bool IsFinished() const { return !m_has_more_packets && !m_has_more_frames; }
+
+ 	std::string GetError() const { return m_error; }
+ 	int GetErrorCode() const { return m_error_code; }
+@@ -74,20 +74,19 @@ private:
+ 	uint8_t *m_convert_buffer[1] = { nullptr };
+ 	int m_convert_buffer_nb_samples = 0;
+
+-	AVInputFormat *m_input_fmt = nullptr;
++	const AVInputFormat *m_input_fmt = nullptr;
+ 	AVDictionary *m_input_opts = nullptr;
+
+ 	AVFormatContext *m_format_ctx = nullptr;
+ 	AVCodecContext *m_codec_ctx = nullptr;
+-	AVFrame *m_frame = nullptr;
+ 	int m_stream_index = -1;
+ 	std::string m_error;
+ 	int m_error_code = 0;
+-	bool m_finished = false;
+ 	bool m_opened = false;
+-	int m_got_frame = 0;
+-	AVPacket m_packet;
+-	AVPacket m_packet0;
++	bool m_has_more_packets = true;
++	bool m_has_more_frames = true;
++	AVPacket *m_packet = nullptr;
++	AVFrame *m_frame = nullptr;
+
+ 	int m_output_sample_rate = 0;
+ 	int m_output_channels = 0;
+@@ -98,19 +97,12 @@ private:
+
+ inline FFmpegAudioReader::FFmpegAudioReader() {
+ 	av_log_set_level(AV_LOG_QUIET);
+-
+-	av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
+ }
+
+ inline FFmpegAudioReader::~FFmpegAudioReader() {
+ 	Close();
+ 	av_dict_free(&m_input_opts);
+ 	av_freep(&m_convert_buffer[0]);
+-	av_packet_unref(&m_packet0);
+ }
+
+ inline bool FFmpegAudioReader::SetInputFormat(const char *name) {
+@@ -135,11 +127,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ 	Close();
+
+-    av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
++	m_packet = av_packet_alloc();
++	if (!m_packet) {
++		return false;
++	}
+
+ 	ret = avformat_open_input(&m_format_ctx, file_name.c_str(), m_input_fmt, &m_input_opts);
+ 	if (ret < 0) {
+@@ -153,26 +144,31 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		return false;
+ 	}
+
+-	AVCodec *codec;
++	const AVCodec *codec;
+ 	ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
+ 	if (ret < 0) {
+ 		SetError("Could not find any audio stream in the file", ret);
+ 		return false;
+ 	}
+ 	m_stream_index = ret;
++	auto stream = m_format_ctx->streams[m_stream_index];
+
+-	m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec;
++	m_codec_ctx = avcodec_alloc_context3(codec);
+ 	m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
+
++	ret = avcodec_parameters_to_context(m_codec_ctx, stream->codecpar);
++	if (ret < 0) {
++		SetError("Could not copy the stream parameters", ret);
++		return false;
++	}
++
+ 	ret = avcodec_open2(m_codec_ctx, codec, nullptr);
+ 	if (ret < 0) {
+ 		SetError("Could not open the codec", ret);
+ 		return false;
+ 	}
+
+-	if (!m_codec_ctx->channel_layout) {
+-		m_codec_ctx->channel_layout = av_get_default_channel_layout(m_codec_ctx->channels);
+-	}
++	av_dump_format(m_format_ctx, 0, "foo", 0);
+
+ 	m_frame = av_frame_alloc();
+ 	if (!m_frame) {
+@@ -183,19 +179,23 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		m_output_sample_rate = m_codec_ctx->sample_rate;
+ 	}
+
+-	if (!m_output_channels) {
+-		m_output_channels = m_codec_ctx->channels;
++	AVChannelLayout output_channel_layout;
++	if (m_output_channels) {
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
++	} else {
++		m_output_channels = m_codec_ctx->ch_layout.nb_channels;
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
+ 	}
+
+-	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
++	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
+ 		m_converter.reset(new FFmpegAudioProcessor());
+ 		m_converter->SetCompatibleMode();
+ 		m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
+ 		m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
+-		m_converter->SetInputChannelLayout(m_codec_ctx->channel_layout);
++		m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
+ 		m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
+ 		m_converter->SetOutputSampleRate(m_output_sample_rate);
+-		m_converter->SetOutputChannelLayout(av_get_default_channel_layout(m_output_channels));
++		m_converter->SetOutputChannelLayout(&output_channel_layout);
+ 		auto ret = m_converter->Init();
+ 		if (ret != 0) {
+ 			SetError("Could not create an audio converter instance", ret);
+@@ -203,10 +203,11 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		}
+ 	}
+
++	av_channel_layout_uninit(&output_channel_layout);
++
+ 	m_opened = true;
+-	m_finished = false;
+-	m_got_frame = 0;
+-	m_nb_packets = 0;
++	m_has_more_packets = true;
++	m_has_more_frames = true;
+ 	m_decode_error = 0;
+
+ 	return true;
+@@ -214,6 +215,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ inline void FFmpegAudioReader::Close() {
+ 	av_frame_free(&m_frame);
++	av_packet_free(&m_packet);
+
+ 	m_stream_index = -1;
+
+@@ -252,91 +254,98 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
+ 		return false;
+ 	}
+
++	*data = nullptr;
++	*size = 0;
++
+ 	int ret;
++	bool needs_packet = false;
+ 	while (true) {
+-		while (m_packet.size <= 0) {
+-			av_packet_unref(&m_packet0);
+-			av_init_packet(&m_packet);
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			ret = av_read_frame(m_format_ctx, &m_packet);
++		while (needs_packet && m_packet->size == 0) {
++			ret = av_read_frame(m_format_ctx, m_packet);
+ 			if (ret < 0) {
+ 				if (ret == AVERROR_EOF) {
+-					m_finished = true;
++					needs_packet = false;
++					m_has_more_packets = false;
+ 					break;
+-				} else {
++				}
++				SetError("Error reading from the audio source", ret);
++				return false;
++			}
++			if (m_packet->stream_index == m_stream_index) {
++				needs_packet = false;
++			} else {
++				av_packet_unref(m_packet);
++			}
++		}
++
++		if (m_packet->size != 0) {
++			ret = avcodec_send_packet(m_codec_ctx, m_packet);
++			if (ret < 0) {
++				if (ret != AVERROR(EAGAIN)) {
+ 					SetError("Error reading from the audio source", ret);
+ 					return false;
+ 				}
+-			}
+-			m_packet0 = m_packet;
+-			if (m_packet.stream_index != m_stream_index) {
+-				m_packet.data = nullptr;
+-				m_packet.size = 0;
+ 			} else {
+-				m_nb_packets++;
++				av_packet_unref(m_packet);
+ 			}
+ 		}
+
+-		ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet);
++		ret = avcodec_receive_frame(m_codec_ctx, m_frame);
+ 		if (ret < 0) {
+-			if (m_decode_error) {
+-				SetError("Error decoding audio frame", m_decode_error);
+-				return false;
++			if (ret == AVERROR_EOF) {
++				m_has_more_frames = false;
++			} else if (ret == AVERROR(EAGAIN)) {
++				if (m_has_more_packets) {
++					needs_packet = true;
++					continue;
++				} else {
++					m_has_more_frames = false;
++				}
+ 			}
+-			m_decode_error = ret;
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			continue;
++			SetError("Error decoding the audio source", ret);
++			return false;
+ 		}
+
+-		break;
+-	}
+-
+-	m_decode_error = 0;
+-
+-	const int decoded = std::min(ret, m_packet.size);
+-	m_packet.data += decoded;
+-	m_packet.size -= decoded;
+-
+-	if (m_got_frame) {
+-		if (m_converter) {
+-			if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
+-				int linsize;
+-				av_freep(&m_convert_buffer[0]);
+-				m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
+-				ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
+-				if (ret < 0) {
+-					SetError("Couldn't allocate audio converter buffer", ret);
++		if (m_frame->nb_samples > 0) {
++			if (m_converter) {
++				if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
++					int linsize;
++					av_freep(&m_convert_buffer[0]);
++					m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
++					ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
++					if (ret < 0) {
++						SetError("Couldn't allocate audio converter buffer", ret);
++						return false;
++					}
++				}
++				auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
++				if (nb_samples < 0) {
++					SetError("Couldn't convert audio", ret);
+ 					return false;
+ 				}
+-			}
+-			auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			}
+-			*data = (const int16_t *) m_convert_buffer[0];
+-			*size = nb_samples;
+-		} else {
+-			*data = (const int16_t *) m_frame->data[0];
+-			*size = m_frame->nb_samples;
+-		}
+-	} else {
+-		if (m_finished && m_converter) {
+-			auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			} else if (nb_samples > 0) {
+-				m_got_frame = 1;
+ 				*data = (const int16_t *) m_convert_buffer[0];
+ 				*size = nb_samples;
++			} else {
++				*data = (const int16_t *) m_frame->data[0];
++				*size = m_frame->nb_samples;
++			}
++		} else {
++			if (m_converter) {
++				if (IsFinished()) {
++					auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
++					if (nb_samples < 0) {
++						SetError("Couldn't convert audio", ret);
++						return false;
++					} else if (nb_samples > 0) {
++						*data = (const int16_t *) m_convert_buffer[0];
++						*size = nb_samples;
++					}
++				}
+ 			}
+ 		}
+-	}
+
+-	return true;
++		return true;
++	}
+ }
+
+ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index a2b517b..123e643 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -38,6 +38,12 @@ set(SRCS
+
+ if(BUILD_TOOLS)
+ 	set(SRCS ${SRCS} ../src/audio/ffmpeg_audio_reader_test.cpp)
++    include_directories(
++        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
++        ${AUDIO_PROCESSOR_INCLUDE_DIRS}
++    )
+ 	link_libraries(fpcalc_libs)
+ endif()
+
+-- 
+2.38.1
+
+
diff --git a/srcpkgs/chromaprint/template b/srcpkgs/chromaprint/template
index 7ef7838949f3..1f7bbc70a22c 100644
--- a/srcpkgs/chromaprint/template
+++ b/srcpkgs/chromaprint/template
@@ -1,7 +1,7 @@
 # Template file for 'chromaprint'
 pkgname=chromaprint
 version=1.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TOOLS=ON"
 make_check_target="check"

From af914181c72330553cba72fc4919e2bdcad8049a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 028/103] chromium: revbump for ffmpeg-5.1.2

---
 srcpkgs/chromium/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 3c1c1caf3765..1f28cde5d3c1 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,7 +2,7 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=111.0.5563.64
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
  $(vopt_if clang "clang lld llvm12")

From f9a9c618af205def5361c18e347b18d6b0c9a760 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 029/103] cmus: revbump for ffmpeg-5.1.2

---
 srcpkgs/cmus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cmus/template b/srcpkgs/cmus/template
index 0fcb424ce336..05b77d0fecae 100644
--- a/srcpkgs/cmus/template
+++ b/srcpkgs/cmus/template
@@ -1,7 +1,7 @@
 # Template file for 'cmus'
 pkgname=cmus
 version=2.10.0
-revision=1
+revision=2
 build_style=configure
 configure_args="prefix=/usr LD=$CC"
 hostmakedepends="pkg-config"

From ec4c3b40964cd0e9375930f9fd6801991099941c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 030/103] cyanrip: revbump for ffmpeg-5.1.2

---
 srcpkgs/cyanrip/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cyanrip/template b/srcpkgs/cyanrip/template
index 9796e3461601..5db30e020d17 100644
--- a/srcpkgs/cyanrip/template
+++ b/srcpkgs/cyanrip/template
@@ -1,7 +1,7 @@
 # Template file for 'cyanrip'
 pkgname=cyanrip
 version=0.9.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="ffmpeg-devel libcdio-devel libcdio-paranoia-devel libcurl-devel libmusicbrainz5-devel"

From e09768b2b041a78446e59535e407d6fcb14f2a40 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 031/103] deadbeef: revbump for ffmpeg-5.1.2

---
 srcpkgs/deadbeef/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/deadbeef/template b/srcpkgs/deadbeef/template
index b664bb1b9bd9..f0fcced864be 100644
--- a/srcpkgs/deadbeef/template
+++ b/srcpkgs/deadbeef/template
@@ -1,7 +1,7 @@
 # Template file for 'deadbeef'
 pkgname=deadbeef
 version=1.8.8
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-oss --disable-lfm --disable-notify --disable-gtk2"

From 4ea7b470bed8abb28c3de3e843a930cf6ca54038 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 032/103] dolphin-emu: revbump for ffmpeg-5.1.2

---
 srcpkgs/dolphin-emu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/dolphin-emu/template b/srcpkgs/dolphin-emu/template
index 7ea197ceb2a8..7aeb0a5b645e 100644
--- a/srcpkgs/dolphin-emu/template
+++ b/srcpkgs/dolphin-emu/template
@@ -1,7 +1,7 @@
 # Template file for 'dolphin-emu'
 pkgname=dolphin-emu
 version=5.0.16101
-revision=1
+revision=2
 _dolphin_commit=8ecfa537a242de74d2e372e30d9d79b14584b2fb
 _mgba_commit=40d4c430fc36caeb7ea32fd39624947ed487d2f2
 #Version/hash pair can be found at https://dolphin-emu.org/download/

From 29f4f566105c65695318a0282e65e33df5d50e84 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 033/103] droidcam-obs-plugin: revbump for ffmpeg-5.1.2

---
 srcpkgs/droidcam-obs-plugin/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/droidcam-obs-plugin/template b/srcpkgs/droidcam-obs-plugin/template
index fc9c9bf6b9d5..fb0480754df4 100644
--- a/srcpkgs/droidcam-obs-plugin/template
+++ b/srcpkgs/droidcam-obs-plugin/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam-obs-plugin'
 pkgname=droidcam-obs-plugin
 version=2.0.1
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=yes
 make_build_args="ALLOW_STATIC=no"

From 08ae9f56b34c9c681bd5d67f8d4cec019e3ff8cb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 034/103] droidcam: revbump for ffmpeg-5.1.2

---
 srcpkgs/droidcam/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/droidcam/template b/srcpkgs/droidcam/template
index 1c3f1b8b1fc6..32a9220b79a4 100644
--- a/srcpkgs/droidcam/template
+++ b/srcpkgs/droidcam/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam'
 pkgname=droidcam
 version=1.8.2
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="USBMUXD=-lusbmuxd-2.0 JPEG=-lturbojpeg"
 hostmakedepends="pkg-config"

From 2f6c5cead34689f23a86debf1cf0c8688ddae258 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 035/103] electron19: revbump for ffmpeg-5.1.2

---
 srcpkgs/electron19/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/electron19/template b/srcpkgs/electron19/template
index 068136be7623..32ce301e730c 100644
--- a/srcpkgs/electron19/template
+++ b/srcpkgs/electron19/template
@@ -1,7 +1,7 @@
 # Template file for 'electron19'
 pkgname=electron19
 version=19.0.8
-revision=2
+revision=3
 _nodever=16.14.2
 _chromiumver=102.0.5005.125
 archs="x86_64* aarch64* ppc64le*"

From e69d3b5678cc2078e59ae29ef13989faf2e8443b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 036/103] ffmpegthumbnailer: revbump for ffmpeg-5.1.2

---
 srcpkgs/ffmpegthumbnailer/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ffmpegthumbnailer/template b/srcpkgs/ffmpegthumbnailer/template
index 039eea7622b3..35d546018d12 100644
--- a/srcpkgs/ffmpegthumbnailer/template
+++ b/srcpkgs/ffmpegthumbnailer/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbnailer'
 pkgname=ffmpegthumbnailer
 version=2.2.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libpng-devel libjpeg-turbo-devel ffmpeg-devel"
@@ -9,8 +9,8 @@ depends="ffmpeg"
 short_desc="Lightweight video thumbnailer"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
-homepage="https://github.com/dirkvdb/${pkgname}"
-distfiles="${homepage}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
+homepage="https://github.com/dirkvdb"
+distfiles="${homepage}/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
 checksum=1cb24059c38223f657b300c84dd80491b7040d4b69471c4fea69be862bc99b5b
 
 post_install() {

From cbbd91637caf896022e4a4f052e5bc023f107e20 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 037/103] ffmpegthumbs: revbump for ffmpeg-5.1.2

---
 srcpkgs/ffmpegthumbs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ffmpegthumbs/template b/srcpkgs/ffmpegthumbs/template
index 5f0b9414dada..11b88193528f 100644
--- a/srcpkgs/ffmpegthumbs/template
+++ b/srcpkgs/ffmpegthumbs/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbs'
 pkgname=ffmpegthumbs
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules kcoreaddons kconfig-devel
  pkg-config qt5-host-tools qt5-qmake gettext"

From 0be6ab730ba9218e0a8f33ac9f83afb7ffa0b170 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 038/103] ffms2: revbump for ffmpeg-5.1.2

---
 srcpkgs/ffms2/patches/ffmpeg5.patch | 419 ++++++++++++++++++++++++++++
 srcpkgs/ffms2/template              |   2 +-
 2 files changed, 420 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ffms2/patches/ffmpeg5.patch

diff --git a/srcpkgs/ffms2/patches/ffmpeg5.patch b/srcpkgs/ffms2/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..0766db172473
--- /dev/null
+++ b/srcpkgs/ffms2/patches/ffmpeg5.patch
@@ -0,0 +1,419 @@
+From 28fc493fda2fa2064afeeb0a5d85fdc42db05dcf Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:12:41 +0100
+Subject: [PATCH 1/3] all: Update AVPacket API usage
+
+AVPackets must all be on the heap now, since it is no longer
+part of the libav* ABI.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 16 ++++++----
+ src/core/indexing.cpp    | 63 ++++++++++++++++++++++------------------
+ src/core/indexing.h      |  4 +--
+ src/core/utils.cpp       |  6 ----
+ src/core/utils.h         |  1 -
+ src/core/videosource.cpp | 30 ++++++++++---------
+ 6 files changed, 64 insertions(+), 56 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index 37cf9aeef..e4ce97cdb 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -285,10 +285,15 @@ FFMS_AudioSource::AudioBlock *FFMS_AudioSource::CacheBlock(CacheIterator &pos) {
+ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     CurrentFrame = &Frames[PacketNumber];
+
+-    AVPacket Packet;
+-    if (!ReadPacket(&Packet))
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++    if (!ReadPacket(Packet)) {
++        av_packet_free(&Packet);
+         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_UNKNOWN,
+             "ReadPacket unexpectedly failed to read a packet");
++    }
+
+     // ReadPacket may have changed the packet number
+     CurrentFrame = &Frames[PacketNumber];
+@@ -297,8 +302,9 @@ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     int NumberOfSamples = 0;
+     AudioBlock *CachedBlock = nullptr;
+
+-    int Ret = avcodec_send_packet(CodecContext, &Packet);
+-    av_packet_unref(&Packet);
++    int Ret = avcodec_send_packet(CodecContext, Packet);
++    av_packet_unref(Packet);
++    av_packet_free(&Packet);
+
+     av_frame_unref(DecodeFrame);
+     Ret = avcodec_receive_frame(CodecContext, DecodeFrame);
+@@ -513,8 +519,6 @@ void FFMS_AudioSource::Seek() {
+ }
+
+ bool FFMS_AudioSource::ReadPacket(AVPacket *Packet) {
+-    InitNullPacket(*Packet);
+-
+     while (av_read_frame(FormatContext, Packet) >= 0) {
+         if (Packet->stream_index == TrackNumber) {
+             // Required because not all audio packets, especially in ogg, have a pts. Use the previous valid packet's pts instead.
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index 23fb95b12..e547c5abf 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -320,7 +320,7 @@ void FFMS_Indexer::CheckAudioProperties(int Track, AVCodecContext *Context) {
+     }
+ }
+
+-void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict,
++void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict,
+                                     int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct) {
+     if (VideoContext.Parser) {
+         uint8_t *OB;
+@@ -330,8 +330,8 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+         av_parser_parse2(VideoContext.Parser,
+             VideoContext.CodecContext,
+             &OB, &OBSize,
+-            pkt.data, pkt.size,
+-            pkt.pts, pkt.dts, pkt.pos);
++            pkt->data, pkt->size,
++            pkt->pts, pkt->dts, pkt->pos);
+
+         // H.264 (PAFF) and HEVC may have one field per packet, so we need to track
+         // when we have a full or half frame available, and mark one of them as
+@@ -351,15 +351,15 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+
+         *RepeatPict = VideoContext.Parser->repeat_pict;
+         *FrameType = VideoContext.Parser->pict_type;
+-        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt.flags & AV_PKT_FLAG_DISCARD));
++        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt->flags & AV_PKT_FLAG_DISCARD));
+     } else {
+-        *Invisible = !!(pkt.flags & AV_PKT_FLAG_DISCARD);
++        *Invisible = !!(pkt->flags & AV_PKT_FLAG_DISCARD);
+     }
+
+     if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP8)
+-        ParseVP8(pkt.data[0], Invisible, FrameType);
++        ParseVP8(pkt->data[0], Invisible, FrameType);
+     else if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP9)
+-        ParseVP9(pkt.data[0], Invisible, FrameType);
++        ParseVP9(pkt->data[0], Invisible, FrameType);
+ }
+
+ void FFMS_Indexer::Free() {
+@@ -458,32 +458,36 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+         }
+     }
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
+     std::vector<int64_t> LastValidTS(FormatContext->nb_streams, AV_NOPTS_VALUE);
+
+     int64_t filesize = avio_size(FormatContext->pb);
+     enum AVPictureStructure LastPicStruct = AV_PICTURE_STRUCTURE_UNKNOWN;
+-    while (av_read_frame(FormatContext, &Packet) >= 0) {
++    while (av_read_frame(FormatContext, Packet) >= 0) {
+         // Update progress
+         // FormatContext->pb can apparently be NULL when opening images.
+         if (IC && FormatContext->pb) {
+-            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate))
++            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate)) {
++                av_packet_free(&Packet);
+                 throw FFMS_Exception(FFMS_ERROR_CANCELLED, FFMS_ERROR_USER,
+                     "Cancelled by user");
++            }
+         }
+-        if (!IndexMask.count(Packet.stream_index)) {
+-            av_packet_unref(&Packet);
++        if (!IndexMask.count(Packet->stream_index)) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+-        int Track = Packet.stream_index;
++        int Track = Packet->stream_index;
+         FFMS_Track &TrackInfo = (*TrackIndices)[Track];
+-        bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
++        bool KeyFrame = !!(Packet->flags & AV_PKT_FLAG_KEY);
+         ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
+
+         if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            int64_t PTS = TrackInfo.UseDTS ? Packet.dts : Packet.pts;
++            int64_t PTS = TrackInfo.UseDTS ? Packet->dts : Packet->pts;
+             if (PTS == AV_NOPTS_VALUE) {
+                 // VPx alt-refs are output as packets which lack timestmps or durations, since
+                 // they are invisible. Currently, the timestamp mangling code in libavformat
+@@ -495,9 +499,11 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 // FFMS2 currently sorts packets by PTS, which will break decoding, otherwise.
+                 bool HasAltRefs = (FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP8 ||
+                                    FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP9);
+-                if (Packet.duration == 0 && !HasAltRefs)
++                if (Packet->duration == 0 && !HasAltRefs) {
++                    av_packet_free(&Packet);
+                     throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER,
+                         "Invalid packet pts, dts, and duration");
++                }
+
+                 if (TrackInfo.empty())
+                     PTS = 0;
+@@ -513,7 +519,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             ParseVideoPacket(AVContexts[Track], Packet, &RepeatPict, &FrameType, &Invisible, &LastPicStruct);
+
+             TrackInfo.AddVideoFrame(PTS, RepeatPict, KeyFrame,
+-                FrameType, Packet.pos, Invisible);
++                FrameType, Packet->pos, Invisible);
+         } else if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+             // For video seeking timestamps are used only if all packets have
+             // timestamps, while for audio they're used if any have timestamps,
+@@ -522,28 +528,29 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 TrackInfo.HasTS = true;
+
+             int64_t StartSample = AVContexts[Track].CurrentSample;
+-            uint32_t SampleCount = IndexAudioPacket(Track, &Packet, AVContexts[Track], *TrackIndices);
++            uint32_t SampleCount = IndexAudioPacket(Track, Packet, AVContexts[Track], *TrackIndices);
+             TrackInfo.SampleRate = AVContexts[Track].CodecContext->sample_rate;
+
+             TrackInfo.AddAudioFrame(LastValidTS[Track],
+-                StartSample, SampleCount, KeyFrame, Packet.pos, Packet.flags & AV_PKT_FLAG_DISCARD);
++                StartSample, SampleCount, KeyFrame, Packet->pos, Packet->flags & AV_PKT_FLAG_DISCARD);
+         }
+
+-        if (!(Packet.flags & AV_PKT_FLAG_DISCARD))
+-            TrackInfo.LastDuration = Packet.duration;
++        if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
++            TrackInfo.LastDuration = Packet->duration;
+
+-        av_packet_unref(&Packet);
++        av_packet_unref(Packet);
+     }
++    av_packet_free(&Packet);
+
+     TrackIndices->Finalize(AVContexts, FormatContext->iformat->name);
+     return TrackIndices.release();
+ }
+
+-void FFMS_Indexer::ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS) {
+-    if (!UseDTS && Packet.pts != AV_NOPTS_VALUE)
+-        TS = Packet.pts;
++void FFMS_Indexer::ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS) {
++    if (!UseDTS && Packet->pts != AV_NOPTS_VALUE)
++        TS = Packet->pts;
+     if (TS == AV_NOPTS_VALUE)
+         UseDTS = true;
+-    if (UseDTS && Packet.dts != AV_NOPTS_VALUE)
+-        TS = Packet.dts;
++    if (UseDTS && Packet->dts != AV_NOPTS_VALUE)
++        TS = Packet->dts;
+ }
+diff --git a/src/core/indexing.h b/src/core/indexing.h
+index 3cfc3c30b..5c0686889 100644
+--- a/src/core/indexing.h
++++ b/src/core/indexing.h
+@@ -80,10 +80,10 @@ struct FFMS_Indexer {
+     int64_t Filesize;
+     uint8_t Digest[20];
+
+-    void ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS);
++    void ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS);
+     void CheckAudioProperties(int Track, AVCodecContext *Context);
+     uint32_t IndexAudioPacket(int Track, AVPacket *Packet, SharedAVContext &Context, FFMS_Index &TrackIndices);
+-    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
++    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
+     void Free();
+ public:
+     FFMS_Indexer(const char *Filename);
+diff --git a/src/core/utils.cpp b/src/core/utils.cpp
+index ce67533fd..8a2e99710 100644
+--- a/src/core/utils.cpp
++++ b/src/core/utils.cpp
+@@ -62,12 +62,6 @@ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo) {
+     }
+ }
+
+-void InitNullPacket(AVPacket &pkt) {
+-    av_init_packet(&pkt);
+-    pkt.data = nullptr;
+-    pkt.size = 0;
+-}
+-
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames) {
+     AP.SampleFormat = static_cast<FFMS_SampleFormat>(av_get_packed_sample_fmt(CTX->sample_fmt));
+     AP.BitsPerSample = av_get_bytes_per_sample(CTX->sample_fmt) * 8;
+diff --git a/src/core/utils.h b/src/core/utils.h
+index 9819dc7c9..003ab794e 100644
+--- a/src/core/utils.h
++++ b/src/core/utils.h
+@@ -58,7 +58,6 @@ std::unique_ptr<T> make_unique(Args&&... args) {
+ }
+
+ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo);
+-void InitNullPacket(AVPacket &pkt);
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames);
+
+ void LAVFOpenFile(const char *SourceFile, AVFormatContext *&FormatContext, int Track);
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index 06bd1610e..b889970e2 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -673,30 +673,34 @@ void FFMS_VideoSource::DecodeNextFrame(int64_t &AStartTime, int64_t &Pos) {
+     if (HasPendingDelayedFrames())
+         return;
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
+-
+-    while (ReadFrame(&Packet) >= 0) {
+-        if (Packet.stream_index != VideoTrack) {
+-            av_packet_unref(&Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++
++    while (ReadFrame(Packet) >= 0) {
++        if (Packet->stream_index != VideoTrack) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+         if (AStartTime < 0)
+-            AStartTime = Frames.UseDTS ? Packet.dts : Packet.pts;
++            AStartTime = Frames.UseDTS ? Packet->dts : Packet->pts;
+
+         if (Pos < 0)
+-            Pos = Packet.pos;
++            Pos = Packet->pos;
+
+-        bool FrameFinished = DecodePacket(&Packet);
+-        av_packet_unref(&Packet);
+-        if (FrameFinished)
++        bool FrameFinished = DecodePacket(Packet);
++        av_packet_unref(Packet);
++        if (FrameFinished) {
++            av_packet_free(&Packet);
+             return;
++        }
+     }
+
+     // Flush final frames
+-    InitNullPacket(Packet);
+-    DecodePacket(&Packet);
++    DecodePacket(Packet);
++    av_packet_free(&Packet);
+ }
+
+ bool FFMS_VideoSource::SeekTo(int n, int SeekOffset) {
+
+From bf9e03e9e08534c024e5a744a6437c4aac160201 Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:20:47 +0100
+Subject: [PATCH 2/3] configure: Remove deprecated API use
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b35ef80bc..d19714d0f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,10 +102,10 @@ CFLAGS="$_CFLAGS $FFMPEG_CFLAGS"
+
+ AC_DEFUN([TEST_FFMPEG],
+          [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-            #include <libavcodec/avcodec.h>
++            #include <libavformat/avformat.h>
+             #include <libswscale/swscale.h>
+             ]],[[
+-                avcodec_register_all();
++                avformat_network_init();
+                 swscale_version();
+             ]])], [eval $1=yes], [eval $1=no])
+         ])
+
+From a18c8296687e267b20ec90ef81671b77d393a36e Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:41:21 +0100
+Subject: [PATCH 3/3] Use auto for AVCodec
+
+The geniuses over at FFmpeg decided to constify this API, so old
+versions of the library will return AVCodec *, while new versions
+of the libary will return const AVCodec *, which, in C++, are not
+OK to convert between.
+
+Rather than use some macro hell in ffmscompat.h, we can work around
+this by using auto.
+
+Gross.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 2 +-
+ src/core/indexing.cpp    | 6 +++---
+ src/core/videosource.cpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index e4ce97cdb..ac0966636 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -469,7 +469,7 @@ void FFMS_AudioSource::OpenFile() {
+
+     LAVFOpenFile(SourceFile.c_str(), FormatContext, TrackNumber);
+
+-    AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
++    auto *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
+     if (Codec == nullptr)
+         throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+             "Audio codec not found");
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index e547c5abf..59fb4e8ea 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -384,7 +384,7 @@ FFMS_TrackType FFMS_Indexer::GetTrackType(int Track) {
+ }
+
+ const char *FFMS_Indexer::GetTrackCodec(int Track) {
+-    AVCodec *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
++    auto *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
+     return codec ? codec->name : nullptr;
+ }
+
+@@ -402,7 +402,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             UseDTS);
+
+         if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (!VideoCodec) {
+                 FormatContext->streams[i]->discard = AVDISCARD_ALL;
+                 IndexMask.erase(i);
+@@ -433,7 +433,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 IndexMask.insert(i);
+             }
+         } else if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+-            AVCodec *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (AudioCodec == nullptr)
+                 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
+                     "Audio codec not found");
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index b889970e2..8956c2256 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -171,7 +171,7 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in
+
+         LAVFOpenFile(SourceFile, FormatContext, VideoTrack);
+
+-        AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
++        auto *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
+         if (Codec == nullptr)
+             throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+                 "Video codec not found");
diff --git a/srcpkgs/ffms2/template b/srcpkgs/ffms2/template
index 68e8a0c14bce..2acfadac44b3 100644
--- a/srcpkgs/ffms2/template
+++ b/srcpkgs/ffms2/template
@@ -1,7 +1,7 @@
 # Template file for 'ffms2'
 pkgname=ffms2
 version=2.40
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--enable-shared --disable-static"
 hostmakedepends="pkg-config autoconf automake libtool"

From a5796c2086cfd27a162c9c28b843a9f094d9d651 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 039/103] freerdp: revbump for ffmpeg-5.1.2

---
 srcpkgs/freerdp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/freerdp/template b/srcpkgs/freerdp/template
index 53e67690f863..1b50e9a86bb2 100644
--- a/srcpkgs/freerdp/template
+++ b/srcpkgs/freerdp/template
@@ -1,7 +1,7 @@
 # Template file for 'freerdp'
 pkgname=freerdp
 version=2.9.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_ALSA=ON -DWITH_CUPS=OFF -DWITH_FFMPEG=ON
  -DWITH_GSTREAMER_0_10=OFF -DWITH_GSTREAMER_1_0=OFF -DWITH_JPEG=ON

From 0127bc8a5f16e79a683885da3808199f70454ecb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 040/103] gerbera: revbump for ffmpeg-5.1.2

---
 srcpkgs/gerbera/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gerbera/template b/srcpkgs/gerbera/template
index ae14f35c767c..2dc0ac0ce03b 100644
--- a/srcpkgs/gerbera/template
+++ b/srcpkgs/gerbera/template
@@ -1,7 +1,7 @@
 # Template file for 'gerbera'
 pkgname=gerbera
 version=1.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_SYSTEMD=0 -DWITH_AVCODEC=1"
 hostmakedepends="pkg-config"

From ca24697d7c1fca56fc0f8c56e8641a93c481f4b4 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 041/103] goldendict: revbump for ffmpeg-5.1.2

---
 srcpkgs/goldendict/patches/ffmpeg4.patch   |  21 --
 srcpkgs/goldendict/patches/ffmpeg5-1.patch | 232 +++++++++++++++++++++
 srcpkgs/goldendict/patches/ffmpeg5-2.patch |  33 +++
 srcpkgs/goldendict/patches/ffmpeg5-3.patch |  25 +++
 srcpkgs/goldendict/template                |   4 +-
 5 files changed, 292 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/goldendict/patches/ffmpeg4.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-1.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-2.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-3.patch

diff --git a/srcpkgs/goldendict/patches/ffmpeg4.patch b/srcpkgs/goldendict/patches/ffmpeg4.patch
deleted file mode 100644
index f045fa27f54b..000000000000
--- a/srcpkgs/goldendict/patches/ffmpeg4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ffmpegaudio.cc.orig 2018-05-09 22:16:13.480659958 +0200
-+++ b/ffmpegaudio.cc      2018-05-09 22:16:50.748322790 +0200
-@@ -143,7 +143,7 @@
-     return false;
-   }
-
--  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
-+  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
-   if ( !avioBuffer )
-   {
-     errorString = QObject::tr( "av_malloc() failed." );
-@@ -380,7 +380,7 @@
-   }
-
-   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
--       codecContext_->codec->capabilities & CODEC_CAP_DELAY )
-+       codecContext_->codec->capabilities & AV_CODEC_CAP_DELAY )
-   {
-     av_init_packet( &packet );
-     int gotFrame = 0;
-
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-1.patch b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
new file mode 100644
index 000000000000..7cfc98ada368
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
@@ -0,0 +1,232 @@
+From 03bbe01b79a1f07a6780cb60f23a087104c5d77b Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 30 Mar 2018 22:53:24 +0300
+Subject: [PATCH] Fix warnings while compile with FFMpeg 3.4.2 (issue #978)
+
+---
+ ffmpegaudio.cc | 68 +++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 62 insertions(+), 6 deletions(-)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index ed1172bdd..56e8f788e 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -91,6 +91,7 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++  AVCodec * codec_;
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
+@@ -114,6 +115,7 @@ DecoderContext::DecoderContext( QByteArray const & audioData, QAtomicInt & isCan
+   audioData_( audioData ),
+   audioDataStream_( audioData_ ),
+   formatContext_( NULL ),
++  codec_( NULL ),
+   codecContext_( NULL ),
+   avioContext_( NULL ),
+   audioStream_( NULL ),
+@@ -143,7 +145,11 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 56 || ( LIBAVCODEC_VERSION_MAJOR == 56 && LIBAVCODEC_VERSION_MINOR < 56 )
+   unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
++#else
++  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
++#endif
+   if ( !avioBuffer )
+   {
+     errorString = QObject::tr( "av_malloc() failed." );
+@@ -186,7 +192,11 @@ bool DecoderContext::openCodec( QString & errorString )
+   // Find audio stream, use the first audio stream if available
+   for ( unsigned i = 0; i < formatContext_->nb_streams; i++ )
+   {
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+     if ( formatContext_->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO )
++#else
++      if ( formatContext_->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO )
++#endif
+     {
+       audioStream_ = formatContext_->streams[i];
+       break;
+@@ -198,22 +208,38 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+   codecContext_ = audioStream_->codec;
+-  AVCodec * codec = avcodec_find_decoder( codecContext_->codec_id );
+-  if ( !codec )
++  codec_ = avcodec_find_decoder( codecContext_->codec_id );
++  if ( !codec_ )
+   {
+     errorString = QObject::tr( "Codec [id: %1] not found." ).arg( codecContext_->codec_id );
+     return false;
+   }
++#else
++  codec_ = avcodec_find_decoder( audioStream_->codecpar->codec_id );
++  if ( !codec_ )
++  {
++    errorString = QObject::tr( "Codec [id: %1] not found." ).arg( audioStream_->codecpar->codec_id );
++    return false;
++  }
++  codecContext_ = avcodec_alloc_context3( codec_ );
++  if ( !codecContext_ )
++  {
++    errorString = QObject::tr( "avcodec_alloc_context3() failed." );
++    return false;
++  }
++  avcodec_parameters_to_context( codecContext_, audioStream_->codecpar );
++#endif
+
+-  ret = avcodec_open2( codecContext_, codec, NULL );
++  ret = avcodec_open2( codecContext_, codec_, NULL );
+   if ( ret < 0 )
+   {
+     errorString = QObject::tr( "avcodec_open2() failed: %1." ).arg( avErrorString( ret ) );
+     return false;
+   }
+
+-  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec->long_name,
++  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec_->long_name,
+           codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
+   return true;
+ }
+@@ -252,10 +278,13 @@ void DecoderContext::closeCodec()
+
+   // Closing a codec context without prior avcodec_open2() will result in
+   // a crash in ffmpeg
+-  if ( audioStream_ && audioStream_->codec && audioStream_->codec->codec )
++  if ( audioStream_ && codecContext_ && codec_ )
+   {
+     audioStream_->discard = AVDISCARD_ALL;
+-    avcodec_close( audioStream_->codec );
++    avcodec_close( codecContext_ );
++#if LIBAVCODEC_VERSION_MAJOR > 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR >= 33 )
++    avcodec_free_context( &codecContext_ );
++#endif
+   }
+
+   avformat_close_input( &formatContext_ );
+@@ -356,6 +385,7 @@ bool DecoderContext::play( QString & errorString )
+     if ( packet.stream_index == audioStream_->index )
+     {
+       AVPacket pack = packet;
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+       int gotFrame = 0;
+       do
+       {
+@@ -370,6 +400,19 @@ bool DecoderContext::play( QString & errorString )
+         pack.data += len;
+       }
+       while( pack.size > 0 );
++#else
++      int ret = avcodec_send_packet( codecContext_, &pack );
++      /* read all the output frames (in general there may be any number of them) */
++      while( ret >= 0 )
++      {
++        ret = avcodec_receive_frame( codecContext_, frame);
++
++        if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++          break;
++
++        playFrame( frame );
++      }
++#endif
+     }
+     // av_free_packet() must be called after each call to av_read_frame()
+ #if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 )
+@@ -379,6 +422,7 @@ bool DecoderContext::play( QString & errorString )
+ #endif
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
+        codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+   {
+@@ -391,6 +435,18 @@ bool DecoderContext::play( QString & errorString )
+       playFrame( frame );
+     }
+   }
++#else
++  /* flush the decoder */
++  av_init_packet( &packet );
++  int ret = avcodec_send_packet(codecContext_, &packet );
++  while( ret >= 0 )
++  {
++    ret = avcodec_receive_frame(codecContext_, frame);
++    if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++      break;
++    playFrame( frame );
++  }
++#endif
+
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+   av_free( frame );
+32
+srcpkgs/goldendict/patches/ffmpeg5-2.patch
+Comment on this file
+@@ -0,0 +1,32 @@
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
+25
+srcpkgs/goldendict/patches/ffmpeg5-3.patch
+Comment on this file
+@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-2.patch b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
new file mode 100644
index 000000000000..9c477b0c1347
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
@@ -0,0 +1,33 @@
+
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-3.patch b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
new file mode 100644
index 000000000000..72101903d1d1
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/template b/srcpkgs/goldendict/template
index f41b5b2c6899..2ca4185e538a 100644
--- a/srcpkgs/goldendict/template
+++ b/srcpkgs/goldendict/template
@@ -1,7 +1,7 @@
 # Template file for 'goldendict'
 pkgname=goldendict
 version=1.5.0RC2
-revision=5
+revision=6
 build_style=qmake
 configure_args="CONFIG+=zim_support"
 hostmakedepends="qt5-qmake pkg-config qt5-host-tools"
@@ -9,7 +9,7 @@ makedepends="tiff-devel qt5-devel libvorbis-devel zlib-devel
  libXtst-devel hunspell-devel qt5-tools-devel qt5-declarative-devel
  qt5-webkit-devel lzo-devel bzip2-devel libao-devel qt5-svg-devel
  libeb-devel qt5-x11extras-devel ffmpeg-devel liblzma-devel"
-short_desc="A feature-rich dictionary lookup program"
+short_desc="Feature-rich dictionary lookup program"
 maintainer="John <me@johnnynator.dev>"
 license="GPL-3.0-or-later"
 homepage="http://goldendict.org/"

From f045568f0b0ac34beac8906bb3d2968f06a0ff92 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 042/103] gst-libav: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-libav/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-libav/template b/srcpkgs/gst-libav/template
index e9a79dc650a5..f082bd211c65 100644
--- a/srcpkgs/gst-libav/template
+++ b/srcpkgs/gst-libav/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-libav'
 pkgname=gst-libav
 version=1.20.3
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config yasm"
 makedepends="orc-devel gst-plugins-base1-devel ffmpeg-devel"

From 285432833fa52f1fa184d638fdc8bc33a16baacc Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 043/103] gst-plugins-bad1: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-plugins-bad1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index bb9c4d87f4c6..f55f82fd4c77 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.20.3
-revision=2
+revision=3
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled

From d5b8a79dd7587b3e12d3b01e8d3cb3a31e2577e1 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 044/103] gst-rtsp-server: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-rtsp-server/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-rtsp-server/template b/srcpkgs/gst-rtsp-server/template
index 33cd64ceb95e..8ceea8d34b4b 100644
--- a/srcpkgs/gst-rtsp-server/template
+++ b/srcpkgs/gst-rtsp-server/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-rtsp-server'
 pkgname=gst-rtsp-server
 version=1.20.3
-revision=2
+revision=3
 build_style=meson
 hostmakedepends="pkg-config python3"
 makedepends="glib-devel gst-plugins-bad1-devel gobject-introspection

From c7e092cac918a721c87bfbe09be3187222c22215 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 045/103] gtk4: revbump for ffmpeg-5.1.2

---
 srcpkgs/gtk4/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 6a50567f53a9..6976aee84817 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
 # Template file for 'gtk4'
 pkgname=gtk4
 version=4.10.1
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dman-pages=true -Dgtk_doc=true

From c8494b22fb259904c2f8e410bd4f5bb07ac4c6bc Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 046/103] guvcview: revbump for ffmpeg-5.1.2

---
 srcpkgs/guvcview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/guvcview/template b/srcpkgs/guvcview/template
index 345cf6006f24..d42fd38fa4ad 100644
--- a/srcpkgs/guvcview/template
+++ b/srcpkgs/guvcview/template
@@ -1,7 +1,7 @@
 # Template file for 'guvcview'
 pkgname=guvcview
 version=2.0.7
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-static --disable-debian-menu"

From 0557795ff0c8e0be46567c175e8a93aefa38d28a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 047/103] handbrake: revbump for ffmpeg-5.1.2

---
 srcpkgs/handbrake/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/handbrake/template b/srcpkgs/handbrake/template
index ca5e4571e49c..188a79f2bf5c 100644
--- a/srcpkgs/handbrake/template
+++ b/srcpkgs/handbrake/template
@@ -1,7 +1,7 @@
 # Template file for 'handbrake'
 pkgname=handbrake
 version=1.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--force --disable-gtk-update-checks --disable-df-fetch --harden
  $(vopt_enable fdk_aac fdk-aac) $(vopt_enable nvenc)"

From d143d4c9753e5ff8b5c59b8bf702008d6d915fdb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 048/103] hedgewars: revbump for ffmpeg-5.1.2

---
 srcpkgs/hedgewars/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index 419f29b98b44..a343b3172a72 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,7 +1,7 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
  -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"

From 6de4881a9eb1f0fc462b2c36a3447176cf61f225 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 049/103] idjc: revbump for ffmpeg-5.1.2

---
 srcpkgs/idjc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/idjc/template b/srcpkgs/idjc/template
index df60318b3db9..b205e74745fe 100644
--- a/srcpkgs/idjc/template
+++ b/srcpkgs/idjc/template
@@ -1,7 +1,7 @@
 # Template file for 'idjc'
 pkgname=idjc
 version=0.9.1
-revision=3
+revision=4
 build_style=gnu-configure
 hostmakedepends="pkg-config git python3 automake gettext-devel libtool"
 makedepends="libvorbis-devel libogg-devel jack-devel libsamplerate-devel

From 2705e2192ed40da344fb6e9a9c0500992552f3c5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 050/103] kfilemetadata5: revbump for ffmpeg-5.1.2

---
 srcpkgs/kfilemetadata5/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kfilemetadata5/template b/srcpkgs/kfilemetadata5/template
index 83f4d583bcb7..b90ef056a196 100644
--- a/srcpkgs/kfilemetadata5/template
+++ b/srcpkgs/kfilemetadata5/template
@@ -1,7 +1,7 @@
 # Template file for 'kfilemetadata5'
 pkgname=kfilemetadata5
 version=5.103.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="kcoreaddons extra-cmake-modules pkg-config qt5-host-tools qt5-qmake
  gettext kcoreaddons python3"

From bbfc4fa57ae9a5fac7e71b9ec6b659f2c12c66e6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 051/103] kid3: revbump for ffmpeg-5.1.2

---
 srcpkgs/kid3/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kid3/template b/srcpkgs/kid3/template
index 456206d90e16..f32f9decb0e7 100644
--- a/srcpkgs/kid3/template
+++ b/srcpkgs/kid3/template
@@ -1,7 +1,7 @@
 # Template file for 'kid3'
 pkgname=kid3
 version=3.9.1
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DWITH_APPS='CLI;$(vopt_if KDE KDE Qt)'
  -DWITH_DOCBOOKDIR=/usr/share/xsl/docbook -DWITH_FLAC=$(vopt_if flac ON OFF)

From 59dd4f8380b836a11927b8a20f01ab57884c7985 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 052/103] kodi: revbump for ffmpeg-5.1.2

---
 srcpkgs/kodi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kodi/template b/srcpkgs/kodi/template
index 8057964d78a3..991325f6c477 100644
--- a/srcpkgs/kodi/template
+++ b/srcpkgs/kodi/template
@@ -1,7 +1,7 @@
 # Template file for 'kodi'
 pkgname=kodi
 version=19.4
-revision=6
+revision=7
 _codename="Matrix"
 build_style=cmake
 configure_args="-DWITH_FFMPEG=/usr -DENABLE_LDGOLD=OFF

From 28377d02daf39a9022bff2d3260b616c620f4e54 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 053/103] kpipewire: revbump for ffmpeg-5.1.2

---
 srcpkgs/kpipewire/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kpipewire/template b/srcpkgs/kpipewire/template
index 1d1e963f296d..07cdc0c7384a 100644
--- a/srcpkgs/kpipewire/template
+++ b/srcpkgs/kpipewire/template
@@ -1,7 +1,7 @@
 # Template file for 'kpipewire'
 pkgname=kpipewire
 version=5.27.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules plasma-wayland-protocols gettext
  qt5-qmake qt5-host-tools pkg-config wayland-devel kcoreaddons

From f3d59ba5194f1e53bb0fb2f1faeb4906f0d1d3b0 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 054/103] libextractor: revbump for ffmpeg-5.1.2

---
 srcpkgs/libextractor/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libextractor/template b/srcpkgs/libextractor/template
index 29d5b8df01f8..ddd4790f93e8 100644
--- a/srcpkgs/libextractor/template
+++ b/srcpkgs/libextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'libextractor'
 pkgname=libextractor
 version=1.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static"
 hostmakedepends="pkg-config"

From 811ce43648c9cc75e63e83bc750118125a0450ee Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 055/103] libopenal: revbump for ffmpeg-5.1.2

---
 srcpkgs/libopenal/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libopenal/template b/srcpkgs/libopenal/template
index 77218f9e539d..3f49ed75a1fd 100644
--- a/srcpkgs/libopenal/template
+++ b/srcpkgs/libopenal/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenal'
 pkgname=libopenal
 version=1.22.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DALSOFT_EXAMPLES=OFF"
 hostmakedepends="pkg-config"

From b970a71301b732fa6df259d0495d02035a98386e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 056/103] libopenshot: revbump for ffmpeg-5.1.2

---
 srcpkgs/libopenshot/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template
index db831f69b474..81aa0d7136d9 100644
--- a/srcpkgs/libopenshot/template
+++ b/srcpkgs/libopenshot/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenshot'
 pkgname=libopenshot
 version=0.3.0
-revision=1
+revision=2
 build_style=cmake
 # Builds fail with Ruby-2.4.1
 configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON"

From 38f6ebead2548ac46d3476e53d29739879c4ad40 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 057/103] loudgain: revbump for ffmpeg-5.1.2

---
 srcpkgs/loudgain/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index da4f2d56e94c..4d6bf29efb4f 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"

From 38d4af530d5a45c19851db6830673351ef8716d7 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 058/103] mediastreamer: revbump for ffmpeg-5.1.2

---
 srcpkgs/mediastreamer/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mediastreamer/template b/srcpkgs/mediastreamer/template
index d0e97e858e29..d29210c1bf9c 100644
--- a/srcpkgs/mediastreamer/template
+++ b/srcpkgs/mediastreamer/template
@@ -1,7 +1,7 @@
 # Template file for 'mediastreamer'
 pkgname=mediastreamer
 version=5.2.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_STRICT=0 -DENABLE_UNIT_TESTS=0"
 hostmakedepends="python3"

From 537b27e2044593f01b2e7f6d6d828476241e94d9 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 059/103] mgba: revbump for ffmpeg-5.1.2

---
 srcpkgs/mgba/patches/ffmpeg5.patch | 117 +++++++++++++++++++++++++++++
 srcpkgs/mgba/template              |   2 +-
 2 files changed, 118 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mgba/patches/ffmpeg5.patch

diff --git a/srcpkgs/mgba/patches/ffmpeg5.patch b/srcpkgs/mgba/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..ad7049efcac3
--- /dev/null
+++ b/srcpkgs/mgba/patches/ffmpeg5.patch
@@ -0,0 +1,117 @@
+From cdc753516798882a805db1d2042dbce8313382bf Mon Sep 17 00:00:00 2001
+From: Ryan Tandy <ryan@nardis.ca>
+Date: Thu, 3 Feb 2022 19:02:52 -0800
+Subject: [PATCH] FFmpeg: Support FFmpeg 5.0
+
+---
+ src/feature/ffmpeg/ffmpeg-decoder.c |  3 ++-
+ src/feature/ffmpeg/ffmpeg-encoder.c | 25 ++++++++++++++-----------
+ 2 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/src/feature/ffmpeg/ffmpeg-decoder.c b/src/feature/ffmpeg/ffmpeg-decoder.c
+index c3bb6d1c5c..daa47fbf2c 100644
+--- a/src/feature/ffmpeg/ffmpeg-decoder.c
++++ b/src/feature/ffmpeg/ffmpeg-decoder.c
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ #include "ffmpeg-decoder.h"
+
++#include <libavcodec/avcodec.h>
+ #include <libswscale/swscale.h>
+
+ void FFmpegDecoderInit(struct FFmpegDecoder* decoder) {
+@@ -38,7 +39,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) {
+ #else
+ 		enum AVMediaType type = decoder->context->streams[i]->codec->codec_type;
+ #endif
+-		struct AVCodec* codec;
++		const struct AVCodec* codec;
+ 		struct AVCodecContext* context = NULL;
+ 		if (type == AVMEDIA_TYPE_VIDEO && decoder->videoStream < 0) {
+ 			decoder->video = avcodec_alloc_context3(NULL);
+diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c
+index ad76ca57b2..be6bd3af5e 100644
+--- a/src/feature/ffmpeg/ffmpeg-encoder.c
++++ b/src/feature/ffmpeg/ffmpeg-encoder.c
+@@ -12,6 +12,9 @@
+
+ #include <libavcodec/version.h>
+ #include <libavcodec/avcodec.h>
++#if LIBAVCODEC_VERSION_MAJOR >= 58
++#include <libavcodec/bsf.h>
++#endif
+
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+@@ -121,7 +124,7 @@ bool FFmpegEncoderSetAudio(struct FFmpegEncoder* encoder, const char* acodec, un
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(acodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(acodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -193,7 +196,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -213,7 +216,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 	if (encoder->pixFormat == AV_PIX_FMT_NONE) {
+ 		return false;
+ 	}
+-	if (vbr < 0 && !av_opt_find(&codec->priv_class, "crf", NULL, 0, 0)) {
++	if (vbr < 0 && !av_opt_find((void*) &codec->priv_class, "crf", NULL, 0, 0)) {
+ 		return false;
+ 	}
+ 	encoder->videoCodec = vcodec;
+@@ -223,7 +226,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ }
+
+ bool FFmpegEncoderSetContainer(struct FFmpegEncoder* encoder, const char* container) {
+-	AVOutputFormat* oformat = av_guess_format(container, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(container, 0, 0);
+ 	if (!oformat) {
+ 		return false;
+ 	}
+@@ -241,9 +244,9 @@ void FFmpegEncoderSetLooping(struct FFmpegEncoder* encoder, bool loop) {
+ }
+
+ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !oformat || (!acodec && !vcodec)) {
+ 		return false;
+ 	}
+@@ -257,8 +260,8 @@ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+ }
+
+ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !FFmpegEncoderVerifyContainer(encoder)) {
+ 		return false;
+ 	}
+@@ -272,9 +275,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+ 	encoder->currentVideoFrame = 0;
+ 	encoder->skipResidue = 0;
+
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+ #ifndef USE_LIBAV
+-	avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile);
++	avformat_alloc_output_context2(&encoder->context, (AVOutputFormat*) oformat, 0, outfile);
+ #else
+ 	encoder->context = avformat_alloc_context();
+ 	strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1);
diff --git a/srcpkgs/mgba/template b/srcpkgs/mgba/template
index 05bca15c1750..f5b6b8464428 100644
--- a/srcpkgs/mgba/template
+++ b/srcpkgs/mgba/template
@@ -1,7 +1,7 @@
 # Template file for 'mgba'
 pkgname=mgba
 version=0.10.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake desktop-file-utils"
 makedepends="SDL2-devel ffmpeg-devel libedit-devel libepoxy-devel libmagick-devel

From 4e90aa213582dd56089e16d2b0959affc6d74fb5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 060/103] minidlna: revbump for ffmpeg-5.1.2

---
 srcpkgs/minidlna/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/minidlna/template b/srcpkgs/minidlna/template
index e8081b1cbc67..9ee9714861fd 100644
--- a/srcpkgs/minidlna/template
+++ b/srcpkgs/minidlna/template
@@ -1,7 +1,7 @@
 # Template file for 'minidlna'
 pkgname=minidlna
 version=1.3.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --sbindir=/usr/bin

From afa9f63fee2ce6fbd82775afdb7187715f9ececc Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 061/103] mixxx: revbump for ffmpeg-5.1.2

---
 srcpkgs/mixxx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template
index 619ddca0d332..4b9ea00d3fb3 100644
--- a/srcpkgs/mixxx/template
+++ b/srcpkgs/mixxx/template
@@ -1,7 +1,7 @@
 # Template file for 'mixxx'
 pkgname=mixxx
 version=2.3.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="extra-cmake-modules pkg-config protobuf qt5-host-tools qt5-devel"

From b5ca220c6532593d757a6c93d6486cf888e6f52a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 062/103] mlt: revbump for ffmpeg-5.1.2

---
 srcpkgs/mlt/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mlt/template b/srcpkgs/mlt/template
index 8933eb4e7bb9..ed6b27503f9a 100644
--- a/srcpkgs/mlt/template
+++ b/srcpkgs/mlt/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt'
 pkgname=mlt
 version=6.26.1
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --libdir=/usr/lib$XBPS_TARGET_WORDSIZE
  --enable-gpl --enable-gpl3 --disable-swfdec --without-kde

From cbafae69581277cad60b43c1ca64e539fed7ad49 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 063/103] mlt7: revbump for ffmpeg-5.1.2

---
 srcpkgs/mlt7/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mlt7/template b/srcpkgs/mlt7/template
index e5972cc0411b..d0e9ec02e58a 100644
--- a/srcpkgs/mlt7/template
+++ b/srcpkgs/mlt7/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt7'
 pkgname=mlt7
 version=7.12.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSWIG_PYTHON=ON"
 hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which

From 84a4f489025ccf393dee612eb1225c9d3170f746 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 064/103] moc: revbump for ffmpeg-5.1.2

---
 srcpkgs/moc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/moc/template b/srcpkgs/moc/template
index c42be650a1d2..4b95426599bf 100644
--- a/srcpkgs/moc/template
+++ b/srcpkgs/moc/template
@@ -1,7 +1,7 @@
 # Template file for 'moc'
 pkgname=moc
 version=2.5.2
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg-devel

From 775b694a9ce6e781eac90d6d090744934c6ca3c5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 065/103] motion: revbump for ffmpeg-5.1.2

---
 srcpkgs/motion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/motion/template b/srcpkgs/motion/template
index 3cf3c3035c5b..7dca12d851e3 100644
--- a/srcpkgs/motion/template
+++ b/srcpkgs/motion/template
@@ -1,7 +1,7 @@
 # Template file for 'motion'
 pkgname=motion
 version=4.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake pkg-config gettext-devel tar"
 makedepends="ffmpeg-devel libmicrohttpd-devel v4l-utils-devel gettext-devel"

From ecfc8d13f0f408f482646449bbbf06c3b466e6b6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 066/103] mpd: revbump for ffmpeg-5.1.2

---
 srcpkgs/mpd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mpd/template b/srcpkgs/mpd/template
index 63701b7d56b1..df35e751ea60 100644
--- a/srcpkgs/mpd/template
+++ b/srcpkgs/mpd/template
@@ -1,7 +1,7 @@
 # Template file for 'mpd'
 pkgname=mpd
 version=0.23.12
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true
  -Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled

From f9c8f1525a17e1b27a91e775f845fc105d5e3df9 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 067/103] mpv: revbump for ffmpeg-5.1.2

---
 srcpkgs/mpv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mpv/template b/srcpkgs/mpv/template
index e163c496c6eb..d4fefbf5e3c7 100644
--- a/srcpkgs/mpv/template
+++ b/srcpkgs/mpv/template
@@ -1,7 +1,7 @@
 # Template file for 'mpv'
 pkgname=mpv
 version=0.35.1
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled
  -Dlibmpv=true -Dcplugins=enabled

From 0e42c57c0f057eb0e4b22ecbef29f0af3b7ca223 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 068/103] musikcube: revbump for ffmpeg-5.1.2

---
 srcpkgs/musikcube/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template
index 4b7930041126..7cd65cf76b77 100644
--- a/srcpkgs/musikcube/template
+++ b/srcpkgs/musikcube/template
@@ -1,7 +1,7 @@
 # Template file for 'musikcube'
 pkgname=musikcube
 version=0.99.4
-revision=1
+revision=2
 build_style=cmake
 make_cmd=make
 configure_args="-DNO_NCURSESW=1"

From 8f4393d60c36bcc668fc51115133071b53e95e3c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 069/103] notcurses: revbump for ffmpeg-5.1.2

---
 srcpkgs/notcurses/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/notcurses/template b/srcpkgs/notcurses/template
index 6dd8a091319f..3110c30c9aff 100644
--- a/srcpkgs/notcurses/template
+++ b/srcpkgs/notcurses/template
@@ -1,7 +1,7 @@
 # Template file for 'notcurses'
 pkgname=notcurses
 version=3.0.9
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_STATIC=ON $(vopt_bool man USE_PANDOC)"
 hostmakedepends="pkg-config $(vopt_if man pandoc)"

From 57b0c3fb8eda0f3683fce2f02d2ffcb0871b09b6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 070/103] obs: revbump for ffmpeg-5.1.2

---
 srcpkgs/obs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/obs/template b/srcpkgs/obs/template
index 1a7132ae832f..078feba62bbb 100644
--- a/srcpkgs/obs/template
+++ b/srcpkgs/obs/template
@@ -1,7 +1,7 @@
 # Template file for 'obs'
 pkgname=obs
 version=29.0.2
-revision=1
+revision=2
 archs="i686* x86_64* ppc64le* aarch64*"
 build_style=cmake
 configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON

From 5429ee97b30d65ede54cf02d03f0fac4e6d06adb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 071/103] olive: revbump for ffmpeg-5.1.2

---
 srcpkgs/olive/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/olive/template b/srcpkgs/olive/template
index 12a46936c990..5290d8e5aacd 100644
--- a/srcpkgs/olive/template
+++ b/srcpkgs/olive/template
@@ -1,7 +1,7 @@
 # Template file for 'olive'
 pkgname=olive
 version=0.1.2
-revision=2
+revision=3
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools pkg-config"
 makedepends="qt5-devel qt5-multimedia-devel qt5-svg-devel ffmpeg-devel frei0r-plugins"

From 462791d87ce3ab27e42c63696de9917c0a4c3a9b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 072/103] omxplayer: revbump for ffmpeg-5.1.2

---
 srcpkgs/omxplayer/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/omxplayer/template b/srcpkgs/omxplayer/template
index e70bf7873d4d..0f42939e1e5d 100644
--- a/srcpkgs/omxplayer/template
+++ b/srcpkgs/omxplayer/template
@@ -1,10 +1,10 @@
 # Template file for 'omxplayer'
 pkgname=omxplayer
 version=20190102
-revision=1
+revision=2
 short_desc="Commandline OMX player for the Raspberry Pi"
 maintainer="Orphaned <orphan@voidlinux.org>"
-license="GPL-2"
+license="GPL-2-or-later"
 homepage="https://github.com/popcornmix/omxplayer"
 
 _commit="f06235cc9690a6d58187514452df8cf8fcdaacec"

From 547031b17d27d920225d1d675ff7877779bc7d25 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 073/103] openimageio: revbump for ffmpeg-5.1.2

---
 srcpkgs/openimageio/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openimageio/template b/srcpkgs/openimageio/template
index cc9d7a33984e..ee988ae2ce07 100644
--- a/srcpkgs/openimageio/template
+++ b/srcpkgs/openimageio/template
@@ -1,7 +1,7 @@
 # Template file for 'openimageio'
 pkgname=openimageio
 version=2.3.18.0
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="-DUSE_OPENGL=0 -DUSE_QT=0 -DUSE_PYTHON=0 -DOIIO_BUILD_TESTS=1

From 0ee9958c5b2ad5c287afb964caff11e531062801 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 074/103] openmw: revbump for ffmpeg-5.1.2

---
 srcpkgs/openmw/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openmw/template b/srcpkgs/openmw/template
index 5251a0283dc1..e3771c7aaf1a 100644
--- a/srcpkgs/openmw/template
+++ b/srcpkgs/openmw/template
@@ -1,7 +1,7 @@
 # Template file for 'openmw'
 pkgname=openmw
 version=0.47.0
-revision=4
+revision=5
 build_style=cmake
 _recast_commit=e75adf86f91eb3082220085e42dda62679f9a3ea
 _bullet_tag=3.17

From d5ca41432abb3b0949d823a63041bec58c4a60f3 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 075/103] openshot: revbump for ffmpeg-5.1.2

---
 srcpkgs/openshot/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openshot/template b/srcpkgs/openshot/template
index 322717d40abc..c074e0338773 100644
--- a/srcpkgs/openshot/template
+++ b/srcpkgs/openshot/template
@@ -1,7 +1,7 @@
 # Template file for 'openshot'
 pkgname=openshot
 version=3.0.0
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3 python3-setuptools"
 makedepends="ffmpeg-devel python3-PyQt5"

From c1e2fca8617a158ca627bb8267fc3ae36d6b2842 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 076/103] opentoonz: revbump for ffmpeg-5.1.2

---
 srcpkgs/opentoonz/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/opentoonz/template b/srcpkgs/opentoonz/template
index ee9f7603f55f..3e81834ca0ed 100644
--- a/srcpkgs/opentoonz/template
+++ b/srcpkgs/opentoonz/template
@@ -1,7 +1,7 @@
 # Template file for 'opentoonz'
 pkgname=opentoonz
 version=1.6.0
-revision=2
+revision=3
 build_wrksrc="toonz/sources"
 build_style=cmake
 make_cmd=make

From 85dd9fdb017c5478a71a9f4ced96a8aa9753efa4 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 077/103] pianobar: revbump for ffmpeg-5.1.2

---
 srcpkgs/pianobar/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pianobar/template b/srcpkgs/pianobar/template
index a9b29e91993f..81efcd122c4d 100644
--- a/srcpkgs/pianobar/template
+++ b/srcpkgs/pianobar/template
@@ -1,7 +1,7 @@
 # Template file for 'pianobar'
 pkgname=pianobar
 version=2022.04.01
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="V=1"
 hostmakedepends="pkg-config"

From 72c369b993e6fdb78410f1d1af385144863d928d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 078/103] ppsspp: revbump for ffmpeg-5.1.2

---
 srcpkgs/ppsspp/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ppsspp/template b/srcpkgs/ppsspp/template
index 7984a733d4be..3bfc951ea1eb 100644
--- a/srcpkgs/ppsspp/template
+++ b/srcpkgs/ppsspp/template
@@ -1,7 +1,7 @@
 # Template file for 'ppsspp'
 pkgname=ppsspp
 version=1.14.4
-revision=1
+revision=2
 _glslang_commit=dc11adde23c455a24e13dd54de9b4ede8bdd7db8
 _SPIRV_Cross_commit=9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1
 _armips_commit=6719edebaae03330ee5441d9b28280672edf00d5
@@ -62,13 +62,12 @@ post_extract() {
 	mv ${wrksrc}/miniupnp-${_miniupnp_commit} ${wrksrc}/ext/miniupnp
 }
 
-post_patch(){
+post_patch() {
 	# disable git versioning
 	vsed -e 's|find_package(Git)|# &|' -i git-version.cmake
 }
 
 do_install() {
-	vlicense LICENSE.TXT
 	vinstall icons/icon.svg 644 usr/share/pixmaps ppsspp.svg
 	vinstall Qt/PPSSPP.desktop 644 usr/share/applications
 	vbin build/PPSSPPHeadless ppsspp-headless

From c3be3d32f93ba08030f8857ebe0a6bebc20fdbc5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 079/103] pqiv: revbump for ffmpeg-5.1.2

---
 srcpkgs/pqiv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pqiv/template b/srcpkgs/pqiv/template
index 542fc27a2d32..9308d949b6a1 100644
--- a/srcpkgs/pqiv/template
+++ b/srcpkgs/pqiv/template
@@ -1,7 +1,7 @@
 # Template file for 'pqiv'
 pkgname=pqiv
 version=2.12
-revision=1
+revision=2
 build_style=gnu-makefile
 hostmakedepends="pkg-config"
 makedepends="glib-devel gtk+3-devel $(vopt_if ffmpeg ffmpeg-devel)

From e39d7ad202eecde375bf0f60cbd0e1d4c6e8822e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 080/103] qmmp: revbump for ffmpeg-5.1.2

---
 srcpkgs/qmmp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qmmp/template b/srcpkgs/qmmp/template
index 26c661ed16be..a150d7441c7a 100644
--- a/srcpkgs/qmmp/template
+++ b/srcpkgs/qmmp/template
@@ -1,7 +1,7 @@
 # Template file for 'qmmp'
 pkgname=qmmp
 version=1.6.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_HAL:BOOL=FALSE -DQMMP_DEFAULT_UI:STRING=simple"
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake"

From 2cbff4c1d46394ccb6d6d4d0017d07dde89cc284 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 081/103] qt5-webengine: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt5-webengine/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index f9d78eced929..0a71484208bc 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
 version=5.15.11
-revision=1
+revision=2
 _version="${version}-lts"
 _chromium_commit=be349eaf62e77955791d7bf29f893f1e8a37daf4
 archs="x86_64* i686* armv[67]* ppc64* aarch64*"

From 68fdac0cefa2b6a5168e184d51281eeade3a603b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 082/103] qt5: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b22575103da4 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,10 +3,10 @@
 # revbump libqtxdg after bumping patch version
 pkgname=qt5
 version=5.15.7+20221119
+revision=2
+build_style=meta
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
-build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel

From d77d1f3351d81a4153c65590164fd84e5ecd6dc7 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 083/103] qt6-multimedia: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt6-multimedia/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qt6-multimedia/template b/srcpkgs/qt6-multimedia/template
index d89e7d54eb5a..aae15e57ca7b 100644
--- a/srcpkgs/qt6-multimedia/template
+++ b/srcpkgs/qt6-multimedia/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-multimedia'
 pkgname=qt6-multimedia
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DQT_FEATURE_gstreamer=ON"
 hostmakedepends="perl qt6-declarative-host-tools pkg-config qt6-shadertools"

From 9a15aa9d3e5e935a679b7d6a7ae046c2498a5a89 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 084/103] qt6-webengine: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt6-webengine/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qt6-webengine/template b/srcpkgs/qt6-webengine/template
index 99012732b53a..96846feaee83 100644
--- a/srcpkgs/qt6-webengine/template
+++ b/srcpkgs/qt6-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-webengine'
 pkgname=qt6-webengine
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DQT_FEATURE_webengine_system_ffmpeg=ON

From ae2e56321a8d0b77a67cce9def2001cfc61c725e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 085/103] qtav: revbump for ffmpeg-5.1.2

---
 srcpkgs/qtav/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qtav/template b/srcpkgs/qtav/template
index 34c30b2c0c78..775d5a139a9e 100644
--- a/srcpkgs/qtav/template
+++ b/srcpkgs/qtav/template
@@ -1,7 +1,7 @@
 # Template file for 'qtav'
 pkgname=qtav
 version=1.13.0
-revision=1
+revision=2
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel libass-devel libopenal-devel

From 210c97b59266d0af1dc488fa2e9e98f568037f71 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 086/103] qtox: revbump for ffmpeg-5.1.2

---
 srcpkgs/qtox/patches/ffmpeg5.patch | 79 ++++++++++++++++++++++++++++++
 srcpkgs/qtox/template              |  2 +-
 2 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qtox/patches/ffmpeg5.patch

diff --git a/srcpkgs/qtox/patches/ffmpeg5.patch b/srcpkgs/qtox/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..3babe1c98447
--- /dev/null
+++ b/srcpkgs/qtox/patches/ffmpeg5.patch
@@ -0,0 +1,79 @@
+From 15673a52b6b4805d482b69281e21947fb7096e05 Mon Sep 17 00:00:00 2001
+From: Anthony Bilinski <me@abilinski.com>
+Date: Thu, 10 Feb 2022 17:24:38 -0800
+Subject: [PATCH] fix(macOS): Update video API usage for newer libavcodec
+
+Newer version of avformat_open_input, av_find_input_format,
+avcodec_find_decoder previously used non-const pointers that are now
+const. Support both version for compatibiltiy with other platforms.
+---
+ src/video/cameradevice.cpp | 9 ++++++---
+ src/video/cameradevice.h   | 1 -
+ src/video/camerasource.cpp | 3 +--
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/video/cameradevice.cpp b/src/video/cameradevice.cpp
+index 3b07968b32..a012a0f78d 100644
+--- a/src/video/cameradevice.cpp
++++ b/src/video/cameradevice.cpp
+@@ -31,6 +31,9 @@ extern "C" {
+ #include "cameradevice.h"
+ #include "src/persistence/settings.h"
+
++// no longer needed when avformat version < 59 is no longer supported
++using AvFindInputFormatRet = decltype(av_find_input_format(""));
++
+ #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
+ #define USING_V4L 1
+ #else
+@@ -71,8 +74,8 @@ extern "C" {
+
+ QHash<QString, CameraDevice*> CameraDevice::openDevices;
+ QMutex CameraDevice::openDeviceLock, CameraDevice::iformatLock;
+-AVInputFormat* CameraDevice::iformat{nullptr};
+-AVInputFormat* CameraDevice::idesktopFormat{nullptr};
++static AvFindInputFormatRet idesktopFormat{nullptr};
++static AvFindInputFormatRet iformat{nullptr};
+
+ CameraDevice::CameraDevice(const QString& devName, AVFormatContext* context)
+     : devName{devName}
+@@ -92,7 +95,7 @@ CameraDevice* CameraDevice::open(QString devName, AVDictionary** options)
+         goto out;
+     }
+
+-    AVInputFormat* format;
++    AvFindInputFormatRet format;
+     if (devName.startsWith("x11grab#")) {
+         devName = devName.mid(8);
+         format = idesktopFormat;
+diff --git a/src/video/cameradevice.h b/src/video/cameradevice.h
+index 910873325b..c05f1dbed4 100644
+--- a/src/video/cameradevice.h
++++ b/src/video/cameradevice.h
+@@ -64,5 +64,4 @@ class CameraDevice
+     std::atomic_int refcount;
+     static QHash<QString, CameraDevice*> openDevices;
+     static QMutex openDeviceLock, iformatLock;
+-    static AVInputFormat *iformat, *idesktopFormat;
+ };
+diff --git a/src/video/camerasource.cpp b/src/video/camerasource.cpp
+index 134bc49afc..3a899f11d0 100644
+--- a/src/video/camerasource.cpp
++++ b/src/video/camerasource.cpp
+@@ -278,7 +278,6 @@ void CameraSource::openDevice()
+     }
+
+     // We need to create a new CameraDevice
+-    AVCodec* codec;
+     device = CameraDevice::open(deviceName, mode);
+
+     if (!device) {
+@@ -322,7 +321,7 @@ void CameraSource::openDevice()
+     AVCodecParameters* cparams = device->context->streams[videoStreamIndex]->codecpar;
+     codecId = cparams->codec_id;
+ #endif
+-    codec = avcodec_find_decoder(codecId);
++    const AVCodec* codec = avcodec_find_decoder(codecId);
+     if (!codec) {
+         qWarning() << "Codec not found";
+         emit openFailed();
diff --git a/srcpkgs/qtox/template b/srcpkgs/qtox/template
index 16019d7eaec9..5cea0b11b697 100644
--- a/srcpkgs/qtox/template
+++ b/srcpkgs/qtox/template
@@ -1,7 +1,7 @@
 # Template file for 'qtox'
 pkgname=qtox
 version=1.17.6
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DUPDATE_CHECK=OFF
  -DGIT_DESCRIBE=${version}

From 7770a9eb0dcd3d39394d715131200f1585901298 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 087/103] retroarch: revbump for ffmpeg-5.1.2

---
 srcpkgs/retroarch/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/retroarch/template b/srcpkgs/retroarch/template
index 240d3df9db00..6d0b16ae2598 100644
--- a/srcpkgs/retroarch/template
+++ b/srcpkgs/retroarch/template
@@ -1,7 +1,7 @@
 # Template file for 'retroarch'
 pkgname=retroarch
 version=1.14.0
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking
  --enable-udev --disable-builtinflac --disable-builtinglslang

From 11c435329fd05076e59a36a57f917e2820abc883 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 088/103] scrcpy: revbump for ffmpeg-5.1.2

---
 srcpkgs/scrcpy/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scrcpy/template b/srcpkgs/scrcpy/template
index ee6e698e387f..8ada5ca4323f 100644
--- a/srcpkgs/scrcpy/template
+++ b/srcpkgs/scrcpy/template
@@ -1,7 +1,7 @@
 # Template file for 'scrcpy'
 pkgname=scrcpy
 version=2.0
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dcompile_server=false
  -Dprebuilt_server=/usr/share/scrcpy/scrcpy-server-v${version}"

From 52ada726f0053859d8b99675471c9d0df4bc21e6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 089/103] spek-alternative: revbump for ffmpeg-5.1.2

---
 srcpkgs/spek-alternative/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spek-alternative/template b/srcpkgs/spek-alternative/template
index d65086b8f008..72747cbb0a02 100644
--- a/srcpkgs/spek-alternative/template
+++ b/srcpkgs/spek-alternative/template
@@ -1,7 +1,7 @@
 # Template file for 'spek-alternative'
 pkgname=spek-alternative
 version=0.8.2.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake gettext-devel intltool libtool pkg-config wxWidgets-common"
 makedepends="ffmpeg-devel wxWidgets-gtk3-devel"

From f34cb5ef08800ae6f925666b94ae593f6141922f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 090/103] ssr: revbump for ffmpeg-5.1.2

---
 srcpkgs/ssr/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ssr/template b/srcpkgs/ssr/template
index b055b9ec0774..842b2423aad1 100644
--- a/srcpkgs/ssr/template
+++ b/srcpkgs/ssr/template
@@ -1,7 +1,7 @@
 # Template file for 'ssr'
 pkgname=ssr
 version=0.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_QT5=ON"
 hostmakedepends="pkg-config"

From 8ac9830a6aacdd80335cdcd0864d70c938b5b601 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 091/103] sumo: revbump for ffmpeg-5.1.2

---
 srcpkgs/sumo/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template
index 0f9b9ec815f5..a3fe134aa5ac 100644
--- a/srcpkgs/sumo/template
+++ b/srcpkgs/sumo/template
@@ -1,7 +1,7 @@
 # Template file for 'sumo'
 pkgname=sumo
 version=1.12.0
-revision=5
+revision=6
 build_style=cmake
 hostmakedepends="libgdal-tools pkg-config swig python3-setuptools"
 makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel

From 7fafbe6991c7f0ebbd6fb1ce649fa361b2992230 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 092/103] synfig: revbump for ffmpeg-5.1.2

---
 srcpkgs/synfig/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template
index 182dc3cd280f..29afb3572e47 100644
--- a/srcpkgs/synfig/template
+++ b/srcpkgs/synfig/template
@@ -2,7 +2,7 @@
 # Should be kept in sync with 'synfigstudio' and 'ETL'
 pkgname=synfig
 version=1.4.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib"
 hostmakedepends="boost-build ImageMagick pkg-config intltool"

From a479d30a681074583e45c59a7d9553cdb55be1f5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 093/103] telegram-desktop: revbump for ffmpeg-5.1.2

---
 srcpkgs/telegram-desktop/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index aae9f3135100..7943b36f0b8a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=4.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 configure_args="-DTDESKTOP_API_ID=209235

From aa3c50bca5f5789cbaf0edb35c0f88d24f7aa43f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 094/103] tg_owt: revbump for ffmpeg-5.1.2

---
 srcpkgs/tg_owt/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tg_owt/template b/srcpkgs/tg_owt/template
index 97d195ddb34a..551614b24956 100644
--- a/srcpkgs/tg_owt/template
+++ b/srcpkgs/tg_owt/template
@@ -1,7 +1,7 @@
 # Template file for 'tg_owt'
 pkgname=tg_owt
 version=0.0.0.20230107
-revision=1
+revision=2
 _commit=5098730b9eb6173f0b52068fe2555b7c1015123a
 _libyuv_commit=00950840d1c9bcbb3eb6ebc5aac5793e71166c8b
 _abseil_commit=8c0b94e793a66495e0b1f34a5eb26bd7dc672db0

From 94e7e48ef6ab1350d3c7a4ca09d657bf1e769945 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 095/103] timg: revbump for ffmpeg-5.1.2

---
 srcpkgs/timg/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/timg/template b/srcpkgs/timg/template
index 91f1516b2597..334443d3f9bb 100644
--- a/srcpkgs/timg/template
+++ b/srcpkgs/timg/template
@@ -1,7 +1,7 @@
 # Template file for 'timg'
 pkgname=timg
 version=1.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_OPENSLIDE_SUPPORT=off -Wno-dev"
 hostmakedepends="pkg-config git"

From 78a9547f28538ea8300fd5a1c68c949a9b5fab89 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 096/103] tracker-miners: revbump for ffmpeg-5.1.2

---
 srcpkgs/tracker-miners/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index 3e7966c2b4a9..285425ba1851 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.4.3
-revision=1
+revision=2
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss

From 7b081b9c069ae5ee26ad309b5d6100d9039ec935 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 097/103] tvheadend: revbump for ffmpeg-5.1.2

---
 srcpkgs/tvheadend/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tvheadend/template b/srcpkgs/tvheadend/template
index e6b16d7ccf3b..a2004480332b 100644
--- a/srcpkgs/tvheadend/template
+++ b/srcpkgs/tvheadend/template
@@ -1,7 +1,7 @@
 # Template file for 'tvheadend'
 pkgname=tvheadend
 version=4.2.8
-revision=6
+revision=7
 build_style=gnu-configure
 configure_args="--enable-dvbscan --disable-ffmpeg_static
 --disable-hdhomerun_static --disable-bintray_cache --disable-libx264_static

From 06ac8ec84590dd1bcebede7d6d1b37d3a2cbf0db Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 098/103] unpaper: revbump for ffmpeg-5.1.2

---
 srcpkgs/unpaper/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/unpaper/template b/srcpkgs/unpaper/template
index 38ed47a58401..8310d5d1e68f 100644
--- a/srcpkgs/unpaper/template
+++ b/srcpkgs/unpaper/template
@@ -1,13 +1,13 @@
 # Template file for 'unpaper'
 pkgname=unpaper
 version=6.1
-revision=3
+revision=4
 build_style=gnu-configure
-maintainer="Orphaned <orphan@voidlinux.org>"
 hostmakedepends="pkg-config libxslt"
 makedepends="ffmpeg-devel"
-license="GPL-2"
+short_desc="Post-processing tool for scanned sheets of paper"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-2.0-or-later"
 homepage="https://www.flameeyes.eu/projects/unpaper"
-short_desc="A post-processing tool for scanned sheets of paper"
 distfiles="https://www.flameeyes.eu/files/${pkgname}-${version}.tar.xz"
 checksum=237c84f5da544b3f7709827f9f12c37c346cdf029b1128fb4633f9bafa5cb930

From 3a915cd471bf7715e13b818463b52ec40836d3bd Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 099/103] vba-m: revbump for ffmpeg-5.1.2

---
 srcpkgs/vba-m/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/vba-m/template b/srcpkgs/vba-m/template
index ba153e0b58ca..aa6093645e97 100644
--- a/srcpkgs/vba-m/template
+++ b/srcpkgs/vba-m/template
@@ -2,7 +2,7 @@
 pkgname=vba-m
 reverts=1292_2
 version=2.1.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GTK=TRUE -DENABLE_FFMPEG=TRUE -DENABLE_LINK=TRUE -DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="gettext pkg-config unzip zip yasm wxWidgets-gtk3-devel"

From f3c76c228dfe58091655ad3d9cd4cb1ec3f5a9e8 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 100/103] vice: revbump for ffmpeg-5.1.2

---
 srcpkgs/vice/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/vice/template b/srcpkgs/vice/template
index 0924767cfcfb..ffa95384f64a 100644
--- a/srcpkgs/vice/template
+++ b/srcpkgs/vice/template
@@ -1,7 +1,7 @@
 # Template file for 'vice'
 pkgname=vice
 version=3.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
 	$(vopt_enable sdl2 sdlui2)

From e26681bbe08d1ad0b1480200dd682dc9ddf2ef28 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 101/103] waypipe: revbump for ffmpeg-5.1.2

---
 srcpkgs/waypipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/waypipe/template b/srcpkgs/waypipe/template
index 5c4161900060..1a46fe27f7d8 100644
--- a/srcpkgs/waypipe/template
+++ b/srcpkgs/waypipe/template
@@ -1,7 +1,7 @@
 # Template file for 'waypipe'
 pkgname=waypipe
 version=0.8.4
-revision=1
+revision=2
 build_style=meson
 # lto is off because it causes linking errors in armv6l and armv7l (due to NEON)
 configure_args="-Dwerror=false -Dwith_dmabuf=enabled -Dwith_lz4=enabled

From e101b4b4a1162f5f61a058dee5180ddcfc696c86 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 102/103] wf-recorder: revbump for ffmpeg-5.1.2

---
 srcpkgs/wf-recorder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/wf-recorder/template b/srcpkgs/wf-recorder/template
index e278eb001600..5d014a5f28af 100644
--- a/srcpkgs/wf-recorder/template
+++ b/srcpkgs/wf-recorder/template
@@ -1,7 +1,7 @@
 # Template file for 'wf-recorder'
 pkgname=wf-recorder
 version=0.3.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config scdoc wayland-devel"
 makedepends="wayland-protocols wayland-devel ffmpeg-devel x264-devel

From 016e8ffa6c016dec6864e13f86b2e31ecfbd8cd7 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 103/103] xpra: revbump for ffmpeg-5.1.2

---
 srcpkgs/xpra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xpra/template b/srcpkgs/xpra/template
index 38f83283b1e5..b6e01ff0a813 100644
--- a/srcpkgs/xpra/template
+++ b/srcpkgs/xpra/template
@@ -1,7 +1,7 @@
 # Template file for 'xpra'
 pkgname=xpra
 version=4.4.4
-revision=1
+revision=2
 build_style=python3-module
 make_build_args="--without-cuda_kernels --without-cuda_rebuild"
 make_install_args="$(vopt_with docs) ${make_build_args}"

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (14 preceding siblings ...)
  2023-03-23  0:15 ` [PR PATCH] [Updated] " zlice
@ 2023-03-23  2:05 ` sgn
  2023-03-23 12:39 ` zlice
                   ` (13 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: sgn @ 2023-03-23  2:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1480479714

Comment:
I'm advocate for not using major version of package as suffix for libraries' package name, instead, I think those libaries should use its SOVERSION for pkgname, like Debian.
For example, the new `libswscale4` should be named `libswscale5`, the one splited from `ffmpeg5` will be named `libswscale6`.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (15 preceding siblings ...)
  2023-03-23  2:05 ` sgn
@ 2023-03-23 12:39 ` zlice
  2023-03-23 12:50 ` [PR PATCH] [Updated] " zlice
                   ` (12 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-23 12:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1481125289

Comment:
have a list of some packages that didn't build last night, i'll look at them today(?)

> For example, the new libswscale4 should be named libswscale5, the one splited from ffmpeg5 will be named libswscale6.

not sure what you mean, rename libxxx's to lib*5 and have lib*5 and lib*4?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (16 preceding siblings ...)
  2023-03-23 12:39 ` zlice
@ 2023-03-23 12:50 ` zlice
  2023-03-23 19:52 ` zlice
                   ` (11 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-23 12:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3205 bytes --]

There is an updated pull request by zlice against master on the void-packages repository

https://github.com/zlice/void-packages ffmpeg5-split
https://github.com/void-linux/void-packages/pull/42936

draft: ffmpeg5 split
[ci skip]

#### Testing the changes

- I tested the changes in this PR: **NO**

I have conflicting changes from [intel packages](https://github.com/void-linux/void-packages/pull/41132) and don't want to mess with my system. If it makes sense I'll move these changes here like I originally intended. ffmpeg5 makes Intel vaapi easier and only rely on oneVPL iirc.

I do not use 80%+ of these packages. I may be able to run Blender, and I use shotcut.


#### New package

- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**



#### Local build testing

- I built this PR locally for my native architecture, **x86_64**


#### Discussion

Continuation of https://github.com/void-linux/void-packages/pull/36315 - thx tibequadorian :)

It was suggested to make `ffmpeg` version 5 and 'copy' (create a new?) `ffmpeg4` package, and that seems to work well.

As stated, I haven't and probably won't test most of these packages, hoping for others to voice in on what's working. 

A few months back (and now) afaict everything has been compiling with ffmpeg5 except for the few problem packages still using ffmpeg4 (below). Can add to the ffmpeg4 list as a incompatible package is found.

`libavresample` is deprecated, but marked as a dependency when trying to build other packages and install `ffmpeg`(5). I think the right way to handle this is make a meta package and the add to removals?

[gstreamer 1.22.1 updates](https://github.com/void-linux/void-packages/pull/42861) could go before this

##### Commit naming / misc

~~`ffpmeg4` isn't "new", not sure what the commit messages should be really for the 4 and 5 split. Additionally xlint complains about `ffmpeg4` revision being 3 and not 1 because it's a "new" package, I assume that's right but not sure.~~

~~Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?~~

I wouldn't mind moving the [intel packages](https://github.com/void-linux/void-packages/pull/41132) into here under another commit. That just got a potential fix that may allow merging but I imagine moving to ffmpeg5 will change and even remove some of those packages. (I won't really test these changes without Intel vaapi either way.)

Maintainer for previous ffmpeg(4) was orphaned, I can put my name in there if that matters, though I don't exactly see myself keeping up on ffmpeg.


##### still ffmpeg4

- `vlc` (vlc4 will support ffmpeg5, there's a patch to build 3.x with ffmpeg5 but it will lack vaapi)
- `osg` (OpenSceneGraph plus `xine-lib`)
- `ytmdl` ? not sure but it uses `python3-ffmpeg-python` which being 6-8yr old I imagine is ffmpeg4


A patch file from https://github.com/void-linux/void-packages/pull/42936.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ffmpeg5-split-42936.patch --]
[-- Type: text/x-diff, Size: 171362 bytes --]

From 36816597fd72a4e58b6081e6f8af2378a1c737b3 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:55:46 -0400
Subject: [PATCH 001/105] ffmpeg: update to 5.1.2.

---
 srcpkgs/ffmpeg/files/altivec.patch            | 60 -------------------
 .../patches/armv5tel-floating-point.patch     | 18 ------
 .../workaround-mesa-readeon-vaapi-bug.patch   | 28 ---------
 srcpkgs/ffmpeg/template                       | 20 +++----
 4 files changed, 9 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/ffmpeg/files/altivec.patch
 delete mode 100644 srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
 delete mode 100644 srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch

diff --git a/srcpkgs/ffmpeg/files/altivec.patch b/srcpkgs/ffmpeg/files/altivec.patch
deleted file mode 100644
index 9c5720046332..000000000000
--- a/srcpkgs/ffmpeg/files/altivec.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-revert some altivec specific change on all ppc* except ppc64le*
-
-q66: "We should also throw in a revert of FFmpeg/FFmpeg@3a557c5 but only
-conditionally, for ppc* but not ppc64le* (the new code is valid for
-POWER8 VSX which LE targets as a baseline but not BE)"
-
-
-This reverts commit 3a557c5d88b7b15b5954ba2743febb055549b536.
----
- libswscale/ppc/yuv2rgb_altivec.c | 24 ++++++++++++++++++++----
- 1 file changed, 20 insertions(+), 4 deletions(-)
-
-diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
-index 536545293d..c1e2852adb 100644
---- a/libswscale/ppc/yuv2rgb_altivec.c
-+++ b/libswscale/ppc/yuv2rgb_altivec.c
-@@ -305,6 +305,9 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
-     vector signed short R1, G1, B1;                                           \
-     vector unsigned char R, G, B;                                             \
-                                                                               \
-+    const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP;                  \
-+    vector unsigned char align_perm;                                          \
-+                                                                              \
-     vector signed short lCY       = c->CY;                                    \
-     vector signed short lOY       = c->OY;                                    \
-     vector signed short lCRV      = c->CRV;                                   \
-@@ -335,13 +338,26 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
-         vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1);       \
-                                                                               \
-         for (j = 0; j < w / 16; j++) {                                        \
--            y0 = vec_xl(0, y1i);                                              \
-+            y1ivP = (const vector unsigned char *) y1i;                       \
-+            y2ivP = (const vector unsigned char *) y2i;                       \
-+            uivP  = (const vector unsigned char *) ui;                        \
-+            vivP  = (const vector unsigned char *) vi;                        \
-+                                                                              \
-+            align_perm = vec_lvsl(0, y1i);                                    \
-+            y0 = (vector unsigned char)                                       \
-+                     vec_perm(y1ivP[0], y1ivP[1], align_perm);                \
-                                                                               \
--            y1 = vec_xl(0, y2i);                                              \
-+            align_perm = vec_lvsl(0, y2i);                                    \
-+            y1 = (vector unsigned char)                                       \
-+                     vec_perm(y2ivP[0], y2ivP[1], align_perm);                \
-                                                                               \
--            u = (vector signed char) vec_xl(0, ui);                           \
-+            align_perm = vec_lvsl(0, ui);                                     \
-+            u = (vector signed char)                                          \
-+                    vec_perm(uivP[0], uivP[1], align_perm);                   \
-                                                                               \
--            v = (vector signed char) vec_xl(0, vi);                           \
-+            align_perm = vec_lvsl(0, vi);                                     \
-+            v = (vector signed char)                                          \
-+                    vec_perm(vivP[0], vivP[1], align_perm);                   \
-                                                                               \
-             u = (vector signed char)                                          \
-                     vec_sub(u,                                                \
--- 
-2.27.0
-
diff --git a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
deleted file mode 100644
index 9a55178c74f0..000000000000
--- a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- a/libavfilter/vf_drawtext.c	2017-10-26 21:03:03.000000000 +0200
-+++ b/libavfilter/vf_drawtext.c	2017-11-21 11:06:49.602284422 +0100
-@@ -39,6 +39,15 @@
- #endif
- #include <fenv.h>
- 
-+#if (FE_ALL_EXCEPT == 0)
-+/* E.g. ARM soft float does not define these */
-+#define FE_INVALID    0
-+#define FE_DIVBYZERO  0
-+#define FE_OVERFLOW   0
-+#define FE_UNDERFLOW  0
-+#define FE_INEXACT    0
-+#endif
-+
- #if CONFIG_LIBFONTCONFIG
- #include <fontconfig/fontconfig.h>
- #endif
diff --git a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
deleted file mode 100644
index 00e3f68a415b..000000000000
--- a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 811d290844206fc73dc39c3e5b67d5d895baedf8 Mon Sep 17 00:00:00 2001
-From: Rainer Hochecker <fernetmenta@online.de>
-Date: Sat, 26 Jan 2019 19:48:35 +0100
-Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices
-
-This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
-It was hit frequently when watching h264 channels received via DVB-X.
-Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704
----
- libavcodec/vaapi_h264.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
-index 5854587a255..f12fdc457a4 100644
---- a/libavcodec/vaapi_h264.c
-+++ b/libavcodec/vaapi_h264.c
-@@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
-     H264SliceContext *sl = &h->slice_ctx[0];
-     int ret;
- 
-+    if (pic->nb_slices == 0) {
-+        ret = AVERROR_INVALIDDATA;
-+        goto finish;
-+    }
-+
-     ret = ff_vaapi_decode_issue(avctx, pic);
-     if (ret < 0)
-         goto finish;
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 23a3d5c9967b..1ac1e4b8df49 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -1,15 +1,15 @@
 # Template file for 'ffmpeg'
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg
-version=4.4.3
-revision=2
+version=5.1.2
+revision=1
 short_desc="Decoding, encoding and streaming software"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
 changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
 distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
-checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
 makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
@@ -26,7 +26,7 @@ makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-deve
  $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
  $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
  $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
- $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers')
  $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
 depends="ffplay>=${version}_${revision}"
 
@@ -114,7 +114,7 @@ do_configure() {
 		$(vopt_enable x265 libx265) \
 		$(vopt_enable v4l2 libv4l2) \
 		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
-		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		--enable-libbs2b --enable-libvidstab \
 		$(vopt_enable dav1d libdav1d) \
 		$(vopt_enable zimg libzimg) \
 		$(vopt_enable webp libwebp) \
@@ -148,10 +148,8 @@ libavdevice_package() {
 	}
 }
 libavresample_package() {
-	short_desc="FFmpeg audio resampling library"
-	pkg_install() {
-		vmove "usr/lib/libavresample.so.*"
-	}
+	short_desc="Package deprecated, removal needed"
+	build_style=meta
 }
 libavformat_package() {
 	short_desc="FFmpeg file format library"
@@ -198,9 +196,9 @@ ffmpeg-devel_package() {
 		libavfilter>=${version}_${revision}
 		libpostproc>=${version}_${revision}
 		libswscale>=${version}_${revision}
-		libswresample>=${version}_${revision}
-		libavresample>=${version}_${revision}"
+		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
+	conflicts="ffmpeg4-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig

From 255a32045804b66f0bfd59c38fdfd83ec7745bcb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:56:22 -0400
Subject: [PATCH 002/105] New package: ffmpeg4-4.4.3.

---
 srcpkgs/ffmpeg4-devel                         |   1 +
 srcpkgs/ffmpeg4/files/altivec.patch           |  60 +++++
 .../patches/armv5tel-floating-point.patch     |  18 ++
 .../workaround-mesa-readeon-vaapi-bug.patch   |  28 +++
 srcpkgs/ffmpeg4/template                      | 214 ++++++++++++++++++
 srcpkgs/libavcodec4                           |   1 +
 srcpkgs/libavdevice4                          |   1 +
 srcpkgs/libavfilter4                          |   1 +
 srcpkgs/libavformat4                          |   1 +
 srcpkgs/libavresample4                        |   1 +
 srcpkgs/libavutil4                            |   1 +
 srcpkgs/libpostproc4                          |   1 +
 srcpkgs/libswresample4                        |   1 +
 srcpkgs/libswscale4                           |   1 +
 14 files changed, 330 insertions(+)
 create mode 120000 srcpkgs/ffmpeg4-devel
 create mode 100644 srcpkgs/ffmpeg4/files/altivec.patch
 create mode 100644 srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
 create mode 100644 srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
 create mode 100644 srcpkgs/ffmpeg4/template
 create mode 120000 srcpkgs/libavcodec4
 create mode 120000 srcpkgs/libavdevice4
 create mode 120000 srcpkgs/libavfilter4
 create mode 120000 srcpkgs/libavformat4
 create mode 120000 srcpkgs/libavresample4
 create mode 120000 srcpkgs/libavutil4
 create mode 120000 srcpkgs/libpostproc4
 create mode 120000 srcpkgs/libswresample4
 create mode 120000 srcpkgs/libswscale4

diff --git a/srcpkgs/ffmpeg4-devel b/srcpkgs/ffmpeg4-devel
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4-devel
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg4/files/altivec.patch b/srcpkgs/ffmpeg4/files/altivec.patch
new file mode 100644
index 000000000000..9c5720046332
--- /dev/null
+++ b/srcpkgs/ffmpeg4/files/altivec.patch
@@ -0,0 +1,60 @@
+revert some altivec specific change on all ppc* except ppc64le*
+
+q66: "We should also throw in a revert of FFmpeg/FFmpeg@3a557c5 but only
+conditionally, for ppc* but not ppc64le* (the new code is valid for
+POWER8 VSX which LE targets as a baseline but not BE)"
+
+
+This reverts commit 3a557c5d88b7b15b5954ba2743febb055549b536.
+---
+ libswscale/ppc/yuv2rgb_altivec.c | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
+index 536545293d..c1e2852adb 100644
+--- a/libswscale/ppc/yuv2rgb_altivec.c
++++ b/libswscale/ppc/yuv2rgb_altivec.c
+@@ -305,6 +305,9 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
+     vector signed short R1, G1, B1;                                           \
+     vector unsigned char R, G, B;                                             \
+                                                                               \
++    const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP;                  \
++    vector unsigned char align_perm;                                          \
++                                                                              \
+     vector signed short lCY       = c->CY;                                    \
+     vector signed short lOY       = c->OY;                                    \
+     vector signed short lCRV      = c->CRV;                                   \
+@@ -335,13 +338,26 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
+         vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1);       \
+                                                                               \
+         for (j = 0; j < w / 16; j++) {                                        \
+-            y0 = vec_xl(0, y1i);                                              \
++            y1ivP = (const vector unsigned char *) y1i;                       \
++            y2ivP = (const vector unsigned char *) y2i;                       \
++            uivP  = (const vector unsigned char *) ui;                        \
++            vivP  = (const vector unsigned char *) vi;                        \
++                                                                              \
++            align_perm = vec_lvsl(0, y1i);                                    \
++            y0 = (vector unsigned char)                                       \
++                     vec_perm(y1ivP[0], y1ivP[1], align_perm);                \
+                                                                               \
+-            y1 = vec_xl(0, y2i);                                              \
++            align_perm = vec_lvsl(0, y2i);                                    \
++            y1 = (vector unsigned char)                                       \
++                     vec_perm(y2ivP[0], y2ivP[1], align_perm);                \
+                                                                               \
+-            u = (vector signed char) vec_xl(0, ui);                           \
++            align_perm = vec_lvsl(0, ui);                                     \
++            u = (vector signed char)                                          \
++                    vec_perm(uivP[0], uivP[1], align_perm);                   \
+                                                                               \
+-            v = (vector signed char) vec_xl(0, vi);                           \
++            align_perm = vec_lvsl(0, vi);                                     \
++            v = (vector signed char)                                          \
++                    vec_perm(vivP[0], vivP[1], align_perm);                   \
+                                                                               \
+             u = (vector signed char)                                          \
+                     vec_sub(u,                                                \
+-- 
+2.27.0
+
diff --git a/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
new file mode 100644
index 000000000000..9a55178c74f0
--- /dev/null
+++ b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
@@ -0,0 +1,18 @@
+--- a/libavfilter/vf_drawtext.c	2017-10-26 21:03:03.000000000 +0200
++++ b/libavfilter/vf_drawtext.c	2017-11-21 11:06:49.602284422 +0100
+@@ -39,6 +39,15 @@
+ #endif
+ #include <fenv.h>
+ 
++#if (FE_ALL_EXCEPT == 0)
++/* E.g. ARM soft float does not define these */
++#define FE_INVALID    0
++#define FE_DIVBYZERO  0
++#define FE_OVERFLOW   0
++#define FE_UNDERFLOW  0
++#define FE_INEXACT    0
++#endif
++
+ #if CONFIG_LIBFONTCONFIG
+ #include <fontconfig/fontconfig.h>
+ #endif
diff --git a/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
new file mode 100644
index 000000000000..00e3f68a415b
--- /dev/null
+++ b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
@@ -0,0 +1,28 @@
+From 811d290844206fc73dc39c3e5b67d5d895baedf8 Mon Sep 17 00:00:00 2001
+From: Rainer Hochecker <fernetmenta@online.de>
+Date: Sat, 26 Jan 2019 19:48:35 +0100
+Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices
+
+This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
+It was hit frequently when watching h264 channels received via DVB-X.
+Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704
+---
+ libavcodec/vaapi_h264.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
+index 5854587a255..f12fdc457a4 100644
+--- a/libavcodec/vaapi_h264.c
++++ b/libavcodec/vaapi_h264.c
+@@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
+     H264SliceContext *sl = &h->slice_ctx[0];
+     int ret;
+ 
++    if (pic->nb_slices == 0) {
++        ret = AVERROR_INVALIDDATA;
++        goto finish;
++    }
++
+     ret = ff_vaapi_decode_issue(avctx, pic);
+     if (ret < 0)
+         goto finish;
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
new file mode 100644
index 000000000000..7bc64bb39f41
--- /dev/null
+++ b/srcpkgs/ffmpeg4/template
@@ -0,0 +1,214 @@
+# Template file for 'ffmpeg4'
+# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
+pkgname=ffmpeg4
+version=4.4.3
+revision=1
+short_desc="Decoding, encoding and streaming software - ffmpeg4 libraries only"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.ffmpeg.org"
+changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
+distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
+checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+
+hostmakedepends="pkg-config perl yasm"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
+
+case "$XBPS_TARGET_MACHINE" in
+	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
+	ppc64*) build_options_default+=" vaapi vdpau";;
+	mips*) CFLAGS="-mnan=legacy";;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" != "32" ]; then
+	build_options_default+=" svtav1"
+fi
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
+do_configure() {
+	# Fix gcc on x86_64-musl only
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
+		sed -i configure -e "s;_cflags_speed='-O3';_cflags_speed='-O2';"
+	fi
+
+	if [ "$CROSS_BUILD" ]; then
+		case "$XBPS_TARGET_MACHINE" in
+			arm*) _arch="arm";;
+			aarch64*) _arch="aarch64";;
+			mips*) _arch="mips";;
+			ppc64*) _arch="ppc64";;
+			ppc*) _arch="ppc";;
+			*) _arch="${XBPS_TARGET_MACHINE%%-musl}";;
+		esac
+
+		_args+=" --enable-cross-compile
+			--sysroot=$XBPS_CROSS_BASE
+			--cross-prefix=${XBPS_CROSS_TRIPLET}-
+			--target-os=linux --arch=${_arch}"
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc|ppc-musl) _args+=" --disable-altivec";;
+	esac
+
+	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+		_args+=" --extra-libs=-latomic"
+	fi
+
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+		--disable-stripping \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
+		$(vopt_if nvenc '--enable-nvenc') \
+		$(vopt_if nvdec '--enable-nvdec')
+}
+do_build() {
+	make ${makejobs}
+	make doc/ff{mpeg,play}.1
+}
+do_install() {
+	make DESTDIR=${DESTDIR} install install-man
+	rm -rf ${DESTDIR}/usr/bin
+}
+
+libavcodec4_package() {
+	short_desc="FFmpeg codec library"
+	pkg_install() {
+		vmove "usr/lib/libavcodec.so.*"
+	}
+}
+libavdevice4_package() {
+	short_desc="FFmpeg device handling library"
+	pkg_install() {
+		vmove "usr/lib/libavdevice.so.*"
+	}
+}
+libavresample4_package() {
+	short_desc="FFmpeg audio resampling library"
+	pkg_install() {
+		vmove "usr/lib/libavresample.so.*"
+	}
+}
+libavformat4_package() {
+	short_desc="FFmpeg file format library"
+	pkg_install() {
+		vmove "usr/lib/libavformat.so.*"
+	}
+}
+libavutil4_package() {
+	short_desc="FFmpeg utility library"
+	pkg_install() {
+		vmove "usr/lib/libavutil.so.*"
+	}
+}
+libavfilter4_package() {
+	short_desc="FFmpeg audio/video filter library"
+	pkg_install() {
+		vmove "usr/lib/libavfilter.so.*"
+	}
+}
+libpostproc4_package() {
+	short_desc="FFmpeg video postprocessing library"
+	pkg_install() {
+		vmove "usr/lib/libpostproc.so.*"
+	}
+}
+libswscale4_package() {
+	short_desc="FFmpeg video scaling library"
+	pkg_install() {
+		vmove "usr/lib/libswscale.so.*"
+	}
+}
+libswresample4_package() {
+	short_desc="FFmpeg video resampling library"
+	pkg_install() {
+		vmove "usr/lib/libswresample.so.*"
+	}
+}
+ffmpeg4-devel_package() {
+	depends="
+		libavcodec4>=${version}_${revision}
+		libavdevice4>=${version}_${revision}
+		libavformat4>=${version}_${revision}
+		libavutil4>=${version}_${revision}
+		libavfilter4>=${version}_${revision}
+		libpostproc4>=${version}_${revision}
+		libswscale4>=${version}_${revision}
+		libswresample4>=${version}_${revision}
+		libavresample4>=${version}_${revision}"
+	short_desc+=" - development files"
+	conflicts="ffmpeg-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/*.a
+		vmove usr/lib/*.so
+		vmove usr/share/ffmpeg/examples
+		vmove usr/share/man/man3
+	}
+}
diff --git a/srcpkgs/libavcodec4 b/srcpkgs/libavcodec4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavcodec4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavdevice4 b/srcpkgs/libavdevice4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavdevice4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavfilter4 b/srcpkgs/libavfilter4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavfilter4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavformat4 b/srcpkgs/libavformat4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavformat4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample4 b/srcpkgs/libavresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavutil4 b/srcpkgs/libavutil4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavutil4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libpostproc4 b/srcpkgs/libpostproc4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libpostproc4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswresample4 b/srcpkgs/libswresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswscale4 b/srcpkgs/libswscale4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswscale4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file

From 7c3a980c4a05662d7f0b28f4cedaa1615385e33f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:04 -0400
Subject: [PATCH 003/105] opencv: update to 4.7.0.

---
 srcpkgs/opencv/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/opencv/template b/srcpkgs/opencv/template
index a09b8dd0d449..41f3183f1582 100644
--- a/srcpkgs/opencv/template
+++ b/srcpkgs/opencv/template
@@ -1,7 +1,7 @@
 # Template file for 'opencv'
 pkgname=opencv
-version=4.6.0
-revision=3
+version=4.7.0
+revision=1
 create_wrksrc=yes
 build_wrksrc=${pkgname}-${version}
 build_style=cmake
@@ -24,8 +24,8 @@ homepage="https://opencv.org"
 changelog="https://github.com/opencv/opencv/wiki/ChangeLog"
 distfiles="https://github.com/opencv/opencv/archive/${version}.tar.gz
  https://github.com/opencv/opencv_contrib/archive/${version}.tar.gz>contrib.tar.gz"
-checksum="1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
- 1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7"
+checksum="8df0079cdbe179748a18d44731af62a245a45ebf5085223dc03133954c662973
+ 42df840cf9055e59d0e22c249cfb19f04743e1bdad113d31b1573d3934d62584"
 patch_args="-Np1 -d ${build_wrksrc}"
 # tests hang indenfinitely, even with test data included
 make_check=no

From e8225c28d0090cc7dbe76d075522f066fa953952 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 004/105] actiona: revbump for opencv-4.7.0

---
 srcpkgs/actiona/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/actiona/template b/srcpkgs/actiona/template
index cf5f0b7a2ae6..0d899311e6df 100644
--- a/srcpkgs/actiona/template
+++ b/srcpkgs/actiona/template
@@ -1,7 +1,7 @@
 # Template file for 'actiona'
 pkgname=actiona
 version=3.10.1
-revision=2
+revision=3
 build_style=qmake
 configure_args="PKGCONFIG_OPENCV=opencv4"
 hostmakedepends="pkg-config qt5-plugin-mysql qt5-qmake qt5-host-tools"

From e76e54c57c2d2fafc8f2982a700370d02ed1df5c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 005/105] digikam: revbump for opencv-4.7.0

---
 srcpkgs/digikam/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/digikam/template b/srcpkgs/digikam/template
index e8ec4961457b..0a8984db85bc 100644
--- a/srcpkgs/digikam/template
+++ b/srcpkgs/digikam/template
@@ -1,7 +1,7 @@
 # Template file for 'digikam'
 pkgname=digikam
 version=7.10.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext pkg-config bison flex qt5-qmake

From 17b83ee21ff92d7990f415fd88fbc3e212f68115 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 006/105] gmic: revbump for opencv-4.7.0

---
 srcpkgs/gmic/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gmic/template b/srcpkgs/gmic/template
index 8e3b80047f26..43c6e0672a2b 100644
--- a/srcpkgs/gmic/template
+++ b/srcpkgs/gmic/template
@@ -1,7 +1,7 @@
 # Template file for 'gmic'
 pkgname=gmic
 version=3.1.6
-revision=1
+revision=2
 _zart_hash=34ebf6cce0bafb98abe57cec83c4a02cd1abeca0
 create_wrksrc=yes
 build_wrksrc="src"

From afad3c15ada0082c62930e9eaacd4a26f1be1eea Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 007/105] nomacs: revbump for opencv-4.7.0

---
 srcpkgs/nomacs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/nomacs/template b/srcpkgs/nomacs/template
index 895e83071a8a..ce4e7f7093da 100644
--- a/srcpkgs/nomacs/template
+++ b/srcpkgs/nomacs/template
@@ -1,7 +1,7 @@
 # Template file for 'nomacs'
 pkgname=nomacs
 version=3.16.224
-revision=3
+revision=4
 build_wrksrc=ImageLounge
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_TRANSLATIONS=1

From 81626c22b96778117d16fed0d562b865279fa3ae Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 008/105] qimgv: revbump for opencv-4.7.0

---
 srcpkgs/qimgv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qimgv/template b/srcpkgs/qimgv/template
index 7eb30db33992..dd341dfe1bfc 100644
--- a/srcpkgs/qimgv/template
+++ b/srcpkgs/qimgv/template
@@ -1,7 +1,7 @@
 # Template file for 'qimgv'
 pkgname=qimgv
 version=1.0.2
-revision=2
+revision=3
 build_style=cmake
 configure_args="$(vopt_if video -DVIDEO_SUPPORT=ON -DVIDEO_SUPPORT=OFF)
  $(vopt_if scale -DOPENCV_SUPPORT=ON -DOPENCV_SUPPORT=OFF)

From 2f13531d7828b3e9d97b6dd701a4482751771d37 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 009/105] retroshare: revbump for opencv-4.7.0

---
 srcpkgs/retroshare/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/retroshare/template b/srcpkgs/retroshare/template
index 8a0786c21a08..72023fa98b75 100644
--- a/srcpkgs/retroshare/template
+++ b/srcpkgs/retroshare/template
@@ -1,7 +1,7 @@
 # Template file for 'retroshare'
 pkgname=retroshare
 version=0.6.6
-revision=2
+revision=4
 build_style=qmake
 #XXX broadcast feature requires an ancient udp-discovery-cpp which either needs
 # to be fetched+patched (FTBFS) here or packaged :/

From 1eb8fc5afdb2f8ff09c2ac117480b5d56c8adf87 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 010/105] siril: revbump for opencv-4.7.0

---
 srcpkgs/siril/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/siril/template b/srcpkgs/siril/template
index e06aa5d0559c..84332f79d060 100644
--- a/srcpkgs/siril/template
+++ b/srcpkgs/siril/template
@@ -1,7 +1,7 @@
 # Template file for 'siril'
 pkgname=siril
 version=0.9.12
-revision=8
+revision=10
 build_style=gnu-configure
 hostmakedepends="pkg-config intltool autoconf automake gettext-devel"
 makedepends="fftw-devel libconfig-devel libopencv-devel libffms2-devel

From 08df475659ed1bd6fc2af9c317e026833efb4e96 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 011/105] waifu2x-converter-cpp: revbump for opencv-4.7.0

---
 srcpkgs/waifu2x-converter-cpp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/waifu2x-converter-cpp/template b/srcpkgs/waifu2x-converter-cpp/template
index 8c095d0d7bab..aa52d8c981a8 100644
--- a/srcpkgs/waifu2x-converter-cpp/template
+++ b/srcpkgs/waifu2x-converter-cpp/template
@@ -1,7 +1,7 @@
 # Template file for 'waifu2x-converter-cpp'
 pkgname=waifu2x-converter-cpp
 version=5.2.4
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DINSTALL_MODELS=ON"
 hostmakedepends="pkg-config"

From 2cd5b3fd4e05c41c58460a98e8bac26c80a03254 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:00:38 -0400
Subject: [PATCH 012/105] vlc: revbump for ffmpeg4-4.4.3

---
 srcpkgs/vlc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/vlc/template b/srcpkgs/vlc/template
index 210762b0a7e2..855ca5238662 100644
--- a/srcpkgs/vlc/template
+++ b/srcpkgs/vlc/template
@@ -1,7 +1,7 @@
 # Template file for 'vlc'
 pkgname=vlc
 version=3.0.18
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-gme --disable-libtar --enable-jack
  --enable-live555 --disable-fluidsynth --enable-dvdread
@@ -25,7 +25,7 @@ lib32disabled=yes
 hostmakedepends="automake libtool pkg-config flex gettext libgcrypt-devel
  live555-devel gettext-devel $(vopt_if lua lua52) $(vopt_if chromecast protobuf)"
 makedepends="
- avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg-devel freefont-ttf
+ avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg4-devel freefont-ttf
  gnutls-devel jack-devel liba52-devel libass-devel libbluray-devel
  libcdio-devel libdca-devel libdvbpsi-devel libdvdnav-devel libmad-devel
  libmatroska-devel libmodplug-devel libmpcdec-devel libmpeg2-devel

From 2d287b23e246b3fb977ab70d4a4fd44ae591cd94 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:00:55 -0400
Subject: [PATCH 013/105] osg: revbump for ffmpeg4-4.4.3

---
 srcpkgs/osg/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index 1a031448b3cf..755793f7e11b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,14 +1,14 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms
 configure_args="-DLIB_POSTFIX="
 hostmakedepends="pkg-config xrandr"
 makedepends="MesaLib-devel gtkglext-devel libcurl-devel giflib-devel librsvg-devel
- jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg-devel xine-lib-devel
+ jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg4-devel xine-lib-devel
  SDL2-devel gst-plugins-base1-devel
  $(vopt_if openexr libopenexr-devel)
  $(vopt_if poppler poppler-glib-devel)

From 5e65f02f0fb010298cbec07c7443df658f1e71fe Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:13 -0400
Subject: [PATCH 014/105] xine-lib: revbump for ffmpeg4-4.4.3

---
 srcpkgs/xine-lib/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/xine-lib/template b/srcpkgs/xine-lib/template
index f713eff49b07..ed6194c17d11 100644
--- a/srcpkgs/xine-lib/template
+++ b/srcpkgs/xine-lib/template
@@ -1,6 +1,6 @@
 # Template file for 'xine-lib'
 pkgname=xine-lib
-version=1.2.12
+version=1.2.13
 revision=1
 build_style=gnu-configure
 configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
@@ -8,7 +8,7 @@ configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
 hostmakedepends="automake gettext-devel libtool pkg-config perl"
 makedepends="
  zlib-devel alsa-lib-devel libxcb-devel libSM-devel libXext-devel libXv-devel
- libXvMC-devel liba52-devel libmad-devel ffmpeg-devel pulseaudio-devel
+ libXvMC-devel liba52-devel libmad-devel ffmpeg4-devel pulseaudio-devel
  jack-devel samba-devel libflac-devel libmodplug-devel libmpcdec-devel
  speex-devel libtheora-devel libvorbis-devel libdca-devel faad2-devel
  libcdio-devel libbluray-devel aalib-devel libcaca-devel libXinerama-devel
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="http://www.xine-project.org"
 changelog="https://sourceforge.net/projects/xine/files/xine-lib/${version}/README.txt/view"
 distfiles="${SOURCEFORGE_SITE}/xine/${pkgname}-${version}.tar.xz"
-checksum=d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098
+checksum=5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f
 
 case "$XBPS_TARGET_MACHINE" in
 	i686-musl)

From 66b36d5f18ec6eaa4dc45a102e399c8fea5f345a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 015/105] QMPlay2: revbump for ffmpeg-5.1.2

---
 srcpkgs/QMPlay2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/QMPlay2/template b/srcpkgs/QMPlay2/template
index ad73cbb01bae..55284c051161 100644
--- a/srcpkgs/QMPlay2/template
+++ b/srcpkgs/QMPlay2/template
@@ -1,7 +1,7 @@
 # Template file for 'QMPlay2'
 pkgname=QMPlay2
 version=23.02.05
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="alsa-lib-devel ffmpeg-devel libass-devel libcdio-devel libgme-devel

From 18e78fb1c624a9164e8fffc7b35992bde062ca8d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 016/105] alsa-plugins: revbump for ffmpeg-5.1.2

---
 srcpkgs/alsa-plugins/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/alsa-plugins/template b/srcpkgs/alsa-plugins/template
index 0bfa6d9fd264..a5708a7d82a8 100644
--- a/srcpkgs/alsa-plugins/template
+++ b/srcpkgs/alsa-plugins/template
@@ -1,7 +1,7 @@
 # Template file for 'alsa-plugins'
 pkgname=alsa-plugins
 version=1.2.7.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-maemo-plugin"
 hostmakedepends="pkg-config"

From d7632eaeb9e981bbff6d0371b40fd9ee481396a2 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 017/105] arcan: revbump for ffmpeg-5.1.2

---
 srcpkgs/arcan/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/arcan/template b/srcpkgs/arcan/template
index 7be9652eccf3..ccc7df11ceac 100644
--- a/srcpkgs/arcan/template
+++ b/srcpkgs/arcan/template
@@ -2,7 +2,7 @@
 # !! keep synced with: acfgfs aclip aloadimage
 pkgname=arcan
 version=0.6.2.1
-revision=1
+revision=2
 create_wrksrc=yes
 build_wrksrc=arcan/src
 build_style=cmake

From 8704582c38f20188e98c6fa5a24a8e447db5033a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 018/105] attract: revbump for ffmpeg-5.1.2

---
 srcpkgs/attract/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/attract/template b/srcpkgs/attract/template
index 26144e931a3c..24017d2bacc2 100644
--- a/srcpkgs/attract/template
+++ b/srcpkgs/attract/template
@@ -1,7 +1,7 @@
 # Template file for 'attract'
 pkgname=attract
 version=2.6.2
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="VERBOSE=1"
 make_use_env=yes

From 33275fb88f631ac09d49220ce552d377f4a75c79 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 019/105] aubio: revbump for ffmpeg-5.1.2

---
 srcpkgs/aubio/patches/ffmpeg5.patch | 37 +++++++++++++++++++++++++++++
 srcpkgs/aubio/template              |  2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/aubio/patches/ffmpeg5.patch

diff --git a/srcpkgs/aubio/patches/ffmpeg5.patch b/srcpkgs/aubio/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a2c8e11ecff0
--- /dev/null
+++ b/srcpkgs/aubio/patches/ffmpeg5.patch
@@ -0,0 +1,37 @@
+commit 35eee003f034a1a2097cd4557deb773eacb18f7b
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:11 2022 +0100
+
+    aubio: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/aubio/patches/ffmpeg-5.0.patch b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..aace41a6e6
+--- /dev/null
++++ b/srcpkgs/aubio/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,25 @@
++From 8a05420e5dd8c7b8b2447f82dc919765876511b3 Mon Sep 17 00:00:00 2001
++From: Paul Brossier <piem@piem.org>
++Date: Tue, 25 Jan 2022 18:30:27 +0100
++Subject: [PATCH] [source_avcodec] define FF_API_LAVF_AVCTX for libavcodec >
++ 59, thx @berolinux (closes gh-353)
++
++---
++ src/io/source_avcodec.c | 4 ++++
++ 1 file changed, 4 insertions(+)
++
++diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c
++index e0ae93b5..1421bd9a 100644
++--- a/src/io/source_avcodec.c
+++++ b/src/io/source_avcodec.c
++@@ -68,6 +68,10 @@
++ #define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
++ #endif
++ 
+++#if LIBAVCODEC_VERSION_MAJOR >= 59
+++#define FF_API_LAVF_AVCTX 1
+++#endif
+++
++ struct _aubio_source_avcodec_t {
++   uint_t hop_size;
++   uint_t samplerate;
diff --git a/srcpkgs/aubio/template b/srcpkgs/aubio/template
index ad1c4b256991..7d875cc02541 100644
--- a/srcpkgs/aubio/template
+++ b/srcpkgs/aubio/template
@@ -1,7 +1,7 @@
 # Template file for 'aubio'
 pkgname=aubio
 version=0.4.9
-revision=1
+revision=2
 build_style=waf3
 # XXX lash, pure and swig support.
 hostmakedepends="pkg-config txt2man"

From 78b5e23ca0ceb810d2f84ff77f3bd3fc7d3d1ead Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 020/105] audacious-plugins: revbump for ffmpeg-5.1.2

---
 .../audacious-plugins/patches/ffmpeg5.patch   | 43 +++++++++++++++++++
 srcpkgs/audacious-plugins/template            |  2 +-
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/audacious-plugins/patches/ffmpeg5.patch

diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg5.patch b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..4e5e34099d71
--- /dev/null
+++ b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
@@ -0,0 +1,43 @@
+commit 298aa371c56c2f52c25a33d9bdec4918b11cebdc
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:12 2022 +0100
+
+    audacious-plugins: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..617c11215b
+--- /dev/null
++++ b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,31 @@
++From f60beb400eeb1e4778bbfd738bc4a4ccef3de539 Mon Sep 17 00:00:00 2001
++From: John Lindgren <john@jlindgren.net>
++Date: Sat, 5 Mar 2022 12:05:34 -0500
++Subject: [PATCH] Fix build with FFmpeg 5.0
++
++---
++ src/ffaudio/ffaudio-core.cc | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/src/ffaudio/ffaudio-core.cc b/src/ffaudio/ffaudio-core.cc
++index 16dc63e3a..a2b95fd6c 100644
++--- a/src/ffaudio/ffaudio-core.cc
+++++ b/src/ffaudio/ffaudio-core.cc
++@@ -274,7 +274,7 @@ static AVInputFormat * get_format_by_content (const char * name, VFSFile & file)
++         AVProbeData d = {name, buf, filled};
++         score = target;
++ 
++-        f = av_probe_input_format2 (& d, true, & score);
+++        f = (AVInputFormat *) av_probe_input_format2 (& d, true, & score);
++         if (f)
++             break;
++ 
++@@ -347,7 +347,7 @@ static bool find_codec (AVFormatContext * c, CodecInfo * cinfo)
++ #endif
++         if (stream && stream->codecpar && stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
++         {
++-            AVCodec * codec = avcodec_find_decoder (stream->codecpar->codec_id);
+++            AVCodec * codec = (AVCodec *) avcodec_find_decoder (stream->codecpar->codec_id);
++ 
++             if (codec)
++             {
diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template
index 910ec0d1891f..def0678bc611 100644
--- a/srcpkgs/audacious-plugins/template
+++ b/srcpkgs/audacious-plugins/template
@@ -2,7 +2,7 @@
 #Keep in sync with audacious!
 pkgname=audacious-plugins
 version=4.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="$(vopt_enable gtk) $(vopt_enable qt)"
 hostmakedepends="gettext pkg-config glib-devel"

From a061e9fccbf080e539fa174851e011fcc1f324bf Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 021/105] audacity: revbump for ffmpeg-5.1.2

---
 srcpkgs/audacity/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/audacity/template b/srcpkgs/audacity/template
index d509c0a89407..c18a4eeb0a73 100644
--- a/srcpkgs/audacity/template
+++ b/srcpkgs/audacity/template
@@ -1,7 +1,7 @@
 # Template file for 'audacity'
 pkgname=audacity
 version=2.4.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--with-ffmpeg=system --with-libsndfile=system --with-expat=system
  --with-libsoxr=system --with-lame=system --with-lv2=system ac_cv_path_WX_CONFIG=wx-config-gtk3"
@@ -33,5 +33,4 @@ post_install() {
 	vcopy plug-ins /usr/share/audacity
 
 	rm ${DESTDIR}/usr/share/doc/audacity/LICENSE.txt
-	vlicense LICENSE.txt LICENSE
 }

From af9054f5d774df07dd830d86dbba84c9eba89c2c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 022/105] avidemux: revbump for ffmpeg-5.1.2

---
 srcpkgs/avidemux/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/avidemux/template b/srcpkgs/avidemux/template
index 253a0243e225..557285982d2b 100644
--- a/srcpkgs/avidemux/template
+++ b/srcpkgs/avidemux/template
@@ -1,7 +1,7 @@
 # Template file for 'avidemux'
 pkgname=avidemux
 version=2.8.0
-revision=2
+revision=3
 # Can't be compiled for aarch64, arm* or mips*
 archs="x86_64* i686*"
 hostmakedepends="cmake pkg-config qt5-host-tools qt5-devel tar yasm"

From d9129b2f1ad785e82ac85b53f11a2fde9f69d5f4 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 023/105] baresip: revbump for ffmpeg-5.1.2

---
 srcpkgs/baresip/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index f1bd1817048b..b21e22334316 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=2.10.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel

From af6520f935273a0efdec6967095cf2aad5c23d00 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 024/105] blender: revbump for ffmpeg-5.1.2

---
 srcpkgs/blender/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index a3255cddbc95..4ec73e05acf5 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
 # Template file for 'blender'
 pkgname=blender
 version=3.4.1
-revision=1
+revision=2
 archs="x86_64* ppc64*"
 build_style="cmake"
 pycompile_dirs="/usr/share/blender/${version%.*}/scripts"

From 1f9def5da75202ab551e3ef5da9b045df15a1a77 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 025/105] cantata: revbump for ffmpeg-5.1.2

---
 srcpkgs/cantata/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cantata/template b/srcpkgs/cantata/template
index 4b417d80d5c2..8a90aaa4c07a 100644
--- a/srcpkgs/cantata/template
+++ b/srcpkgs/cantata/template
@@ -1,7 +1,7 @@
 # Template file for 'cantata'
 pkgname=cantata
 version=2.5.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools qt5-tools"
 makedepends="qt5-devel qt5-tools-devel qt5-svg-devel qt5-xmlpatterns-devel

From b4394643ddfb9b7f92352d246c4193e028922257 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 026/105] ccextractor: revbump for ffmpeg-5.1.2

---
 srcpkgs/ccextractor/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccextractor/template b/srcpkgs/ccextractor/template
index 9abcd82852b2..7fe2ba4f27b6 100644
--- a/srcpkgs/ccextractor/template
+++ b/srcpkgs/ccextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'ccextractor'
 pkgname=ccextractor
 version=0.93
-revision=1
+revision=2
 build_wrksrc="linux"
 build_style=gnu-configure
 configure_args="--enable-ocr --enable-hardsubx"

From 4f55a5cef210da366cd34eca96c425976667950c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 027/105] chromaprint: revbump for ffmpeg-5.1.2

---
 srcpkgs/chromaprint/patches/ffmpeg5.patch | 569 ++++++++++++++++++++++
 srcpkgs/chromaprint/template              |   2 +-
 2 files changed, 570 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/chromaprint/patches/ffmpeg5.patch

diff --git a/srcpkgs/chromaprint/patches/ffmpeg5.patch b/srcpkgs/chromaprint/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a9fd307a23c8
--- /dev/null
+++ b/srcpkgs/chromaprint/patches/ffmpeg5.patch
@@ -0,0 +1,569 @@
+From 8ccad6937177b1b92e40ab8f4447ea27bac009a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
+Date: Fri, 4 Nov 2022 21:47:38 +0100
+Subject: [PATCH] Use FFmpeg 5.x (#120)
+
+* Use FFmpeg 5.1.2 for CI builds
+
+* Build on Ubuntu 20.04
+
+* Upgrade code to FFmpeg 5.x APIs
+
+* Only set FFmpeg include dirs if building tools
+
+* No longer needed
+
+* Use ubuntu 20.04
+---
+ .github/workflows/build.yml                   |   6 +-
+ CMakeLists.txt                                |  16 --
+ package/build.sh                              |   4 +-
+ src/audio/ffmpeg_audio_processor.h            |   2 -
+ src/audio/ffmpeg_audio_processor_avresample.h |  72 -------
+ src/audio/ffmpeg_audio_processor_swresample.h |  18 +-
+ src/audio/ffmpeg_audio_reader.h               | 197 +++++++++---------
+ tests/CMakeLists.txt                          |   6 +
+ 8 files changed, 122 insertions(+), 199 deletions(-)
+ delete mode 100644 src/audio/ffmpeg_audio_processor_avresample.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8d6a32..4da2405 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -84,9 +84,6 @@ find_package(FFmpeg)
+ if(FFMPEG_LIBRARIES)
+ 	cmake_push_check_state(RESET)
+ 	set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lm)
+-	check_function_exists(av_packet_unref HAVE_AV_PACKET_UNREF)
+-	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
+-	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
+ 	cmake_pop_check_state()
+ endif()
+
+@@ -163,14 +160,11 @@ message(STATUS "Using ${FFT_LIB} for FFT calculations")
+ if(NOT AUDIO_PROCESSOR_LIB)
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+ 		set(AUDIO_PROCESSOR_LIB "swresample")
+-	elseif(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(AUDIO_PROCESSOR_LIB "avresample")
+ 	endif()
+ endif()
+
+ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE OFF)
+ 		set(USE_SWRESAMPLE ON)
+ 		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+ 		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS})
+@@ -178,16 +172,6 @@ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+ 	endif()
+ 	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+-elseif(AUDIO_PROCESSOR_LIB STREQUAL "avresample")
+-	if(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE ON)
+-		set(USE_SWRESAMPLE OFF)
+-		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBAVRESAMPLE_LIBRARIES})
+-		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS})
+-	else()
+-		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+-	endif()
+-	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+ else()
+ 	message(STATUS "Building without audio conversion support, please install FFmpeg with libswresample")
+ endif()
+diff --git a/package/build.sh b/package/build.sh
+index da631ae..b41d36e 100755
+--- a/package/build.sh
++++ b/package/build.sh
+@@ -7,8 +7,8 @@ set -eux
+
+ BASE_DIR=$(cd $(dirname $0)/.. && pwd)
+
+-FFMPEG_VERSION=4.4.1
+-FFMPEG_BUILD_TAG=v4.4.1-1
++FFMPEG_VERSION=5.1.2
++FFMPEG_BUILD_TAG=v${FFMPEG_VERSION}-1
+
+ TMP_BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX)
+ trap 'rm -rf $TMP_BUILD_DIR' EXIT
+diff --git a/src/audio/ffmpeg_audio_processor.h b/src/audio/ffmpeg_audio_processor.h
+index 7628fc7..39f4f6d 100644
+--- a/src/audio/ffmpeg_audio_processor.h
++++ b/src/audio/ffmpeg_audio_processor.h
+@@ -10,8 +10,6 @@
+
+ #if defined(USE_SWRESAMPLE)
+ #include "audio/ffmpeg_audio_processor_swresample.h"
+-#elif defined(USE_AVRESAMPLE)
+-#include "audio/ffmpeg_audio_processor_avresample.h"
+ #else
+ #error "no audio processing library"
+ #endif
+diff --git a/src/audio/ffmpeg_audio_processor_avresample.h b/src/audio/ffmpeg_audio_processor_avresample.h
+deleted file mode 100644
+index bd85f92..0000000
+--- a/src/audio/ffmpeg_audio_processor_avresample.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-// Copyright (C) 2016  Lukas Lalinsky
+-// Distributed under the MIT license, see the LICENSE file for details.
+-
+-#ifndef CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-#define CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-
+-extern "C" {
+-#include <libavresample/avresample.h>
+-}
+-
+-namespace chromaprint {
+-
+-class FFmpegAudioProcessor {
+-public:
+-	FFmpegAudioProcessor() {
+-		m_resample_ctx = avresample_alloc_context();
+-	}
+-
+-	~FFmpegAudioProcessor() {
+-		avresample_free(&m_resample_ctx);
+-	}
+-
+-	void SetCompatibleMode() {
+-		av_opt_set_int(m_resample_ctx, "filter_size", 16, 0);
+-		av_opt_set_int(m_resample_ctx, "phase_shift", 8, 0);
+-		av_opt_set_int(m_resample_ctx, "linear_interp", 1, 0);
+-		av_opt_set_double(m_resample_ctx, "cutoff", 0.8, 0);
+-	}
+-
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "in_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_rate", sample_rate, 0);
+-	}
+-
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "out_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_rate, 0);
+-	}
+-
+-	int Init() {
+-		return avresample_open(m_resample_ctx);
+-	}
+-
+-	int Convert(uint8_t **out, int out_count, const uint8_t **in, int in_count) {
+-		return avresample_convert(m_resample_ctx, out, 0, out_count, (uint8_t **) in, 0, in_count);
+-	}
+-
+-	int Flush(uint8_t **out, int out_count) {
+-		return avresample_read(m_resample_ctx, out, out_count);
+-	}
+-
+-private:
+-	AVAudioResampleContext *m_resample_ctx = nullptr;
+-};
+-
+-}; // namespace chromaprint
+-
+-#endif
+diff --git a/src/audio/ffmpeg_audio_processor_swresample.h b/src/audio/ffmpeg_audio_processor_swresample.h
+index b86266b..b1d4bea 100644
+--- a/src/audio/ffmpeg_audio_processor_swresample.h
++++ b/src/audio/ffmpeg_audio_processor_swresample.h
+@@ -28,30 +28,28 @@ public:
+ 		av_opt_set_double(m_swr_ctx, "cutoff", 0.8, 0);
+ 	}
+
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "icl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "ich", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetInputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "isf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "in_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "isr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "in_sample_rate", sample_rate, 0);
+ 	}
+
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "ocl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "och", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "osf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "out_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "osr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "out_sample_rate", sample_rate, 0);
+ 	}
+
+ 	int Init() {
+diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h
+index 5550164..1c6b346 100644
+--- a/src/audio/ffmpeg_audio_reader.h
++++ b/src/audio/ffmpeg_audio_reader.h
+@@ -62,7 +62,7 @@ public:
+ 	bool Read(const int16_t **data, size_t *size);
+
+ 	bool IsOpen() const { return m_opened; }
+-	bool IsFinished() const { return m_finished && !m_got_frame; }
++	bool IsFinished() const { return !m_has_more_packets && !m_has_more_frames; }
+
+ 	std::string GetError() const { return m_error; }
+ 	int GetErrorCode() const { return m_error_code; }
+@@ -74,20 +74,19 @@ private:
+ 	uint8_t *m_convert_buffer[1] = { nullptr };
+ 	int m_convert_buffer_nb_samples = 0;
+
+-	AVInputFormat *m_input_fmt = nullptr;
++	const AVInputFormat *m_input_fmt = nullptr;
+ 	AVDictionary *m_input_opts = nullptr;
+
+ 	AVFormatContext *m_format_ctx = nullptr;
+ 	AVCodecContext *m_codec_ctx = nullptr;
+-	AVFrame *m_frame = nullptr;
+ 	int m_stream_index = -1;
+ 	std::string m_error;
+ 	int m_error_code = 0;
+-	bool m_finished = false;
+ 	bool m_opened = false;
+-	int m_got_frame = 0;
+-	AVPacket m_packet;
+-	AVPacket m_packet0;
++	bool m_has_more_packets = true;
++	bool m_has_more_frames = true;
++	AVPacket *m_packet = nullptr;
++	AVFrame *m_frame = nullptr;
+
+ 	int m_output_sample_rate = 0;
+ 	int m_output_channels = 0;
+@@ -98,19 +97,12 @@ private:
+
+ inline FFmpegAudioReader::FFmpegAudioReader() {
+ 	av_log_set_level(AV_LOG_QUIET);
+-
+-	av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
+ }
+
+ inline FFmpegAudioReader::~FFmpegAudioReader() {
+ 	Close();
+ 	av_dict_free(&m_input_opts);
+ 	av_freep(&m_convert_buffer[0]);
+-	av_packet_unref(&m_packet0);
+ }
+
+ inline bool FFmpegAudioReader::SetInputFormat(const char *name) {
+@@ -135,11 +127,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ 	Close();
+
+-    av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
++	m_packet = av_packet_alloc();
++	if (!m_packet) {
++		return false;
++	}
+
+ 	ret = avformat_open_input(&m_format_ctx, file_name.c_str(), m_input_fmt, &m_input_opts);
+ 	if (ret < 0) {
+@@ -153,26 +144,31 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		return false;
+ 	}
+
+-	AVCodec *codec;
++	const AVCodec *codec;
+ 	ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
+ 	if (ret < 0) {
+ 		SetError("Could not find any audio stream in the file", ret);
+ 		return false;
+ 	}
+ 	m_stream_index = ret;
++	auto stream = m_format_ctx->streams[m_stream_index];
+
+-	m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec;
++	m_codec_ctx = avcodec_alloc_context3(codec);
+ 	m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
+
++	ret = avcodec_parameters_to_context(m_codec_ctx, stream->codecpar);
++	if (ret < 0) {
++		SetError("Could not copy the stream parameters", ret);
++		return false;
++	}
++
+ 	ret = avcodec_open2(m_codec_ctx, codec, nullptr);
+ 	if (ret < 0) {
+ 		SetError("Could not open the codec", ret);
+ 		return false;
+ 	}
+
+-	if (!m_codec_ctx->channel_layout) {
+-		m_codec_ctx->channel_layout = av_get_default_channel_layout(m_codec_ctx->channels);
+-	}
++	av_dump_format(m_format_ctx, 0, "foo", 0);
+
+ 	m_frame = av_frame_alloc();
+ 	if (!m_frame) {
+@@ -183,19 +179,23 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		m_output_sample_rate = m_codec_ctx->sample_rate;
+ 	}
+
+-	if (!m_output_channels) {
+-		m_output_channels = m_codec_ctx->channels;
++	AVChannelLayout output_channel_layout;
++	if (m_output_channels) {
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
++	} else {
++		m_output_channels = m_codec_ctx->ch_layout.nb_channels;
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
+ 	}
+
+-	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
++	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
+ 		m_converter.reset(new FFmpegAudioProcessor());
+ 		m_converter->SetCompatibleMode();
+ 		m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
+ 		m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
+-		m_converter->SetInputChannelLayout(m_codec_ctx->channel_layout);
++		m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
+ 		m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
+ 		m_converter->SetOutputSampleRate(m_output_sample_rate);
+-		m_converter->SetOutputChannelLayout(av_get_default_channel_layout(m_output_channels));
++		m_converter->SetOutputChannelLayout(&output_channel_layout);
+ 		auto ret = m_converter->Init();
+ 		if (ret != 0) {
+ 			SetError("Could not create an audio converter instance", ret);
+@@ -203,10 +203,11 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		}
+ 	}
+
++	av_channel_layout_uninit(&output_channel_layout);
++
+ 	m_opened = true;
+-	m_finished = false;
+-	m_got_frame = 0;
+-	m_nb_packets = 0;
++	m_has_more_packets = true;
++	m_has_more_frames = true;
+ 	m_decode_error = 0;
+
+ 	return true;
+@@ -214,6 +215,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ inline void FFmpegAudioReader::Close() {
+ 	av_frame_free(&m_frame);
++	av_packet_free(&m_packet);
+
+ 	m_stream_index = -1;
+
+@@ -252,91 +254,98 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
+ 		return false;
+ 	}
+
++	*data = nullptr;
++	*size = 0;
++
+ 	int ret;
++	bool needs_packet = false;
+ 	while (true) {
+-		while (m_packet.size <= 0) {
+-			av_packet_unref(&m_packet0);
+-			av_init_packet(&m_packet);
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			ret = av_read_frame(m_format_ctx, &m_packet);
++		while (needs_packet && m_packet->size == 0) {
++			ret = av_read_frame(m_format_ctx, m_packet);
+ 			if (ret < 0) {
+ 				if (ret == AVERROR_EOF) {
+-					m_finished = true;
++					needs_packet = false;
++					m_has_more_packets = false;
+ 					break;
+-				} else {
++				}
++				SetError("Error reading from the audio source", ret);
++				return false;
++			}
++			if (m_packet->stream_index == m_stream_index) {
++				needs_packet = false;
++			} else {
++				av_packet_unref(m_packet);
++			}
++		}
++
++		if (m_packet->size != 0) {
++			ret = avcodec_send_packet(m_codec_ctx, m_packet);
++			if (ret < 0) {
++				if (ret != AVERROR(EAGAIN)) {
+ 					SetError("Error reading from the audio source", ret);
+ 					return false;
+ 				}
+-			}
+-			m_packet0 = m_packet;
+-			if (m_packet.stream_index != m_stream_index) {
+-				m_packet.data = nullptr;
+-				m_packet.size = 0;
+ 			} else {
+-				m_nb_packets++;
++				av_packet_unref(m_packet);
+ 			}
+ 		}
+
+-		ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet);
++		ret = avcodec_receive_frame(m_codec_ctx, m_frame);
+ 		if (ret < 0) {
+-			if (m_decode_error) {
+-				SetError("Error decoding audio frame", m_decode_error);
+-				return false;
++			if (ret == AVERROR_EOF) {
++				m_has_more_frames = false;
++			} else if (ret == AVERROR(EAGAIN)) {
++				if (m_has_more_packets) {
++					needs_packet = true;
++					continue;
++				} else {
++					m_has_more_frames = false;
++				}
+ 			}
+-			m_decode_error = ret;
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			continue;
++			SetError("Error decoding the audio source", ret);
++			return false;
+ 		}
+
+-		break;
+-	}
+-
+-	m_decode_error = 0;
+-
+-	const int decoded = std::min(ret, m_packet.size);
+-	m_packet.data += decoded;
+-	m_packet.size -= decoded;
+-
+-	if (m_got_frame) {
+-		if (m_converter) {
+-			if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
+-				int linsize;
+-				av_freep(&m_convert_buffer[0]);
+-				m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
+-				ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
+-				if (ret < 0) {
+-					SetError("Couldn't allocate audio converter buffer", ret);
++		if (m_frame->nb_samples > 0) {
++			if (m_converter) {
++				if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
++					int linsize;
++					av_freep(&m_convert_buffer[0]);
++					m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
++					ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
++					if (ret < 0) {
++						SetError("Couldn't allocate audio converter buffer", ret);
++						return false;
++					}
++				}
++				auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
++				if (nb_samples < 0) {
++					SetError("Couldn't convert audio", ret);
+ 					return false;
+ 				}
+-			}
+-			auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			}
+-			*data = (const int16_t *) m_convert_buffer[0];
+-			*size = nb_samples;
+-		} else {
+-			*data = (const int16_t *) m_frame->data[0];
+-			*size = m_frame->nb_samples;
+-		}
+-	} else {
+-		if (m_finished && m_converter) {
+-			auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			} else if (nb_samples > 0) {
+-				m_got_frame = 1;
+ 				*data = (const int16_t *) m_convert_buffer[0];
+ 				*size = nb_samples;
++			} else {
++				*data = (const int16_t *) m_frame->data[0];
++				*size = m_frame->nb_samples;
++			}
++		} else {
++			if (m_converter) {
++				if (IsFinished()) {
++					auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
++					if (nb_samples < 0) {
++						SetError("Couldn't convert audio", ret);
++						return false;
++					} else if (nb_samples > 0) {
++						*data = (const int16_t *) m_convert_buffer[0];
++						*size = nb_samples;
++					}
++				}
+ 			}
+ 		}
+-	}
+
+-	return true;
++		return true;
++	}
+ }
+
+ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index a2b517b..123e643 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -38,6 +38,12 @@ set(SRCS
+
+ if(BUILD_TOOLS)
+ 	set(SRCS ${SRCS} ../src/audio/ffmpeg_audio_reader_test.cpp)
++    include_directories(
++        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
++        ${AUDIO_PROCESSOR_INCLUDE_DIRS}
++    )
+ 	link_libraries(fpcalc_libs)
+ endif()
+
+-- 
+2.38.1
+
+
diff --git a/srcpkgs/chromaprint/template b/srcpkgs/chromaprint/template
index 7ef7838949f3..1f7bbc70a22c 100644
--- a/srcpkgs/chromaprint/template
+++ b/srcpkgs/chromaprint/template
@@ -1,7 +1,7 @@
 # Template file for 'chromaprint'
 pkgname=chromaprint
 version=1.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TOOLS=ON"
 make_check_target="check"

From af914181c72330553cba72fc4919e2bdcad8049a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 028/105] chromium: revbump for ffmpeg-5.1.2

---
 srcpkgs/chromium/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 3c1c1caf3765..1f28cde5d3c1 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,7 +2,7 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=111.0.5563.64
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
  $(vopt_if clang "clang lld llvm12")

From f9a9c618af205def5361c18e347b18d6b0c9a760 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 029/105] cmus: revbump for ffmpeg-5.1.2

---
 srcpkgs/cmus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cmus/template b/srcpkgs/cmus/template
index 0fcb424ce336..05b77d0fecae 100644
--- a/srcpkgs/cmus/template
+++ b/srcpkgs/cmus/template
@@ -1,7 +1,7 @@
 # Template file for 'cmus'
 pkgname=cmus
 version=2.10.0
-revision=1
+revision=2
 build_style=configure
 configure_args="prefix=/usr LD=$CC"
 hostmakedepends="pkg-config"

From ec4c3b40964cd0e9375930f9fd6801991099941c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 030/105] cyanrip: revbump for ffmpeg-5.1.2

---
 srcpkgs/cyanrip/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cyanrip/template b/srcpkgs/cyanrip/template
index 9796e3461601..5db30e020d17 100644
--- a/srcpkgs/cyanrip/template
+++ b/srcpkgs/cyanrip/template
@@ -1,7 +1,7 @@
 # Template file for 'cyanrip'
 pkgname=cyanrip
 version=0.9.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="ffmpeg-devel libcdio-devel libcdio-paranoia-devel libcurl-devel libmusicbrainz5-devel"

From e09768b2b041a78446e59535e407d6fcb14f2a40 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 031/105] deadbeef: revbump for ffmpeg-5.1.2

---
 srcpkgs/deadbeef/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/deadbeef/template b/srcpkgs/deadbeef/template
index b664bb1b9bd9..f0fcced864be 100644
--- a/srcpkgs/deadbeef/template
+++ b/srcpkgs/deadbeef/template
@@ -1,7 +1,7 @@
 # Template file for 'deadbeef'
 pkgname=deadbeef
 version=1.8.8
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-oss --disable-lfm --disable-notify --disable-gtk2"

From 4ea7b470bed8abb28c3de3e843a930cf6ca54038 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 032/105] dolphin-emu: revbump for ffmpeg-5.1.2

---
 srcpkgs/dolphin-emu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/dolphin-emu/template b/srcpkgs/dolphin-emu/template
index 7ea197ceb2a8..7aeb0a5b645e 100644
--- a/srcpkgs/dolphin-emu/template
+++ b/srcpkgs/dolphin-emu/template
@@ -1,7 +1,7 @@
 # Template file for 'dolphin-emu'
 pkgname=dolphin-emu
 version=5.0.16101
-revision=1
+revision=2
 _dolphin_commit=8ecfa537a242de74d2e372e30d9d79b14584b2fb
 _mgba_commit=40d4c430fc36caeb7ea32fd39624947ed487d2f2
 #Version/hash pair can be found at https://dolphin-emu.org/download/

From 29f4f566105c65695318a0282e65e33df5d50e84 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 033/105] droidcam-obs-plugin: revbump for ffmpeg-5.1.2

---
 srcpkgs/droidcam-obs-plugin/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/droidcam-obs-plugin/template b/srcpkgs/droidcam-obs-plugin/template
index fc9c9bf6b9d5..fb0480754df4 100644
--- a/srcpkgs/droidcam-obs-plugin/template
+++ b/srcpkgs/droidcam-obs-plugin/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam-obs-plugin'
 pkgname=droidcam-obs-plugin
 version=2.0.1
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=yes
 make_build_args="ALLOW_STATIC=no"

From 08ae9f56b34c9c681bd5d67f8d4cec019e3ff8cb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 034/105] droidcam: revbump for ffmpeg-5.1.2

---
 srcpkgs/droidcam/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/droidcam/template b/srcpkgs/droidcam/template
index 1c3f1b8b1fc6..32a9220b79a4 100644
--- a/srcpkgs/droidcam/template
+++ b/srcpkgs/droidcam/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam'
 pkgname=droidcam
 version=1.8.2
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="USBMUXD=-lusbmuxd-2.0 JPEG=-lturbojpeg"
 hostmakedepends="pkg-config"

From 2f6c5cead34689f23a86debf1cf0c8688ddae258 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 035/105] electron19: revbump for ffmpeg-5.1.2

---
 srcpkgs/electron19/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/electron19/template b/srcpkgs/electron19/template
index 068136be7623..32ce301e730c 100644
--- a/srcpkgs/electron19/template
+++ b/srcpkgs/electron19/template
@@ -1,7 +1,7 @@
 # Template file for 'electron19'
 pkgname=electron19
 version=19.0.8
-revision=2
+revision=3
 _nodever=16.14.2
 _chromiumver=102.0.5005.125
 archs="x86_64* aarch64* ppc64le*"

From e69d3b5678cc2078e59ae29ef13989faf2e8443b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 036/105] ffmpegthumbnailer: revbump for ffmpeg-5.1.2

---
 srcpkgs/ffmpegthumbnailer/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ffmpegthumbnailer/template b/srcpkgs/ffmpegthumbnailer/template
index 039eea7622b3..35d546018d12 100644
--- a/srcpkgs/ffmpegthumbnailer/template
+++ b/srcpkgs/ffmpegthumbnailer/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbnailer'
 pkgname=ffmpegthumbnailer
 version=2.2.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libpng-devel libjpeg-turbo-devel ffmpeg-devel"
@@ -9,8 +9,8 @@ depends="ffmpeg"
 short_desc="Lightweight video thumbnailer"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
-homepage="https://github.com/dirkvdb/${pkgname}"
-distfiles="${homepage}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
+homepage="https://github.com/dirkvdb"
+distfiles="${homepage}/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
 checksum=1cb24059c38223f657b300c84dd80491b7040d4b69471c4fea69be862bc99b5b
 
 post_install() {

From cbbd91637caf896022e4a4f052e5bc023f107e20 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 037/105] ffmpegthumbs: revbump for ffmpeg-5.1.2

---
 srcpkgs/ffmpegthumbs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ffmpegthumbs/template b/srcpkgs/ffmpegthumbs/template
index 5f0b9414dada..11b88193528f 100644
--- a/srcpkgs/ffmpegthumbs/template
+++ b/srcpkgs/ffmpegthumbs/template
@@ -1,7 +1,7 @@
 # Template file for 'ffmpegthumbs'
 pkgname=ffmpegthumbs
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules kcoreaddons kconfig-devel
  pkg-config qt5-host-tools qt5-qmake gettext"

From 0be6ab730ba9218e0a8f33ac9f83afb7ffa0b170 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 038/105] ffms2: revbump for ffmpeg-5.1.2

---
 srcpkgs/ffms2/patches/ffmpeg5.patch | 419 ++++++++++++++++++++++++++++
 srcpkgs/ffms2/template              |   2 +-
 2 files changed, 420 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ffms2/patches/ffmpeg5.patch

diff --git a/srcpkgs/ffms2/patches/ffmpeg5.patch b/srcpkgs/ffms2/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..0766db172473
--- /dev/null
+++ b/srcpkgs/ffms2/patches/ffmpeg5.patch
@@ -0,0 +1,419 @@
+From 28fc493fda2fa2064afeeb0a5d85fdc42db05dcf Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:12:41 +0100
+Subject: [PATCH 1/3] all: Update AVPacket API usage
+
+AVPackets must all be on the heap now, since it is no longer
+part of the libav* ABI.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 16 ++++++----
+ src/core/indexing.cpp    | 63 ++++++++++++++++++++++------------------
+ src/core/indexing.h      |  4 +--
+ src/core/utils.cpp       |  6 ----
+ src/core/utils.h         |  1 -
+ src/core/videosource.cpp | 30 ++++++++++---------
+ 6 files changed, 64 insertions(+), 56 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index 37cf9aeef..e4ce97cdb 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -285,10 +285,15 @@ FFMS_AudioSource::AudioBlock *FFMS_AudioSource::CacheBlock(CacheIterator &pos) {
+ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     CurrentFrame = &Frames[PacketNumber];
+
+-    AVPacket Packet;
+-    if (!ReadPacket(&Packet))
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++    if (!ReadPacket(Packet)) {
++        av_packet_free(&Packet);
+         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_UNKNOWN,
+             "ReadPacket unexpectedly failed to read a packet");
++    }
+
+     // ReadPacket may have changed the packet number
+     CurrentFrame = &Frames[PacketNumber];
+@@ -297,8 +302,9 @@ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     int NumberOfSamples = 0;
+     AudioBlock *CachedBlock = nullptr;
+
+-    int Ret = avcodec_send_packet(CodecContext, &Packet);
+-    av_packet_unref(&Packet);
++    int Ret = avcodec_send_packet(CodecContext, Packet);
++    av_packet_unref(Packet);
++    av_packet_free(&Packet);
+
+     av_frame_unref(DecodeFrame);
+     Ret = avcodec_receive_frame(CodecContext, DecodeFrame);
+@@ -513,8 +519,6 @@ void FFMS_AudioSource::Seek() {
+ }
+
+ bool FFMS_AudioSource::ReadPacket(AVPacket *Packet) {
+-    InitNullPacket(*Packet);
+-
+     while (av_read_frame(FormatContext, Packet) >= 0) {
+         if (Packet->stream_index == TrackNumber) {
+             // Required because not all audio packets, especially in ogg, have a pts. Use the previous valid packet's pts instead.
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index 23fb95b12..e547c5abf 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -320,7 +320,7 @@ void FFMS_Indexer::CheckAudioProperties(int Track, AVCodecContext *Context) {
+     }
+ }
+
+-void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict,
++void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict,
+                                     int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct) {
+     if (VideoContext.Parser) {
+         uint8_t *OB;
+@@ -330,8 +330,8 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+         av_parser_parse2(VideoContext.Parser,
+             VideoContext.CodecContext,
+             &OB, &OBSize,
+-            pkt.data, pkt.size,
+-            pkt.pts, pkt.dts, pkt.pos);
++            pkt->data, pkt->size,
++            pkt->pts, pkt->dts, pkt->pos);
+
+         // H.264 (PAFF) and HEVC may have one field per packet, so we need to track
+         // when we have a full or half frame available, and mark one of them as
+@@ -351,15 +351,15 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+
+         *RepeatPict = VideoContext.Parser->repeat_pict;
+         *FrameType = VideoContext.Parser->pict_type;
+-        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt.flags & AV_PKT_FLAG_DISCARD));
++        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt->flags & AV_PKT_FLAG_DISCARD));
+     } else {
+-        *Invisible = !!(pkt.flags & AV_PKT_FLAG_DISCARD);
++        *Invisible = !!(pkt->flags & AV_PKT_FLAG_DISCARD);
+     }
+
+     if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP8)
+-        ParseVP8(pkt.data[0], Invisible, FrameType);
++        ParseVP8(pkt->data[0], Invisible, FrameType);
+     else if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP9)
+-        ParseVP9(pkt.data[0], Invisible, FrameType);
++        ParseVP9(pkt->data[0], Invisible, FrameType);
+ }
+
+ void FFMS_Indexer::Free() {
+@@ -458,32 +458,36 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+         }
+     }
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
+     std::vector<int64_t> LastValidTS(FormatContext->nb_streams, AV_NOPTS_VALUE);
+
+     int64_t filesize = avio_size(FormatContext->pb);
+     enum AVPictureStructure LastPicStruct = AV_PICTURE_STRUCTURE_UNKNOWN;
+-    while (av_read_frame(FormatContext, &Packet) >= 0) {
++    while (av_read_frame(FormatContext, Packet) >= 0) {
+         // Update progress
+         // FormatContext->pb can apparently be NULL when opening images.
+         if (IC && FormatContext->pb) {
+-            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate))
++            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate)) {
++                av_packet_free(&Packet);
+                 throw FFMS_Exception(FFMS_ERROR_CANCELLED, FFMS_ERROR_USER,
+                     "Cancelled by user");
++            }
+         }
+-        if (!IndexMask.count(Packet.stream_index)) {
+-            av_packet_unref(&Packet);
++        if (!IndexMask.count(Packet->stream_index)) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+-        int Track = Packet.stream_index;
++        int Track = Packet->stream_index;
+         FFMS_Track &TrackInfo = (*TrackIndices)[Track];
+-        bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
++        bool KeyFrame = !!(Packet->flags & AV_PKT_FLAG_KEY);
+         ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
+
+         if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            int64_t PTS = TrackInfo.UseDTS ? Packet.dts : Packet.pts;
++            int64_t PTS = TrackInfo.UseDTS ? Packet->dts : Packet->pts;
+             if (PTS == AV_NOPTS_VALUE) {
+                 // VPx alt-refs are output as packets which lack timestmps or durations, since
+                 // they are invisible. Currently, the timestamp mangling code in libavformat
+@@ -495,9 +499,11 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 // FFMS2 currently sorts packets by PTS, which will break decoding, otherwise.
+                 bool HasAltRefs = (FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP8 ||
+                                    FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP9);
+-                if (Packet.duration == 0 && !HasAltRefs)
++                if (Packet->duration == 0 && !HasAltRefs) {
++                    av_packet_free(&Packet);
+                     throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER,
+                         "Invalid packet pts, dts, and duration");
++                }
+
+                 if (TrackInfo.empty())
+                     PTS = 0;
+@@ -513,7 +519,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             ParseVideoPacket(AVContexts[Track], Packet, &RepeatPict, &FrameType, &Invisible, &LastPicStruct);
+
+             TrackInfo.AddVideoFrame(PTS, RepeatPict, KeyFrame,
+-                FrameType, Packet.pos, Invisible);
++                FrameType, Packet->pos, Invisible);
+         } else if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+             // For video seeking timestamps are used only if all packets have
+             // timestamps, while for audio they're used if any have timestamps,
+@@ -522,28 +528,29 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 TrackInfo.HasTS = true;
+
+             int64_t StartSample = AVContexts[Track].CurrentSample;
+-            uint32_t SampleCount = IndexAudioPacket(Track, &Packet, AVContexts[Track], *TrackIndices);
++            uint32_t SampleCount = IndexAudioPacket(Track, Packet, AVContexts[Track], *TrackIndices);
+             TrackInfo.SampleRate = AVContexts[Track].CodecContext->sample_rate;
+
+             TrackInfo.AddAudioFrame(LastValidTS[Track],
+-                StartSample, SampleCount, KeyFrame, Packet.pos, Packet.flags & AV_PKT_FLAG_DISCARD);
++                StartSample, SampleCount, KeyFrame, Packet->pos, Packet->flags & AV_PKT_FLAG_DISCARD);
+         }
+
+-        if (!(Packet.flags & AV_PKT_FLAG_DISCARD))
+-            TrackInfo.LastDuration = Packet.duration;
++        if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
++            TrackInfo.LastDuration = Packet->duration;
+
+-        av_packet_unref(&Packet);
++        av_packet_unref(Packet);
+     }
++    av_packet_free(&Packet);
+
+     TrackIndices->Finalize(AVContexts, FormatContext->iformat->name);
+     return TrackIndices.release();
+ }
+
+-void FFMS_Indexer::ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS) {
+-    if (!UseDTS && Packet.pts != AV_NOPTS_VALUE)
+-        TS = Packet.pts;
++void FFMS_Indexer::ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS) {
++    if (!UseDTS && Packet->pts != AV_NOPTS_VALUE)
++        TS = Packet->pts;
+     if (TS == AV_NOPTS_VALUE)
+         UseDTS = true;
+-    if (UseDTS && Packet.dts != AV_NOPTS_VALUE)
+-        TS = Packet.dts;
++    if (UseDTS && Packet->dts != AV_NOPTS_VALUE)
++        TS = Packet->dts;
+ }
+diff --git a/src/core/indexing.h b/src/core/indexing.h
+index 3cfc3c30b..5c0686889 100644
+--- a/src/core/indexing.h
++++ b/src/core/indexing.h
+@@ -80,10 +80,10 @@ struct FFMS_Indexer {
+     int64_t Filesize;
+     uint8_t Digest[20];
+
+-    void ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS);
++    void ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS);
+     void CheckAudioProperties(int Track, AVCodecContext *Context);
+     uint32_t IndexAudioPacket(int Track, AVPacket *Packet, SharedAVContext &Context, FFMS_Index &TrackIndices);
+-    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
++    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
+     void Free();
+ public:
+     FFMS_Indexer(const char *Filename);
+diff --git a/src/core/utils.cpp b/src/core/utils.cpp
+index ce67533fd..8a2e99710 100644
+--- a/src/core/utils.cpp
++++ b/src/core/utils.cpp
+@@ -62,12 +62,6 @@ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo) {
+     }
+ }
+
+-void InitNullPacket(AVPacket &pkt) {
+-    av_init_packet(&pkt);
+-    pkt.data = nullptr;
+-    pkt.size = 0;
+-}
+-
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames) {
+     AP.SampleFormat = static_cast<FFMS_SampleFormat>(av_get_packed_sample_fmt(CTX->sample_fmt));
+     AP.BitsPerSample = av_get_bytes_per_sample(CTX->sample_fmt) * 8;
+diff --git a/src/core/utils.h b/src/core/utils.h
+index 9819dc7c9..003ab794e 100644
+--- a/src/core/utils.h
++++ b/src/core/utils.h
+@@ -58,7 +58,6 @@ std::unique_ptr<T> make_unique(Args&&... args) {
+ }
+
+ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo);
+-void InitNullPacket(AVPacket &pkt);
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames);
+
+ void LAVFOpenFile(const char *SourceFile, AVFormatContext *&FormatContext, int Track);
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index 06bd1610e..b889970e2 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -673,30 +673,34 @@ void FFMS_VideoSource::DecodeNextFrame(int64_t &AStartTime, int64_t &Pos) {
+     if (HasPendingDelayedFrames())
+         return;
+
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
+-
+-    while (ReadFrame(&Packet) >= 0) {
+-        if (Packet.stream_index != VideoTrack) {
+-            av_packet_unref(&Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++
++    while (ReadFrame(Packet) >= 0) {
++        if (Packet->stream_index != VideoTrack) {
++            av_packet_unref(Packet);
+             continue;
+         }
+
+         if (AStartTime < 0)
+-            AStartTime = Frames.UseDTS ? Packet.dts : Packet.pts;
++            AStartTime = Frames.UseDTS ? Packet->dts : Packet->pts;
+
+         if (Pos < 0)
+-            Pos = Packet.pos;
++            Pos = Packet->pos;
+
+-        bool FrameFinished = DecodePacket(&Packet);
+-        av_packet_unref(&Packet);
+-        if (FrameFinished)
++        bool FrameFinished = DecodePacket(Packet);
++        av_packet_unref(Packet);
++        if (FrameFinished) {
++            av_packet_free(&Packet);
+             return;
++        }
+     }
+
+     // Flush final frames
+-    InitNullPacket(Packet);
+-    DecodePacket(&Packet);
++    DecodePacket(Packet);
++    av_packet_free(&Packet);
+ }
+
+ bool FFMS_VideoSource::SeekTo(int n, int SeekOffset) {
+
+From bf9e03e9e08534c024e5a744a6437c4aac160201 Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:20:47 +0100
+Subject: [PATCH 2/3] configure: Remove deprecated API use
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b35ef80bc..d19714d0f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,10 +102,10 @@ CFLAGS="$_CFLAGS $FFMPEG_CFLAGS"
+
+ AC_DEFUN([TEST_FFMPEG],
+          [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-            #include <libavcodec/avcodec.h>
++            #include <libavformat/avformat.h>
+             #include <libswscale/swscale.h>
+             ]],[[
+-                avcodec_register_all();
++                avformat_network_init();
+                 swscale_version();
+             ]])], [eval $1=yes], [eval $1=no])
+         ])
+
+From a18c8296687e267b20ec90ef81671b77d393a36e Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:41:21 +0100
+Subject: [PATCH 3/3] Use auto for AVCodec
+
+The geniuses over at FFmpeg decided to constify this API, so old
+versions of the library will return AVCodec *, while new versions
+of the libary will return const AVCodec *, which, in C++, are not
+OK to convert between.
+
+Rather than use some macro hell in ffmscompat.h, we can work around
+this by using auto.
+
+Gross.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 2 +-
+ src/core/indexing.cpp    | 6 +++---
+ src/core/videosource.cpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index e4ce97cdb..ac0966636 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -469,7 +469,7 @@ void FFMS_AudioSource::OpenFile() {
+
+     LAVFOpenFile(SourceFile.c_str(), FormatContext, TrackNumber);
+
+-    AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
++    auto *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
+     if (Codec == nullptr)
+         throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+             "Audio codec not found");
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index e547c5abf..59fb4e8ea 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -384,7 +384,7 @@ FFMS_TrackType FFMS_Indexer::GetTrackType(int Track) {
+ }
+
+ const char *FFMS_Indexer::GetTrackCodec(int Track) {
+-    AVCodec *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
++    auto *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
+     return codec ? codec->name : nullptr;
+ }
+
+@@ -402,7 +402,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             UseDTS);
+
+         if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (!VideoCodec) {
+                 FormatContext->streams[i]->discard = AVDISCARD_ALL;
+                 IndexMask.erase(i);
+@@ -433,7 +433,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 IndexMask.insert(i);
+             }
+         } else if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+-            AVCodec *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (AudioCodec == nullptr)
+                 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
+                     "Audio codec not found");
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index b889970e2..8956c2256 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -171,7 +171,7 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in
+
+         LAVFOpenFile(SourceFile, FormatContext, VideoTrack);
+
+-        AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
++        auto *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
+         if (Codec == nullptr)
+             throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+                 "Video codec not found");
diff --git a/srcpkgs/ffms2/template b/srcpkgs/ffms2/template
index 68e8a0c14bce..2acfadac44b3 100644
--- a/srcpkgs/ffms2/template
+++ b/srcpkgs/ffms2/template
@@ -1,7 +1,7 @@
 # Template file for 'ffms2'
 pkgname=ffms2
 version=2.40
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--enable-shared --disable-static"
 hostmakedepends="pkg-config autoconf automake libtool"

From a5796c2086cfd27a162c9c28b843a9f094d9d651 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 039/105] freerdp: revbump for ffmpeg-5.1.2

---
 srcpkgs/freerdp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/freerdp/template b/srcpkgs/freerdp/template
index 53e67690f863..1b50e9a86bb2 100644
--- a/srcpkgs/freerdp/template
+++ b/srcpkgs/freerdp/template
@@ -1,7 +1,7 @@
 # Template file for 'freerdp'
 pkgname=freerdp
 version=2.9.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_ALSA=ON -DWITH_CUPS=OFF -DWITH_FFMPEG=ON
  -DWITH_GSTREAMER_0_10=OFF -DWITH_GSTREAMER_1_0=OFF -DWITH_JPEG=ON

From 0127bc8a5f16e79a683885da3808199f70454ecb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 040/105] gerbera: revbump for ffmpeg-5.1.2

---
 srcpkgs/gerbera/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gerbera/template b/srcpkgs/gerbera/template
index ae14f35c767c..2dc0ac0ce03b 100644
--- a/srcpkgs/gerbera/template
+++ b/srcpkgs/gerbera/template
@@ -1,7 +1,7 @@
 # Template file for 'gerbera'
 pkgname=gerbera
 version=1.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_SYSTEMD=0 -DWITH_AVCODEC=1"
 hostmakedepends="pkg-config"

From ca24697d7c1fca56fc0f8c56e8641a93c481f4b4 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 041/105] goldendict: revbump for ffmpeg-5.1.2

---
 srcpkgs/goldendict/patches/ffmpeg4.patch   |  21 --
 srcpkgs/goldendict/patches/ffmpeg5-1.patch | 232 +++++++++++++++++++++
 srcpkgs/goldendict/patches/ffmpeg5-2.patch |  33 +++
 srcpkgs/goldendict/patches/ffmpeg5-3.patch |  25 +++
 srcpkgs/goldendict/template                |   4 +-
 5 files changed, 292 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/goldendict/patches/ffmpeg4.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-1.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-2.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5-3.patch

diff --git a/srcpkgs/goldendict/patches/ffmpeg4.patch b/srcpkgs/goldendict/patches/ffmpeg4.patch
deleted file mode 100644
index f045fa27f54b..000000000000
--- a/srcpkgs/goldendict/patches/ffmpeg4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ffmpegaudio.cc.orig 2018-05-09 22:16:13.480659958 +0200
-+++ b/ffmpegaudio.cc      2018-05-09 22:16:50.748322790 +0200
-@@ -143,7 +143,7 @@
-     return false;
-   }
-
--  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
-+  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
-   if ( !avioBuffer )
-   {
-     errorString = QObject::tr( "av_malloc() failed." );
-@@ -380,7 +380,7 @@
-   }
-
-   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
--       codecContext_->codec->capabilities & CODEC_CAP_DELAY )
-+       codecContext_->codec->capabilities & AV_CODEC_CAP_DELAY )
-   {
-     av_init_packet( &packet );
-     int gotFrame = 0;
-
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-1.patch b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
new file mode 100644
index 000000000000..7cfc98ada368
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-1.patch
@@ -0,0 +1,232 @@
+From 03bbe01b79a1f07a6780cb60f23a087104c5d77b Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 30 Mar 2018 22:53:24 +0300
+Subject: [PATCH] Fix warnings while compile with FFMpeg 3.4.2 (issue #978)
+
+---
+ ffmpegaudio.cc | 68 +++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 62 insertions(+), 6 deletions(-)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index ed1172bdd..56e8f788e 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -91,6 +91,7 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++  AVCodec * codec_;
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
+@@ -114,6 +115,7 @@ DecoderContext::DecoderContext( QByteArray const & audioData, QAtomicInt & isCan
+   audioData_( audioData ),
+   audioDataStream_( audioData_ ),
+   formatContext_( NULL ),
++  codec_( NULL ),
+   codecContext_( NULL ),
+   avioContext_( NULL ),
+   audioStream_( NULL ),
+@@ -143,7 +145,11 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 56 || ( LIBAVCODEC_VERSION_MAJOR == 56 && LIBAVCODEC_VERSION_MINOR < 56 )
+   unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
++#else
++  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
++#endif
+   if ( !avioBuffer )
+   {
+     errorString = QObject::tr( "av_malloc() failed." );
+@@ -186,7 +192,11 @@ bool DecoderContext::openCodec( QString & errorString )
+   // Find audio stream, use the first audio stream if available
+   for ( unsigned i = 0; i < formatContext_->nb_streams; i++ )
+   {
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+     if ( formatContext_->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO )
++#else
++      if ( formatContext_->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO )
++#endif
+     {
+       audioStream_ = formatContext_->streams[i];
+       break;
+@@ -198,22 +208,38 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+   codecContext_ = audioStream_->codec;
+-  AVCodec * codec = avcodec_find_decoder( codecContext_->codec_id );
+-  if ( !codec )
++  codec_ = avcodec_find_decoder( codecContext_->codec_id );
++  if ( !codec_ )
+   {
+     errorString = QObject::tr( "Codec [id: %1] not found." ).arg( codecContext_->codec_id );
+     return false;
+   }
++#else
++  codec_ = avcodec_find_decoder( audioStream_->codecpar->codec_id );
++  if ( !codec_ )
++  {
++    errorString = QObject::tr( "Codec [id: %1] not found." ).arg( audioStream_->codecpar->codec_id );
++    return false;
++  }
++  codecContext_ = avcodec_alloc_context3( codec_ );
++  if ( !codecContext_ )
++  {
++    errorString = QObject::tr( "avcodec_alloc_context3() failed." );
++    return false;
++  }
++  avcodec_parameters_to_context( codecContext_, audioStream_->codecpar );
++#endif
+
+-  ret = avcodec_open2( codecContext_, codec, NULL );
++  ret = avcodec_open2( codecContext_, codec_, NULL );
+   if ( ret < 0 )
+   {
+     errorString = QObject::tr( "avcodec_open2() failed: %1." ).arg( avErrorString( ret ) );
+     return false;
+   }
+
+-  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec->long_name,
++  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec_->long_name,
+           codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
+   return true;
+ }
+@@ -252,10 +278,13 @@ void DecoderContext::closeCodec()
+
+   // Closing a codec context without prior avcodec_open2() will result in
+   // a crash in ffmpeg
+-  if ( audioStream_ && audioStream_->codec && audioStream_->codec->codec )
++  if ( audioStream_ && codecContext_ && codec_ )
+   {
+     audioStream_->discard = AVDISCARD_ALL;
+-    avcodec_close( audioStream_->codec );
++    avcodec_close( codecContext_ );
++#if LIBAVCODEC_VERSION_MAJOR > 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR >= 33 )
++    avcodec_free_context( &codecContext_ );
++#endif
+   }
+
+   avformat_close_input( &formatContext_ );
+@@ -356,6 +385,7 @@ bool DecoderContext::play( QString & errorString )
+     if ( packet.stream_index == audioStream_->index )
+     {
+       AVPacket pack = packet;
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+       int gotFrame = 0;
+       do
+       {
+@@ -370,6 +400,19 @@ bool DecoderContext::play( QString & errorString )
+         pack.data += len;
+       }
+       while( pack.size > 0 );
++#else
++      int ret = avcodec_send_packet( codecContext_, &pack );
++      /* read all the output frames (in general there may be any number of them) */
++      while( ret >= 0 )
++      {
++        ret = avcodec_receive_frame( codecContext_, frame);
++
++        if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++          break;
++
++        playFrame( frame );
++      }
++#endif
+     }
+     // av_free_packet() must be called after each call to av_read_frame()
+ #if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 )
+@@ -379,6 +422,7 @@ bool DecoderContext::play( QString & errorString )
+ #endif
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
+        codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+   {
+@@ -391,6 +435,18 @@ bool DecoderContext::play( QString & errorString )
+       playFrame( frame );
+     }
+   }
++#else
++  /* flush the decoder */
++  av_init_packet( &packet );
++  int ret = avcodec_send_packet(codecContext_, &packet );
++  while( ret >= 0 )
++  {
++    ret = avcodec_receive_frame(codecContext_, frame);
++    if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++      break;
++    playFrame( frame );
++  }
++#endif
+
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+   av_free( frame );
+32
+srcpkgs/goldendict/patches/ffmpeg5-2.patch
+Comment on this file
+@@ -0,0 +1,32 @@
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
+25
+srcpkgs/goldendict/patches/ffmpeg5-3.patch
+Comment on this file
+@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-2.patch b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
new file mode 100644
index 000000000000..9c477b0c1347
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-2.patch
@@ -0,0 +1,33 @@
+
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
diff --git a/srcpkgs/goldendict/patches/ffmpeg5-3.patch b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
new file mode 100644
index 000000000000..72101903d1d1
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5-3.patch
@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/template b/srcpkgs/goldendict/template
index f41b5b2c6899..2ca4185e538a 100644
--- a/srcpkgs/goldendict/template
+++ b/srcpkgs/goldendict/template
@@ -1,7 +1,7 @@
 # Template file for 'goldendict'
 pkgname=goldendict
 version=1.5.0RC2
-revision=5
+revision=6
 build_style=qmake
 configure_args="CONFIG+=zim_support"
 hostmakedepends="qt5-qmake pkg-config qt5-host-tools"
@@ -9,7 +9,7 @@ makedepends="tiff-devel qt5-devel libvorbis-devel zlib-devel
  libXtst-devel hunspell-devel qt5-tools-devel qt5-declarative-devel
  qt5-webkit-devel lzo-devel bzip2-devel libao-devel qt5-svg-devel
  libeb-devel qt5-x11extras-devel ffmpeg-devel liblzma-devel"
-short_desc="A feature-rich dictionary lookup program"
+short_desc="Feature-rich dictionary lookup program"
 maintainer="John <me@johnnynator.dev>"
 license="GPL-3.0-or-later"
 homepage="http://goldendict.org/"

From f045568f0b0ac34beac8906bb3d2968f06a0ff92 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 042/105] gst-libav: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-libav/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-libav/template b/srcpkgs/gst-libav/template
index e9a79dc650a5..f082bd211c65 100644
--- a/srcpkgs/gst-libav/template
+++ b/srcpkgs/gst-libav/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-libav'
 pkgname=gst-libav
 version=1.20.3
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config yasm"
 makedepends="orc-devel gst-plugins-base1-devel ffmpeg-devel"

From 285432833fa52f1fa184d638fdc8bc33a16baacc Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 043/105] gst-plugins-bad1: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-plugins-bad1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index bb9c4d87f4c6..f55f82fd4c77 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.20.3
-revision=2
+revision=3
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled

From d5b8a79dd7587b3e12d3b01e8d3cb3a31e2577e1 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 044/105] gst-rtsp-server: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-rtsp-server/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-rtsp-server/template b/srcpkgs/gst-rtsp-server/template
index 33cd64ceb95e..8ceea8d34b4b 100644
--- a/srcpkgs/gst-rtsp-server/template
+++ b/srcpkgs/gst-rtsp-server/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-rtsp-server'
 pkgname=gst-rtsp-server
 version=1.20.3
-revision=2
+revision=3
 build_style=meson
 hostmakedepends="pkg-config python3"
 makedepends="glib-devel gst-plugins-bad1-devel gobject-introspection

From c7e092cac918a721c87bfbe09be3187222c22215 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 045/105] gtk4: revbump for ffmpeg-5.1.2

---
 srcpkgs/gtk4/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 6a50567f53a9..6976aee84817 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
 # Template file for 'gtk4'
 pkgname=gtk4
 version=4.10.1
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dman-pages=true -Dgtk_doc=true

From c8494b22fb259904c2f8e410bd4f5bb07ac4c6bc Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 046/105] guvcview: revbump for ffmpeg-5.1.2

---
 srcpkgs/guvcview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/guvcview/template b/srcpkgs/guvcview/template
index 345cf6006f24..d42fd38fa4ad 100644
--- a/srcpkgs/guvcview/template
+++ b/srcpkgs/guvcview/template
@@ -1,7 +1,7 @@
 # Template file for 'guvcview'
 pkgname=guvcview
 version=2.0.7
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-static --disable-debian-menu"

From 0557795ff0c8e0be46567c175e8a93aefa38d28a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 047/105] handbrake: revbump for ffmpeg-5.1.2

---
 srcpkgs/handbrake/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/handbrake/template b/srcpkgs/handbrake/template
index ca5e4571e49c..188a79f2bf5c 100644
--- a/srcpkgs/handbrake/template
+++ b/srcpkgs/handbrake/template
@@ -1,7 +1,7 @@
 # Template file for 'handbrake'
 pkgname=handbrake
 version=1.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--force --disable-gtk-update-checks --disable-df-fetch --harden
  $(vopt_enable fdk_aac fdk-aac) $(vopt_enable nvenc)"

From d143d4c9753e5ff8b5c59b8bf702008d6d915fdb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 048/105] hedgewars: revbump for ffmpeg-5.1.2

---
 srcpkgs/hedgewars/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index 419f29b98b44..a343b3172a72 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,7 +1,7 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
  -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"

From 6de4881a9eb1f0fc462b2c36a3447176cf61f225 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 049/105] idjc: revbump for ffmpeg-5.1.2

---
 srcpkgs/idjc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/idjc/template b/srcpkgs/idjc/template
index df60318b3db9..b205e74745fe 100644
--- a/srcpkgs/idjc/template
+++ b/srcpkgs/idjc/template
@@ -1,7 +1,7 @@
 # Template file for 'idjc'
 pkgname=idjc
 version=0.9.1
-revision=3
+revision=4
 build_style=gnu-configure
 hostmakedepends="pkg-config git python3 automake gettext-devel libtool"
 makedepends="libvorbis-devel libogg-devel jack-devel libsamplerate-devel

From 2705e2192ed40da344fb6e9a9c0500992552f3c5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 050/105] kfilemetadata5: revbump for ffmpeg-5.1.2

---
 srcpkgs/kfilemetadata5/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kfilemetadata5/template b/srcpkgs/kfilemetadata5/template
index 83f4d583bcb7..b90ef056a196 100644
--- a/srcpkgs/kfilemetadata5/template
+++ b/srcpkgs/kfilemetadata5/template
@@ -1,7 +1,7 @@
 # Template file for 'kfilemetadata5'
 pkgname=kfilemetadata5
 version=5.103.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="kcoreaddons extra-cmake-modules pkg-config qt5-host-tools qt5-qmake
  gettext kcoreaddons python3"

From bbfc4fa57ae9a5fac7e71b9ec6b659f2c12c66e6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 051/105] kid3: revbump for ffmpeg-5.1.2

---
 srcpkgs/kid3/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kid3/template b/srcpkgs/kid3/template
index 456206d90e16..f32f9decb0e7 100644
--- a/srcpkgs/kid3/template
+++ b/srcpkgs/kid3/template
@@ -1,7 +1,7 @@
 # Template file for 'kid3'
 pkgname=kid3
 version=3.9.1
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DWITH_APPS='CLI;$(vopt_if KDE KDE Qt)'
  -DWITH_DOCBOOKDIR=/usr/share/xsl/docbook -DWITH_FLAC=$(vopt_if flac ON OFF)

From 59dd4f8380b836a11927b8a20f01ab57884c7985 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 052/105] kodi: revbump for ffmpeg-5.1.2

---
 srcpkgs/kodi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kodi/template b/srcpkgs/kodi/template
index 8057964d78a3..991325f6c477 100644
--- a/srcpkgs/kodi/template
+++ b/srcpkgs/kodi/template
@@ -1,7 +1,7 @@
 # Template file for 'kodi'
 pkgname=kodi
 version=19.4
-revision=6
+revision=7
 _codename="Matrix"
 build_style=cmake
 configure_args="-DWITH_FFMPEG=/usr -DENABLE_LDGOLD=OFF

From 28377d02daf39a9022bff2d3260b616c620f4e54 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 053/105] kpipewire: revbump for ffmpeg-5.1.2

---
 srcpkgs/kpipewire/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kpipewire/template b/srcpkgs/kpipewire/template
index 1d1e963f296d..07cdc0c7384a 100644
--- a/srcpkgs/kpipewire/template
+++ b/srcpkgs/kpipewire/template
@@ -1,7 +1,7 @@
 # Template file for 'kpipewire'
 pkgname=kpipewire
 version=5.27.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules plasma-wayland-protocols gettext
  qt5-qmake qt5-host-tools pkg-config wayland-devel kcoreaddons

From f3d59ba5194f1e53bb0fb2f1faeb4906f0d1d3b0 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 054/105] libextractor: revbump for ffmpeg-5.1.2

---
 srcpkgs/libextractor/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libextractor/template b/srcpkgs/libextractor/template
index 29d5b8df01f8..ddd4790f93e8 100644
--- a/srcpkgs/libextractor/template
+++ b/srcpkgs/libextractor/template
@@ -1,7 +1,7 @@
 # Template file for 'libextractor'
 pkgname=libextractor
 version=1.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static"
 hostmakedepends="pkg-config"

From 811ce43648c9cc75e63e83bc750118125a0450ee Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 055/105] libopenal: revbump for ffmpeg-5.1.2

---
 srcpkgs/libopenal/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libopenal/template b/srcpkgs/libopenal/template
index 77218f9e539d..3f49ed75a1fd 100644
--- a/srcpkgs/libopenal/template
+++ b/srcpkgs/libopenal/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenal'
 pkgname=libopenal
 version=1.22.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DALSOFT_EXAMPLES=OFF"
 hostmakedepends="pkg-config"

From b970a71301b732fa6df259d0495d02035a98386e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 056/105] libopenshot: revbump for ffmpeg-5.1.2

---
 srcpkgs/libopenshot/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template
index db831f69b474..81aa0d7136d9 100644
--- a/srcpkgs/libopenshot/template
+++ b/srcpkgs/libopenshot/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenshot'
 pkgname=libopenshot
 version=0.3.0
-revision=1
+revision=2
 build_style=cmake
 # Builds fail with Ruby-2.4.1
 configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON"

From 38f6ebead2548ac46d3476e53d29739879c4ad40 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 057/105] loudgain: revbump for ffmpeg-5.1.2

---
 srcpkgs/loudgain/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index da4f2d56e94c..4d6bf29efb4f 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"

From 38d4af530d5a45c19851db6830673351ef8716d7 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 058/105] mediastreamer: revbump for ffmpeg-5.1.2

---
 srcpkgs/mediastreamer/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mediastreamer/template b/srcpkgs/mediastreamer/template
index d0e97e858e29..d29210c1bf9c 100644
--- a/srcpkgs/mediastreamer/template
+++ b/srcpkgs/mediastreamer/template
@@ -1,7 +1,7 @@
 # Template file for 'mediastreamer'
 pkgname=mediastreamer
 version=5.2.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_STRICT=0 -DENABLE_UNIT_TESTS=0"
 hostmakedepends="python3"

From 537b27e2044593f01b2e7f6d6d828476241e94d9 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 059/105] mgba: revbump for ffmpeg-5.1.2

---
 srcpkgs/mgba/patches/ffmpeg5.patch | 117 +++++++++++++++++++++++++++++
 srcpkgs/mgba/template              |   2 +-
 2 files changed, 118 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mgba/patches/ffmpeg5.patch

diff --git a/srcpkgs/mgba/patches/ffmpeg5.patch b/srcpkgs/mgba/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..ad7049efcac3
--- /dev/null
+++ b/srcpkgs/mgba/patches/ffmpeg5.patch
@@ -0,0 +1,117 @@
+From cdc753516798882a805db1d2042dbce8313382bf Mon Sep 17 00:00:00 2001
+From: Ryan Tandy <ryan@nardis.ca>
+Date: Thu, 3 Feb 2022 19:02:52 -0800
+Subject: [PATCH] FFmpeg: Support FFmpeg 5.0
+
+---
+ src/feature/ffmpeg/ffmpeg-decoder.c |  3 ++-
+ src/feature/ffmpeg/ffmpeg-encoder.c | 25 ++++++++++++++-----------
+ 2 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/src/feature/ffmpeg/ffmpeg-decoder.c b/src/feature/ffmpeg/ffmpeg-decoder.c
+index c3bb6d1c5c..daa47fbf2c 100644
+--- a/src/feature/ffmpeg/ffmpeg-decoder.c
++++ b/src/feature/ffmpeg/ffmpeg-decoder.c
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ #include "ffmpeg-decoder.h"
+
++#include <libavcodec/avcodec.h>
+ #include <libswscale/swscale.h>
+
+ void FFmpegDecoderInit(struct FFmpegDecoder* decoder) {
+@@ -38,7 +39,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) {
+ #else
+ 		enum AVMediaType type = decoder->context->streams[i]->codec->codec_type;
+ #endif
+-		struct AVCodec* codec;
++		const struct AVCodec* codec;
+ 		struct AVCodecContext* context = NULL;
+ 		if (type == AVMEDIA_TYPE_VIDEO && decoder->videoStream < 0) {
+ 			decoder->video = avcodec_alloc_context3(NULL);
+diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c
+index ad76ca57b2..be6bd3af5e 100644
+--- a/src/feature/ffmpeg/ffmpeg-encoder.c
++++ b/src/feature/ffmpeg/ffmpeg-encoder.c
+@@ -12,6 +12,9 @@
+
+ #include <libavcodec/version.h>
+ #include <libavcodec/avcodec.h>
++#if LIBAVCODEC_VERSION_MAJOR >= 58
++#include <libavcodec/bsf.h>
++#endif
+
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+@@ -121,7 +124,7 @@ bool FFmpegEncoderSetAudio(struct FFmpegEncoder* encoder, const char* acodec, un
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(acodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(acodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -193,7 +196,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 		return true;
+ 	}
+
+-	AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
++	const AVCodec* codec = avcodec_find_encoder_by_name(vcodec);
+ 	if (!codec) {
+ 		return false;
+ 	}
+@@ -213,7 +216,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ 	if (encoder->pixFormat == AV_PIX_FMT_NONE) {
+ 		return false;
+ 	}
+-	if (vbr < 0 && !av_opt_find(&codec->priv_class, "crf", NULL, 0, 0)) {
++	if (vbr < 0 && !av_opt_find((void*) &codec->priv_class, "crf", NULL, 0, 0)) {
+ 		return false;
+ 	}
+ 	encoder->videoCodec = vcodec;
+@@ -223,7 +226,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in
+ }
+
+ bool FFmpegEncoderSetContainer(struct FFmpegEncoder* encoder, const char* container) {
+-	AVOutputFormat* oformat = av_guess_format(container, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(container, 0, 0);
+ 	if (!oformat) {
+ 		return false;
+ 	}
+@@ -241,9 +244,9 @@ void FFmpegEncoderSetLooping(struct FFmpegEncoder* encoder, bool loop) {
+ }
+
+ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !oformat || (!acodec && !vcodec)) {
+ 		return false;
+ 	}
+@@ -257,8 +260,8 @@ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) {
+ }
+
+ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+-	AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
+-	AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
++	const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec);
++	const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec);
+ 	if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !FFmpegEncoderVerifyContainer(encoder)) {
+ 		return false;
+ 	}
+@@ -272,9 +275,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
+ 	encoder->currentVideoFrame = 0;
+ 	encoder->skipResidue = 0;
+
+-	AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
++	const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
+ #ifndef USE_LIBAV
+-	avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile);
++	avformat_alloc_output_context2(&encoder->context, (AVOutputFormat*) oformat, 0, outfile);
+ #else
+ 	encoder->context = avformat_alloc_context();
+ 	strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1);
diff --git a/srcpkgs/mgba/template b/srcpkgs/mgba/template
index 05bca15c1750..f5b6b8464428 100644
--- a/srcpkgs/mgba/template
+++ b/srcpkgs/mgba/template
@@ -1,7 +1,7 @@
 # Template file for 'mgba'
 pkgname=mgba
 version=0.10.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake desktop-file-utils"
 makedepends="SDL2-devel ffmpeg-devel libedit-devel libepoxy-devel libmagick-devel

From 4e90aa213582dd56089e16d2b0959affc6d74fb5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 060/105] minidlna: revbump for ffmpeg-5.1.2

---
 srcpkgs/minidlna/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/minidlna/template b/srcpkgs/minidlna/template
index e8081b1cbc67..9ee9714861fd 100644
--- a/srcpkgs/minidlna/template
+++ b/srcpkgs/minidlna/template
@@ -1,7 +1,7 @@
 # Template file for 'minidlna'
 pkgname=minidlna
 version=1.3.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --sbindir=/usr/bin

From afa9f63fee2ce6fbd82775afdb7187715f9ececc Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 061/105] mixxx: revbump for ffmpeg-5.1.2

---
 srcpkgs/mixxx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template
index 619ddca0d332..4b9ea00d3fb3 100644
--- a/srcpkgs/mixxx/template
+++ b/srcpkgs/mixxx/template
@@ -1,7 +1,7 @@
 # Template file for 'mixxx'
 pkgname=mixxx
 version=2.3.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="extra-cmake-modules pkg-config protobuf qt5-host-tools qt5-devel"

From b5ca220c6532593d757a6c93d6486cf888e6f52a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 062/105] mlt: revbump for ffmpeg-5.1.2

---
 srcpkgs/mlt/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mlt/template b/srcpkgs/mlt/template
index 8933eb4e7bb9..ed6b27503f9a 100644
--- a/srcpkgs/mlt/template
+++ b/srcpkgs/mlt/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt'
 pkgname=mlt
 version=6.26.1
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --libdir=/usr/lib$XBPS_TARGET_WORDSIZE
  --enable-gpl --enable-gpl3 --disable-swfdec --without-kde

From cbafae69581277cad60b43c1ca64e539fed7ad49 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 063/105] mlt7: revbump for ffmpeg-5.1.2

---
 srcpkgs/mlt7/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mlt7/template b/srcpkgs/mlt7/template
index e5972cc0411b..d0e9ec02e58a 100644
--- a/srcpkgs/mlt7/template
+++ b/srcpkgs/mlt7/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt7'
 pkgname=mlt7
 version=7.12.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSWIG_PYTHON=ON"
 hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which

From 84a4f489025ccf393dee612eb1225c9d3170f746 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 064/105] moc: revbump for ffmpeg-5.1.2

---
 srcpkgs/moc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/moc/template b/srcpkgs/moc/template
index c42be650a1d2..4b95426599bf 100644
--- a/srcpkgs/moc/template
+++ b/srcpkgs/moc/template
@@ -1,7 +1,7 @@
 # Template file for 'moc'
 pkgname=moc
 version=2.5.2
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg-devel

From 775b694a9ce6e781eac90d6d090744934c6ca3c5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 065/105] motion: revbump for ffmpeg-5.1.2

---
 srcpkgs/motion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/motion/template b/srcpkgs/motion/template
index 3cf3c3035c5b..7dca12d851e3 100644
--- a/srcpkgs/motion/template
+++ b/srcpkgs/motion/template
@@ -1,7 +1,7 @@
 # Template file for 'motion'
 pkgname=motion
 version=4.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake pkg-config gettext-devel tar"
 makedepends="ffmpeg-devel libmicrohttpd-devel v4l-utils-devel gettext-devel"

From ecfc8d13f0f408f482646449bbbf06c3b466e6b6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 066/105] mpd: revbump for ffmpeg-5.1.2

---
 srcpkgs/mpd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mpd/template b/srcpkgs/mpd/template
index 63701b7d56b1..df35e751ea60 100644
--- a/srcpkgs/mpd/template
+++ b/srcpkgs/mpd/template
@@ -1,7 +1,7 @@
 # Template file for 'mpd'
 pkgname=mpd
 version=0.23.12
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true
  -Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled

From f9c8f1525a17e1b27a91e775f845fc105d5e3df9 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 067/105] mpv: revbump for ffmpeg-5.1.2

---
 srcpkgs/mpv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mpv/template b/srcpkgs/mpv/template
index e163c496c6eb..d4fefbf5e3c7 100644
--- a/srcpkgs/mpv/template
+++ b/srcpkgs/mpv/template
@@ -1,7 +1,7 @@
 # Template file for 'mpv'
 pkgname=mpv
 version=0.35.1
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled
  -Dlibmpv=true -Dcplugins=enabled

From 0e42c57c0f057eb0e4b22ecbef29f0af3b7ca223 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 068/105] musikcube: revbump for ffmpeg-5.1.2

---
 srcpkgs/musikcube/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template
index 4b7930041126..7cd65cf76b77 100644
--- a/srcpkgs/musikcube/template
+++ b/srcpkgs/musikcube/template
@@ -1,7 +1,7 @@
 # Template file for 'musikcube'
 pkgname=musikcube
 version=0.99.4
-revision=1
+revision=2
 build_style=cmake
 make_cmd=make
 configure_args="-DNO_NCURSESW=1"

From 8f4393d60c36bcc668fc51115133071b53e95e3c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 069/105] notcurses: revbump for ffmpeg-5.1.2

---
 srcpkgs/notcurses/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/notcurses/template b/srcpkgs/notcurses/template
index 6dd8a091319f..3110c30c9aff 100644
--- a/srcpkgs/notcurses/template
+++ b/srcpkgs/notcurses/template
@@ -1,7 +1,7 @@
 # Template file for 'notcurses'
 pkgname=notcurses
 version=3.0.9
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_STATIC=ON $(vopt_bool man USE_PANDOC)"
 hostmakedepends="pkg-config $(vopt_if man pandoc)"

From 57b0c3fb8eda0f3683fce2f02d2ffcb0871b09b6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 070/105] obs: revbump for ffmpeg-5.1.2

---
 srcpkgs/obs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/obs/template b/srcpkgs/obs/template
index 1a7132ae832f..078feba62bbb 100644
--- a/srcpkgs/obs/template
+++ b/srcpkgs/obs/template
@@ -1,7 +1,7 @@
 # Template file for 'obs'
 pkgname=obs
 version=29.0.2
-revision=1
+revision=2
 archs="i686* x86_64* ppc64le* aarch64*"
 build_style=cmake
 configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON

From 5429ee97b30d65ede54cf02d03f0fac4e6d06adb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 071/105] olive: revbump for ffmpeg-5.1.2

---
 srcpkgs/olive/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/olive/template b/srcpkgs/olive/template
index 12a46936c990..5290d8e5aacd 100644
--- a/srcpkgs/olive/template
+++ b/srcpkgs/olive/template
@@ -1,7 +1,7 @@
 # Template file for 'olive'
 pkgname=olive
 version=0.1.2
-revision=2
+revision=3
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools pkg-config"
 makedepends="qt5-devel qt5-multimedia-devel qt5-svg-devel ffmpeg-devel frei0r-plugins"

From 462791d87ce3ab27e42c63696de9917c0a4c3a9b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 072/105] omxplayer: revbump for ffmpeg-5.1.2

---
 srcpkgs/omxplayer/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/omxplayer/template b/srcpkgs/omxplayer/template
index e70bf7873d4d..0f42939e1e5d 100644
--- a/srcpkgs/omxplayer/template
+++ b/srcpkgs/omxplayer/template
@@ -1,10 +1,10 @@
 # Template file for 'omxplayer'
 pkgname=omxplayer
 version=20190102
-revision=1
+revision=2
 short_desc="Commandline OMX player for the Raspberry Pi"
 maintainer="Orphaned <orphan@voidlinux.org>"
-license="GPL-2"
+license="GPL-2-or-later"
 homepage="https://github.com/popcornmix/omxplayer"
 
 _commit="f06235cc9690a6d58187514452df8cf8fcdaacec"

From 547031b17d27d920225d1d675ff7877779bc7d25 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 073/105] openimageio: revbump for ffmpeg-5.1.2

---
 srcpkgs/openimageio/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openimageio/template b/srcpkgs/openimageio/template
index cc9d7a33984e..ee988ae2ce07 100644
--- a/srcpkgs/openimageio/template
+++ b/srcpkgs/openimageio/template
@@ -1,7 +1,7 @@
 # Template file for 'openimageio'
 pkgname=openimageio
 version=2.3.18.0
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="-DUSE_OPENGL=0 -DUSE_QT=0 -DUSE_PYTHON=0 -DOIIO_BUILD_TESTS=1

From 0ee9958c5b2ad5c287afb964caff11e531062801 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 074/105] openmw: revbump for ffmpeg-5.1.2

---
 srcpkgs/openmw/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openmw/template b/srcpkgs/openmw/template
index 5251a0283dc1..e3771c7aaf1a 100644
--- a/srcpkgs/openmw/template
+++ b/srcpkgs/openmw/template
@@ -1,7 +1,7 @@
 # Template file for 'openmw'
 pkgname=openmw
 version=0.47.0
-revision=4
+revision=5
 build_style=cmake
 _recast_commit=e75adf86f91eb3082220085e42dda62679f9a3ea
 _bullet_tag=3.17

From d5ca41432abb3b0949d823a63041bec58c4a60f3 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 075/105] openshot: revbump for ffmpeg-5.1.2

---
 srcpkgs/openshot/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openshot/template b/srcpkgs/openshot/template
index 322717d40abc..c074e0338773 100644
--- a/srcpkgs/openshot/template
+++ b/srcpkgs/openshot/template
@@ -1,7 +1,7 @@
 # Template file for 'openshot'
 pkgname=openshot
 version=3.0.0
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3 python3-setuptools"
 makedepends="ffmpeg-devel python3-PyQt5"

From c1e2fca8617a158ca627bb8267fc3ae36d6b2842 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 076/105] opentoonz: revbump for ffmpeg-5.1.2

---
 srcpkgs/opentoonz/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/opentoonz/template b/srcpkgs/opentoonz/template
index ee9f7603f55f..3e81834ca0ed 100644
--- a/srcpkgs/opentoonz/template
+++ b/srcpkgs/opentoonz/template
@@ -1,7 +1,7 @@
 # Template file for 'opentoonz'
 pkgname=opentoonz
 version=1.6.0
-revision=2
+revision=3
 build_wrksrc="toonz/sources"
 build_style=cmake
 make_cmd=make

From 85dd9fdb017c5478a71a9f4ced96a8aa9753efa4 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 077/105] pianobar: revbump for ffmpeg-5.1.2

---
 srcpkgs/pianobar/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pianobar/template b/srcpkgs/pianobar/template
index a9b29e91993f..81efcd122c4d 100644
--- a/srcpkgs/pianobar/template
+++ b/srcpkgs/pianobar/template
@@ -1,7 +1,7 @@
 # Template file for 'pianobar'
 pkgname=pianobar
 version=2022.04.01
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="V=1"
 hostmakedepends="pkg-config"

From 72c369b993e6fdb78410f1d1af385144863d928d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 078/105] ppsspp: revbump for ffmpeg-5.1.2

---
 srcpkgs/ppsspp/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ppsspp/template b/srcpkgs/ppsspp/template
index 7984a733d4be..3bfc951ea1eb 100644
--- a/srcpkgs/ppsspp/template
+++ b/srcpkgs/ppsspp/template
@@ -1,7 +1,7 @@
 # Template file for 'ppsspp'
 pkgname=ppsspp
 version=1.14.4
-revision=1
+revision=2
 _glslang_commit=dc11adde23c455a24e13dd54de9b4ede8bdd7db8
 _SPIRV_Cross_commit=9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1
 _armips_commit=6719edebaae03330ee5441d9b28280672edf00d5
@@ -62,13 +62,12 @@ post_extract() {
 	mv ${wrksrc}/miniupnp-${_miniupnp_commit} ${wrksrc}/ext/miniupnp
 }
 
-post_patch(){
+post_patch() {
 	# disable git versioning
 	vsed -e 's|find_package(Git)|# &|' -i git-version.cmake
 }
 
 do_install() {
-	vlicense LICENSE.TXT
 	vinstall icons/icon.svg 644 usr/share/pixmaps ppsspp.svg
 	vinstall Qt/PPSSPP.desktop 644 usr/share/applications
 	vbin build/PPSSPPHeadless ppsspp-headless

From c3be3d32f93ba08030f8857ebe0a6bebc20fdbc5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 079/105] pqiv: revbump for ffmpeg-5.1.2

---
 srcpkgs/pqiv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pqiv/template b/srcpkgs/pqiv/template
index 542fc27a2d32..9308d949b6a1 100644
--- a/srcpkgs/pqiv/template
+++ b/srcpkgs/pqiv/template
@@ -1,7 +1,7 @@
 # Template file for 'pqiv'
 pkgname=pqiv
 version=2.12
-revision=1
+revision=2
 build_style=gnu-makefile
 hostmakedepends="pkg-config"
 makedepends="glib-devel gtk+3-devel $(vopt_if ffmpeg ffmpeg-devel)

From e39d7ad202eecde375bf0f60cbd0e1d4c6e8822e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 080/105] qmmp: revbump for ffmpeg-5.1.2

---
 srcpkgs/qmmp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qmmp/template b/srcpkgs/qmmp/template
index 26c661ed16be..a150d7441c7a 100644
--- a/srcpkgs/qmmp/template
+++ b/srcpkgs/qmmp/template
@@ -1,7 +1,7 @@
 # Template file for 'qmmp'
 pkgname=qmmp
 version=1.6.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_HAL:BOOL=FALSE -DQMMP_DEFAULT_UI:STRING=simple"
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake"

From 2cbff4c1d46394ccb6d6d4d0017d07dde89cc284 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 081/105] qt5-webengine: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt5-webengine/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index f9d78eced929..0a71484208bc 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
 version=5.15.11
-revision=1
+revision=2
 _version="${version}-lts"
 _chromium_commit=be349eaf62e77955791d7bf29f893f1e8a37daf4
 archs="x86_64* i686* armv[67]* ppc64* aarch64*"

From 68fdac0cefa2b6a5168e184d51281eeade3a603b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 082/105] qt5: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b22575103da4 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,10 +3,10 @@
 # revbump libqtxdg after bumping patch version
 pkgname=qt5
 version=5.15.7+20221119
+revision=2
+build_style=meta
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
-build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel

From d77d1f3351d81a4153c65590164fd84e5ecd6dc7 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 083/105] qt6-multimedia: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt6-multimedia/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qt6-multimedia/template b/srcpkgs/qt6-multimedia/template
index d89e7d54eb5a..aae15e57ca7b 100644
--- a/srcpkgs/qt6-multimedia/template
+++ b/srcpkgs/qt6-multimedia/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-multimedia'
 pkgname=qt6-multimedia
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DQT_FEATURE_gstreamer=ON"
 hostmakedepends="perl qt6-declarative-host-tools pkg-config qt6-shadertools"

From 9a15aa9d3e5e935a679b7d6a7ae046c2498a5a89 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 084/105] qt6-webengine: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt6-webengine/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qt6-webengine/template b/srcpkgs/qt6-webengine/template
index 99012732b53a..96846feaee83 100644
--- a/srcpkgs/qt6-webengine/template
+++ b/srcpkgs/qt6-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-webengine'
 pkgname=qt6-webengine
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DQT_FEATURE_webengine_system_ffmpeg=ON

From ae2e56321a8d0b77a67cce9def2001cfc61c725e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 085/105] qtav: revbump for ffmpeg-5.1.2

---
 srcpkgs/qtav/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qtav/template b/srcpkgs/qtav/template
index 34c30b2c0c78..775d5a139a9e 100644
--- a/srcpkgs/qtav/template
+++ b/srcpkgs/qtav/template
@@ -1,7 +1,7 @@
 # Template file for 'qtav'
 pkgname=qtav
 version=1.13.0
-revision=1
+revision=2
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel libass-devel libopenal-devel

From 210c97b59266d0af1dc488fa2e9e98f568037f71 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 086/105] qtox: revbump for ffmpeg-5.1.2

---
 srcpkgs/qtox/patches/ffmpeg5.patch | 79 ++++++++++++++++++++++++++++++
 srcpkgs/qtox/template              |  2 +-
 2 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qtox/patches/ffmpeg5.patch

diff --git a/srcpkgs/qtox/patches/ffmpeg5.patch b/srcpkgs/qtox/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..3babe1c98447
--- /dev/null
+++ b/srcpkgs/qtox/patches/ffmpeg5.patch
@@ -0,0 +1,79 @@
+From 15673a52b6b4805d482b69281e21947fb7096e05 Mon Sep 17 00:00:00 2001
+From: Anthony Bilinski <me@abilinski.com>
+Date: Thu, 10 Feb 2022 17:24:38 -0800
+Subject: [PATCH] fix(macOS): Update video API usage for newer libavcodec
+
+Newer version of avformat_open_input, av_find_input_format,
+avcodec_find_decoder previously used non-const pointers that are now
+const. Support both version for compatibiltiy with other platforms.
+---
+ src/video/cameradevice.cpp | 9 ++++++---
+ src/video/cameradevice.h   | 1 -
+ src/video/camerasource.cpp | 3 +--
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/video/cameradevice.cpp b/src/video/cameradevice.cpp
+index 3b07968b32..a012a0f78d 100644
+--- a/src/video/cameradevice.cpp
++++ b/src/video/cameradevice.cpp
+@@ -31,6 +31,9 @@ extern "C" {
+ #include "cameradevice.h"
+ #include "src/persistence/settings.h"
+
++// no longer needed when avformat version < 59 is no longer supported
++using AvFindInputFormatRet = decltype(av_find_input_format(""));
++
+ #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
+ #define USING_V4L 1
+ #else
+@@ -71,8 +74,8 @@ extern "C" {
+
+ QHash<QString, CameraDevice*> CameraDevice::openDevices;
+ QMutex CameraDevice::openDeviceLock, CameraDevice::iformatLock;
+-AVInputFormat* CameraDevice::iformat{nullptr};
+-AVInputFormat* CameraDevice::idesktopFormat{nullptr};
++static AvFindInputFormatRet idesktopFormat{nullptr};
++static AvFindInputFormatRet iformat{nullptr};
+
+ CameraDevice::CameraDevice(const QString& devName, AVFormatContext* context)
+     : devName{devName}
+@@ -92,7 +95,7 @@ CameraDevice* CameraDevice::open(QString devName, AVDictionary** options)
+         goto out;
+     }
+
+-    AVInputFormat* format;
++    AvFindInputFormatRet format;
+     if (devName.startsWith("x11grab#")) {
+         devName = devName.mid(8);
+         format = idesktopFormat;
+diff --git a/src/video/cameradevice.h b/src/video/cameradevice.h
+index 910873325b..c05f1dbed4 100644
+--- a/src/video/cameradevice.h
++++ b/src/video/cameradevice.h
+@@ -64,5 +64,4 @@ class CameraDevice
+     std::atomic_int refcount;
+     static QHash<QString, CameraDevice*> openDevices;
+     static QMutex openDeviceLock, iformatLock;
+-    static AVInputFormat *iformat, *idesktopFormat;
+ };
+diff --git a/src/video/camerasource.cpp b/src/video/camerasource.cpp
+index 134bc49afc..3a899f11d0 100644
+--- a/src/video/camerasource.cpp
++++ b/src/video/camerasource.cpp
+@@ -278,7 +278,6 @@ void CameraSource::openDevice()
+     }
+
+     // We need to create a new CameraDevice
+-    AVCodec* codec;
+     device = CameraDevice::open(deviceName, mode);
+
+     if (!device) {
+@@ -322,7 +321,7 @@ void CameraSource::openDevice()
+     AVCodecParameters* cparams = device->context->streams[videoStreamIndex]->codecpar;
+     codecId = cparams->codec_id;
+ #endif
+-    codec = avcodec_find_decoder(codecId);
++    const AVCodec* codec = avcodec_find_decoder(codecId);
+     if (!codec) {
+         qWarning() << "Codec not found";
+         emit openFailed();
diff --git a/srcpkgs/qtox/template b/srcpkgs/qtox/template
index 16019d7eaec9..5cea0b11b697 100644
--- a/srcpkgs/qtox/template
+++ b/srcpkgs/qtox/template
@@ -1,7 +1,7 @@
 # Template file for 'qtox'
 pkgname=qtox
 version=1.17.6
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DUPDATE_CHECK=OFF
  -DGIT_DESCRIBE=${version}

From 7770a9eb0dcd3d39394d715131200f1585901298 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 087/105] retroarch: revbump for ffmpeg-5.1.2

---
 srcpkgs/retroarch/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/retroarch/template b/srcpkgs/retroarch/template
index 240d3df9db00..6d0b16ae2598 100644
--- a/srcpkgs/retroarch/template
+++ b/srcpkgs/retroarch/template
@@ -1,7 +1,7 @@
 # Template file for 'retroarch'
 pkgname=retroarch
 version=1.14.0
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking
  --enable-udev --disable-builtinflac --disable-builtinglslang

From 11c435329fd05076e59a36a57f917e2820abc883 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 088/105] scrcpy: revbump for ffmpeg-5.1.2

---
 srcpkgs/scrcpy/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scrcpy/template b/srcpkgs/scrcpy/template
index ee6e698e387f..8ada5ca4323f 100644
--- a/srcpkgs/scrcpy/template
+++ b/srcpkgs/scrcpy/template
@@ -1,7 +1,7 @@
 # Template file for 'scrcpy'
 pkgname=scrcpy
 version=2.0
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dcompile_server=false
  -Dprebuilt_server=/usr/share/scrcpy/scrcpy-server-v${version}"

From 52ada726f0053859d8b99675471c9d0df4bc21e6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 089/105] spek-alternative: revbump for ffmpeg-5.1.2

---
 srcpkgs/spek-alternative/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spek-alternative/template b/srcpkgs/spek-alternative/template
index d65086b8f008..72747cbb0a02 100644
--- a/srcpkgs/spek-alternative/template
+++ b/srcpkgs/spek-alternative/template
@@ -1,7 +1,7 @@
 # Template file for 'spek-alternative'
 pkgname=spek-alternative
 version=0.8.2.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake gettext-devel intltool libtool pkg-config wxWidgets-common"
 makedepends="ffmpeg-devel wxWidgets-gtk3-devel"

From f34cb5ef08800ae6f925666b94ae593f6141922f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 090/105] ssr: revbump for ffmpeg-5.1.2

---
 srcpkgs/ssr/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ssr/template b/srcpkgs/ssr/template
index b055b9ec0774..842b2423aad1 100644
--- a/srcpkgs/ssr/template
+++ b/srcpkgs/ssr/template
@@ -1,7 +1,7 @@
 # Template file for 'ssr'
 pkgname=ssr
 version=0.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_QT5=ON"
 hostmakedepends="pkg-config"

From 8ac9830a6aacdd80335cdcd0864d70c938b5b601 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 091/105] sumo: revbump for ffmpeg-5.1.2

---
 srcpkgs/sumo/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template
index 0f9b9ec815f5..a3fe134aa5ac 100644
--- a/srcpkgs/sumo/template
+++ b/srcpkgs/sumo/template
@@ -1,7 +1,7 @@
 # Template file for 'sumo'
 pkgname=sumo
 version=1.12.0
-revision=5
+revision=6
 build_style=cmake
 hostmakedepends="libgdal-tools pkg-config swig python3-setuptools"
 makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel

From 7fafbe6991c7f0ebbd6fb1ce649fa361b2992230 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 092/105] synfig: revbump for ffmpeg-5.1.2

---
 srcpkgs/synfig/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template
index 182dc3cd280f..29afb3572e47 100644
--- a/srcpkgs/synfig/template
+++ b/srcpkgs/synfig/template
@@ -2,7 +2,7 @@
 # Should be kept in sync with 'synfigstudio' and 'ETL'
 pkgname=synfig
 version=1.4.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib"
 hostmakedepends="boost-build ImageMagick pkg-config intltool"

From a479d30a681074583e45c59a7d9553cdb55be1f5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 093/105] telegram-desktop: revbump for ffmpeg-5.1.2

---
 srcpkgs/telegram-desktop/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index aae9f3135100..7943b36f0b8a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=4.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 configure_args="-DTDESKTOP_API_ID=209235

From aa3c50bca5f5789cbaf0edb35c0f88d24f7aa43f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 094/105] tg_owt: revbump for ffmpeg-5.1.2

---
 srcpkgs/tg_owt/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tg_owt/template b/srcpkgs/tg_owt/template
index 97d195ddb34a..551614b24956 100644
--- a/srcpkgs/tg_owt/template
+++ b/srcpkgs/tg_owt/template
@@ -1,7 +1,7 @@
 # Template file for 'tg_owt'
 pkgname=tg_owt
 version=0.0.0.20230107
-revision=1
+revision=2
 _commit=5098730b9eb6173f0b52068fe2555b7c1015123a
 _libyuv_commit=00950840d1c9bcbb3eb6ebc5aac5793e71166c8b
 _abseil_commit=8c0b94e793a66495e0b1f34a5eb26bd7dc672db0

From 94e7e48ef6ab1350d3c7a4ca09d657bf1e769945 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 095/105] timg: revbump for ffmpeg-5.1.2

---
 srcpkgs/timg/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/timg/template b/srcpkgs/timg/template
index 91f1516b2597..334443d3f9bb 100644
--- a/srcpkgs/timg/template
+++ b/srcpkgs/timg/template
@@ -1,7 +1,7 @@
 # Template file for 'timg'
 pkgname=timg
 version=1.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_OPENSLIDE_SUPPORT=off -Wno-dev"
 hostmakedepends="pkg-config git"

From 78a9547f28538ea8300fd5a1c68c949a9b5fab89 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 096/105] tracker-miners: revbump for ffmpeg-5.1.2

---
 srcpkgs/tracker-miners/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index 3e7966c2b4a9..285425ba1851 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.4.3
-revision=1
+revision=2
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss

From 7b081b9c069ae5ee26ad309b5d6100d9039ec935 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 097/105] tvheadend: revbump for ffmpeg-5.1.2

---
 srcpkgs/tvheadend/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tvheadend/template b/srcpkgs/tvheadend/template
index e6b16d7ccf3b..a2004480332b 100644
--- a/srcpkgs/tvheadend/template
+++ b/srcpkgs/tvheadend/template
@@ -1,7 +1,7 @@
 # Template file for 'tvheadend'
 pkgname=tvheadend
 version=4.2.8
-revision=6
+revision=7
 build_style=gnu-configure
 configure_args="--enable-dvbscan --disable-ffmpeg_static
 --disable-hdhomerun_static --disable-bintray_cache --disable-libx264_static

From 06ac8ec84590dd1bcebede7d6d1b37d3a2cbf0db Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 098/105] unpaper: revbump for ffmpeg-5.1.2

---
 srcpkgs/unpaper/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/unpaper/template b/srcpkgs/unpaper/template
index 38ed47a58401..8310d5d1e68f 100644
--- a/srcpkgs/unpaper/template
+++ b/srcpkgs/unpaper/template
@@ -1,13 +1,13 @@
 # Template file for 'unpaper'
 pkgname=unpaper
 version=6.1
-revision=3
+revision=4
 build_style=gnu-configure
-maintainer="Orphaned <orphan@voidlinux.org>"
 hostmakedepends="pkg-config libxslt"
 makedepends="ffmpeg-devel"
-license="GPL-2"
+short_desc="Post-processing tool for scanned sheets of paper"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-2.0-or-later"
 homepage="https://www.flameeyes.eu/projects/unpaper"
-short_desc="A post-processing tool for scanned sheets of paper"
 distfiles="https://www.flameeyes.eu/files/${pkgname}-${version}.tar.xz"
 checksum=237c84f5da544b3f7709827f9f12c37c346cdf029b1128fb4633f9bafa5cb930

From 3a915cd471bf7715e13b818463b52ec40836d3bd Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 099/105] vba-m: revbump for ffmpeg-5.1.2

---
 srcpkgs/vba-m/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/vba-m/template b/srcpkgs/vba-m/template
index ba153e0b58ca..aa6093645e97 100644
--- a/srcpkgs/vba-m/template
+++ b/srcpkgs/vba-m/template
@@ -2,7 +2,7 @@
 pkgname=vba-m
 reverts=1292_2
 version=2.1.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GTK=TRUE -DENABLE_FFMPEG=TRUE -DENABLE_LINK=TRUE -DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="gettext pkg-config unzip zip yasm wxWidgets-gtk3-devel"

From f3c76c228dfe58091655ad3d9cd4cb1ec3f5a9e8 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 100/105] vice: revbump for ffmpeg-5.1.2

---
 srcpkgs/vice/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/vice/template b/srcpkgs/vice/template
index 0924767cfcfb..ffa95384f64a 100644
--- a/srcpkgs/vice/template
+++ b/srcpkgs/vice/template
@@ -1,7 +1,7 @@
 # Template file for 'vice'
 pkgname=vice
 version=3.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
 	$(vopt_enable sdl2 sdlui2)

From e26681bbe08d1ad0b1480200dd682dc9ddf2ef28 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 101/105] waypipe: revbump for ffmpeg-5.1.2

---
 srcpkgs/waypipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/waypipe/template b/srcpkgs/waypipe/template
index 5c4161900060..1a46fe27f7d8 100644
--- a/srcpkgs/waypipe/template
+++ b/srcpkgs/waypipe/template
@@ -1,7 +1,7 @@
 # Template file for 'waypipe'
 pkgname=waypipe
 version=0.8.4
-revision=1
+revision=2
 build_style=meson
 # lto is off because it causes linking errors in armv6l and armv7l (due to NEON)
 configure_args="-Dwerror=false -Dwith_dmabuf=enabled -Dwith_lz4=enabled

From e101b4b4a1162f5f61a058dee5180ddcfc696c86 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 102/105] wf-recorder: revbump for ffmpeg-5.1.2

---
 srcpkgs/wf-recorder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/wf-recorder/template b/srcpkgs/wf-recorder/template
index e278eb001600..5d014a5f28af 100644
--- a/srcpkgs/wf-recorder/template
+++ b/srcpkgs/wf-recorder/template
@@ -1,7 +1,7 @@
 # Template file for 'wf-recorder'
 pkgname=wf-recorder
 version=0.3.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config scdoc wayland-devel"
 makedepends="wayland-protocols wayland-devel ffmpeg-devel x264-devel

From 016e8ffa6c016dec6864e13f86b2e31ecfbd8cd7 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 103/105] xpra: revbump for ffmpeg-5.1.2

---
 srcpkgs/xpra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xpra/template b/srcpkgs/xpra/template
index 38f83283b1e5..b6e01ff0a813 100644
--- a/srcpkgs/xpra/template
+++ b/srcpkgs/xpra/template
@@ -1,7 +1,7 @@
 # Template file for 'xpra'
 pkgname=xpra
 version=4.4.4
-revision=1
+revision=2
 build_style=python3-module
 make_build_args="--without-cuda_kernels --without-cuda_rebuild"
 make_install_args="$(vopt_with docs) ${make_build_args}"

From 2b5055887021b059c97c05a60c0c339b1af14c8b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Thu, 23 Mar 2023 08:50:13 -0400
Subject: [PATCH 104/105] shlibs: ffmpeg-5.1.2

---
 common/shlibs | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index f972eebc4d3a..aab66c83f4b3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -389,15 +389,23 @@ libid3tag.so.0 libid3tag-0.15.1b_1
 libgif.so.7 giflib-5.1.0_1
 libImlib2.so.1 imlib2-1.4.2_1
 libmp3lame.so.0 lame-3.98.2_1
-libavdevice.so.58 libavdevice-4.0_1
-libavformat.so.58 libavformat-4.0_1
-libswscale.so.5 libswscale-4.0_1
-libswresample.so.3 libswresample-4.0_1
-libavresample.so.4 libavresample-4.0_1
-libpostproc.so.55 libpostproc-4.0_1
-libavcodec.so.58 libavcodec-4.0_1
-libavutil.so.56 libavutil-4.0_1
-libavfilter.so.7 libavfilter-4.0_1
+libavdevice.so.59 libavdevice-5.1.2_1
+libavformat.so.59 libavformat-5.1.2_1
+libswscale.so.6 libswscale-5.1.2_1
+libswresample.so.4 libswresample-5.1.2_1
+libpostproc.so.56 libpostproc-5.1.2_1
+libavcodec.so.59 libavcodec-5.1.2_1
+libavutil.so.57 libavutil-5.1.2_1
+libavfilter.so.8 libavfilter-5.1.2_1
+libavdevice.so.58 libavdevice4-4.0_1
+libavformat.so.58 libavformat4-4.0_1
+libswscale.so.5 libswscale4-4.0_1
+libswresample.so.3 libswresample4-4.0_1
+libavresample.so.4 libavresample4-4.0_1
+libpostproc.so.55 libpostproc4-4.0_1
+libavcodec.so.58 libavcodec4-4.0_1
+libavutil.so.56 libavutil4-4.0_1
+libavfilter.so.7 libavfilter4-4.0_1
 libSDL-1.2.so.0 SDL-1.2.14_1
 libSDL_image-1.2.so.0 SDL_image-1.2.10_1
 libx264.so.157 x264-20190507.2245_1

From 6b8adb04c76982d7211db9c39a0c3b1a717468eb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Thu, 23 Mar 2023 08:50:25 -0400
Subject: [PATCH 105/105] shlibs: opencv-4.7.0

---
 common/shlibs | 104 +++++++++++++++++++++++++-------------------------
 1 file changed, 52 insertions(+), 52 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index aab66c83f4b3..a9d1c6a16ec6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2128,58 +2128,58 @@ libcapstone.so.4 capstone-4.0_1
 libhavege.so.2 libhaveged-1.9.11_1
 libnih.so.1 libnih-1.0.3_1
 libnih-dbus.so.1 libnih-1.0.3_1
-libopencv_quality.so.406 libopencv-4.6.0_1
-libopencv_reg.so.406 libopencv-4.6.0_1
-libopencv_surface_matching.so.406 libopencv-4.6.0_1
-libopencv_xphoto.so.406 libopencv-4.6.0_1
-libopencv_freetype.so.406 libopencv-4.6.0_1
-libopencv_fuzzy.so.406 libopencv-4.6.0_1
-libopencv_hfs.so.406 libopencv-4.6.0_1
-libopencv_img_hash.so.406 libopencv-4.6.0_1
-libopencv_line_descriptor.so.406 libopencv-4.6.0_1
-libopencv_saliency.so.406 libopencv-4.6.0_1
-libopencv_structured_light.so.406 libopencv-4.6.0_1
-libopencv_aruco.so.406 libopencv-4.6.0_1
-libopencv_bgsegm.so.406 libopencv-4.6.0_1
-libopencv_bioinspired.so.406 libopencv-4.6.0_1
-libopencv_ccalib.so.406 libopencv-4.6.0_1
-libopencv_face.so.406 libopencv-4.6.0_1
-libopencv_tracking.so.406 libopencv-4.6.0_1
-libopencv_xfeatures2d.so.406 libopencv-4.6.0_1
-libopencv_optflow.so.406 libopencv-4.6.0_1
-libopencv_ximgproc.so.406 libopencv-4.6.0_1
-libopencv_plot.so.406 libopencv-4.6.0_1
-libopencv_text.so.406 libopencv-4.6.0_1
-libopencv_ml.so.406 libopencv-4.6.0_1
-libopencv_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn.so.406 libopencv-4.6.0_1
-libopencv_shape.so.406 libopencv-4.6.0_1
-libopencv_stitching.so.406 libopencv-4.6.0_1
-libopencv_photo.so.406 libopencv-4.6.0_1
-libopencv_video.so.406 libopencv-4.6.0_1
-libopencv_calib3d.so.406 libopencv-4.6.0_1
-libopencv_features2d.so.406 libopencv-4.6.0_1
-libopencv_flann.so.406 libopencv-4.6.0_1
-libopencv_highgui.so.406 libopencv-4.6.0_1
-libopencv_videoio.so.406 libopencv-4.6.0_1
-libopencv_imgcodecs.so.406 libopencv-4.6.0_1
-libopencv_imgproc.so.406 libopencv-4.6.0_1
-libopencv_core.so.406 libopencv-4.6.0_1
-libopencv_superres.so.406 libopencv-4.6.0_1
-libopencv_videostab.so.406 libopencv-4.6.0_1
-libopencv_gapi.so.406 libopencv-4.6.0_1
-libopencv_xobjdetect.so.406 libopencv-4.6.0_1
-libopencv_datasets.so.406 libopencv-4.6.0_1
-libopencv_dnn_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn_superres.so.406 libopencv-4.6.0_1
-libopencv_dpm.so.406 libopencv-4.6.0_1
-libopencv_phase_unwrapping.so.406 libopencv-4.6.0_1
-libopencv_stereo.so.406 libopencv-4.6.0_1
-libopencv_rapid.so.406 libopencv-4.6.0_1
-libopencv_intensity_transform.so.406 libopencv-4.6.0_1
-libopencv_alphamat.so.406 libopencv-4.6.0_1
-libopencv_barcode.so.406 libopencv-4.6.0_1
-libopencv_mcc.so.406 libopencv-4.6.0_1
+libopencv_quality.so.407 libopencv-4.7.0_1
+libopencv_reg.so.407 libopencv-4.7.0_1
+libopencv_surface_matching.so.407 libopencv-4.7.0_1
+libopencv_xphoto.so.407 libopencv-4.7.0_1
+libopencv_freetype.so.407 libopencv-4.7.0_1
+libopencv_fuzzy.so.407 libopencv-4.7.0_1
+libopencv_hfs.so.407 libopencv-4.7.0_1
+libopencv_img_hash.so.407 libopencv-4.7.0_1
+libopencv_line_descriptor.so.407 libopencv-4.7.0_1
+libopencv_saliency.so.407 libopencv-4.7.0_1
+libopencv_structured_light.so.407 libopencv-4.7.0_1
+libopencv_aruco.so.407 libopencv-4.7.0_1
+libopencv_bgsegm.so.407 libopencv-4.7.0_1
+libopencv_bioinspired.so.407 libopencv-4.7.0_1
+libopencv_ccalib.so.407 libopencv-4.7.0_1
+libopencv_face.so.407 libopencv-4.7.0_1
+libopencv_tracking.so.407 libopencv-4.7.0_1
+libopencv_xfeatures2d.so.407 libopencv-4.7.0_1
+libopencv_optflow.so.407 libopencv-4.7.0_1
+libopencv_ximgproc.so.407 libopencv-4.7.0_1
+libopencv_plot.so.407 libopencv-4.7.0_1
+libopencv_text.so.407 libopencv-4.7.0_1
+libopencv_ml.so.407 libopencv-4.7.0_1
+libopencv_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn.so.407 libopencv-4.7.0_1
+libopencv_shape.so.407 libopencv-4.7.0_1
+libopencv_stitching.so.407 libopencv-4.7.0_1
+libopencv_photo.so.407 libopencv-4.7.0_1
+libopencv_video.so.407 libopencv-4.7.0_1
+libopencv_calib3d.so.407 libopencv-4.7.0_1
+libopencv_features2d.so.407 libopencv-4.7.0_1
+libopencv_flann.so.407 libopencv-4.7.0_1
+libopencv_highgui.so.407 libopencv-4.7.0_1
+libopencv_videoio.so.407 libopencv-4.7.0_1
+libopencv_imgcodecs.so.407 libopencv-4.7.0_1
+libopencv_imgproc.so.407 libopencv-4.7.0_1
+libopencv_core.so.407 libopencv-4.7.0_1
+libopencv_superres.so.407 libopencv-4.7.0_1
+libopencv_videostab.so.407 libopencv-4.7.0_1
+libopencv_gapi.so.407 libopencv-4.7.0_1
+libopencv_xobjdetect.so.407 libopencv-4.7.0_1
+libopencv_datasets.so.407 libopencv-4.7.0_1
+libopencv_dnn_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn_superres.so.407 libopencv-4.7.0_1
+libopencv_dpm.so.407 libopencv-4.7.0_1
+libopencv_phase_unwrapping.so.407 libopencv-4.7.0_1
+libopencv_stereo.so.407 libopencv-4.7.0_1
+libopencv_rapid.so.407 libopencv-4.7.0_1
+libopencv_intensity_transform.so.407 libopencv-4.7.0_1
+libopencv_alphamat.so.407 libopencv-4.7.0_1
+libopencv_barcode.so.407 libopencv-4.7.0_1
+libopencv_mcc.so.407 libopencv-4.7.0_1
 libuniconf.so.4.6 wvstreams-4.6.1_20
 libwvbase.so.4.6 wvstreams-4.6.1_20
 libwvutils.so.4.6 wvstreams-4.6.1_20

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (17 preceding siblings ...)
  2023-03-23 12:50 ` [PR PATCH] [Updated] " zlice
@ 2023-03-23 19:52 ` zlice
  2023-03-23 20:01 ` zlice
                   ` (10 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-23 19:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3205 bytes --]

There is an updated pull request by zlice against master on the void-packages repository

https://github.com/zlice/void-packages ffmpeg5-split
https://github.com/void-linux/void-packages/pull/42936

draft: ffmpeg5 split
[ci skip]

#### Testing the changes

- I tested the changes in this PR: **NO**

I have conflicting changes from [intel packages](https://github.com/void-linux/void-packages/pull/41132) and don't want to mess with my system. If it makes sense I'll move these changes here like I originally intended. ffmpeg5 makes Intel vaapi easier and only rely on oneVPL iirc.

I do not use 80%+ of these packages. I may be able to run Blender, and I use shotcut.


#### New package

- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**



#### Local build testing

- I built this PR locally for my native architecture, **x86_64**


#### Discussion

Continuation of https://github.com/void-linux/void-packages/pull/36315 - thx tibequadorian :)

It was suggested to make `ffmpeg` version 5 and 'copy' (create a new?) `ffmpeg4` package, and that seems to work well.

As stated, I haven't and probably won't test most of these packages, hoping for others to voice in on what's working. 

A few months back (and now) afaict everything has been compiling with ffmpeg5 except for the few problem packages still using ffmpeg4 (below). Can add to the ffmpeg4 list as a incompatible package is found.

`libavresample` is deprecated, but marked as a dependency when trying to build other packages and install `ffmpeg`(5). I think the right way to handle this is make a meta package and the add to removals?

[gstreamer 1.22.1 updates](https://github.com/void-linux/void-packages/pull/42861) could go before this

##### Commit naming / misc

~~`ffpmeg4` isn't "new", not sure what the commit messages should be really for the 4 and 5 split. Additionally xlint complains about `ffmpeg4` revision being 3 and not 1 because it's a "new" package, I assume that's right but not sure.~~

~~Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?~~

I wouldn't mind moving the [intel packages](https://github.com/void-linux/void-packages/pull/41132) into here under another commit. That just got a potential fix that may allow merging but I imagine moving to ffmpeg5 will change and even remove some of those packages. (I won't really test these changes without Intel vaapi either way.)

Maintainer for previous ffmpeg(4) was orphaned, I can put my name in there if that matters, though I don't exactly see myself keeping up on ffmpeg.


##### still ffmpeg4

- `vlc` (vlc4 will support ffmpeg5, there's a patch to build 3.x with ffmpeg5 but it will lack vaapi)
- `osg` (OpenSceneGraph plus `xine-lib`)
- `ytmdl` ? not sure but it uses `python3-ffmpeg-python` which being 6-8yr old I imagine is ffmpeg4


A patch file from https://github.com/void-linux/void-packages/pull/42936.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ffmpeg5-split-42936.patch --]
[-- Type: text/x-diff, Size: 173433 bytes --]

From 2710412420bef49f1d9c05eb5733b86988947ed2 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:55:46 -0400
Subject: [PATCH 001/104] ffmpeg: update to 5.1.2.

---
 common/shlibs                                 | 26 +++++---
 srcpkgs/ffmpeg/files/altivec.patch            | 60 -------------------
 .../patches/armv5tel-floating-point.patch     | 18 ------
 .../workaround-mesa-readeon-vaapi-bug.patch   | 28 ---------
 srcpkgs/ffmpeg/template                       | 20 +++----
 5 files changed, 26 insertions(+), 126 deletions(-)
 delete mode 100644 srcpkgs/ffmpeg/files/altivec.patch
 delete mode 100644 srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
 delete mode 100644 srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch

diff --git a/common/shlibs b/common/shlibs
index f972eebc4d3a..aab66c83f4b3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -389,15 +389,23 @@ libid3tag.so.0 libid3tag-0.15.1b_1
 libgif.so.7 giflib-5.1.0_1
 libImlib2.so.1 imlib2-1.4.2_1
 libmp3lame.so.0 lame-3.98.2_1
-libavdevice.so.58 libavdevice-4.0_1
-libavformat.so.58 libavformat-4.0_1
-libswscale.so.5 libswscale-4.0_1
-libswresample.so.3 libswresample-4.0_1
-libavresample.so.4 libavresample-4.0_1
-libpostproc.so.55 libpostproc-4.0_1
-libavcodec.so.58 libavcodec-4.0_1
-libavutil.so.56 libavutil-4.0_1
-libavfilter.so.7 libavfilter-4.0_1
+libavdevice.so.59 libavdevice-5.1.2_1
+libavformat.so.59 libavformat-5.1.2_1
+libswscale.so.6 libswscale-5.1.2_1
+libswresample.so.4 libswresample-5.1.2_1
+libpostproc.so.56 libpostproc-5.1.2_1
+libavcodec.so.59 libavcodec-5.1.2_1
+libavutil.so.57 libavutil-5.1.2_1
+libavfilter.so.8 libavfilter-5.1.2_1
+libavdevice.so.58 libavdevice4-4.0_1
+libavformat.so.58 libavformat4-4.0_1
+libswscale.so.5 libswscale4-4.0_1
+libswresample.so.3 libswresample4-4.0_1
+libavresample.so.4 libavresample4-4.0_1
+libpostproc.so.55 libpostproc4-4.0_1
+libavcodec.so.58 libavcodec4-4.0_1
+libavutil.so.56 libavutil4-4.0_1
+libavfilter.so.7 libavfilter4-4.0_1
 libSDL-1.2.so.0 SDL-1.2.14_1
 libSDL_image-1.2.so.0 SDL_image-1.2.10_1
 libx264.so.157 x264-20190507.2245_1
diff --git a/srcpkgs/ffmpeg/files/altivec.patch b/srcpkgs/ffmpeg/files/altivec.patch
deleted file mode 100644
index 9c5720046332..000000000000
--- a/srcpkgs/ffmpeg/files/altivec.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-revert some altivec specific change on all ppc* except ppc64le*
-
-q66: "We should also throw in a revert of FFmpeg/FFmpeg@3a557c5 but only
-conditionally, for ppc* but not ppc64le* (the new code is valid for
-POWER8 VSX which LE targets as a baseline but not BE)"
-
-
-This reverts commit 3a557c5d88b7b15b5954ba2743febb055549b536.
----
- libswscale/ppc/yuv2rgb_altivec.c | 24 ++++++++++++++++++++----
- 1 file changed, 20 insertions(+), 4 deletions(-)
-
-diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
-index 536545293d..c1e2852adb 100644
---- a/libswscale/ppc/yuv2rgb_altivec.c
-+++ b/libswscale/ppc/yuv2rgb_altivec.c
-@@ -305,6 +305,9 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
-     vector signed short R1, G1, B1;                                           \
-     vector unsigned char R, G, B;                                             \
-                                                                               \
-+    const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP;                  \
-+    vector unsigned char align_perm;                                          \
-+                                                                              \
-     vector signed short lCY       = c->CY;                                    \
-     vector signed short lOY       = c->OY;                                    \
-     vector signed short lCRV      = c->CRV;                                   \
-@@ -335,13 +338,26 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
-         vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1);       \
-                                                                               \
-         for (j = 0; j < w / 16; j++) {                                        \
--            y0 = vec_xl(0, y1i);                                              \
-+            y1ivP = (const vector unsigned char *) y1i;                       \
-+            y2ivP = (const vector unsigned char *) y2i;                       \
-+            uivP  = (const vector unsigned char *) ui;                        \
-+            vivP  = (const vector unsigned char *) vi;                        \
-+                                                                              \
-+            align_perm = vec_lvsl(0, y1i);                                    \
-+            y0 = (vector unsigned char)                                       \
-+                     vec_perm(y1ivP[0], y1ivP[1], align_perm);                \
-                                                                               \
--            y1 = vec_xl(0, y2i);                                              \
-+            align_perm = vec_lvsl(0, y2i);                                    \
-+            y1 = (vector unsigned char)                                       \
-+                     vec_perm(y2ivP[0], y2ivP[1], align_perm);                \
-                                                                               \
--            u = (vector signed char) vec_xl(0, ui);                           \
-+            align_perm = vec_lvsl(0, ui);                                     \
-+            u = (vector signed char)                                          \
-+                    vec_perm(uivP[0], uivP[1], align_perm);                   \
-                                                                               \
--            v = (vector signed char) vec_xl(0, vi);                           \
-+            align_perm = vec_lvsl(0, vi);                                     \
-+            v = (vector signed char)                                          \
-+                    vec_perm(vivP[0], vivP[1], align_perm);                   \
-                                                                               \
-             u = (vector signed char)                                          \
-                     vec_sub(u,                                                \
--- 
-2.27.0
-
diff --git a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
deleted file mode 100644
index 9a55178c74f0..000000000000
--- a/srcpkgs/ffmpeg/patches/armv5tel-floating-point.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- a/libavfilter/vf_drawtext.c	2017-10-26 21:03:03.000000000 +0200
-+++ b/libavfilter/vf_drawtext.c	2017-11-21 11:06:49.602284422 +0100
-@@ -39,6 +39,15 @@
- #endif
- #include <fenv.h>
- 
-+#if (FE_ALL_EXCEPT == 0)
-+/* E.g. ARM soft float does not define these */
-+#define FE_INVALID    0
-+#define FE_DIVBYZERO  0
-+#define FE_OVERFLOW   0
-+#define FE_UNDERFLOW  0
-+#define FE_INEXACT    0
-+#endif
-+
- #if CONFIG_LIBFONTCONFIG
- #include <fontconfig/fontconfig.h>
- #endif
diff --git a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
deleted file mode 100644
index 00e3f68a415b..000000000000
--- a/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 811d290844206fc73dc39c3e5b67d5d895baedf8 Mon Sep 17 00:00:00 2001
-From: Rainer Hochecker <fernetmenta@online.de>
-Date: Sat, 26 Jan 2019 19:48:35 +0100
-Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices
-
-This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
-It was hit frequently when watching h264 channels received via DVB-X.
-Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704
----
- libavcodec/vaapi_h264.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
-index 5854587a255..f12fdc457a4 100644
---- a/libavcodec/vaapi_h264.c
-+++ b/libavcodec/vaapi_h264.c
-@@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
-     H264SliceContext *sl = &h->slice_ctx[0];
-     int ret;
- 
-+    if (pic->nb_slices == 0) {
-+        ret = AVERROR_INVALIDDATA;
-+        goto finish;
-+    }
-+
-     ret = ff_vaapi_decode_issue(avctx, pic);
-     if (ret < 0)
-         goto finish;
diff --git a/srcpkgs/ffmpeg/template b/srcpkgs/ffmpeg/template
index 23a3d5c9967b..1ac1e4b8df49 100644
--- a/srcpkgs/ffmpeg/template
+++ b/srcpkgs/ffmpeg/template
@@ -1,15 +1,15 @@
 # Template file for 'ffmpeg'
 # audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
 pkgname=ffmpeg
-version=4.4.3
-revision=2
+version=5.1.2
+revision=1
 short_desc="Decoding, encoding and streaming software"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://www.ffmpeg.org"
 changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
 distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
-checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
 
 hostmakedepends="pkg-config perl yasm"
 makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
@@ -26,7 +26,7 @@ makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-deve
  $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
  $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
  $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
- $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers')
  $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
 depends="ffplay>=${version}_${revision}"
 
@@ -114,7 +114,7 @@ do_configure() {
 		$(vopt_enable x265 libx265) \
 		$(vopt_enable v4l2 libv4l2) \
 		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
-		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		--enable-libbs2b --enable-libvidstab \
 		$(vopt_enable dav1d libdav1d) \
 		$(vopt_enable zimg libzimg) \
 		$(vopt_enable webp libwebp) \
@@ -148,10 +148,8 @@ libavdevice_package() {
 	}
 }
 libavresample_package() {
-	short_desc="FFmpeg audio resampling library"
-	pkg_install() {
-		vmove "usr/lib/libavresample.so.*"
-	}
+	short_desc="Package deprecated, removal needed"
+	build_style=meta
 }
 libavformat_package() {
 	short_desc="FFmpeg file format library"
@@ -198,9 +196,9 @@ ffmpeg-devel_package() {
 		libavfilter>=${version}_${revision}
 		libpostproc>=${version}_${revision}
 		libswscale>=${version}_${revision}
-		libswresample>=${version}_${revision}
-		libavresample>=${version}_${revision}"
+		libswresample>=${version}_${revision}"
 	short_desc+=" - development files"
+	conflicts="ffmpeg4-devel"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig

From b66efa34aae3eb8d4a7d47356210ef4d2052f2e4 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:56:22 -0400
Subject: [PATCH 002/104] New package: ffmpeg4-4.4.3.

---
 srcpkgs/ffmpeg4-devel                         |   1 +
 srcpkgs/ffmpeg4/files/altivec.patch           |  60 +++++
 .../patches/armv5tel-floating-point.patch     |  18 ++
 .../workaround-mesa-readeon-vaapi-bug.patch   |  28 +++
 srcpkgs/ffmpeg4/template                      | 214 ++++++++++++++++++
 srcpkgs/libavcodec4                           |   1 +
 srcpkgs/libavdevice4                          |   1 +
 srcpkgs/libavfilter4                          |   1 +
 srcpkgs/libavformat4                          |   1 +
 srcpkgs/libavresample4                        |   1 +
 srcpkgs/libavutil4                            |   1 +
 srcpkgs/libpostproc4                          |   1 +
 srcpkgs/libswresample4                        |   1 +
 srcpkgs/libswscale4                           |   1 +
 14 files changed, 330 insertions(+)
 create mode 120000 srcpkgs/ffmpeg4-devel
 create mode 100644 srcpkgs/ffmpeg4/files/altivec.patch
 create mode 100644 srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
 create mode 100644 srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
 create mode 100644 srcpkgs/ffmpeg4/template
 create mode 120000 srcpkgs/libavcodec4
 create mode 120000 srcpkgs/libavdevice4
 create mode 120000 srcpkgs/libavfilter4
 create mode 120000 srcpkgs/libavformat4
 create mode 120000 srcpkgs/libavresample4
 create mode 120000 srcpkgs/libavutil4
 create mode 120000 srcpkgs/libpostproc4
 create mode 120000 srcpkgs/libswresample4
 create mode 120000 srcpkgs/libswscale4

diff --git a/srcpkgs/ffmpeg4-devel b/srcpkgs/ffmpeg4-devel
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/ffmpeg4-devel
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg4/files/altivec.patch b/srcpkgs/ffmpeg4/files/altivec.patch
new file mode 100644
index 000000000000..9c5720046332
--- /dev/null
+++ b/srcpkgs/ffmpeg4/files/altivec.patch
@@ -0,0 +1,60 @@
+revert some altivec specific change on all ppc* except ppc64le*
+
+q66: "We should also throw in a revert of FFmpeg/FFmpeg@3a557c5 but only
+conditionally, for ppc* but not ppc64le* (the new code is valid for
+POWER8 VSX which LE targets as a baseline but not BE)"
+
+
+This reverts commit 3a557c5d88b7b15b5954ba2743febb055549b536.
+---
+ libswscale/ppc/yuv2rgb_altivec.c | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
+index 536545293d..c1e2852adb 100644
+--- a/libswscale/ppc/yuv2rgb_altivec.c
++++ b/libswscale/ppc/yuv2rgb_altivec.c
+@@ -305,6 +305,9 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
+     vector signed short R1, G1, B1;                                           \
+     vector unsigned char R, G, B;                                             \
+                                                                               \
++    const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP;                  \
++    vector unsigned char align_perm;                                          \
++                                                                              \
+     vector signed short lCY       = c->CY;                                    \
+     vector signed short lOY       = c->OY;                                    \
+     vector signed short lCRV      = c->CRV;                                   \
+@@ -335,13 +338,26 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
+         vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1);       \
+                                                                               \
+         for (j = 0; j < w / 16; j++) {                                        \
+-            y0 = vec_xl(0, y1i);                                              \
++            y1ivP = (const vector unsigned char *) y1i;                       \
++            y2ivP = (const vector unsigned char *) y2i;                       \
++            uivP  = (const vector unsigned char *) ui;                        \
++            vivP  = (const vector unsigned char *) vi;                        \
++                                                                              \
++            align_perm = vec_lvsl(0, y1i);                                    \
++            y0 = (vector unsigned char)                                       \
++                     vec_perm(y1ivP[0], y1ivP[1], align_perm);                \
+                                                                               \
+-            y1 = vec_xl(0, y2i);                                              \
++            align_perm = vec_lvsl(0, y2i);                                    \
++            y1 = (vector unsigned char)                                       \
++                     vec_perm(y2ivP[0], y2ivP[1], align_perm);                \
+                                                                               \
+-            u = (vector signed char) vec_xl(0, ui);                           \
++            align_perm = vec_lvsl(0, ui);                                     \
++            u = (vector signed char)                                          \
++                    vec_perm(uivP[0], uivP[1], align_perm);                   \
+                                                                               \
+-            v = (vector signed char) vec_xl(0, vi);                           \
++            align_perm = vec_lvsl(0, vi);                                     \
++            v = (vector signed char)                                          \
++                    vec_perm(vivP[0], vivP[1], align_perm);                   \
+                                                                               \
+             u = (vector signed char)                                          \
+                     vec_sub(u,                                                \
+-- 
+2.27.0
+
diff --git a/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
new file mode 100644
index 000000000000..9a55178c74f0
--- /dev/null
+++ b/srcpkgs/ffmpeg4/patches/armv5tel-floating-point.patch
@@ -0,0 +1,18 @@
+--- a/libavfilter/vf_drawtext.c	2017-10-26 21:03:03.000000000 +0200
++++ b/libavfilter/vf_drawtext.c	2017-11-21 11:06:49.602284422 +0100
+@@ -39,6 +39,15 @@
+ #endif
+ #include <fenv.h>
+ 
++#if (FE_ALL_EXCEPT == 0)
++/* E.g. ARM soft float does not define these */
++#define FE_INVALID    0
++#define FE_DIVBYZERO  0
++#define FE_OVERFLOW   0
++#define FE_UNDERFLOW  0
++#define FE_INEXACT    0
++#endif
++
+ #if CONFIG_LIBFONTCONFIG
+ #include <fontconfig/fontconfig.h>
+ #endif
diff --git a/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
new file mode 100644
index 000000000000..00e3f68a415b
--- /dev/null
+++ b/srcpkgs/ffmpeg4/patches/workaround-mesa-readeon-vaapi-bug.patch
@@ -0,0 +1,28 @@
+From 811d290844206fc73dc39c3e5b67d5d895baedf8 Mon Sep 17 00:00:00 2001
+From: Rainer Hochecker <fernetmenta@online.de>
+Date: Sat, 26 Jan 2019 19:48:35 +0100
+Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices
+
+This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
+It was hit frequently when watching h264 channels received via DVB-X.
+Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704
+---
+ libavcodec/vaapi_h264.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
+index 5854587a255..f12fdc457a4 100644
+--- a/libavcodec/vaapi_h264.c
++++ b/libavcodec/vaapi_h264.c
+@@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
+     H264SliceContext *sl = &h->slice_ctx[0];
+     int ret;
+ 
++    if (pic->nb_slices == 0) {
++        ret = AVERROR_INVALIDDATA;
++        goto finish;
++    }
++
+     ret = ff_vaapi_decode_issue(avctx, pic);
+     if (ret < 0)
+         goto finish;
diff --git a/srcpkgs/ffmpeg4/template b/srcpkgs/ffmpeg4/template
new file mode 100644
index 000000000000..7bc64bb39f41
--- /dev/null
+++ b/srcpkgs/ffmpeg4/template
@@ -0,0 +1,214 @@
+# Template file for 'ffmpeg4'
+# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
+pkgname=ffmpeg4
+version=4.4.3
+revision=1
+short_desc="Decoding, encoding and streaming software - ffmpeg4 libraries only"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.ffmpeg.org"
+changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
+distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
+checksum=6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e
+
+hostmakedepends="pkg-config perl yasm"
+makedepends="zlib-devel bzip2-devel freetype-devel alsa-lib-devel libXfixes-devel
+ libXext-devel libXvMC-devel libxcb-devel lame-devel libtheora-devel
+ libvorbis-devel x264-devel xvidcore-devel jack-devel SDL2-devel
+ libcdio-paranoia-devel librtmp-devel libmodplug-devel gnutls-devel
+ speex-devel celt-devel harfbuzz-devel libass-devel opus-devel ocl-icd-devel
+ libbs2b-devel libvidstab-devel $(vopt_if pulseaudio pulseaudio-devel)
+ $(vopt_if vaapi libva-devel) $(vopt_if vdpau libvdpau-devel)
+ $(vopt_if x265 x265-devel) $(vopt_if v4l2 v4l-utils-devel)
+ $(vopt_if fdk_aac fdk-aac-devel) $(vopt_if vpx libvpx-devel)
+ $(vopt_if aom libaom-devel) $(vopt_if sndio sndio-devel)
+ $(vopt_if dav1d libdav1d-devel) $(vopt_if zimg zimg-devel)
+ $(vopt_if webp libwebp-devel) $(vopt_if sofa libmysofa-devel)
+ $(vopt_if drm libdrm-devel) $(vopt_if svtav1 libsvt-av1-devel)
+ $(vopt_if srt srt-devel) $(vopt_if rist librist-devel)
+ $(vopt_if vulkan 'vulkan-loader Vulkan-Headers')
+ $(vopt_if nvenc nv-codec-headers) $(vopt_if nvdec nv-codec-headers)"
+
+build_options="x265 v4l2 vaapi vdpau vpx fdk_aac aom nvenc sndio pulseaudio
+ dav1d zimg webp sofa vulkan drm svtav1 srt rist nvdec"
+build_options_default="x265 v4l2 vpx aom sndio pulseaudio dav1d webp vulkan drm srt rist"
+
+desc_option_srt="Enable support for SRT (Secure, Reliable, Transport)"
+desc_option_rist="Enable support for RIST (Reliable Internet Stream Transport)"
+desc_option_sofa="Enable support for AES SOFA"
+desc_option_webp="Enable support for WebP"
+
+case "$XBPS_TARGET_MACHINE" in
+	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
+	ppc64*) build_options_default+=" vaapi vdpau";;
+	mips*) CFLAGS="-mnan=legacy";;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" != "32" ]; then
+	build_options_default+=" svtav1"
+fi
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+_apply_patch() {
+	local args="$1" pname="$(basename $2)"
+
+	if [ ! -f ".${pname}_done" ]; then
+		patch -N $args -i $2
+		touch .${pname}_done
+	fi
+}
+
+post_patch() {
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64le*) ;;
+		ppc*) _apply_patch -p1 ${FILESDIR}/altivec.patch ;;
+	esac
+}
+
+do_configure() {
+	# Fix gcc on x86_64-musl only
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
+		sed -i configure -e "s;_cflags_speed='-O3';_cflags_speed='-O2';"
+	fi
+
+	if [ "$CROSS_BUILD" ]; then
+		case "$XBPS_TARGET_MACHINE" in
+			arm*) _arch="arm";;
+			aarch64*) _arch="aarch64";;
+			mips*) _arch="mips";;
+			ppc64*) _arch="ppc64";;
+			ppc*) _arch="ppc";;
+			*) _arch="${XBPS_TARGET_MACHINE%%-musl}";;
+		esac
+
+		_args+=" --enable-cross-compile
+			--sysroot=$XBPS_CROSS_BASE
+			--cross-prefix=${XBPS_CROSS_TRIPLET}-
+			--target-os=linux --arch=${_arch}"
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc|ppc-musl) _args+=" --disable-altivec";;
+	esac
+
+	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+		_args+=" --extra-libs=-latomic"
+	fi
+
+	./configure --prefix=/usr --disable-debug --enable-gpl --enable-gnutls \
+		--disable-stripping \
+		--enable-libcdio --enable-version3 --enable-runtime-cpudetect \
+		--enable-libmp3lame --enable-libvorbis --enable-libxvid \
+		--enable-libx264 $(vopt_enable vpx libvpx) --enable-libtheora \
+		--enable-shared --enable-static --enable-libxcb \
+		$(vopt_enable pulseaudio libpulse) --enable-libfreetype --enable-libmodplug \
+		--enable-libspeex --enable-libcelt --enable-libass \
+		--enable-libopus --enable-librtmp --enable-libjack \
+		$(vopt_if fdk_aac '--enable-nonfree --enable-libfdk-aac') \
+		--disable-libopencore_amrnb --disable-libopencore_amrwb \
+		--disable-libopenjpeg \
+		--enable-postproc --enable-opencl ${_args} \
+		$(vopt_enable x265 libx265) \
+		$(vopt_enable v4l2 libv4l2) \
+		$(vopt_enable aom libaom) $(vopt_enable vaapi) $(vopt_enable vdpau) \
+		--enable-libbs2b --enable-avresample --enable-libvidstab \
+		$(vopt_enable dav1d libdav1d) \
+		$(vopt_enable zimg libzimg) \
+		$(vopt_enable webp libwebp) \
+		$(vopt_enable sofa libmysofa) \
+		$(vopt_enable vulkan) \
+		$(vopt_enable drm libdrm) \
+		$(vopt_enable svtav1 libsvtav1) \
+		$(vopt_enable srt libsrt) \
+		$(vopt_enable rist librist) \
+		$(vopt_if nvenc '--enable-nvenc') \
+		$(vopt_if nvdec '--enable-nvdec')
+}
+do_build() {
+	make ${makejobs}
+	make doc/ff{mpeg,play}.1
+}
+do_install() {
+	make DESTDIR=${DESTDIR} install install-man
+	rm -rf ${DESTDIR}/usr/bin
+}
+
+libavcodec4_package() {
+	short_desc="FFmpeg codec library"
+	pkg_install() {
+		vmove "usr/lib/libavcodec.so.*"
+	}
+}
+libavdevice4_package() {
+	short_desc="FFmpeg device handling library"
+	pkg_install() {
+		vmove "usr/lib/libavdevice.so.*"
+	}
+}
+libavresample4_package() {
+	short_desc="FFmpeg audio resampling library"
+	pkg_install() {
+		vmove "usr/lib/libavresample.so.*"
+	}
+}
+libavformat4_package() {
+	short_desc="FFmpeg file format library"
+	pkg_install() {
+		vmove "usr/lib/libavformat.so.*"
+	}
+}
+libavutil4_package() {
+	short_desc="FFmpeg utility library"
+	pkg_install() {
+		vmove "usr/lib/libavutil.so.*"
+	}
+}
+libavfilter4_package() {
+	short_desc="FFmpeg audio/video filter library"
+	pkg_install() {
+		vmove "usr/lib/libavfilter.so.*"
+	}
+}
+libpostproc4_package() {
+	short_desc="FFmpeg video postprocessing library"
+	pkg_install() {
+		vmove "usr/lib/libpostproc.so.*"
+	}
+}
+libswscale4_package() {
+	short_desc="FFmpeg video scaling library"
+	pkg_install() {
+		vmove "usr/lib/libswscale.so.*"
+	}
+}
+libswresample4_package() {
+	short_desc="FFmpeg video resampling library"
+	pkg_install() {
+		vmove "usr/lib/libswresample.so.*"
+	}
+}
+ffmpeg4-devel_package() {
+	depends="
+		libavcodec4>=${version}_${revision}
+		libavdevice4>=${version}_${revision}
+		libavformat4>=${version}_${revision}
+		libavutil4>=${version}_${revision}
+		libavfilter4>=${version}_${revision}
+		libpostproc4>=${version}_${revision}
+		libswscale4>=${version}_${revision}
+		libswresample4>=${version}_${revision}
+		libavresample4>=${version}_${revision}"
+	short_desc+=" - development files"
+	conflicts="ffmpeg-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/*.a
+		vmove usr/lib/*.so
+		vmove usr/share/ffmpeg/examples
+		vmove usr/share/man/man3
+	}
+}
diff --git a/srcpkgs/libavcodec4 b/srcpkgs/libavcodec4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavcodec4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavdevice4 b/srcpkgs/libavdevice4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavdevice4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavfilter4 b/srcpkgs/libavfilter4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavfilter4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavformat4 b/srcpkgs/libavformat4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavformat4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavresample4 b/srcpkgs/libavresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libavutil4 b/srcpkgs/libavutil4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libavutil4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libpostproc4 b/srcpkgs/libpostproc4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libpostproc4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswresample4 b/srcpkgs/libswresample4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswresample4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file
diff --git a/srcpkgs/libswscale4 b/srcpkgs/libswscale4
new file mode 120000
index 000000000000..887f354e7c6b
--- /dev/null
+++ b/srcpkgs/libswscale4
@@ -0,0 +1 @@
+ffmpeg4
\ No newline at end of file

From 053c9cd3d0c710988528f3bd3095254716af92e5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:04 -0400
Subject: [PATCH 003/104] opencv: update to 4.7.0.

---
 common/shlibs           | 104 ++++++++++++++++++++--------------------
 srcpkgs/opencv/template |   8 ++--
 2 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index aab66c83f4b3..a9d1c6a16ec6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2128,58 +2128,58 @@ libcapstone.so.4 capstone-4.0_1
 libhavege.so.2 libhaveged-1.9.11_1
 libnih.so.1 libnih-1.0.3_1
 libnih-dbus.so.1 libnih-1.0.3_1
-libopencv_quality.so.406 libopencv-4.6.0_1
-libopencv_reg.so.406 libopencv-4.6.0_1
-libopencv_surface_matching.so.406 libopencv-4.6.0_1
-libopencv_xphoto.so.406 libopencv-4.6.0_1
-libopencv_freetype.so.406 libopencv-4.6.0_1
-libopencv_fuzzy.so.406 libopencv-4.6.0_1
-libopencv_hfs.so.406 libopencv-4.6.0_1
-libopencv_img_hash.so.406 libopencv-4.6.0_1
-libopencv_line_descriptor.so.406 libopencv-4.6.0_1
-libopencv_saliency.so.406 libopencv-4.6.0_1
-libopencv_structured_light.so.406 libopencv-4.6.0_1
-libopencv_aruco.so.406 libopencv-4.6.0_1
-libopencv_bgsegm.so.406 libopencv-4.6.0_1
-libopencv_bioinspired.so.406 libopencv-4.6.0_1
-libopencv_ccalib.so.406 libopencv-4.6.0_1
-libopencv_face.so.406 libopencv-4.6.0_1
-libopencv_tracking.so.406 libopencv-4.6.0_1
-libopencv_xfeatures2d.so.406 libopencv-4.6.0_1
-libopencv_optflow.so.406 libopencv-4.6.0_1
-libopencv_ximgproc.so.406 libopencv-4.6.0_1
-libopencv_plot.so.406 libopencv-4.6.0_1
-libopencv_text.so.406 libopencv-4.6.0_1
-libopencv_ml.so.406 libopencv-4.6.0_1
-libopencv_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn.so.406 libopencv-4.6.0_1
-libopencv_shape.so.406 libopencv-4.6.0_1
-libopencv_stitching.so.406 libopencv-4.6.0_1
-libopencv_photo.so.406 libopencv-4.6.0_1
-libopencv_video.so.406 libopencv-4.6.0_1
-libopencv_calib3d.so.406 libopencv-4.6.0_1
-libopencv_features2d.so.406 libopencv-4.6.0_1
-libopencv_flann.so.406 libopencv-4.6.0_1
-libopencv_highgui.so.406 libopencv-4.6.0_1
-libopencv_videoio.so.406 libopencv-4.6.0_1
-libopencv_imgcodecs.so.406 libopencv-4.6.0_1
-libopencv_imgproc.so.406 libopencv-4.6.0_1
-libopencv_core.so.406 libopencv-4.6.0_1
-libopencv_superres.so.406 libopencv-4.6.0_1
-libopencv_videostab.so.406 libopencv-4.6.0_1
-libopencv_gapi.so.406 libopencv-4.6.0_1
-libopencv_xobjdetect.so.406 libopencv-4.6.0_1
-libopencv_datasets.so.406 libopencv-4.6.0_1
-libopencv_dnn_objdetect.so.406 libopencv-4.6.0_1
-libopencv_dnn_superres.so.406 libopencv-4.6.0_1
-libopencv_dpm.so.406 libopencv-4.6.0_1
-libopencv_phase_unwrapping.so.406 libopencv-4.6.0_1
-libopencv_stereo.so.406 libopencv-4.6.0_1
-libopencv_rapid.so.406 libopencv-4.6.0_1
-libopencv_intensity_transform.so.406 libopencv-4.6.0_1
-libopencv_alphamat.so.406 libopencv-4.6.0_1
-libopencv_barcode.so.406 libopencv-4.6.0_1
-libopencv_mcc.so.406 libopencv-4.6.0_1
+libopencv_quality.so.407 libopencv-4.7.0_1
+libopencv_reg.so.407 libopencv-4.7.0_1
+libopencv_surface_matching.so.407 libopencv-4.7.0_1
+libopencv_xphoto.so.407 libopencv-4.7.0_1
+libopencv_freetype.so.407 libopencv-4.7.0_1
+libopencv_fuzzy.so.407 libopencv-4.7.0_1
+libopencv_hfs.so.407 libopencv-4.7.0_1
+libopencv_img_hash.so.407 libopencv-4.7.0_1
+libopencv_line_descriptor.so.407 libopencv-4.7.0_1
+libopencv_saliency.so.407 libopencv-4.7.0_1
+libopencv_structured_light.so.407 libopencv-4.7.0_1
+libopencv_aruco.so.407 libopencv-4.7.0_1
+libopencv_bgsegm.so.407 libopencv-4.7.0_1
+libopencv_bioinspired.so.407 libopencv-4.7.0_1
+libopencv_ccalib.so.407 libopencv-4.7.0_1
+libopencv_face.so.407 libopencv-4.7.0_1
+libopencv_tracking.so.407 libopencv-4.7.0_1
+libopencv_xfeatures2d.so.407 libopencv-4.7.0_1
+libopencv_optflow.so.407 libopencv-4.7.0_1
+libopencv_ximgproc.so.407 libopencv-4.7.0_1
+libopencv_plot.so.407 libopencv-4.7.0_1
+libopencv_text.so.407 libopencv-4.7.0_1
+libopencv_ml.so.407 libopencv-4.7.0_1
+libopencv_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn.so.407 libopencv-4.7.0_1
+libopencv_shape.so.407 libopencv-4.7.0_1
+libopencv_stitching.so.407 libopencv-4.7.0_1
+libopencv_photo.so.407 libopencv-4.7.0_1
+libopencv_video.so.407 libopencv-4.7.0_1
+libopencv_calib3d.so.407 libopencv-4.7.0_1
+libopencv_features2d.so.407 libopencv-4.7.0_1
+libopencv_flann.so.407 libopencv-4.7.0_1
+libopencv_highgui.so.407 libopencv-4.7.0_1
+libopencv_videoio.so.407 libopencv-4.7.0_1
+libopencv_imgcodecs.so.407 libopencv-4.7.0_1
+libopencv_imgproc.so.407 libopencv-4.7.0_1
+libopencv_core.so.407 libopencv-4.7.0_1
+libopencv_superres.so.407 libopencv-4.7.0_1
+libopencv_videostab.so.407 libopencv-4.7.0_1
+libopencv_gapi.so.407 libopencv-4.7.0_1
+libopencv_xobjdetect.so.407 libopencv-4.7.0_1
+libopencv_datasets.so.407 libopencv-4.7.0_1
+libopencv_dnn_objdetect.so.407 libopencv-4.7.0_1
+libopencv_dnn_superres.so.407 libopencv-4.7.0_1
+libopencv_dpm.so.407 libopencv-4.7.0_1
+libopencv_phase_unwrapping.so.407 libopencv-4.7.0_1
+libopencv_stereo.so.407 libopencv-4.7.0_1
+libopencv_rapid.so.407 libopencv-4.7.0_1
+libopencv_intensity_transform.so.407 libopencv-4.7.0_1
+libopencv_alphamat.so.407 libopencv-4.7.0_1
+libopencv_barcode.so.407 libopencv-4.7.0_1
+libopencv_mcc.so.407 libopencv-4.7.0_1
 libuniconf.so.4.6 wvstreams-4.6.1_20
 libwvbase.so.4.6 wvstreams-4.6.1_20
 libwvutils.so.4.6 wvstreams-4.6.1_20
diff --git a/srcpkgs/opencv/template b/srcpkgs/opencv/template
index a09b8dd0d449..41f3183f1582 100644
--- a/srcpkgs/opencv/template
+++ b/srcpkgs/opencv/template
@@ -1,7 +1,7 @@
 # Template file for 'opencv'
 pkgname=opencv
-version=4.6.0
-revision=3
+version=4.7.0
+revision=1
 create_wrksrc=yes
 build_wrksrc=${pkgname}-${version}
 build_style=cmake
@@ -24,8 +24,8 @@ homepage="https://opencv.org"
 changelog="https://github.com/opencv/opencv/wiki/ChangeLog"
 distfiles="https://github.com/opencv/opencv/archive/${version}.tar.gz
  https://github.com/opencv/opencv_contrib/archive/${version}.tar.gz>contrib.tar.gz"
-checksum="1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
- 1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7"
+checksum="8df0079cdbe179748a18d44731af62a245a45ebf5085223dc03133954c662973
+ 42df840cf9055e59d0e22c249cfb19f04743e1bdad113d31b1573d3934d62584"
 patch_args="-Np1 -d ${build_wrksrc}"
 # tests hang indenfinitely, even with test data included
 make_check=no

From 6ffc9164d1c69a9df2e152b50eabfcca722f44ca Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 004/104] actiona: revbump for opencv-4.7.0

---
 srcpkgs/actiona/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/actiona/template b/srcpkgs/actiona/template
index cf5f0b7a2ae6..0d899311e6df 100644
--- a/srcpkgs/actiona/template
+++ b/srcpkgs/actiona/template
@@ -1,7 +1,7 @@
 # Template file for 'actiona'
 pkgname=actiona
 version=3.10.1
-revision=2
+revision=3
 build_style=qmake
 configure_args="PKGCONFIG_OPENCV=opencv4"
 hostmakedepends="pkg-config qt5-plugin-mysql qt5-qmake qt5-host-tools"

From bd9652019cb6b210d135ea312264ebe85d807560 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 005/104] digikam: revbump for opencv-4.7.0

---
 srcpkgs/digikam/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/digikam/template b/srcpkgs/digikam/template
index e8ec4961457b..0a8984db85bc 100644
--- a/srcpkgs/digikam/template
+++ b/srcpkgs/digikam/template
@@ -1,7 +1,7 @@
 # Template file for 'digikam'
 pkgname=digikam
 version=7.10.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext pkg-config bison flex qt5-qmake

From b0d5dfc8c2214bc73ae5859a0f8c5df272d934e7 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 006/104] gmic: revbump for opencv-4.7.0

---
 srcpkgs/gmic/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gmic/template b/srcpkgs/gmic/template
index 8e3b80047f26..43c6e0672a2b 100644
--- a/srcpkgs/gmic/template
+++ b/srcpkgs/gmic/template
@@ -1,7 +1,7 @@
 # Template file for 'gmic'
 pkgname=gmic
 version=3.1.6
-revision=1
+revision=2
 _zart_hash=34ebf6cce0bafb98abe57cec83c4a02cd1abeca0
 create_wrksrc=yes
 build_wrksrc="src"

From cb851836b13d1a327d482a4ecc16c7c9ccab76c5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:45 -0400
Subject: [PATCH 007/104] nomacs: revbump for opencv-4.7.0

---
 srcpkgs/nomacs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/nomacs/template b/srcpkgs/nomacs/template
index 895e83071a8a..ce4e7f7093da 100644
--- a/srcpkgs/nomacs/template
+++ b/srcpkgs/nomacs/template
@@ -1,7 +1,7 @@
 # Template file for 'nomacs'
 pkgname=nomacs
 version=3.16.224
-revision=3
+revision=4
 build_wrksrc=ImageLounge
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_TRANSLATIONS=1

From 13577bf1429f0d9aafc134de39095d280a490d7c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 008/104] qimgv: revbump for opencv-4.7.0

---
 srcpkgs/qimgv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qimgv/template b/srcpkgs/qimgv/template
index 7eb30db33992..dd341dfe1bfc 100644
--- a/srcpkgs/qimgv/template
+++ b/srcpkgs/qimgv/template
@@ -1,7 +1,7 @@
 # Template file for 'qimgv'
 pkgname=qimgv
 version=1.0.2
-revision=2
+revision=3
 build_style=cmake
 configure_args="$(vopt_if video -DVIDEO_SUPPORT=ON -DVIDEO_SUPPORT=OFF)
  $(vopt_if scale -DOPENCV_SUPPORT=ON -DOPENCV_SUPPORT=OFF)

From 8b777e67fe3c9a0c8130af21029ee0233d46cfa7 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 009/104] retroshare: revbump for opencv-4.7.0

---
 srcpkgs/retroshare/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/retroshare/template b/srcpkgs/retroshare/template
index 8a0786c21a08..72023fa98b75 100644
--- a/srcpkgs/retroshare/template
+++ b/srcpkgs/retroshare/template
@@ -1,7 +1,7 @@
 # Template file for 'retroshare'
 pkgname=retroshare
 version=0.6.6
-revision=2
+revision=4
 build_style=qmake
 #XXX broadcast feature requires an ancient udp-discovery-cpp which either needs
 # to be fetched+patched (FTBFS) here or packaged :/

From dca856aa94eb156ecc140c95b120fd183579157d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 010/104] siril: revbump for opencv-4.7.0

---
 srcpkgs/siril/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/siril/template b/srcpkgs/siril/template
index e06aa5d0559c..84332f79d060 100644
--- a/srcpkgs/siril/template
+++ b/srcpkgs/siril/template
@@ -1,7 +1,7 @@
 # Template file for 'siril'
 pkgname=siril
 version=0.9.12
-revision=8
+revision=10
 build_style=gnu-configure
 hostmakedepends="pkg-config intltool autoconf automake gettext-devel"
 makedepends="fftw-devel libconfig-devel libopencv-devel libffms2-devel

From 6edf33c8849b233dea154050eec6295884b4bcdb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 19:59:46 -0400
Subject: [PATCH 011/104] waifu2x-converter-cpp: revbump for opencv-4.7.0

---
 srcpkgs/waifu2x-converter-cpp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/waifu2x-converter-cpp/template b/srcpkgs/waifu2x-converter-cpp/template
index 8c095d0d7bab..aa52d8c981a8 100644
--- a/srcpkgs/waifu2x-converter-cpp/template
+++ b/srcpkgs/waifu2x-converter-cpp/template
@@ -1,7 +1,7 @@
 # Template file for 'waifu2x-converter-cpp'
 pkgname=waifu2x-converter-cpp
 version=5.2.4
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DINSTALL_MODELS=ON"
 hostmakedepends="pkg-config"

From 83d364708b86201f948986fa0fbb862cc240d2c0 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:00:38 -0400
Subject: [PATCH 012/104] vlc: revbump for ffmpeg4-4.4.3

---
 srcpkgs/vlc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/vlc/template b/srcpkgs/vlc/template
index 210762b0a7e2..855ca5238662 100644
--- a/srcpkgs/vlc/template
+++ b/srcpkgs/vlc/template
@@ -1,7 +1,7 @@
 # Template file for 'vlc'
 pkgname=vlc
 version=3.0.18
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-gme --disable-libtar --enable-jack
  --enable-live555 --disable-fluidsynth --enable-dvdread
@@ -25,7 +25,7 @@ lib32disabled=yes
 hostmakedepends="automake libtool pkg-config flex gettext libgcrypt-devel
  live555-devel gettext-devel $(vopt_if lua lua52) $(vopt_if chromecast protobuf)"
 makedepends="
- avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg-devel freefont-ttf
+ avahi-libs-devel dbus-glib-devel faad2-devel ffmpeg4-devel freefont-ttf
  gnutls-devel jack-devel liba52-devel libass-devel libbluray-devel
  libcdio-devel libdca-devel libdvbpsi-devel libdvdnav-devel libmad-devel
  libmatroska-devel libmodplug-devel libmpcdec-devel libmpeg2-devel

From b9bf075a54a5c6a7c82f5a94ec65ab5142b4d6af Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:00:55 -0400
Subject: [PATCH 013/104] osg: revbump for ffmpeg4-4.4.3

---
 srcpkgs/osg/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index 1a031448b3cf..755793f7e11b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,14 +1,14 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms
 configure_args="-DLIB_POSTFIX="
 hostmakedepends="pkg-config xrandr"
 makedepends="MesaLib-devel gtkglext-devel libcurl-devel giflib-devel librsvg-devel
- jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg-devel xine-lib-devel
+ jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg4-devel xine-lib-devel
  SDL2-devel gst-plugins-base1-devel
  $(vopt_if openexr libopenexr-devel)
  $(vopt_if poppler poppler-glib-devel)

From d4c2579779f4c36cb20c9be914030e9b18a59598 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:13 -0400
Subject: [PATCH 014/104] xine-lib: revbump for ffmpeg4-4.4.3

---
 srcpkgs/xine-lib/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/xine-lib/template b/srcpkgs/xine-lib/template
index f713eff49b07..ed6194c17d11 100644
--- a/srcpkgs/xine-lib/template
+++ b/srcpkgs/xine-lib/template
@@ -1,6 +1,6 @@
 # Template file for 'xine-lib'
 pkgname=xine-lib
-version=1.2.12
+version=1.2.13
 revision=1
 build_style=gnu-configure
 configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
@@ -8,7 +8,7 @@ configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3
 hostmakedepends="automake gettext-devel libtool pkg-config perl"
 makedepends="
  zlib-devel alsa-lib-devel libxcb-devel libSM-devel libXext-devel libXv-devel
- libXvMC-devel liba52-devel libmad-devel ffmpeg-devel pulseaudio-devel
+ libXvMC-devel liba52-devel libmad-devel ffmpeg4-devel pulseaudio-devel
  jack-devel samba-devel libflac-devel libmodplug-devel libmpcdec-devel
  speex-devel libtheora-devel libvorbis-devel libdca-devel faad2-devel
  libcdio-devel libbluray-devel aalib-devel libcaca-devel libXinerama-devel
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="http://www.xine-project.org"
 changelog="https://sourceforge.net/projects/xine/files/xine-lib/${version}/README.txt/view"
 distfiles="${SOURCEFORGE_SITE}/xine/${pkgname}-${version}.tar.xz"
-checksum=d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098
+checksum=5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f
 
 case "$XBPS_TARGET_MACHINE" in
 	i686-musl)

From f86e57f7a15b785a3924ded7a0a56d03f1cb21f8 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 015/104] QMPlay2: revbump for ffmpeg-5.1.2

---
 srcpkgs/QMPlay2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/QMPlay2/template b/srcpkgs/QMPlay2/template
index ad73cbb01bae..55284c051161 100644
--- a/srcpkgs/QMPlay2/template
+++ b/srcpkgs/QMPlay2/template
@@ -1,7 +1,7 @@
 # Template file for 'QMPlay2'
 pkgname=QMPlay2
 version=23.02.05
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="alsa-lib-devel ffmpeg-devel libass-devel libcdio-devel libgme-devel

From f5e58a705cd8cadb5a342953718082f9707b4491 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 016/104] alsa-plugins: revbump for ffmpeg-5.1.2

---
 srcpkgs/alsa-plugins/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/alsa-plugins/template b/srcpkgs/alsa-plugins/template
index 0bfa6d9fd264..a5708a7d82a8 100644
--- a/srcpkgs/alsa-plugins/template
+++ b/srcpkgs/alsa-plugins/template
@@ -1,7 +1,7 @@
 # Template file for 'alsa-plugins'
 pkgname=alsa-plugins
 version=1.2.7.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-maemo-plugin"
 hostmakedepends="pkg-config"

From 7d05e63b25dacec03d7b318e074cc31c860e4e5d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 017/104] arcan: revbump for ffmpeg-5.1.2

---
 srcpkgs/arcan/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/arcan/template b/srcpkgs/arcan/template
index 7be9652eccf3..ccc7df11ceac 100644
--- a/srcpkgs/arcan/template
+++ b/srcpkgs/arcan/template
@@ -2,7 +2,7 @@
 # !! keep synced with: acfgfs aclip aloadimage
 pkgname=arcan
 version=0.6.2.1
-revision=1
+revision=2
 create_wrksrc=yes
 build_wrksrc=arcan/src
 build_style=cmake

From 39bc35be503c31b3a7b928ea5bebcbe1c1c190c0 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 018/104] attract: revbump for ffmpeg4-4.4.3

---
 srcpkgs/attract/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/attract/template b/srcpkgs/attract/template
index 26144e931a3c..e760bf0d18ae 100644
--- a/srcpkgs/attract/template
+++ b/srcpkgs/attract/template
@@ -1,12 +1,12 @@
 # Template file for 'attract'
 pkgname=attract
 version=2.6.2
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="VERBOSE=1"
 make_use_env=yes
 hostmakedepends="pkg-config"
-makedepends="SFML-devel ffmpeg-devel fontconfig-devel glu-devel libarchive-devel
+makedepends="SFML-devel ffmpeg4-devel fontconfig-devel glu-devel libarchive-devel
  libcurl-devel libjpeg-turbo-devel xine-lib rapidjson libXrandr-devel"
 depends="git"
 short_desc="Attract-Mode is a graphical frontend for emulators"

From 8c83b46d1e4254a76f110f8de7bd843861040d56 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 019/104] aubio: revbump for ffmpeg-5.1.2

---
 srcpkgs/aubio/patches/ffmpeg5.patch | 25 +++++++++++++++++++++++++
 srcpkgs/aubio/template              |  2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/aubio/patches/ffmpeg5.patch

diff --git a/srcpkgs/aubio/patches/ffmpeg5.patch b/srcpkgs/aubio/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..aace41a6e6d9
--- /dev/null
+++ b/srcpkgs/aubio/patches/ffmpeg5.patch
@@ -0,0 +1,25 @@
+From 8a05420e5dd8c7b8b2447f82dc919765876511b3 Mon Sep 17 00:00:00 2001
+From: Paul Brossier <piem@piem.org>
+Date: Tue, 25 Jan 2022 18:30:27 +0100
+Subject: [PATCH] [source_avcodec] define FF_API_LAVF_AVCTX for libavcodec >
+ 59, thx @berolinux (closes gh-353)
+
+---
+ src/io/source_avcodec.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c
+index e0ae93b5..1421bd9a 100644
+--- a/src/io/source_avcodec.c
++++ b/src/io/source_avcodec.c
+@@ -68,6 +68,10 @@
+ #define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
+ #endif
+ 
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++#define FF_API_LAVF_AVCTX 1
++#endif
++
+ struct _aubio_source_avcodec_t {
+   uint_t hop_size;
+   uint_t samplerate;
diff --git a/srcpkgs/aubio/template b/srcpkgs/aubio/template
index ad1c4b256991..7d875cc02541 100644
--- a/srcpkgs/aubio/template
+++ b/srcpkgs/aubio/template
@@ -1,7 +1,7 @@
 # Template file for 'aubio'
 pkgname=aubio
 version=0.4.9
-revision=1
+revision=2
 build_style=waf3
 # XXX lash, pure and swig support.
 hostmakedepends="pkg-config txt2man"

From c0f04b3c592a3a2488abef19047f37ac2bdf8f4f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 020/104] audacious-plugins: revbump for ffmpeg-5.1.2

---
 .../audacious-plugins/patches/ffmpeg5.patch   | 43 +++++++++++++++++++
 srcpkgs/audacious-plugins/template            |  2 +-
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/audacious-plugins/patches/ffmpeg5.patch

diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg5.patch b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..4e5e34099d71
--- /dev/null
+++ b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch
@@ -0,0 +1,43 @@
+commit 298aa371c56c2f52c25a33d9bdec4918b11cebdc
+Author: tibequadorian <tibequadorian@posteo.de>
+Date:   Sat Mar 19 18:40:12 2022 +0100
+
+    audacious-plugins: rebuild against ffmpeg-5.0
+
+diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+new file mode 100644
+index 0000000000..617c11215b
+--- /dev/null
++++ b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch
+@@ -0,0 +1,31 @@
++From f60beb400eeb1e4778bbfd738bc4a4ccef3de539 Mon Sep 17 00:00:00 2001
++From: John Lindgren <john@jlindgren.net>
++Date: Sat, 5 Mar 2022 12:05:34 -0500
++Subject: [PATCH] Fix build with FFmpeg 5.0
++
++---
++ src/ffaudio/ffaudio-core.cc | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/src/ffaudio/ffaudio-core.cc b/src/ffaudio/ffaudio-core.cc
++index 16dc63e3a..a2b95fd6c 100644
++--- a/src/ffaudio/ffaudio-core.cc
+++++ b/src/ffaudio/ffaudio-core.cc
++@@ -274,7 +274,7 @@ static AVInputFormat * get_format_by_content (const char * name, VFSFile & file)
++         AVProbeData d = {name, buf, filled};
++         score = target;
++ 
++-        f = av_probe_input_format2 (& d, true, & score);
+++        f = (AVInputFormat *) av_probe_input_format2 (& d, true, & score);
++         if (f)
++             break;
++ 
++@@ -347,7 +347,7 @@ static bool find_codec (AVFormatContext * c, CodecInfo * cinfo)
++ #endif
++         if (stream && stream->codecpar && stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
++         {
++-            AVCodec * codec = avcodec_find_decoder (stream->codecpar->codec_id);
+++            AVCodec * codec = (AVCodec *) avcodec_find_decoder (stream->codecpar->codec_id);
++ 
++             if (codec)
++             {
diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template
index 910ec0d1891f..def0678bc611 100644
--- a/srcpkgs/audacious-plugins/template
+++ b/srcpkgs/audacious-plugins/template
@@ -2,7 +2,7 @@
 #Keep in sync with audacious!
 pkgname=audacious-plugins
 version=4.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="$(vopt_enable gtk) $(vopt_enable qt)"
 hostmakedepends="gettext pkg-config glib-devel"

From 7eedd0aa286c278dba4f519148b16bafd8e21b38 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 021/104] audacity: revbump for ffmpeg4-4.4.3

---
 srcpkgs/audacity/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/audacity/template b/srcpkgs/audacity/template
index d509c0a89407..11e20255685b 100644
--- a/srcpkgs/audacity/template
+++ b/srcpkgs/audacity/template
@@ -1,7 +1,7 @@
 # Template file for 'audacity'
 pkgname=audacity
 version=2.4.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--with-ffmpeg=system --with-libsndfile=system --with-expat=system
  --with-libsoxr=system --with-lame=system --with-lv2=system ac_cv_path_WX_CONFIG=wx-config-gtk3"
@@ -9,7 +9,7 @@ hostmakedepends="pkg-config cmake gettext libtool m4 which"
 makedepends="jack-devel wxWidgets-gtk3-devel gtk+3-devel
  libmad-devel soundtouch-devel libsoxr-devel
  vamp-plugin-sdk-devel lame-devel libid3tag-devel libflac-devel
- ffmpeg-devel twolame-devel serd-devel lv2 lilv-devel suil-devel"
+ ffmpeg4-devel twolame-devel serd-devel lv2 lilv-devel suil-devel"
 depends="desktop-file-utils hicolor-icon-theme"
 short_desc="Graphical cross-platform audio editor"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -33,5 +33,4 @@ post_install() {
 	vcopy plug-ins /usr/share/audacity
 
 	rm ${DESTDIR}/usr/share/doc/audacity/LICENSE.txt
-	vlicense LICENSE.txt LICENSE
 }

From 7b8f6e71aa594cb0a6bf453486aac1d6d27db48d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 022/104] avidemux: revbump for ffmpeg-5.1.2

---
 srcpkgs/avidemux/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/avidemux/template b/srcpkgs/avidemux/template
index 253a0243e225..557285982d2b 100644
--- a/srcpkgs/avidemux/template
+++ b/srcpkgs/avidemux/template
@@ -1,7 +1,7 @@
 # Template file for 'avidemux'
 pkgname=avidemux
 version=2.8.0
-revision=2
+revision=3
 # Can't be compiled for aarch64, arm* or mips*
 archs="x86_64* i686*"
 hostmakedepends="cmake pkg-config qt5-host-tools qt5-devel tar yasm"

From 53f4f3b9fc1875b6465ef695332a2771846ffbf2 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:45 -0400
Subject: [PATCH 023/104] baresip: revbump for ffmpeg-5.1.2

---
 srcpkgs/baresip/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index f1bd1817048b..b21e22334316 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=2.10.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel

From f9f939880bda4b5ea7a4250dc5bec8596ca2bea5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 024/104] blender: revbump for ffmpeg-5.1.2

---
 srcpkgs/blender/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index a3255cddbc95..4ec73e05acf5 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
 # Template file for 'blender'
 pkgname=blender
 version=3.4.1
-revision=1
+revision=2
 archs="x86_64* ppc64*"
 build_style="cmake"
 pycompile_dirs="/usr/share/blender/${version%.*}/scripts"

From aaf35e37cfc510045e90cd8a05a21944a5202696 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 025/104] cantata: revbump for ffmpeg-5.1.2

---
 srcpkgs/cantata/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cantata/template b/srcpkgs/cantata/template
index 4b417d80d5c2..8a90aaa4c07a 100644
--- a/srcpkgs/cantata/template
+++ b/srcpkgs/cantata/template
@@ -1,7 +1,7 @@
 # Template file for 'cantata'
 pkgname=cantata
 version=2.5.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools qt5-tools"
 makedepends="qt5-devel qt5-tools-devel qt5-svg-devel qt5-xmlpatterns-devel

From a8b80b4f41cf19dc0143bac79f600e5ee2cb5fc9 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 026/104] ccextractor: revbump for ffmpeg4-4.4.3

---
 srcpkgs/ccextractor/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccextractor/template b/srcpkgs/ccextractor/template
index 9abcd82852b2..6eccad5885af 100644
--- a/srcpkgs/ccextractor/template
+++ b/srcpkgs/ccextractor/template
@@ -1,12 +1,12 @@
 # Template file for 'ccextractor'
 pkgname=ccextractor
 version=0.93
-revision=1
+revision=2
 build_wrksrc="linux"
 build_style=gnu-configure
 configure_args="--enable-ocr --enable-hardsubx"
 hostmakedepends="automake pkg-config"
-makedepends="leptonica-devel tesseract-ocr-devel ffmpeg-devel"
+makedepends="leptonica-devel tesseract-ocr-devel ffmpeg4-devel"
 short_desc="Extract subtitles from video streams"
 maintainer="newbluemoon <blaumolch@mailbox.org>"
 license="GPL-2.0-or-later"

From 6d014d87da96b0f306c782d062069b13e6b3bdac Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 027/104] chromaprint: revbump for ffmpeg-5.1.2

---
 srcpkgs/chromaprint/patches/ffmpeg5.patch | 569 ++++++++++++++++++++++
 srcpkgs/chromaprint/template              |   2 +-
 2 files changed, 570 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/chromaprint/patches/ffmpeg5.patch

diff --git a/srcpkgs/chromaprint/patches/ffmpeg5.patch b/srcpkgs/chromaprint/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..a9fd307a23c8
--- /dev/null
+++ b/srcpkgs/chromaprint/patches/ffmpeg5.patch
@@ -0,0 +1,569 @@
+From 8ccad6937177b1b92e40ab8f4447ea27bac009a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
+Date: Fri, 4 Nov 2022 21:47:38 +0100
+Subject: [PATCH] Use FFmpeg 5.x (#120)
+
+* Use FFmpeg 5.1.2 for CI builds
+
+* Build on Ubuntu 20.04
+
+* Upgrade code to FFmpeg 5.x APIs
+
+* Only set FFmpeg include dirs if building tools
+
+* No longer needed
+
+* Use ubuntu 20.04
+---
+ .github/workflows/build.yml                   |   6 +-
+ CMakeLists.txt                                |  16 --
+ package/build.sh                              |   4 +-
+ src/audio/ffmpeg_audio_processor.h            |   2 -
+ src/audio/ffmpeg_audio_processor_avresample.h |  72 -------
+ src/audio/ffmpeg_audio_processor_swresample.h |  18 +-
+ src/audio/ffmpeg_audio_reader.h               | 197 +++++++++---------
+ tests/CMakeLists.txt                          |   6 +
+ 8 files changed, 122 insertions(+), 199 deletions(-)
+ delete mode 100644 src/audio/ffmpeg_audio_processor_avresample.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8d6a32..4da2405 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -84,9 +84,6 @@ find_package(FFmpeg)
+ if(FFMPEG_LIBRARIES)
+ 	cmake_push_check_state(RESET)
+ 	set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lm)
+-	check_function_exists(av_packet_unref HAVE_AV_PACKET_UNREF)
+-	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
+-	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
+ 	cmake_pop_check_state()
+ endif()
+
+@@ -163,14 +160,11 @@ message(STATUS "Using ${FFT_LIB} for FFT calculations")
+ if(NOT AUDIO_PROCESSOR_LIB)
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+ 		set(AUDIO_PROCESSOR_LIB "swresample")
+-	elseif(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(AUDIO_PROCESSOR_LIB "avresample")
+ 	endif()
+ endif()
+
+ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE OFF)
+ 		set(USE_SWRESAMPLE ON)
+ 		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+ 		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS})
+@@ -178,16 +172,6 @@ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+ 	endif()
+ 	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+-elseif(AUDIO_PROCESSOR_LIB STREQUAL "avresample")
+-	if(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE ON)
+-		set(USE_SWRESAMPLE OFF)
+-		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBAVRESAMPLE_LIBRARIES})
+-		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS})
+-	else()
+-		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+-	endif()
+-	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+ else()
+ 	message(STATUS "Building without audio conversion support, please install FFmpeg with libswresample")
+ endif()
+diff --git a/package/build.sh b/package/build.sh
+index da631ae..b41d36e 100755
+--- a/package/build.sh
++++ b/package/build.sh
+@@ -7,8 +7,8 @@ set -eux
+
+ BASE_DIR=$(cd $(dirname $0)/.. && pwd)
+
+-FFMPEG_VERSION=4.4.1
+-FFMPEG_BUILD_TAG=v4.4.1-1
++FFMPEG_VERSION=5.1.2
++FFMPEG_BUILD_TAG=v${FFMPEG_VERSION}-1
+
+ TMP_BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX)
+ trap 'rm -rf $TMP_BUILD_DIR' EXIT
+diff --git a/src/audio/ffmpeg_audio_processor.h b/src/audio/ffmpeg_audio_processor.h
+index 7628fc7..39f4f6d 100644
+--- a/src/audio/ffmpeg_audio_processor.h
++++ b/src/audio/ffmpeg_audio_processor.h
+@@ -10,8 +10,6 @@
+
+ #if defined(USE_SWRESAMPLE)
+ #include "audio/ffmpeg_audio_processor_swresample.h"
+-#elif defined(USE_AVRESAMPLE)
+-#include "audio/ffmpeg_audio_processor_avresample.h"
+ #else
+ #error "no audio processing library"
+ #endif
+diff --git a/src/audio/ffmpeg_audio_processor_avresample.h b/src/audio/ffmpeg_audio_processor_avresample.h
+deleted file mode 100644
+index bd85f92..0000000
+--- a/src/audio/ffmpeg_audio_processor_avresample.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-// Copyright (C) 2016  Lukas Lalinsky
+-// Distributed under the MIT license, see the LICENSE file for details.
+-
+-#ifndef CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-#define CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-
+-extern "C" {
+-#include <libavresample/avresample.h>
+-}
+-
+-namespace chromaprint {
+-
+-class FFmpegAudioProcessor {
+-public:
+-	FFmpegAudioProcessor() {
+-		m_resample_ctx = avresample_alloc_context();
+-	}
+-
+-	~FFmpegAudioProcessor() {
+-		avresample_free(&m_resample_ctx);
+-	}
+-
+-	void SetCompatibleMode() {
+-		av_opt_set_int(m_resample_ctx, "filter_size", 16, 0);
+-		av_opt_set_int(m_resample_ctx, "phase_shift", 8, 0);
+-		av_opt_set_int(m_resample_ctx, "linear_interp", 1, 0);
+-		av_opt_set_double(m_resample_ctx, "cutoff", 0.8, 0);
+-	}
+-
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "in_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_rate", sample_rate, 0);
+-	}
+-
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "out_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_rate, 0);
+-	}
+-
+-	int Init() {
+-		return avresample_open(m_resample_ctx);
+-	}
+-
+-	int Convert(uint8_t **out, int out_count, const uint8_t **in, int in_count) {
+-		return avresample_convert(m_resample_ctx, out, 0, out_count, (uint8_t **) in, 0, in_count);
+-	}
+-
+-	int Flush(uint8_t **out, int out_count) {
+-		return avresample_read(m_resample_ctx, out, out_count);
+-	}
+-
+-private:
+-	AVAudioResampleContext *m_resample_ctx = nullptr;
+-};
+-
+-}; // namespace chromaprint
+-
+-#endif
+diff --git a/src/audio/ffmpeg_audio_processor_swresample.h b/src/audio/ffmpeg_audio_processor_swresample.h
+index b86266b..b1d4bea 100644
+--- a/src/audio/ffmpeg_audio_processor_swresample.h
++++ b/src/audio/ffmpeg_audio_processor_swresample.h
+@@ -28,30 +28,28 @@ public:
+ 		av_opt_set_double(m_swr_ctx, "cutoff", 0.8, 0);
+ 	}
+
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "icl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "ich", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetInputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "isf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "in_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "isr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "in_sample_rate", sample_rate, 0);
+ 	}
+
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "ocl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "och", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
+ 	}
+
+ 	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "osf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "out_sample_fmt", sample_format, 0);
+ 	}
+
+ 	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "osr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "out_sample_rate", sample_rate, 0);
+ 	}
+
+ 	int Init() {
+diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h
+index 5550164..1c6b346 100644
+--- a/src/audio/ffmpeg_audio_reader.h
++++ b/src/audio/ffmpeg_audio_reader.h
+@@ -62,7 +62,7 @@ public:
+ 	bool Read(const int16_t **data, size_t *size);
+
+ 	bool IsOpen() const { return m_opened; }
+-	bool IsFinished() const { return m_finished && !m_got_frame; }
++	bool IsFinished() const { return !m_has_more_packets && !m_has_more_frames; }
+
+ 	std::string GetError() const { return m_error; }
+ 	int GetErrorCode() const { return m_error_code; }
+@@ -74,20 +74,19 @@ private:
+ 	uint8_t *m_convert_buffer[1] = { nullptr };
+ 	int m_convert_buffer_nb_samples = 0;
+
+-	AVInputFormat *m_input_fmt = nullptr;
++	const AVInputFormat *m_input_fmt = nullptr;
+ 	AVDictionary *m_input_opts = nullptr;
+
+ 	AVFormatContext *m_format_ctx = nullptr;
+ 	AVCodecContext *m_codec_ctx = nullptr;
+-	AVFrame *m_frame = nullptr;
+ 	int m_stream_index = -1;
+ 	std::string m_error;
+ 	int m_error_code = 0;
+-	bool m_finished = false;
+ 	bool m_opened = false;
+-	int m_got_frame = 0;
+-	AVPacket m_packet;
+-	AVPacket m_packet0;
++	bool m_has_more_packets = true;
++	bool m_has_more_frames = true;
++	AVPacket *m_packet = nullptr;
++	AVFrame *m_frame = nullptr;
+
+ 	int m_output_sample_rate = 0;
+ 	int m_output_channels = 0;
+@@ -98,19 +97,12 @@ private:
+
+ inline FFmpegAudioReader::FFmpegAudioReader() {
+ 	av_log_set_level(AV_LOG_QUIET);
+-
+-	av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
+ }
+
+ inline FFmpegAudioReader::~FFmpegAudioReader() {
+ 	Close();
+ 	av_dict_free(&m_input_opts);
+ 	av_freep(&m_convert_buffer[0]);
+-	av_packet_unref(&m_packet0);
+ }
+
+ inline bool FFmpegAudioReader::SetInputFormat(const char *name) {
+@@ -135,11 +127,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ 	Close();
+
+-    av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
++	m_packet = av_packet_alloc();
++	if (!m_packet) {
++		return false;
++	}
+
+ 	ret = avformat_open_input(&m_format_ctx, file_name.c_str(), m_input_fmt, &m_input_opts);
+ 	if (ret < 0) {
+@@ -153,26 +144,31 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		return false;
+ 	}
+
+-	AVCodec *codec;
++	const AVCodec *codec;
+ 	ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
+ 	if (ret < 0) {
+ 		SetError("Could not find any audio stream in the file", ret);
+ 		return false;
+ 	}
+ 	m_stream_index = ret;
++	auto stream = m_format_ctx->streams[m_stream_index];
+
+-	m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec;
++	m_codec_ctx = avcodec_alloc_context3(codec);
+ 	m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
+
++	ret = avcodec_parameters_to_context(m_codec_ctx, stream->codecpar);
++	if (ret < 0) {
++		SetError("Could not copy the stream parameters", ret);
++		return false;
++	}
++
+ 	ret = avcodec_open2(m_codec_ctx, codec, nullptr);
+ 	if (ret < 0) {
+ 		SetError("Could not open the codec", ret);
+ 		return false;
+ 	}
+
+-	if (!m_codec_ctx->channel_layout) {
+-		m_codec_ctx->channel_layout = av_get_default_channel_layout(m_codec_ctx->channels);
+-	}
++	av_dump_format(m_format_ctx, 0, "foo", 0);
+
+ 	m_frame = av_frame_alloc();
+ 	if (!m_frame) {
+@@ -183,19 +179,23 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		m_output_sample_rate = m_codec_ctx->sample_rate;
+ 	}
+
+-	if (!m_output_channels) {
+-		m_output_channels = m_codec_ctx->channels;
++	AVChannelLayout output_channel_layout;
++	if (m_output_channels) {
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
++	} else {
++		m_output_channels = m_codec_ctx->ch_layout.nb_channels;
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
+ 	}
+
+-	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
++	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
+ 		m_converter.reset(new FFmpegAudioProcessor());
+ 		m_converter->SetCompatibleMode();
+ 		m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
+ 		m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
+-		m_converter->SetInputChannelLayout(m_codec_ctx->channel_layout);
++		m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
+ 		m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
+ 		m_converter->SetOutputSampleRate(m_output_sample_rate);
+-		m_converter->SetOutputChannelLayout(av_get_default_channel_layout(m_output_channels));
++		m_converter->SetOutputChannelLayout(&output_channel_layout);
+ 		auto ret = m_converter->Init();
+ 		if (ret != 0) {
+ 			SetError("Could not create an audio converter instance", ret);
+@@ -203,10 +203,11 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		}
+ 	}
+
++	av_channel_layout_uninit(&output_channel_layout);
++
+ 	m_opened = true;
+-	m_finished = false;
+-	m_got_frame = 0;
+-	m_nb_packets = 0;
++	m_has_more_packets = true;
++	m_has_more_frames = true;
+ 	m_decode_error = 0;
+
+ 	return true;
+@@ -214,6 +215,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+
+ inline void FFmpegAudioReader::Close() {
+ 	av_frame_free(&m_frame);
++	av_packet_free(&m_packet);
+
+ 	m_stream_index = -1;
+
+@@ -252,91 +254,98 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
+ 		return false;
+ 	}
+
++	*data = nullptr;
++	*size = 0;
++
+ 	int ret;
++	bool needs_packet = false;
+ 	while (true) {
+-		while (m_packet.size <= 0) {
+-			av_packet_unref(&m_packet0);
+-			av_init_packet(&m_packet);
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			ret = av_read_frame(m_format_ctx, &m_packet);
++		while (needs_packet && m_packet->size == 0) {
++			ret = av_read_frame(m_format_ctx, m_packet);
+ 			if (ret < 0) {
+ 				if (ret == AVERROR_EOF) {
+-					m_finished = true;
++					needs_packet = false;
++					m_has_more_packets = false;
+ 					break;
+-				} else {
++				}
++				SetError("Error reading from the audio source", ret);
++				return false;
++			}
++			if (m_packet->stream_index == m_stream_index) {
++				needs_packet = false;
++			} else {
++				av_packet_unref(m_packet);
++			}
++		}
++
++		if (m_packet->size != 0) {
++			ret = avcodec_send_packet(m_codec_ctx, m_packet);
++			if (ret < 0) {
++				if (ret != AVERROR(EAGAIN)) {
+ 					SetError("Error reading from the audio source", ret);
+ 					return false;
+ 				}
+-			}
+-			m_packet0 = m_packet;
+-			if (m_packet.stream_index != m_stream_index) {
+-				m_packet.data = nullptr;
+-				m_packet.size = 0;
+ 			} else {
+-				m_nb_packets++;
++				av_packet_unref(m_packet);
+ 			}
+ 		}
+
+-		ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet);
++		ret = avcodec_receive_frame(m_codec_ctx, m_frame);
+ 		if (ret < 0) {
+-			if (m_decode_error) {
+-				SetError("Error decoding audio frame", m_decode_error);
+-				return false;
++			if (ret == AVERROR_EOF) {
++				m_has_more_frames = false;
++			} else if (ret == AVERROR(EAGAIN)) {
++				if (m_has_more_packets) {
++					needs_packet = true;
++					continue;
++				} else {
++					m_has_more_frames = false;
++				}
+ 			}
+-			m_decode_error = ret;
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			continue;
++			SetError("Error decoding the audio source", ret);
++			return false;
+ 		}
+
+-		break;
+-	}
+-
+-	m_decode_error = 0;
+-
+-	const int decoded = std::min(ret, m_packet.size);
+-	m_packet.data += decoded;
+-	m_packet.size -= decoded;
+-
+-	if (m_got_frame) {
+-		if (m_converter) {
+-			if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
+-				int linsize;
+-				av_freep(&m_convert_buffer[0]);
+-				m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
+-				ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
+-				if (ret < 0) {
+-					SetError("Couldn't allocate audio converter buffer", ret);
++		if (m_frame->nb_samples > 0) {
++			if (m_converter) {
++				if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
++					int linsize;
++					av_freep(&m_convert_buffer[0]);
++					m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
++					ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
++					if (ret < 0) {
++						SetError("Couldn't allocate audio converter buffer", ret);
++						return false;
++					}
++				}
++				auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
++				if (nb_samples < 0) {
++					SetError("Couldn't convert audio", ret);
+ 					return false;
+ 				}
+-			}
+-			auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			}
+-			*data = (const int16_t *) m_convert_buffer[0];
+-			*size = nb_samples;
+-		} else {
+-			*data = (const int16_t *) m_frame->data[0];
+-			*size = m_frame->nb_samples;
+-		}
+-	} else {
+-		if (m_finished && m_converter) {
+-			auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			} else if (nb_samples > 0) {
+-				m_got_frame = 1;
+ 				*data = (const int16_t *) m_convert_buffer[0];
+ 				*size = nb_samples;
++			} else {
++				*data = (const int16_t *) m_frame->data[0];
++				*size = m_frame->nb_samples;
++			}
++		} else {
++			if (m_converter) {
++				if (IsFinished()) {
++					auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
++					if (nb_samples < 0) {
++						SetError("Couldn't convert audio", ret);
++						return false;
++					} else if (nb_samples > 0) {
++						*data = (const int16_t *) m_convert_buffer[0];
++						*size = nb_samples;
++					}
++				}
+ 			}
+ 		}
+-	}
+
+-	return true;
++		return true;
++	}
+ }
+
+ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index a2b517b..123e643 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -38,6 +38,12 @@ set(SRCS
+
+ if(BUILD_TOOLS)
+ 	set(SRCS ${SRCS} ../src/audio/ffmpeg_audio_reader_test.cpp)
++    include_directories(
++        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
++        ${AUDIO_PROCESSOR_INCLUDE_DIRS}
++    )
+ 	link_libraries(fpcalc_libs)
+ endif()
+
+-- 
+2.38.1
+
+
diff --git a/srcpkgs/chromaprint/template b/srcpkgs/chromaprint/template
index 7ef7838949f3..1f7bbc70a22c 100644
--- a/srcpkgs/chromaprint/template
+++ b/srcpkgs/chromaprint/template
@@ -1,7 +1,7 @@
 # Template file for 'chromaprint'
 pkgname=chromaprint
 version=1.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TOOLS=ON"
 make_check_target="check"

From 9e4e947234cb8e7263f32f9cae011580f5adcdbb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 028/104] chromium: revbump for ffmpeg-5.1.2

---
 srcpkgs/chromium/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 3c1c1caf3765..1f28cde5d3c1 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,7 +2,7 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=111.0.5563.64
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
  $(vopt_if clang "clang lld llvm12")

From 18abf622bb68f61edec6963e1a24551e27d3d124 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 029/104] cmus: revbump for ffmpeg-5.1.2

---
 srcpkgs/cmus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cmus/template b/srcpkgs/cmus/template
index 0fcb424ce336..05b77d0fecae 100644
--- a/srcpkgs/cmus/template
+++ b/srcpkgs/cmus/template
@@ -1,7 +1,7 @@
 # Template file for 'cmus'
 pkgname=cmus
 version=2.10.0
-revision=1
+revision=2
 build_style=configure
 configure_args="prefix=/usr LD=$CC"
 hostmakedepends="pkg-config"

From e8436c1931d9d30179f4732d2f25e11af7f03370 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 030/104] cyanrip: revbump for ffmpeg-5.1.2

---
 srcpkgs/cyanrip/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cyanrip/template b/srcpkgs/cyanrip/template
index 9796e3461601..5db30e020d17 100644
--- a/srcpkgs/cyanrip/template
+++ b/srcpkgs/cyanrip/template
@@ -1,7 +1,7 @@
 # Template file for 'cyanrip'
 pkgname=cyanrip
 version=0.9.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="ffmpeg-devel libcdio-devel libcdio-paranoia-devel libcurl-devel libmusicbrainz5-devel"

From 0c956fd8d26c30ea7781ddce40d5982a794f8b6e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 031/104] deadbeef: revbump for ffmpeg4-4.4.3

---
 srcpkgs/deadbeef/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/deadbeef/template b/srcpkgs/deadbeef/template
index b664bb1b9bd9..165b3c7b9cad 100644
--- a/srcpkgs/deadbeef/template
+++ b/srcpkgs/deadbeef/template
@@ -1,14 +1,14 @@
 # Template file for 'deadbeef'
 pkgname=deadbeef
 version=1.8.8
-revision=1
+revision=2
 create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-oss --disable-lfm --disable-notify --disable-gtk2"
 hostmakedepends="automake libtool gettext gettext-devel intltool pkg-config
  yasm clang glib-devel"
 makedepends="
- alsa-lib-devel dbus-devel faad2-devel ffmpeg-devel gtk+3-devel imlib2-devel
+ alsa-lib-devel dbus-devel faad2-devel ffmpeg4-devel gtk+3-devel imlib2-devel
  jansson-devel libcddb-devel libcdio-devel libcurl-devel libflac-devel
  libmad-devel libpng-devel libsamplerate-devel libsndfile-devel libvorbis-devel
  libzip-devel mpg123-devel opusfile-devel pulseaudio-devel wavpack-devel"

From 3130ed38a8080cbfe5975b84ab88222697af02f1 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 032/104] dolphin-emu: revbump for ffmpeg-5.1.2

---
 srcpkgs/dolphin-emu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/dolphin-emu/template b/srcpkgs/dolphin-emu/template
index 7ea197ceb2a8..7aeb0a5b645e 100644
--- a/srcpkgs/dolphin-emu/template
+++ b/srcpkgs/dolphin-emu/template
@@ -1,7 +1,7 @@
 # Template file for 'dolphin-emu'
 pkgname=dolphin-emu
 version=5.0.16101
-revision=1
+revision=2
 _dolphin_commit=8ecfa537a242de74d2e372e30d9d79b14584b2fb
 _mgba_commit=40d4c430fc36caeb7ea32fd39624947ed487d2f2
 #Version/hash pair can be found at https://dolphin-emu.org/download/

From fd9b397ef6d94c6c3abaa24125c0ca72bc8bda46 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 033/104] droidcam-obs-plugin: revbump for ffmpeg-5.1.2

---
 srcpkgs/droidcam-obs-plugin/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/droidcam-obs-plugin/template b/srcpkgs/droidcam-obs-plugin/template
index fc9c9bf6b9d5..fb0480754df4 100644
--- a/srcpkgs/droidcam-obs-plugin/template
+++ b/srcpkgs/droidcam-obs-plugin/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam-obs-plugin'
 pkgname=droidcam-obs-plugin
 version=2.0.1
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=yes
 make_build_args="ALLOW_STATIC=no"

From 5931c6f74d31170d49dda86dbbda112ece4e0b7b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 034/104] droidcam: revbump for ffmpeg-5.1.2

---
 srcpkgs/droidcam/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/droidcam/template b/srcpkgs/droidcam/template
index 1c3f1b8b1fc6..32a9220b79a4 100644
--- a/srcpkgs/droidcam/template
+++ b/srcpkgs/droidcam/template
@@ -1,7 +1,7 @@
 # Template file for 'droidcam'
 pkgname=droidcam
 version=1.8.2
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="USBMUXD=-lusbmuxd-2.0 JPEG=-lturbojpeg"
 hostmakedepends="pkg-config"

From 135dad7d377d12c3846360b26b359601ed9bd34f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:46 -0400
Subject: [PATCH 035/104] electron19: revbump for ffmpeg-5.1.2

---
 srcpkgs/electron19/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/electron19/template b/srcpkgs/electron19/template
index 068136be7623..32ce301e730c 100644
--- a/srcpkgs/electron19/template
+++ b/srcpkgs/electron19/template
@@ -1,7 +1,7 @@
 # Template file for 'electron19'
 pkgname=electron19
 version=19.0.8
-revision=2
+revision=3
 _nodever=16.14.2
 _chromiumver=102.0.5005.125
 archs="x86_64* aarch64* ppc64le*"

From 84aaba0447d6c29574a8ec1403c0afbe04af0cf3 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 036/104] ffmpegthumbnailer: revbump for ffmpeg4-4.4.3

---
 srcpkgs/ffmpegthumbnailer/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/ffmpegthumbnailer/template b/srcpkgs/ffmpegthumbnailer/template
index 039eea7622b3..8546bef3e868 100644
--- a/srcpkgs/ffmpegthumbnailer/template
+++ b/srcpkgs/ffmpegthumbnailer/template
@@ -1,16 +1,16 @@
 # Template file for 'ffmpegthumbnailer'
 pkgname=ffmpegthumbnailer
 version=2.2.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="libpng-devel libjpeg-turbo-devel ffmpeg-devel"
-depends="ffmpeg"
+makedepends="libpng-devel libjpeg-turbo-devel ffmpeg4-devel"
+depends="ffmpeg4"
 short_desc="Lightweight video thumbnailer"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
-homepage="https://github.com/dirkvdb/${pkgname}"
-distfiles="${homepage}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
+homepage="https://github.com/dirkvdb"
+distfiles="${homepage}/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
 checksum=1cb24059c38223f657b300c84dd80491b7040d4b69471c4fea69be862bc99b5b
 
 post_install() {

From 0a569736c2a75ee2c7e19fabee1bdfd0bbf49fa1 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 037/104] ffmpegthumbs: revbump for ffmpeg4-4.4.3

---
 srcpkgs/ffmpegthumbs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ffmpegthumbs/template b/srcpkgs/ffmpegthumbs/template
index 5f0b9414dada..944a78fbc96c 100644
--- a/srcpkgs/ffmpegthumbs/template
+++ b/srcpkgs/ffmpegthumbs/template
@@ -1,11 +1,11 @@
 # Template file for 'ffmpegthumbs'
 pkgname=ffmpegthumbs
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules kcoreaddons kconfig-devel
  pkg-config qt5-host-tools qt5-qmake gettext"
-makedepends="qt5-devel kio-devel ffmpeg-devel taglib-devel"
+makedepends="qt5-devel kio-devel ffmpeg4-devel taglib-devel"
 short_desc="FFmpeg-based thumbnail creator for video files"
 maintainer="Michael Straube <straubem@gmx.de>"
 license="GPL-2.0-or-later"

From bab367641e819e57632a2a2705d57c890c13e699 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 038/104] ffms2: revbump for ffmpeg-5.1.2

---
 srcpkgs/ffms2/patches/ffmpeg5.patch | 424 ++++++++++++++++++++++++++++
 srcpkgs/ffms2/template              |   2 +-
 2 files changed, 425 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ffms2/patches/ffmpeg5.patch

diff --git a/srcpkgs/ffms2/patches/ffmpeg5.patch b/srcpkgs/ffms2/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..1479fabcafcb
--- /dev/null
+++ b/srcpkgs/ffms2/patches/ffmpeg5.patch
@@ -0,0 +1,424 @@
+From 45673149e9a2f5586855ad472e3059084eaa36b1 Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:41:21 +0100
+Subject: [PATCH] Use auto for AVCodec
+
+The geniuses over at FFmpeg decided to constify this API, so old
+versions of the library will return AVCodec *, while new versions
+of the libary will return const AVCodec *, which, in C++, are not
+OK to convert between.
+
+Rather than use some macro hell in ffmscompat.h, we can work around
+this by using auto.
+
+Gross.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 2 +-
+ src/core/indexing.cpp    | 6 +++---
+ src/core/videosource.cpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index e4ce97c..ac09666 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -469,7 +469,7 @@ void FFMS_AudioSource::OpenFile() {
+ 
+     LAVFOpenFile(SourceFile.c_str(), FormatContext, TrackNumber);
+ 
+-    AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
++    auto *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id);
+     if (Codec == nullptr)
+         throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+             "Audio codec not found");
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index e547c5a..59fb4e8 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -384,7 +384,7 @@ FFMS_TrackType FFMS_Indexer::GetTrackType(int Track) {
+ }
+ 
+ const char *FFMS_Indexer::GetTrackCodec(int Track) {
+-    AVCodec *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
++    auto *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id);
+     return codec ? codec->name : nullptr;
+ }
+ 
+@@ -402,7 +402,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             UseDTS);
+ 
+         if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (!VideoCodec) {
+                 FormatContext->streams[i]->discard = AVDISCARD_ALL;
+                 IndexMask.erase(i);
+@@ -433,7 +433,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 IndexMask.insert(i);
+             }
+         } else if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+-            AVCodec *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
++            auto *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id);
+             if (AudioCodec == nullptr)
+                 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
+                     "Audio codec not found");
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index b889970..8956c22 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -171,7 +171,7 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in
+ 
+         LAVFOpenFile(SourceFile, FormatContext, VideoTrack);
+ 
+-        AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
++        auto *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id);
+         if (Codec == nullptr)
+             throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
+                 "Video codec not found");
+-- 
+2.40.0
+
+From 96cbf38ea9381829a1314f432a2c60495dcefaad Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:12:41 +0100
+Subject: [PATCH] all: Update AVPacket API usage
+
+AVPackets must all be on the heap now, since it is no longer
+part of the libav* ABI.
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ src/core/audiosource.cpp | 16 ++++++----
+ src/core/indexing.cpp    | 63 ++++++++++++++++++++++------------------
+ src/core/indexing.h      |  4 +--
+ src/core/utils.cpp       |  6 ----
+ src/core/utils.h         |  1 -
+ src/core/videosource.cpp | 30 ++++++++++---------
+ 6 files changed, 64 insertions(+), 56 deletions(-)
+
+diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp
+index 37cf9ae..e4ce97c 100644
+--- a/src/core/audiosource.cpp
++++ b/src/core/audiosource.cpp
+@@ -285,10 +285,15 @@ FFMS_AudioSource::AudioBlock *FFMS_AudioSource::CacheBlock(CacheIterator &pos) {
+ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     CurrentFrame = &Frames[PacketNumber];
+ 
+-    AVPacket Packet;
+-    if (!ReadPacket(&Packet))
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++    if (!ReadPacket(Packet)) {
++        av_packet_free(&Packet);
+         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_UNKNOWN,
+             "ReadPacket unexpectedly failed to read a packet");
++    }
+ 
+     // ReadPacket may have changed the packet number
+     CurrentFrame = &Frames[PacketNumber];
+@@ -297,8 +302,9 @@ int FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
+     int NumberOfSamples = 0;
+     AudioBlock *CachedBlock = nullptr;
+     
+-    int Ret = avcodec_send_packet(CodecContext, &Packet);
+-    av_packet_unref(&Packet);
++    int Ret = avcodec_send_packet(CodecContext, Packet);
++    av_packet_unref(Packet);
++    av_packet_free(&Packet);
+ 
+     av_frame_unref(DecodeFrame);
+     Ret = avcodec_receive_frame(CodecContext, DecodeFrame);
+@@ -513,8 +519,6 @@ void FFMS_AudioSource::Seek() {
+ }
+ 
+ bool FFMS_AudioSource::ReadPacket(AVPacket *Packet) {
+-    InitNullPacket(*Packet);
+-
+     while (av_read_frame(FormatContext, Packet) >= 0) {
+         if (Packet->stream_index == TrackNumber) {
+             // Required because not all audio packets, especially in ogg, have a pts. Use the previous valid packet's pts instead.
+diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp
+index 23fb95b..e547c5a 100644
+--- a/src/core/indexing.cpp
++++ b/src/core/indexing.cpp
+@@ -320,7 +320,7 @@ void FFMS_Indexer::CheckAudioProperties(int Track, AVCodecContext *Context) {
+     }
+ }
+ 
+-void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict,
++void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict,
+                                     int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct) {
+     if (VideoContext.Parser) {
+         uint8_t *OB;
+@@ -330,8 +330,8 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+         av_parser_parse2(VideoContext.Parser,
+             VideoContext.CodecContext,
+             &OB, &OBSize,
+-            pkt.data, pkt.size,
+-            pkt.pts, pkt.dts, pkt.pos);
++            pkt->data, pkt->size,
++            pkt->pts, pkt->dts, pkt->pos);
+ 
+         // H.264 (PAFF) and HEVC may have one field per packet, so we need to track
+         // when we have a full or half frame available, and mark one of them as
+@@ -351,15 +351,15 @@ void FFMS_Indexer::ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt
+ 
+         *RepeatPict = VideoContext.Parser->repeat_pict;
+         *FrameType = VideoContext.Parser->pict_type;
+-        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt.flags & AV_PKT_FLAG_DISCARD));
++        *Invisible = (IncompleteFrame || VideoContext.Parser->repeat_pict < 0 || (pkt->flags & AV_PKT_FLAG_DISCARD));
+     } else {
+-        *Invisible = !!(pkt.flags & AV_PKT_FLAG_DISCARD);
++        *Invisible = !!(pkt->flags & AV_PKT_FLAG_DISCARD);
+     }
+ 
+     if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP8)
+-        ParseVP8(pkt.data[0], Invisible, FrameType);
++        ParseVP8(pkt->data[0], Invisible, FrameType);
+     else if (VideoContext.CodecContext->codec_id == AV_CODEC_ID_VP9)
+-        ParseVP9(pkt.data[0], Invisible, FrameType);
++        ParseVP9(pkt->data[0], Invisible, FrameType);
+ }
+ 
+ void FFMS_Indexer::Free() {
+@@ -458,32 +458,36 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+         }
+     }
+ 
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
+     std::vector<int64_t> LastValidTS(FormatContext->nb_streams, AV_NOPTS_VALUE);
+ 
+     int64_t filesize = avio_size(FormatContext->pb);
+     enum AVPictureStructure LastPicStruct = AV_PICTURE_STRUCTURE_UNKNOWN;
+-    while (av_read_frame(FormatContext, &Packet) >= 0) {
++    while (av_read_frame(FormatContext, Packet) >= 0) {
+         // Update progress
+         // FormatContext->pb can apparently be NULL when opening images.
+         if (IC && FormatContext->pb) {
+-            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate))
++            if ((*IC)(FormatContext->pb->pos, filesize, ICPrivate)) {
++                av_packet_free(&Packet);
+                 throw FFMS_Exception(FFMS_ERROR_CANCELLED, FFMS_ERROR_USER,
+                     "Cancelled by user");
++            }
+         }
+-        if (!IndexMask.count(Packet.stream_index)) {
+-            av_packet_unref(&Packet);
++        if (!IndexMask.count(Packet->stream_index)) {
++            av_packet_unref(Packet);
+             continue;
+         }
+ 
+-        int Track = Packet.stream_index;
++        int Track = Packet->stream_index;
+         FFMS_Track &TrackInfo = (*TrackIndices)[Track];
+-        bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
++        bool KeyFrame = !!(Packet->flags & AV_PKT_FLAG_KEY);
+         ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
+ 
+         if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+-            int64_t PTS = TrackInfo.UseDTS ? Packet.dts : Packet.pts;
++            int64_t PTS = TrackInfo.UseDTS ? Packet->dts : Packet->pts;
+             if (PTS == AV_NOPTS_VALUE) {
+                 // VPx alt-refs are output as packets which lack timestmps or durations, since
+                 // they are invisible. Currently, the timestamp mangling code in libavformat
+@@ -495,9 +499,11 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 // FFMS2 currently sorts packets by PTS, which will break decoding, otherwise.
+                 bool HasAltRefs = (FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP8 ||
+                                    FormatContext->streams[Track]->codecpar->codec_id == AV_CODEC_ID_VP9);
+-                if (Packet.duration == 0 && !HasAltRefs)
++                if (Packet->duration == 0 && !HasAltRefs) {
++                    av_packet_free(&Packet);
+                     throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER,
+                         "Invalid packet pts, dts, and duration");
++                }
+ 
+                 if (TrackInfo.empty())
+                     PTS = 0;
+@@ -513,7 +519,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+             ParseVideoPacket(AVContexts[Track], Packet, &RepeatPict, &FrameType, &Invisible, &LastPicStruct);
+ 
+             TrackInfo.AddVideoFrame(PTS, RepeatPict, KeyFrame,
+-                FrameType, Packet.pos, Invisible);
++                FrameType, Packet->pos, Invisible);
+         } else if (FormatContext->streams[Track]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+             // For video seeking timestamps are used only if all packets have
+             // timestamps, while for audio they're used if any have timestamps,
+@@ -522,28 +528,29 @@ FFMS_Index *FFMS_Indexer::DoIndexing() {
+                 TrackInfo.HasTS = true;
+ 
+             int64_t StartSample = AVContexts[Track].CurrentSample;
+-            uint32_t SampleCount = IndexAudioPacket(Track, &Packet, AVContexts[Track], *TrackIndices);
++            uint32_t SampleCount = IndexAudioPacket(Track, Packet, AVContexts[Track], *TrackIndices);
+             TrackInfo.SampleRate = AVContexts[Track].CodecContext->sample_rate;
+ 
+             TrackInfo.AddAudioFrame(LastValidTS[Track],
+-                StartSample, SampleCount, KeyFrame, Packet.pos, Packet.flags & AV_PKT_FLAG_DISCARD);
++                StartSample, SampleCount, KeyFrame, Packet->pos, Packet->flags & AV_PKT_FLAG_DISCARD);
+         }
+ 
+-        if (!(Packet.flags & AV_PKT_FLAG_DISCARD))
+-            TrackInfo.LastDuration = Packet.duration;
++        if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
++            TrackInfo.LastDuration = Packet->duration;
+ 
+-        av_packet_unref(&Packet);
++        av_packet_unref(Packet);
+     }
++    av_packet_free(&Packet);
+ 
+     TrackIndices->Finalize(AVContexts, FormatContext->iformat->name);
+     return TrackIndices.release();
+ }
+ 
+-void FFMS_Indexer::ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS) {
+-    if (!UseDTS && Packet.pts != AV_NOPTS_VALUE)
+-        TS = Packet.pts;
++void FFMS_Indexer::ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS) {
++    if (!UseDTS && Packet->pts != AV_NOPTS_VALUE)
++        TS = Packet->pts;
+     if (TS == AV_NOPTS_VALUE)
+         UseDTS = true;
+-    if (UseDTS && Packet.dts != AV_NOPTS_VALUE)
+-        TS = Packet.dts;
++    if (UseDTS && Packet->dts != AV_NOPTS_VALUE)
++        TS = Packet->dts;
+ }
+diff --git a/src/core/indexing.h b/src/core/indexing.h
+index 3cfc3c3..5c06868 100644
+--- a/src/core/indexing.h
++++ b/src/core/indexing.h
+@@ -80,10 +80,10 @@ private:
+     int64_t Filesize;
+     uint8_t Digest[20];
+ 
+-    void ReadTS(const AVPacket &Packet, int64_t &TS, bool &UseDTS);
++    void ReadTS(const AVPacket *Packet, int64_t &TS, bool &UseDTS);
+     void CheckAudioProperties(int Track, AVCodecContext *Context);
+     uint32_t IndexAudioPacket(int Track, AVPacket *Packet, SharedAVContext &Context, FFMS_Index &TrackIndices);
+-    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket &pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
++    void ParseVideoPacket(SharedAVContext &VideoContext, AVPacket *pkt, int *RepeatPict, int *FrameType, bool *Invisible, enum AVPictureStructure *LastPicStruct);
+     void Free();
+ public:
+     FFMS_Indexer(const char *Filename);
+diff --git a/src/core/utils.cpp b/src/core/utils.cpp
+index ce67533..8a2e997 100644
+--- a/src/core/utils.cpp
++++ b/src/core/utils.cpp
+@@ -62,12 +62,6 @@ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo) {
+     }
+ }
+ 
+-void InitNullPacket(AVPacket &pkt) {
+-    av_init_packet(&pkt);
+-    pkt.data = nullptr;
+-    pkt.size = 0;
+-}
+-
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames) {
+     AP.SampleFormat = static_cast<FFMS_SampleFormat>(av_get_packed_sample_fmt(CTX->sample_fmt));
+     AP.BitsPerSample = av_get_bytes_per_sample(CTX->sample_fmt) * 8;
+diff --git a/src/core/utils.h b/src/core/utils.h
+index 9819dc7..003ab79 100644
+--- a/src/core/utils.h
++++ b/src/core/utils.h
+@@ -58,7 +58,6 @@ std::unique_ptr<T> make_unique(Args&&... args) {
+ }
+ 
+ void ClearErrorInfo(FFMS_ErrorInfo *ErrorInfo);
+-void InitNullPacket(AVPacket &pkt);
+ void FillAP(FFMS_AudioProperties &AP, AVCodecContext *CTX, FFMS_Track &Frames);
+ 
+ void LAVFOpenFile(const char *SourceFile, AVFormatContext *&FormatContext, int Track);
+diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
+index 06bd161..b889970 100644
+--- a/src/core/videosource.cpp
++++ b/src/core/videosource.cpp
+@@ -673,30 +673,34 @@ void FFMS_VideoSource::DecodeNextFrame(int64_t &AStartTime, int64_t &Pos) {
+     if (HasPendingDelayedFrames())
+         return;
+ 
+-    AVPacket Packet;
+-    InitNullPacket(Packet);
+-
+-    while (ReadFrame(&Packet) >= 0) {
+-        if (Packet.stream_index != VideoTrack) {
+-            av_packet_unref(&Packet);
++    AVPacket *Packet = av_packet_alloc();
++    if (!Packet)
++        throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_ALLOCATION_FAILED,
++            "Could not allocate packet.");
++
++    while (ReadFrame(Packet) >= 0) {
++        if (Packet->stream_index != VideoTrack) {
++            av_packet_unref(Packet);
+             continue;
+         }
+ 
+         if (AStartTime < 0)
+-            AStartTime = Frames.UseDTS ? Packet.dts : Packet.pts;
++            AStartTime = Frames.UseDTS ? Packet->dts : Packet->pts;
+ 
+         if (Pos < 0)
+-            Pos = Packet.pos;
++            Pos = Packet->pos;
+ 
+-        bool FrameFinished = DecodePacket(&Packet);
+-        av_packet_unref(&Packet);
+-        if (FrameFinished)
++        bool FrameFinished = DecodePacket(Packet);
++        av_packet_unref(Packet);
++        if (FrameFinished) {
++            av_packet_free(&Packet);
+             return;
++        }
+     }
+ 
+     // Flush final frames
+-    InitNullPacket(Packet);
+-    DecodePacket(&Packet);
++    DecodePacket(Packet);
++    av_packet_free(&Packet);
+ }
+ 
+ bool FFMS_VideoSource::SeekTo(int n, int SeekOffset) {
+-- 
+2.40.0
+
+From bf9e03e9e08534c024e5a744a6437c4aac160201 Mon Sep 17 00:00:00 2001
+From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+Date: Tue, 4 May 2021 14:20:47 +0100
+Subject: [PATCH 2/3] configure: Remove deprecated API use
+
+Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b35ef80bc..d19714d0f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,10 +102,10 @@ CFLAGS="$_CFLAGS $FFMPEG_CFLAGS"
+
+ AC_DEFUN([TEST_FFMPEG],
+          [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-            #include <libavcodec/avcodec.h>
++            #include <libavformat/avformat.h>
+             #include <libswscale/swscale.h>
+             ]],[[
+-                avcodec_register_all();
++                avformat_network_init();
+                 swscale_version();
+             ]])], [eval $1=yes], [eval $1=no])
+         ])
+
diff --git a/srcpkgs/ffms2/template b/srcpkgs/ffms2/template
index 68e8a0c14bce..2acfadac44b3 100644
--- a/srcpkgs/ffms2/template
+++ b/srcpkgs/ffms2/template
@@ -1,7 +1,7 @@
 # Template file for 'ffms2'
 pkgname=ffms2
 version=2.40
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--enable-shared --disable-static"
 hostmakedepends="pkg-config autoconf automake libtool"

From 501c8357e54882740a0eb19e88cf7c71ca658b37 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 039/104] freerdp: revbump for ffmpeg-5.1.2

---
 srcpkgs/freerdp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/freerdp/template b/srcpkgs/freerdp/template
index 53e67690f863..1b50e9a86bb2 100644
--- a/srcpkgs/freerdp/template
+++ b/srcpkgs/freerdp/template
@@ -1,7 +1,7 @@
 # Template file for 'freerdp'
 pkgname=freerdp
 version=2.9.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_ALSA=ON -DWITH_CUPS=OFF -DWITH_FFMPEG=ON
  -DWITH_GSTREAMER_0_10=OFF -DWITH_GSTREAMER_1_0=OFF -DWITH_JPEG=ON

From 64877b794febf27175bc79fd101a8cca384517ef Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 040/104] gerbera: revbump for ffmpeg-5.1.2

---
 srcpkgs/gerbera/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gerbera/template b/srcpkgs/gerbera/template
index ae14f35c767c..2dc0ac0ce03b 100644
--- a/srcpkgs/gerbera/template
+++ b/srcpkgs/gerbera/template
@@ -1,7 +1,7 @@
 # Template file for 'gerbera'
 pkgname=gerbera
 version=1.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_SYSTEMD=0 -DWITH_AVCODEC=1"
 hostmakedepends="pkg-config"

From a670109219a9f0151ba12031a888f336ed6ec743 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 041/104] goldendict: revbump for ffmpeg-5.1.2

---
 srcpkgs/goldendict/patches/ffmpeg4.patch |  21 --
 srcpkgs/goldendict/patches/ffmpeg5.patch | 232 +++++++++++++++++++++++
 srcpkgs/goldendict/template              |   4 +-
 3 files changed, 234 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/goldendict/patches/ffmpeg4.patch
 create mode 100644 srcpkgs/goldendict/patches/ffmpeg5.patch

diff --git a/srcpkgs/goldendict/patches/ffmpeg4.patch b/srcpkgs/goldendict/patches/ffmpeg4.patch
deleted file mode 100644
index f045fa27f54b..000000000000
--- a/srcpkgs/goldendict/patches/ffmpeg4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ffmpegaudio.cc.orig 2018-05-09 22:16:13.480659958 +0200
-+++ b/ffmpegaudio.cc      2018-05-09 22:16:50.748322790 +0200
-@@ -143,7 +143,7 @@
-     return false;
-   }
-
--  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
-+  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
-   if ( !avioBuffer )
-   {
-     errorString = QObject::tr( "av_malloc() failed." );
-@@ -380,7 +380,7 @@
-   }
-
-   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
--       codecContext_->codec->capabilities & CODEC_CAP_DELAY )
-+       codecContext_->codec->capabilities & AV_CODEC_CAP_DELAY )
-   {
-     av_init_packet( &packet );
-     int gotFrame = 0;
-
diff --git a/srcpkgs/goldendict/patches/ffmpeg5.patch b/srcpkgs/goldendict/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..7cfc98ada368
--- /dev/null
+++ b/srcpkgs/goldendict/patches/ffmpeg5.patch
@@ -0,0 +1,232 @@
+From 03bbe01b79a1f07a6780cb60f23a087104c5d77b Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 30 Mar 2018 22:53:24 +0300
+Subject: [PATCH] Fix warnings while compile with FFMpeg 3.4.2 (issue #978)
+
+---
+ ffmpegaudio.cc | 68 +++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 62 insertions(+), 6 deletions(-)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index ed1172bdd..56e8f788e 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -91,6 +91,7 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++  AVCodec * codec_;
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
+@@ -114,6 +115,7 @@ DecoderContext::DecoderContext( QByteArray const & audioData, QAtomicInt & isCan
+   audioData_( audioData ),
+   audioDataStream_( audioData_ ),
+   formatContext_( NULL ),
++  codec_( NULL ),
+   codecContext_( NULL ),
+   avioContext_( NULL ),
+   audioStream_( NULL ),
+@@ -143,7 +145,11 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 56 || ( LIBAVCODEC_VERSION_MAJOR == 56 && LIBAVCODEC_VERSION_MINOR < 56 )
+   unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
++#else
++  unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
++#endif
+   if ( !avioBuffer )
+   {
+     errorString = QObject::tr( "av_malloc() failed." );
+@@ -186,7 +192,11 @@ bool DecoderContext::openCodec( QString & errorString )
+   // Find audio stream, use the first audio stream if available
+   for ( unsigned i = 0; i < formatContext_->nb_streams; i++ )
+   {
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+     if ( formatContext_->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO )
++#else
++      if ( formatContext_->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO )
++#endif
+     {
+       audioStream_ = formatContext_->streams[i];
+       break;
+@@ -198,22 +208,38 @@ bool DecoderContext::openCodec( QString & errorString )
+     return false;
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+   codecContext_ = audioStream_->codec;
+-  AVCodec * codec = avcodec_find_decoder( codecContext_->codec_id );
+-  if ( !codec )
++  codec_ = avcodec_find_decoder( codecContext_->codec_id );
++  if ( !codec_ )
+   {
+     errorString = QObject::tr( "Codec [id: %1] not found." ).arg( codecContext_->codec_id );
+     return false;
+   }
++#else
++  codec_ = avcodec_find_decoder( audioStream_->codecpar->codec_id );
++  if ( !codec_ )
++  {
++    errorString = QObject::tr( "Codec [id: %1] not found." ).arg( audioStream_->codecpar->codec_id );
++    return false;
++  }
++  codecContext_ = avcodec_alloc_context3( codec_ );
++  if ( !codecContext_ )
++  {
++    errorString = QObject::tr( "avcodec_alloc_context3() failed." );
++    return false;
++  }
++  avcodec_parameters_to_context( codecContext_, audioStream_->codecpar );
++#endif
+
+-  ret = avcodec_open2( codecContext_, codec, NULL );
++  ret = avcodec_open2( codecContext_, codec_, NULL );
+   if ( ret < 0 )
+   {
+     errorString = QObject::tr( "avcodec_open2() failed: %1." ).arg( avErrorString( ret ) );
+     return false;
+   }
+
+-  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec->long_name,
++  av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec_->long_name,
+           codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
+   return true;
+ }
+@@ -252,10 +278,13 @@ void DecoderContext::closeCodec()
+
+   // Closing a codec context without prior avcodec_open2() will result in
+   // a crash in ffmpeg
+-  if ( audioStream_ && audioStream_->codec && audioStream_->codec->codec )
++  if ( audioStream_ && codecContext_ && codec_ )
+   {
+     audioStream_->discard = AVDISCARD_ALL;
+-    avcodec_close( audioStream_->codec );
++    avcodec_close( codecContext_ );
++#if LIBAVCODEC_VERSION_MAJOR > 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR >= 33 )
++    avcodec_free_context( &codecContext_ );
++#endif
+   }
+
+   avformat_close_input( &formatContext_ );
+@@ -356,6 +385,7 @@ bool DecoderContext::play( QString & errorString )
+     if ( packet.stream_index == audioStream_->index )
+     {
+       AVPacket pack = packet;
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+       int gotFrame = 0;
+       do
+       {
+@@ -370,6 +400,19 @@ bool DecoderContext::play( QString & errorString )
+         pack.data += len;
+       }
+       while( pack.size > 0 );
++#else
++      int ret = avcodec_send_packet( codecContext_, &pack );
++      /* read all the output frames (in general there may be any number of them) */
++      while( ret >= 0 )
++      {
++        ret = avcodec_receive_frame( codecContext_, frame);
++
++        if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++          break;
++
++        playFrame( frame );
++      }
++#endif
+     }
+     // av_free_packet() must be called after each call to av_read_frame()
+ #if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 )
+@@ -379,6 +422,7 @@ bool DecoderContext::play( QString & errorString )
+ #endif
+   }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+   if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
+        codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+   {
+@@ -391,6 +435,18 @@ bool DecoderContext::play( QString & errorString )
+       playFrame( frame );
+     }
+   }
++#else
++  /* flush the decoder */
++  av_init_packet( &packet );
++  int ret = avcodec_send_packet(codecContext_, &packet );
++  while( ret >= 0 )
++  {
++    ret = avcodec_receive_frame(codecContext_, frame);
++    if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++      break;
++    playFrame( frame );
++  }
++#endif
+
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+   av_free( frame );
+32
+srcpkgs/goldendict/patches/ffmpeg5-2.patch
+Comment on this file
+@@ -0,0 +1,32 @@
+From 966f4a8b78e6324b930e5a50f2bb930bd87e565e Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 27 Sep 2019 17:00:52 +0300
+Subject: [PATCH] FFmpeg player: Fix some crashes on broken files
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index 56e8f788e..415fc79cb 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -51,7 +51,9 @@ AudioService & AudioService::instance()
+
+ AudioService::AudioService()
+ {
++#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
+   av_register_all();
++#endif
+   ao_initialize();
+ }
+
+@@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
+ #else
+   /* flush the decoder */
+   av_init_packet( &packet );
++  packet.data = NULL;
++  packet.size = 0;
+   int ret = avcodec_send_packet(codecContext_, &packet );
+   while( ret >= 0 )
+   {
+25
+srcpkgs/goldendict/patches/ffmpeg5-3.patch
+Comment on this file
+@@ -0,0 +1,25 @@
+From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
+From: Liao Junxuan <mikeljx@126.com>
+Date: Sun, 20 Feb 2022 12:28:05 +0800
+Subject: [PATCH] add support for ffmpeg 5.0
+
+---
+ ffmpegaudio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index d550f4a77..7948d2187 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -94,7 +94,11 @@ struct DecoderContext
+   QByteArray audioData_;
+   QDataStream audioDataStream_;
+   AVFormatContext * formatContext_;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+   AVCodec * codec_;
++#else
++  const AVCodec * codec_;
++#endif
+   AVCodecContext * codecContext_;
+   AVIOContext * avioContext_;
+   AVStream * audioStream_;
diff --git a/srcpkgs/goldendict/template b/srcpkgs/goldendict/template
index f41b5b2c6899..2ca4185e538a 100644
--- a/srcpkgs/goldendict/template
+++ b/srcpkgs/goldendict/template
@@ -1,7 +1,7 @@
 # Template file for 'goldendict'
 pkgname=goldendict
 version=1.5.0RC2
-revision=5
+revision=6
 build_style=qmake
 configure_args="CONFIG+=zim_support"
 hostmakedepends="qt5-qmake pkg-config qt5-host-tools"
@@ -9,7 +9,7 @@ makedepends="tiff-devel qt5-devel libvorbis-devel zlib-devel
  libXtst-devel hunspell-devel qt5-tools-devel qt5-declarative-devel
  qt5-webkit-devel lzo-devel bzip2-devel libao-devel qt5-svg-devel
  libeb-devel qt5-x11extras-devel ffmpeg-devel liblzma-devel"
-short_desc="A feature-rich dictionary lookup program"
+short_desc="Feature-rich dictionary lookup program"
 maintainer="John <me@johnnynator.dev>"
 license="GPL-3.0-or-later"
 homepage="http://goldendict.org/"

From 17ee4894ccfd9a7a8c41fc27f83014dd7f46c1e1 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 042/104] gst-libav: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-libav/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-libav/template b/srcpkgs/gst-libav/template
index e9a79dc650a5..f082bd211c65 100644
--- a/srcpkgs/gst-libav/template
+++ b/srcpkgs/gst-libav/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-libav'
 pkgname=gst-libav
 version=1.20.3
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config yasm"
 makedepends="orc-devel gst-plugins-base1-devel ffmpeg-devel"

From d402108397d1a36c92b81fe5895f02a13a28bfbd Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 043/104] gst-plugins-bad1: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-plugins-bad1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index bb9c4d87f4c6..f55f82fd4c77 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.20.3
-revision=2
+revision=3
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled

From a506f9507cced6dc4fa60bb4360c71ce51209102 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 044/104] gst-rtsp-server: revbump for ffmpeg-5.1.2

---
 srcpkgs/gst-rtsp-server/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-rtsp-server/template b/srcpkgs/gst-rtsp-server/template
index 33cd64ceb95e..8ceea8d34b4b 100644
--- a/srcpkgs/gst-rtsp-server/template
+++ b/srcpkgs/gst-rtsp-server/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-rtsp-server'
 pkgname=gst-rtsp-server
 version=1.20.3
-revision=2
+revision=3
 build_style=meson
 hostmakedepends="pkg-config python3"
 makedepends="glib-devel gst-plugins-bad1-devel gobject-introspection

From a49d8af4d684b13a22df3b260d6d58b4e1ff711c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 045/104] gtk4: revbump for ffmpeg-5.1.2

---
 srcpkgs/gtk4/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 6a50567f53a9..6976aee84817 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
 # Template file for 'gtk4'
 pkgname=gtk4
 version=4.10.1
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dman-pages=true -Dgtk_doc=true

From f0ae9063c439fac5d9e9e0e747140afe92e907f8 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:47 -0400
Subject: [PATCH 046/104] guvcview: update to 2.0.8.

---
 srcpkgs/guvcview/patches/fix-include.patch | 10 ++++++++++
 srcpkgs/guvcview/template                  |  5 ++---
 2 files changed, 12 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/guvcview/patches/fix-include.patch

diff --git a/srcpkgs/guvcview/patches/fix-include.patch b/srcpkgs/guvcview/patches/fix-include.patch
new file mode 100644
index 000000000000..503c2af3b78c
--- /dev/null
+++ b/srcpkgs/guvcview/patches/fix-include.patch
@@ -0,0 +1,10 @@
+--- a/guvcview/guvcview.c
++++ b/guvcview/guvcview.c
+@@ -28,6 +28,7 @@
+ #include <sys/stat.h>
+ #include <sys/resource.h>
+ #include <errno.h>
++#include <locale.h>
+ 
+ #include "gview.h"
+ #include "gviewv4l2core.h"
diff --git a/srcpkgs/guvcview/template b/srcpkgs/guvcview/template
index 345cf6006f24..86a7fd619612 100644
--- a/srcpkgs/guvcview/template
+++ b/srcpkgs/guvcview/template
@@ -1,8 +1,7 @@
 # Template file for 'guvcview'
 pkgname=guvcview
-version=2.0.7
+version=2.0.8
 revision=1
-create_wrksrc=yes
 build_style=gnu-configure
 configure_args="--disable-static --disable-debian-menu"
 hostmakedepends="pkg-config intltool autoconf automake libtool glib-devel"
@@ -14,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://guvcview.sourceforge.net/"
 distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-src-${version}.tar.bz2"
-checksum=f47d51fbd06e44eeaa1a82f4a153c927527c90d94514197a70b2956028cc8ad4
+checksum=a21f4e448286666cf27bafef5290cc953a0a1796b752e5bbe521266dc1230c81
 
 post_patch() {
 	sed '31a#include <locale.h>' -i  guvcview/guvcview.c

From 6505fce17fd0767713eb06477c5a8d09c6797f74 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 047/104] handbrake: revbump for ffmpeg4-4.4.3

---
 srcpkgs/handbrake/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/handbrake/template b/srcpkgs/handbrake/template
index ca5e4571e49c..b44bc0822305 100644
--- a/srcpkgs/handbrake/template
+++ b/srcpkgs/handbrake/template
@@ -1,14 +1,14 @@
 # Template file for 'handbrake'
 pkgname=handbrake
 version=1.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--force --disable-gtk-update-checks --disable-df-fetch --harden
  $(vopt_enable fdk_aac fdk-aac) $(vopt_enable nvenc)"
 make_build_args="-C ${XBPS_TRIPLET}"
 make_install_args="-C ${XBPS_TRIPLET}"
 hostmakedepends="automake cmake gettext-devel glib-devel intltool libtool m4 meson nasm pkg-config python3"
-makedepends="bzip2-devel ffmpeg-devel gst-plugins-base1-devel gtk+3-devel
+makedepends="bzip2-devel ffmpeg4-devel gst-plugins-base1-devel gtk+3-devel
  jansson-devel lame-devel libass-devel libbluray-devel libdav1d-devel
  libdvdnav-devel libdvdread-devel libgudev-devel libnuma-devel
  libsamplerate-devel libtheora-devel libvorbis-devel libvpx-devel libxml2-devel

From ff1708d3182ddaef2420339b36be013c4576a968 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 048/104] hedgewars: revbump for ffmpeg4-4.4.3

---
 srcpkgs/hedgewars/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index 419f29b98b44..926fe4fe3e68 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,13 +1,13 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
  -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
 make_cmd=make
 hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
-makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
+makedepends="ffmpeg4-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
 depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"

From 88b0d57aa504013c7c1a66c2198bfec08e8b120d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 049/104] idjc: revbump for ffmpeg4-4.4.3

---
 srcpkgs/idjc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/idjc/template b/srcpkgs/idjc/template
index df60318b3db9..36a75baf597c 100644
--- a/srcpkgs/idjc/template
+++ b/srcpkgs/idjc/template
@@ -1,11 +1,11 @@
 # Template file for 'idjc'
 pkgname=idjc
 version=0.9.1
-revision=3
+revision=4
 build_style=gnu-configure
 hostmakedepends="pkg-config git python3 automake gettext-devel libtool"
 makedepends="libvorbis-devel libogg-devel jack-devel libsamplerate-devel
- libflac-devel libsndfile-devel mpg123-devel ffmpeg-devel speex-devel
+ libflac-devel libsndfile-devel mpg123-devel ffmpeg4-devel speex-devel
  glib-devel pixman-devel lame-devel python3-gobject-devel libshout-idjc-devel
  opus-devel twolame-devel python3-mutagen python3-devel"
 depends="python3-gobject python3-mutagen desktop-file-utils shared-mime-info python3-dbus jack"

From 88ca2b733d686d6f59eb5c38fdf1b2638b743c92 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 050/104] kfilemetadata5: revbump for ffmpeg-5.1.2

---
 srcpkgs/kfilemetadata5/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kfilemetadata5/template b/srcpkgs/kfilemetadata5/template
index 83f4d583bcb7..b90ef056a196 100644
--- a/srcpkgs/kfilemetadata5/template
+++ b/srcpkgs/kfilemetadata5/template
@@ -1,7 +1,7 @@
 # Template file for 'kfilemetadata5'
 pkgname=kfilemetadata5
 version=5.103.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="kcoreaddons extra-cmake-modules pkg-config qt5-host-tools qt5-qmake
  gettext kcoreaddons python3"

From aa32c06728c26aa44ea39e10b576538776114e9b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 051/104] kid3: revbump for ffmpeg-5.1.2

---
 srcpkgs/kid3/patches/ffmpeg5.patch | 17 +++++++++++++++++
 srcpkgs/kid3/template              |  2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/kid3/patches/ffmpeg5.patch

diff --git a/srcpkgs/kid3/patches/ffmpeg5.patch b/srcpkgs/kid3/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..135fc50e07c9
--- /dev/null
+++ b/srcpkgs/kid3/patches/ffmpeg5.patch
@@ -0,0 +1,17 @@
+# https://aur.archlinux.org/cgit/aur.git/diff/ffmpeg5.patch?h=kid3-cli&id=12410a74906612e7efc0ec8fbce739b4a0fef7e7
+diff --git a/src/plugins/acoustidimport/ffmpegfingerprintdecoder.cpp b/src/plugins/acoustidimport/ffmpegfingerprintdecoder.cpp
+index e156d424..e12b9abd 100644
+--- a/src/plugins/acoustidimport/ffmpegfingerprintdecoder.cpp
++++ b/src/plugins/acoustidimport/ffmpegfingerprintdecoder.cpp
+@@ -232,7 +232,11 @@ private:
+   friend class Format;
+   friend class Converter;
+   AVCodecContext* m_ptr;
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 0)
+   AVCodec* m_impl;
++#else
++  const AVCodec* m_impl;
++#endif
+   AVFrame* m_frame;
+   bool m_opened;
+ };
diff --git a/srcpkgs/kid3/template b/srcpkgs/kid3/template
index 456206d90e16..f32f9decb0e7 100644
--- a/srcpkgs/kid3/template
+++ b/srcpkgs/kid3/template
@@ -1,7 +1,7 @@
 # Template file for 'kid3'
 pkgname=kid3
 version=3.9.1
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DWITH_APPS='CLI;$(vopt_if KDE KDE Qt)'
  -DWITH_DOCBOOKDIR=/usr/share/xsl/docbook -DWITH_FLAC=$(vopt_if flac ON OFF)

From 745cfb5ed5657ea37cea5c6cb276f1e313b5af51 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 052/104] kodi: revbump for ffmpeg4-4.4.3

---
 srcpkgs/kodi/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kodi/template b/srcpkgs/kodi/template
index 8057964d78a3..6cc1874be7ba 100644
--- a/srcpkgs/kodi/template
+++ b/srcpkgs/kodi/template
@@ -1,7 +1,7 @@
 # Template file for 'kodi'
 pkgname=kodi
 version=19.4
-revision=6
+revision=7
 _codename="Matrix"
 build_style=cmake
 configure_args="-DWITH_FFMPEG=/usr -DENABLE_LDGOLD=OFF
@@ -54,7 +54,7 @@ makedepends="
  libmad-devel fontconfig-devel libXinerama-devel libsamplerate-devel libmms-devel
  enca-devel boost-devel libcurl-devel libva-devel libvdpau-devel libass-devel
  libbluetooth-devel yajl-devel libplist-devel librtmp-devel tinyxml-devel
- taglib-devel libcap-devel lame-devel libbluray-devel libnfs-devel ffmpeg-devel
+ taglib-devel libcap-devel lame-devel libbluray-devel libnfs-devel ffmpeg4-devel
  giflib-devel libxslt-devel gnutls-devel libssh-devel libmicrohttpd-devel
  libcec-devel dcadec-devel flatbuffers-devel fmt-devel lcms2-devel
  libfstrcmp-devel rapidjson libcdio-paranoia spdlog libwaylandpp-devel

From 25daf206299857f17b715c968811ffc6effd3d46 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 053/104] kpipewire: revbump for ffmpeg-5.1.2

---
 srcpkgs/kpipewire/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kpipewire/template b/srcpkgs/kpipewire/template
index 1d1e963f296d..07cdc0c7384a 100644
--- a/srcpkgs/kpipewire/template
+++ b/srcpkgs/kpipewire/template
@@ -1,7 +1,7 @@
 # Template file for 'kpipewire'
 pkgname=kpipewire
 version=5.27.2
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules plasma-wayland-protocols gettext
  qt5-qmake qt5-host-tools pkg-config wayland-devel kcoreaddons

From 825e5affb590db9fec04fcff095723c220acfe8d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 054/104] libextractor: revbump for ffmpeg4-4.4.3

---
 srcpkgs/libextractor/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libextractor/template b/srcpkgs/libextractor/template
index 29d5b8df01f8..1fb9ca56a96a 100644
--- a/srcpkgs/libextractor/template
+++ b/srcpkgs/libextractor/template
@@ -1,13 +1,13 @@
 # Template file for 'libextractor'
 pkgname=libextractor
 version=1.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static"
 hostmakedepends="pkg-config"
 makedepends="zlib-devel bzip2-devel exiv2-devel tiff-devel libpng-devel
  libjpeg-turbo-devel libvorbis-devel libflac-devel giflib-devel libmpeg2-devel
- ffmpeg-devel gtk+3-devel libltdl-devel libarchive-devel file-devel libgsf-devel"
+ ffmpeg4-devel gtk+3-devel libltdl-devel libarchive-devel file-devel libgsf-devel"
 short_desc="Library used to extract meta data from files"
 maintainer="Martin Riese <grauehaare@gmx.de>"
 license="GPL-3.0-or-later"

From 2d6f8351ef754319cafb31099ad17b05ae8959bb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 055/104] libopenal: revbump for ffmpeg-5.1.2

---
 srcpkgs/libopenal/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libopenal/template b/srcpkgs/libopenal/template
index 77218f9e539d..3f49ed75a1fd 100644
--- a/srcpkgs/libopenal/template
+++ b/srcpkgs/libopenal/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenal'
 pkgname=libopenal
 version=1.22.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DALSOFT_EXAMPLES=OFF"
 hostmakedepends="pkg-config"

From 4ebca73cd916bdbf472df9f920e0282abb67bf9e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 056/104] libopenshot: revbump for ffmpeg-5.1.2

---
 srcpkgs/libopenshot/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template
index db831f69b474..81aa0d7136d9 100644
--- a/srcpkgs/libopenshot/template
+++ b/srcpkgs/libopenshot/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenshot'
 pkgname=libopenshot
 version=0.3.0
-revision=1
+revision=2
 build_style=cmake
 # Builds fail with Ruby-2.4.1
 configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON"

From 9cf0913eb6e86dd9abdc90b09919f5a5dc7f966e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 057/104] loudgain: revbump for ffmpeg-5.1.2

---
 srcpkgs/loudgain/patches/ffmpeg5.patch | 11 +++++++++++
 srcpkgs/loudgain/template              |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/ffmpeg5.patch

diff --git a/srcpkgs/loudgain/patches/ffmpeg5.patch b/srcpkgs/loudgain/patches/ffmpeg5.patch
new file mode 100644
index 000000000000..16d4510ee98f
--- /dev/null
+++ b/srcpkgs/loudgain/patches/ffmpeg5.patch
@@ -0,0 +1,11 @@
+--- a/src/scan.c	2019-09-06 11:31:19.000000000 -0400
++++ b/src/scan.c	2023-03-23 11:15:40.867968521 -0400
+@@ -69,8 +69,6 @@
+ 	 * It is now useless
+ 	 * https://github.com/FFmpeg/FFmpeg/blob/70d25268c21cbee5f08304da95be1f647c630c15/doc/APIchanges#L86
+ 	 */
+-  if (avformat_version() < AV_VERSION_INT(58,9,100))
+-    av_register_all();
+ 
+ 	av_log_set_callback(scan_av_log);
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index da4f2d56e94c..4d6bf29efb4f 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"

From 8b5db67605b1899e04c74e4afa26793daa961fcf Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 058/104] mediastreamer: revbump for ffmpeg4-4.4.3

---
 srcpkgs/mediastreamer/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/mediastreamer/template b/srcpkgs/mediastreamer/template
index d0e97e858e29..1bde031443a5 100644
--- a/srcpkgs/mediastreamer/template
+++ b/srcpkgs/mediastreamer/template
@@ -1,11 +1,11 @@
 # Template file for 'mediastreamer'
 pkgname=mediastreamer
 version=5.2.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_STRICT=0 -DENABLE_UNIT_TESTS=0"
 hostmakedepends="python3"
-makedepends="bzrtp-devel ffmpeg-devel glew-devel libXv-devel libsrtp-devel
+makedepends="bzrtp-devel ffmpeg4-devel glew-devel libXv-devel libsrtp-devel
  libupnp-devel libvpx-devel mbedtls-devel opus-devel ortp-devel pulseaudio-devel
  libtheora-devel speex-devel v4l-utils-devel bcg729-devel bcmatroska2-devel libgsm-devel"
 # zxing-cpp-devel (1.2.0 probably not compatible, check again after updaing xzing)

From 5aba5ca6bd317be24e7d42705026fa57f96dee2e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 059/104] mgba: revbump for ffmpeg-5.1.2

---
 srcpkgs/mgba/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mgba/template b/srcpkgs/mgba/template
index 05bca15c1750..f5b6b8464428 100644
--- a/srcpkgs/mgba/template
+++ b/srcpkgs/mgba/template
@@ -1,7 +1,7 @@
 # Template file for 'mgba'
 pkgname=mgba
 version=0.10.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake desktop-file-utils"
 makedepends="SDL2-devel ffmpeg-devel libedit-devel libepoxy-devel libmagick-devel

From 4d0944377f81bdadb2412b8852a54330c7b6d813 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:48 -0400
Subject: [PATCH 060/104] minidlna: revbump for ffmpeg-5.1.2

---
 srcpkgs/minidlna/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/minidlna/template b/srcpkgs/minidlna/template
index e8081b1cbc67..9ee9714861fd 100644
--- a/srcpkgs/minidlna/template
+++ b/srcpkgs/minidlna/template
@@ -1,7 +1,7 @@
 # Template file for 'minidlna'
 pkgname=minidlna
 version=1.3.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --sbindir=/usr/bin

From 8c4fd30b58fdeecc3349a4d804370b98a866735d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 061/104] mixxx: revbump for ffmpeg-5.1.2

---
 srcpkgs/mixxx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template
index 619ddca0d332..4b9ea00d3fb3 100644
--- a/srcpkgs/mixxx/template
+++ b/srcpkgs/mixxx/template
@@ -1,7 +1,7 @@
 # Template file for 'mixxx'
 pkgname=mixxx
 version=2.3.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="extra-cmake-modules pkg-config protobuf qt5-host-tools qt5-devel"

From 7363bf4e819e73014b3c7ad550247ead0f927b7e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 062/104] mlt: revbump for ffmpeg4-4.4.3

---
 srcpkgs/mlt/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/mlt/template b/srcpkgs/mlt/template
index 8933eb4e7bb9..73353fedafb5 100644
--- a/srcpkgs/mlt/template
+++ b/srcpkgs/mlt/template
@@ -1,14 +1,14 @@
 # Template file for 'mlt'
 pkgname=mlt
 version=6.26.1
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --libdir=/usr/lib$XBPS_TARGET_WORDSIZE
  --enable-gpl --enable-gpl3 --disable-swfdec --without-kde
  --swig-languages=python"
 hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which"
 # XXX: movit vid.stab
-makedepends="alsa-lib-devel ffmpeg-devel gtk+-devel jack-devel ladspa-sdk
+makedepends="alsa-lib-devel ffmpeg4-devel gtk+-devel jack-devel ladspa-sdk
  libexif-devel libsamplerate-devel libxml2-devel sox-devel SDL_image-devel
  fftw-devel frei0r-plugins python3-devel pulseaudio-devel movit-devel
  libvidstab-devel libatomic-devel"

From 2f47871558238b6916ee016e56191e78f00ddc57 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 063/104] mlt7: revbump for ffmpeg-5.1.2

---
 srcpkgs/mlt7/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mlt7/template b/srcpkgs/mlt7/template
index e5972cc0411b..d0e9ec02e58a 100644
--- a/srcpkgs/mlt7/template
+++ b/srcpkgs/mlt7/template
@@ -1,7 +1,7 @@
 # Template file for 'mlt7'
 pkgname=mlt7
 version=7.12.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSWIG_PYTHON=ON"
 hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which

From e5e58940ad55ca9b56c524fdc01f977518aff365 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 064/104] moc: revbump for ffmpeg4-4.4.3

---
 srcpkgs/moc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/moc/template b/srcpkgs/moc/template
index c42be650a1d2..d4f0eefbad52 100644
--- a/srcpkgs/moc/template
+++ b/srcpkgs/moc/template
@@ -1,10 +1,10 @@
 # Template file for 'moc'
 pkgname=moc
 version=2.5.2
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="pkg-config"
-makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg-devel
+makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg4-devel
  jack-devel alsa-lib-devel libltdl-devel libflac-devel libvorbis-devel
  libmad-devel libmpcdec-devel libmodplug-devel libid3tag-devel faad2-devel
  taglib-devel libsndfile-devel wavpack-devel speex-devel libsamplerate-devel

From bee9a717ce78d0b9fe8125902ea22f58f316fe30 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 065/104] motion: revbump for ffmpeg-5.1.2

---
 srcpkgs/motion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/motion/template b/srcpkgs/motion/template
index 3cf3c3035c5b..7dca12d851e3 100644
--- a/srcpkgs/motion/template
+++ b/srcpkgs/motion/template
@@ -1,7 +1,7 @@
 # Template file for 'motion'
 pkgname=motion
 version=4.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake pkg-config gettext-devel tar"
 makedepends="ffmpeg-devel libmicrohttpd-devel v4l-utils-devel gettext-devel"

From f896ca3cec18633f3ace4aff755fd019e57c6f73 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 066/104] mpd: revbump for ffmpeg-5.1.2

---
 srcpkgs/mpd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mpd/template b/srcpkgs/mpd/template
index 63701b7d56b1..df35e751ea60 100644
--- a/srcpkgs/mpd/template
+++ b/srcpkgs/mpd/template
@@ -1,7 +1,7 @@
 # Template file for 'mpd'
 pkgname=mpd
 version=0.23.12
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true
  -Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled

From 7edbe1bb7df57bb729e237add9218a7e1e52fdc9 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 067/104] mpv: revbump for ffmpeg-5.1.2

---
 srcpkgs/mpv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mpv/template b/srcpkgs/mpv/template
index e163c496c6eb..d4fefbf5e3c7 100644
--- a/srcpkgs/mpv/template
+++ b/srcpkgs/mpv/template
@@ -1,7 +1,7 @@
 # Template file for 'mpv'
 pkgname=mpv
 version=0.35.1
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled
  -Dlibmpv=true -Dcplugins=enabled

From 2795bdfa671fb81d6c11cf56f60a9b52fd743367 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 068/104] musikcube: revbump for ffmpeg-5.1.2

---
 srcpkgs/musikcube/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template
index 4b7930041126..7cd65cf76b77 100644
--- a/srcpkgs/musikcube/template
+++ b/srcpkgs/musikcube/template
@@ -1,7 +1,7 @@
 # Template file for 'musikcube'
 pkgname=musikcube
 version=0.99.4
-revision=1
+revision=2
 build_style=cmake
 make_cmd=make
 configure_args="-DNO_NCURSESW=1"

From 4f49ec358cafa18c887f2c9bd8797c428099754d Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 069/104] notcurses: revbump for ffmpeg-5.1.2

---
 srcpkgs/notcurses/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/notcurses/template b/srcpkgs/notcurses/template
index 6dd8a091319f..3110c30c9aff 100644
--- a/srcpkgs/notcurses/template
+++ b/srcpkgs/notcurses/template
@@ -1,7 +1,7 @@
 # Template file for 'notcurses'
 pkgname=notcurses
 version=3.0.9
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_STATIC=ON $(vopt_bool man USE_PANDOC)"
 hostmakedepends="pkg-config $(vopt_if man pandoc)"

From 227b04566976e806e65330cc1849ee2fd37cd22c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 070/104] obs: revbump for ffmpeg-5.1.2

---
 srcpkgs/obs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/obs/template b/srcpkgs/obs/template
index 1a7132ae832f..078feba62bbb 100644
--- a/srcpkgs/obs/template
+++ b/srcpkgs/obs/template
@@ -1,7 +1,7 @@
 # Template file for 'obs'
 pkgname=obs
 version=29.0.2
-revision=1
+revision=2
 archs="i686* x86_64* ppc64le* aarch64*"
 build_style=cmake
 configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON

From 16747efb9605d9c3cfed45bade3dcc7406c806e0 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 071/104] olive: revbump for ffmpeg4-4.4.3

---
 srcpkgs/olive/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/olive/template b/srcpkgs/olive/template
index 12a46936c990..5c2917b9c512 100644
--- a/srcpkgs/olive/template
+++ b/srcpkgs/olive/template
@@ -1,10 +1,10 @@
 # Template file for 'olive'
 pkgname=olive
 version=0.1.2
-revision=2
+revision=3
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools pkg-config"
-makedepends="qt5-devel qt5-multimedia-devel qt5-svg-devel ffmpeg-devel frei0r-plugins"
+makedepends="qt5-devel qt5-multimedia-devel qt5-svg-devel ffmpeg4-devel frei0r-plugins"
 short_desc="Non-linear video editor"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"

From 21b4e22597332c835d90f399a186d9a2ed65662a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:49 -0400
Subject: [PATCH 072/104] omxplayer: revbump for ffmpeg4-4.4.3

---
 srcpkgs/omxplayer/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/omxplayer/template b/srcpkgs/omxplayer/template
index e70bf7873d4d..c835103d8789 100644
--- a/srcpkgs/omxplayer/template
+++ b/srcpkgs/omxplayer/template
@@ -1,10 +1,10 @@
 # Template file for 'omxplayer'
 pkgname=omxplayer
 version=20190102
-revision=1
+revision=2
 short_desc="Commandline OMX player for the Raspberry Pi"
 maintainer="Orphaned <orphan@voidlinux.org>"
-license="GPL-2"
+license="GPL-2-or-later"
 homepage="https://github.com/popcornmix/omxplayer"
 
 _commit="f06235cc9690a6d58187514452df8cf8fcdaacec"
@@ -15,7 +15,7 @@ checksum=af2d9450f8947842ea8c401fe9f71eec444013ebbdee29f2ac828c9c493c1329
 archs="armv6l* armv7l*"
 build_style=gnu-makefile
 hostmakedepends="curl pkg-config"
-makedepends="alsa-lib-devel rpi-userland-devel pcre-devel boost-devel freetype-devel ffmpeg-devel dbus-devel"
+makedepends="alsa-lib-devel rpi-userland-devel pcre-devel boost-devel freetype-devel ffmpeg4-devel dbus-devel"
 depends="freefont-ttf"
 
 do_build() {

From c3b2c1f9935cafe04a91929e938f23b947413292 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 073/104] openimageio: update to 2.4.8.1.

---
 common/shlibs                | 4 ++--
 srcpkgs/openimageio/template | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index a9d1c6a16ec6..9dae48fb9c07 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2251,8 +2251,8 @@ libgom-1.0.so.0 gom-0.3.0_1
 libetpan.so.20 libetpan-1.9.3_4
 libxmp.so.4 libxmp-4.3.7_1
 libKF5ThreadWeaver.so.5 threadweaver-5.26.0_1
-libOpenImageIO_Util.so.2.3 openimageio-2.3.18.0_1
-libOpenImageIO.so.2.3 openimageio-2.3.18.0_1
+libOpenImageIO_Util.so.2.4 openimageio-2.4.8.1_1
+libOpenImageIO.so.2.4 openimageio-2.4.8.1_1
 libOpenColorIO.so.2.1 opencolorio-2.1.2_1
 libpystring.so.1 pystring-1.1.3_1
 libyaml-cpp.so.0.7 yaml-cpp-0.7.0_1
diff --git a/srcpkgs/openimageio/template b/srcpkgs/openimageio/template
index cc9d7a33984e..079861ef5fe9 100644
--- a/srcpkgs/openimageio/template
+++ b/srcpkgs/openimageio/template
@@ -1,6 +1,6 @@
 # Template file for 'openimageio'
 pkgname=openimageio
-version=2.3.18.0
+version=2.4.8.1
 revision=1
 build_style=cmake
 build_helper=qemu
@@ -18,7 +18,7 @@ license="BSD-3-Clause"
 homepage="https://sites.google.com/site/openimageio/home"
 changelog="https://raw.githubusercontent.com/OpenImageIO/oiio/release/CHANGES.md"
 distfiles="https://github.com/OpenImageIO/oiio/archive/v${version}.tar.gz"
-checksum=09c7fa0685fdb34f696f2e5d44c2ba2336b5ca6ad8851cb516575508fe06397a
+checksum=304be2f2c48ef88c41aa718311a15ef23117103eb96b8f7efe78b8467f18f8be
 # Runs checks even for features we disabled.
 make_check=no
 

From b00c138ed8ba07497503c600af58ca5fbf61531b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 074/104] openmw: revbump for ffmpeg-5.1.2

---
 srcpkgs/openmw/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openmw/template b/srcpkgs/openmw/template
index 5251a0283dc1..e3771c7aaf1a 100644
--- a/srcpkgs/openmw/template
+++ b/srcpkgs/openmw/template
@@ -1,7 +1,7 @@
 # Template file for 'openmw'
 pkgname=openmw
 version=0.47.0
-revision=4
+revision=5
 build_style=cmake
 _recast_commit=e75adf86f91eb3082220085e42dda62679f9a3ea
 _bullet_tag=3.17

From c6cc53fdf3c6e8e5fffc97474a0bf8a136a3c93a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 075/104] openshot: revbump for ffmpeg-5.1.2

---
 srcpkgs/openshot/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openshot/template b/srcpkgs/openshot/template
index 322717d40abc..c074e0338773 100644
--- a/srcpkgs/openshot/template
+++ b/srcpkgs/openshot/template
@@ -1,7 +1,7 @@
 # Template file for 'openshot'
 pkgname=openshot
 version=3.0.0
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3 python3-setuptools"
 makedepends="ffmpeg-devel python3-PyQt5"

From 3af6219c1f1e81cc4d0f41ddca70a5f73e113a4f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 076/104] opentoonz: revbump for ffmpeg-5.1.2

---
 srcpkgs/opentoonz/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/opentoonz/template b/srcpkgs/opentoonz/template
index ee9f7603f55f..3e81834ca0ed 100644
--- a/srcpkgs/opentoonz/template
+++ b/srcpkgs/opentoonz/template
@@ -1,7 +1,7 @@
 # Template file for 'opentoonz'
 pkgname=opentoonz
 version=1.6.0
-revision=2
+revision=3
 build_wrksrc="toonz/sources"
 build_style=cmake
 make_cmd=make

From 7e5ae36c40a7e77bac1694a1ea9a0b7c7b969eb0 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 077/104] pianobar: revbump for ffmpeg-5.1.2

---
 srcpkgs/pianobar/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pianobar/template b/srcpkgs/pianobar/template
index a9b29e91993f..81efcd122c4d 100644
--- a/srcpkgs/pianobar/template
+++ b/srcpkgs/pianobar/template
@@ -1,7 +1,7 @@
 # Template file for 'pianobar'
 pkgname=pianobar
 version=2022.04.01
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="V=1"
 hostmakedepends="pkg-config"

From 8cb3a9d2f10bacc0dd74364e908da703b0decdec Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 078/104] ppsspp: revbump for ffmpeg4-4.4.3

---
 srcpkgs/ppsspp/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/ppsspp/template b/srcpkgs/ppsspp/template
index 7984a733d4be..15a42fd2c993 100644
--- a/srcpkgs/ppsspp/template
+++ b/srcpkgs/ppsspp/template
@@ -1,7 +1,7 @@
 # Template file for 'ppsspp'
 pkgname=ppsspp
 version=1.14.4
-revision=1
+revision=2
 _glslang_commit=dc11adde23c455a24e13dd54de9b4ede8bdd7db8
 _SPIRV_Cross_commit=9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1
 _armips_commit=6719edebaae03330ee5441d9b28280672edf00d5
@@ -13,7 +13,7 @@ configure_args="-DHEADLESS=1 -DUSE_SYSTEM_FFMPEG=1 -DUNITTEST=ON
  -DUSING_QT_UI=$(vopt_if qt ON OFF) -DUSE_SYSTEM_ZSTD=ON
  -DARMIPS_USE_STD_FILESYSTEM=ON"
 hostmakedepends="pkg-config python3 $(vopt_if qt qt5-host-tools)"
-makedepends="zlib-devel glew-devel ffmpeg-devel libzip-devel
+makedepends="zlib-devel glew-devel ffmpeg4-devel libzip-devel
  snappy-devel rapidjson libpng-devel libzstd-devel
  $(vopt_if sdl2 SDL2-devel) $(vopt_if wayland wayland-devel)
  $(vopt_if qt 'qt5-devel qt5-multimedia-devel')"
@@ -62,13 +62,12 @@ post_extract() {
 	mv ${wrksrc}/miniupnp-${_miniupnp_commit} ${wrksrc}/ext/miniupnp
 }
 
-post_patch(){
+post_patch() {
 	# disable git versioning
 	vsed -e 's|find_package(Git)|# &|' -i git-version.cmake
 }
 
 do_install() {
-	vlicense LICENSE.TXT
 	vinstall icons/icon.svg 644 usr/share/pixmaps ppsspp.svg
 	vinstall Qt/PPSSPP.desktop 644 usr/share/applications
 	vbin build/PPSSPPHeadless ppsspp-headless

From 13431d5cbe1d2e99f1f1f2ae2021ea8cb7234a74 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 079/104] pqiv: revbump for ffmpeg-5.1.2

---
 srcpkgs/pqiv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pqiv/template b/srcpkgs/pqiv/template
index 542fc27a2d32..9308d949b6a1 100644
--- a/srcpkgs/pqiv/template
+++ b/srcpkgs/pqiv/template
@@ -1,7 +1,7 @@
 # Template file for 'pqiv'
 pkgname=pqiv
 version=2.12
-revision=1
+revision=2
 build_style=gnu-makefile
 hostmakedepends="pkg-config"
 makedepends="glib-devel gtk+3-devel $(vopt_if ffmpeg ffmpeg-devel)

From 310d7d5ed553478aaa8a200adf406770f8c666a6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 080/104] qmmp: revbump for ffmpeg-5.1.2

---
 srcpkgs/qmmp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qmmp/template b/srcpkgs/qmmp/template
index 26c661ed16be..a150d7441c7a 100644
--- a/srcpkgs/qmmp/template
+++ b/srcpkgs/qmmp/template
@@ -1,7 +1,7 @@
 # Template file for 'qmmp'
 pkgname=qmmp
 version=1.6.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_HAL:BOOL=FALSE -DQMMP_DEFAULT_UI:STRING=simple"
 hostmakedepends="pkg-config qt5-host-tools qt5-qmake"

From 7037d03d0a84e1d3391756ec890aa75ce6e083f6 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:50 -0400
Subject: [PATCH 081/104] qt5-webengine: revbump for ffmpeg4-4.4.3

---
 srcpkgs/qt5-webengine/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index f9d78eced929..be3c61933332 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
 version=5.15.11
-revision=1
+revision=2
 _version="${version}-lts"
 _chromium_commit=be349eaf62e77955791d7bf29f893f1e8a37daf4
 archs="x86_64* i686* armv[67]* ppc64* aarch64*"
@@ -19,7 +19,7 @@ hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config nodejs
  libjpeg-turbo-devel libpng-devel libwebp-devel freetype-devel
  harfbuzz-devel"
 makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel qt5-devel
- qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg4-devel
  libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
  libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
  jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel

From 9c9c28cc768e8e145425d7454572bec3148d239a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 082/104] qt5: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b22575103da4 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,10 +3,10 @@
 # revbump libqtxdg after bumping patch version
 pkgname=qt5
 version=5.15.7+20221119
+revision=2
+build_style=meta
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
-build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel

From 0f70d30ac73fb0f0c574470a8512cbab7854b0cd Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 083/104] qt6-multimedia: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt6-multimedia/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qt6-multimedia/template b/srcpkgs/qt6-multimedia/template
index d89e7d54eb5a..aae15e57ca7b 100644
--- a/srcpkgs/qt6-multimedia/template
+++ b/srcpkgs/qt6-multimedia/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-multimedia'
 pkgname=qt6-multimedia
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DQT_FEATURE_gstreamer=ON"
 hostmakedepends="perl qt6-declarative-host-tools pkg-config qt6-shadertools"

From adaacbe2088fa6787750a036f449d602c6d5c0b5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 084/104] qt6-webengine: revbump for ffmpeg-5.1.2

---
 srcpkgs/qt6-webengine/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qt6-webengine/template b/srcpkgs/qt6-webengine/template
index 99012732b53a..96846feaee83 100644
--- a/srcpkgs/qt6-webengine/template
+++ b/srcpkgs/qt6-webengine/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-webengine'
 pkgname=qt6-webengine
 version=6.4.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DQT_FEATURE_webengine_system_ffmpeg=ON

From db934791648067004d25ef1c0d00eab5a776cffb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 085/104] qtav: revbump for ffmpeg4-4.4.3

---
 srcpkgs/qtav/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtav/template b/srcpkgs/qtav/template
index 34c30b2c0c78..2d00ad104355 100644
--- a/srcpkgs/qtav/template
+++ b/srcpkgs/qtav/template
@@ -1,10 +1,10 @@
 # Template file for 'qtav'
 pkgname=qtav
 version=1.13.0
-revision=1
+revision=2
 build_style=qmake
 hostmakedepends="qt5-qmake qt5-host-tools"
-makedepends="ffmpeg-devel libass-devel libopenal-devel
+makedepends="ffmpeg4-devel libass-devel libopenal-devel
  libva-glx-devel libXv-devel pulseaudio-devel
  qt5-declarative-devel qt5-svg-devel
  qt5-quickcontrols"

From f05e31de3e5b3594b07c6c7311e9abf4fca122dd Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 086/104] qtox: revbump for ffmpeg-5.1.2

---
 srcpkgs/qtox/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/qtox/template b/srcpkgs/qtox/template
index 16019d7eaec9..5cea0b11b697 100644
--- a/srcpkgs/qtox/template
+++ b/srcpkgs/qtox/template
@@ -1,7 +1,7 @@
 # Template file for 'qtox'
 pkgname=qtox
 version=1.17.6
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DUPDATE_CHECK=OFF
  -DGIT_DESCRIBE=${version}

From 60adffd51913abb890862760b70fe6ecc7456a8c Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 087/104] retroarch: revbump for ffmpeg-5.1.2

---
 srcpkgs/retroarch/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/retroarch/template b/srcpkgs/retroarch/template
index 240d3df9db00..6d0b16ae2598 100644
--- a/srcpkgs/retroarch/template
+++ b/srcpkgs/retroarch/template
@@ -1,7 +1,7 @@
 # Template file for 'retroarch'
 pkgname=retroarch
 version=1.14.0
-revision=1
+revision=2
 build_style=configure
 configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking
  --enable-udev --disable-builtinflac --disable-builtinglslang

From 739450e65f46d9840779689ea8916087113972df Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 088/104] scrcpy: revbump for ffmpeg-5.1.2

---
 srcpkgs/scrcpy/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scrcpy/template b/srcpkgs/scrcpy/template
index ee6e698e387f..8ada5ca4323f 100644
--- a/srcpkgs/scrcpy/template
+++ b/srcpkgs/scrcpy/template
@@ -1,7 +1,7 @@
 # Template file for 'scrcpy'
 pkgname=scrcpy
 version=2.0
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dcompile_server=false
  -Dprebuilt_server=/usr/share/scrcpy/scrcpy-server-v${version}"

From 730885203963967bff07be81d06de5bbe0700f96 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 089/104] spek-alternative: revbump for ffmpeg4-4.4.3

---
 srcpkgs/spek-alternative/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/spek-alternative/template b/srcpkgs/spek-alternative/template
index d65086b8f008..05246f1b8d0c 100644
--- a/srcpkgs/spek-alternative/template
+++ b/srcpkgs/spek-alternative/template
@@ -1,11 +1,11 @@
 # Template file for 'spek-alternative'
 pkgname=spek-alternative
 version=0.8.2.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake gettext-devel intltool libtool pkg-config wxWidgets-common"
-makedepends="ffmpeg-devel wxWidgets-gtk3-devel"
-depends="ffmpeg"
+makedepends="ffmpeg4-devel wxWidgets-gtk3-devel"
+depends="ffmpeg4"
 short_desc="Acoustic spectrum analyser"
 maintainer="Kartik Singh <kartik.ynwa@gmail.com>"
 license="GPL-3.0-or-later"

From 756b1e3f6e2713f44fbf3e135fc1cbd1bfae905b Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 090/104] ssr: revbump for ffmpeg4-4.4.3

---
 srcpkgs/ssr/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ssr/template b/srcpkgs/ssr/template
index b055b9ec0774..3448ca110eb0 100644
--- a/srcpkgs/ssr/template
+++ b/srcpkgs/ssr/template
@@ -1,11 +1,11 @@
 # Template file for 'ssr'
 pkgname=ssr
 version=0.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_QT5=ON"
 hostmakedepends="pkg-config"
-makedepends="alsa-lib-devel ffmpeg-devel glu-devel jack-devel pulseaudio-devel
+makedepends="alsa-lib-devel ffmpeg4-devel glu-devel jack-devel pulseaudio-devel
  qt5-tools-devel qt5-x11extras-devel libXinerama-devel v4l-utils-devel"
 depends="desktop-file-utils hicolor-icon-theme"
 short_desc="Simple Screen Recorder for programs and games"

From 7fc41c8d94889983a046abbd98a52af237ea3ceb Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:51 -0400
Subject: [PATCH 091/104] sumo: revbump for ffmpeg-5.1.2

---
 srcpkgs/sumo/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template
index 0f9b9ec815f5..a3fe134aa5ac 100644
--- a/srcpkgs/sumo/template
+++ b/srcpkgs/sumo/template
@@ -1,7 +1,7 @@
 # Template file for 'sumo'
 pkgname=sumo
 version=1.12.0
-revision=5
+revision=6
 build_style=cmake
 hostmakedepends="libgdal-tools pkg-config swig python3-setuptools"
 makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel

From d45f87bec195badfe813b84047218b224151e64f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 092/104] synfig: revbump for ffmpeg4-4.4.3

---
 srcpkgs/synfig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template
index 182dc3cd280f..1b34edbb5a38 100644
--- a/srcpkgs/synfig/template
+++ b/srcpkgs/synfig/template
@@ -2,12 +2,12 @@
 # Should be kept in sync with 'synfigstudio' and 'ETL'
 pkgname=synfig
 version=1.4.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib"
 hostmakedepends="boost-build ImageMagick pkg-config intltool"
 makedepends="ETL gettext-devel libxml++-devel mlt-devel libmagick-devel
- libmng-devel boost-build boost-devel libopenexr-devel ffmpeg-devel"
+ libmng-devel boost-build boost-devel libopenexr-devel ffmpeg4-devel"
 depends="ImageMagick"
 short_desc="CLI 2D vector and timeline-based animation software"
 maintainer="Orphaned <orphan@voidlinux.org>"

From 268d64ab225d5f7a1396e79d7df6bdef991b645f Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 093/104] telegram-desktop: revbump for ffmpeg-5.1.2

---
 srcpkgs/telegram-desktop/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index aae9f3135100..7943b36f0b8a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=4.6.5
-revision=1
+revision=2
 build_style=cmake
 build_helper="qemu"
 configure_args="-DTDESKTOP_API_ID=209235

From 86de34d9b2ab281848e34609adbbcd7bc5da80ea Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 094/104] tg_owt: revbump for ffmpeg-5.1.2

---
 srcpkgs/tg_owt/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tg_owt/template b/srcpkgs/tg_owt/template
index 97d195ddb34a..551614b24956 100644
--- a/srcpkgs/tg_owt/template
+++ b/srcpkgs/tg_owt/template
@@ -1,7 +1,7 @@
 # Template file for 'tg_owt'
 pkgname=tg_owt
 version=0.0.0.20230107
-revision=1
+revision=2
 _commit=5098730b9eb6173f0b52068fe2555b7c1015123a
 _libyuv_commit=00950840d1c9bcbb3eb6ebc5aac5793e71166c8b
 _abseil_commit=8c0b94e793a66495e0b1f34a5eb26bd7dc672db0

From 59606a8d5384814e51ba01ae58dcc63540d5ba0a Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 095/104] timg: revbump for ffmpeg-5.1.2

---
 srcpkgs/timg/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/timg/template b/srcpkgs/timg/template
index 91f1516b2597..334443d3f9bb 100644
--- a/srcpkgs/timg/template
+++ b/srcpkgs/timg/template
@@ -1,7 +1,7 @@
 # Template file for 'timg'
 pkgname=timg
 version=1.4.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWITH_OPENSLIDE_SUPPORT=off -Wno-dev"
 hostmakedepends="pkg-config git"

From a22ff15d1cd3f23c78365ea84eb2ce0a06f97c0e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 096/104] tracker-miners: revbump for ffmpeg-5.1.2

---
 srcpkgs/tracker-miners/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index 3e7966c2b4a9..285425ba1851 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.4.3
-revision=1
+revision=2
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss

From 89a4d8309c12bf1809058a945c5a305865018e39 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 097/104] tvheadend: revbump for ffmpeg4-4.4.3

---
 srcpkgs/tvheadend/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/tvheadend/template b/srcpkgs/tvheadend/template
index e6b16d7ccf3b..46b52b6fb7f9 100644
--- a/srcpkgs/tvheadend/template
+++ b/srcpkgs/tvheadend/template
@@ -1,14 +1,14 @@
 # Template file for 'tvheadend'
 pkgname=tvheadend
 version=4.2.8
-revision=6
+revision=7
 build_style=gnu-configure
 configure_args="--enable-dvbscan --disable-ffmpeg_static
 --disable-hdhomerun_static --disable-bintray_cache --disable-libx264_static
 --disable-libx265_static --disable-libvpx_static --disable-libtheora_static
 --disable-libvorbis_static --disable-libfdkaac_static"
 hostmakedepends="gettext pkg-config python git which"
-makedepends="avahi-libs-devel openssl-devel zlib-devel libcurl-devel ffmpeg-devel"
+makedepends="avahi-libs-devel openssl-devel zlib-devel libcurl-devel ffmpeg4-devel"
 short_desc="TV streaming server"
 maintainer="lemmi <lemmi@nerd2nerd.org>"
 license="GPL-3.0-only"

From d49e007ba639de99761cc14ef244c6f73a1a33ea Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 098/104] unpaper: update to 7.0.0.

---
 srcpkgs/unpaper/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/unpaper/template b/srcpkgs/unpaper/template
index 38ed47a58401..1ff910e722af 100644
--- a/srcpkgs/unpaper/template
+++ b/srcpkgs/unpaper/template
@@ -1,13 +1,13 @@
 # Template file for 'unpaper'
 pkgname=unpaper
-version=6.1
-revision=3
-build_style=gnu-configure
+version=7.0.0
+revision=1
+build_style=meson
+hostmakedepends="pkg-config meson libxslt"
+makedepends="ffmpeg-devel python3-Sphinx"
+short_desc="Post-processing tool for scanned sheets of paper"
 maintainer="Orphaned <orphan@voidlinux.org>"
-hostmakedepends="pkg-config libxslt"
-makedepends="ffmpeg-devel"
-license="GPL-2"
+license="GPL-2.0-or-later"
 homepage="https://www.flameeyes.eu/projects/unpaper"
-short_desc="A post-processing tool for scanned sheets of paper"
 distfiles="https://www.flameeyes.eu/files/${pkgname}-${version}.tar.xz"
-checksum=237c84f5da544b3f7709827f9f12c37c346cdf029b1128fb4633f9bafa5cb930
+checksum=2575fbbf26c22719d1cb882b59602c9900c7f747118ac130883f63419be46a80

From 5daefe2b8a104084c695bba0e5acb9ffde97fd56 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 099/104] vba-m: revbump for ffmpeg-5.1.2

---
 srcpkgs/vba-m/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/vba-m/template b/srcpkgs/vba-m/template
index ba153e0b58ca..aa6093645e97 100644
--- a/srcpkgs/vba-m/template
+++ b/srcpkgs/vba-m/template
@@ -2,7 +2,7 @@
 pkgname=vba-m
 reverts=1292_2
 version=2.1.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GTK=TRUE -DENABLE_FFMPEG=TRUE -DENABLE_LINK=TRUE -DCMAKE_BUILD_TYPE=Release"
 hostmakedepends="gettext pkg-config unzip zip yasm wxWidgets-gtk3-devel"

From bdd37310a5b95add16632c6718488d18ad5fb3e1 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 100/104] vice: revbump for ffmpeg4-4.4.3

---
 srcpkgs/vice/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/vice/template b/srcpkgs/vice/template
index 0924767cfcfb..5981e45149d0 100644
--- a/srcpkgs/vice/template
+++ b/srcpkgs/vice/template
@@ -1,7 +1,7 @@
 # Template file for 'vice'
 pkgname=vice
 version=3.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
 	$(vopt_enable sdl2 sdlui2)
@@ -28,7 +28,7 @@ makedepends="
 	$(vopt_if gtk3 gtk+3-devel)
 	$(vopt_if gtk3 pulseaudio-devel)
 	$(vopt_if gtk3 pango-devel)
-	$(vopt_if ffmpeg ffmpeg-devel)"
+	$(vopt_if ffmpeg ffmpeg4-devel)"
 short_desc="Emulator for C64, C128, CBM-II, PET, VIC20, Plus4 and C16"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"

From 700701b07e4b34b24d7b0ce6fb4977ea8203baaa Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 101/104] waypipe: revbump for ffmpeg-5.1.2

---
 srcpkgs/waypipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/waypipe/template b/srcpkgs/waypipe/template
index 5c4161900060..1a46fe27f7d8 100644
--- a/srcpkgs/waypipe/template
+++ b/srcpkgs/waypipe/template
@@ -1,7 +1,7 @@
 # Template file for 'waypipe'
 pkgname=waypipe
 version=0.8.4
-revision=1
+revision=2
 build_style=meson
 # lto is off because it causes linking errors in armv6l and armv7l (due to NEON)
 configure_args="-Dwerror=false -Dwith_dmabuf=enabled -Dwith_lz4=enabled

From 114f4ff52e3316031b703c8f281df7747f6f45e5 Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 102/104] wf-recorder: revbump for ffmpeg-5.1.2

---
 srcpkgs/wf-recorder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/wf-recorder/template b/srcpkgs/wf-recorder/template
index e278eb001600..5d014a5f28af 100644
--- a/srcpkgs/wf-recorder/template
+++ b/srcpkgs/wf-recorder/template
@@ -1,7 +1,7 @@
 # Template file for 'wf-recorder'
 pkgname=wf-recorder
 version=0.3.0
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config scdoc wayland-devel"
 makedepends="wayland-protocols wayland-devel ffmpeg-devel x264-devel

From bb4872ccb4658b1cb62e78768f76455e9b1589ea Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Wed, 22 Mar 2023 20:01:52 -0400
Subject: [PATCH 103/104] xpra: revbump for ffmpeg-5.1.2

---
 srcpkgs/xpra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xpra/template b/srcpkgs/xpra/template
index 38f83283b1e5..b6e01ff0a813 100644
--- a/srcpkgs/xpra/template
+++ b/srcpkgs/xpra/template
@@ -1,7 +1,7 @@
 # Template file for 'xpra'
 pkgname=xpra
 version=4.4.4
-revision=1
+revision=2
 build_style=python3-module
 make_build_args="--without-cuda_kernels --without-cuda_rebuild"
 make_install_args="$(vopt_with docs) ${make_build_args}"

From 19ddc645ee05caacaf6cb141f3a88b357fc5354e Mon Sep 17 00:00:00 2001
From: zlice <zlice555@gmail.com>
Date: Thu, 23 Mar 2023 10:57:47 -0400
Subject: [PATCH 104/104] openimagedenoise: revbump for openimageio 2.4.8.1

---
 srcpkgs/openimagedenoise/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openimagedenoise/template b/srcpkgs/openimagedenoise/template
index db5ccdb055cc..cb90045afb63 100644
--- a/srcpkgs/openimagedenoise/template
+++ b/srcpkgs/openimagedenoise/template
@@ -1,7 +1,7 @@
 # Template file for 'openimagedenoise'
 pkgname=openimagedenoise
 version=1.4.3
-revision=1
+revision=2
 archs="x86_64*"
 build_style=cmake
 hostmakedepends="ispc python3"

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (18 preceding siblings ...)
  2023-03-23 19:52 ` zlice
@ 2023-03-23 20:01 ` zlice
  2023-03-23 20:02 ` zlice
                   ` (9 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-23 20:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1481817247

Comment:
K everything should be building except the few outliers I added to OP.

Also, should we change this message? `# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!` seems like anything with `ffmpeg-devel` and I'm not 100% convinced that covers it (ytmdl doesn't have 'devel' but ffmpeg in 'depends')

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (19 preceding siblings ...)
  2023-03-23 20:01 ` zlice
@ 2023-03-23 20:02 ` zlice
  2023-03-31 13:03 ` zlice
                   ` (8 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-23 20:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1481125289

Comment:
have a list of some packages that didn't build last night, i'll look at them today(?)

> For example, the new libswscale4 should be named libswscale5, the one splited from ffmpeg5 will be named libswscale6.

not sure what you mean, rename libxxx's to lib\*5 and have lib\*5 and lib\*4?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (20 preceding siblings ...)
  2023-03-23 20:02 ` zlice
@ 2023-03-31 13:03 ` zlice
  2023-03-31 13:03 ` zlice
                   ` (7 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-31 13:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1491895493

Comment:
fwiw, all ffmpeg5 packages seem to compile with a few extra patches for ffmpeg6

not sure if skipping 5 to 6 is fine (6 has all the av1 codec stuff i personally want)

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (21 preceding siblings ...)
  2023-03-31 13:03 ` zlice
@ 2023-03-31 13:03 ` zlice
  2023-04-04 13:18 ` zlice
                   ` (6 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-03-31 13:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1491895493

Comment:
fwiw, all ffmpeg5 packages seem to compile with a few extra patches for ffmpeg6

not sure if skipping 5 to 6 is fine (6 has all the av1 codec stuff i personally want)

note: still haven't gotten around to testing

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (22 preceding siblings ...)
  2023-03-31 13:03 ` zlice
@ 2023-04-04 13:18 ` zlice
  2023-04-04 14:47 ` zlice
                   ` (5 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-04-04 13:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1495959157

Comment:
installed ffmpeg6 last night https://github.com/zlice/void-packages/tree/ffmpeg6-split

chromium is the only exception so far i think

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (23 preceding siblings ...)
  2023-04-04 13:18 ` zlice
@ 2023-04-04 14:47 ` zlice
  2023-04-23 15:23 ` zlice
                   ` (4 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-04-04 14:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1495959157

Comment:
installed ffmpeg6 last night https://github.com/zlice/void-packages/tree/ffmpeg6-split

~~chromium is the only exception so far i think~~

chrome just needs flags i guess? `chromium --use-vulkan --enable-features=VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization --disable-features=UseChromeOSDirectVideoDecoder,UseSkiaRenderer --disable-reading-from-canvas --webgpu --ignore-gpu-blocklist --enable-raw-draw --disable-gpu-driver-workarounds --use-gl=egl` works for me

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (24 preceding siblings ...)
  2023-04-04 14:47 ` zlice
@ 2023-04-23 15:23 ` zlice
  2023-04-23 15:24 ` zlice
                   ` (3 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-04-23 15:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1519092301

Comment:
Have been running ffmpeg6 fine for a bit now, though on top of my `gstreamer` and `intel packages` PRs mentioned. Want to double check commits on the 6 branch even without gstreamer/intel changes.

This does touch a lot and is relying on other big changes. What should next steps be? (will probably make another PR with the 6 branch at some point)

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (25 preceding siblings ...)
  2023-04-23 15:23 ` zlice
@ 2023-04-23 15:24 ` zlice
  2023-05-05 13:20 ` [PR PATCH] [Closed]: " zlice
                   ` (2 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-04-23 15:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1519092301

Comment:
Have been running ffmpeg6 fine for a bit now, though on top of my `gstreamer` and `intel packages` PRs mentioned (switched intel stuff to oneVPL). Want to double check commits on the 6 branch even without gstreamer/intel changes.

This does touch a lot and is relying on other big changes. What should next steps be? (will probably make another PR with the 6 branch at some point)

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (27 preceding siblings ...)
  2023-05-05 13:20 ` [PR PATCH] [Closed]: " zlice
@ 2023-05-05 13:20 ` zlice
  2023-05-05 13:20 ` zlice
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-05-05 13:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1536253937

Comment:
Closing this in favor of https://github.com/void-linux/void-packages/pull/43761 I have been running ffmpeg6 for a month now.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Closed]: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (26 preceding siblings ...)
  2023-04-23 15:24 ` zlice
@ 2023-05-05 13:20 ` zlice
  2023-05-05 13:20 ` zlice
  2023-05-05 13:20 ` zlice
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-05-05 13:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4202 bytes --]

There's a closed pull request on the void-packages repository

draft: ffmpeg5 split
https://github.com/void-linux/void-packages/pull/42936

Description:
[ci skip]

#### Testing the changes

- I tested the changes in this PR: **YES**

~~I have conflicting changes from [intel packages](https://github.com/void-linux/void-packages/pull/41132) and don't want to mess with my system. If it makes sense I'll move these changes here like I originally intended. ffmpeg5 makes Intel vaapi easier and only rely on oneVPL iirc.~~

I do not use 80%+ of these packages. I may be able to run Blender, and I use shotcut.


#### New package

- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**



#### Local build testing

- I built this PR locally for my native architecture, **x86_64**


#### Discussion

Continuation of https://github.com/void-linux/void-packages/pull/36315 - thx tibequadorian :)

It was suggested to make `ffmpeg` version 5 and 'copy' (create a new?) `ffmpeg4` package, and that seems to work well.

As stated, I haven't and probably won't test most of these packages, hoping for others to voice in on what's working. 

A few months back (and now) afaict everything has been compiling with ffmpeg5 except for the few problem packages still using ffmpeg4 (below). Can add to the ffmpeg4 list as a incompatible package is found.

`libavresample` is deprecated, but marked as a dependency when trying to build other packages and install `ffmpeg`(5). I think the right way to handle this is make a meta package and the add to removals?

[gstreamer 1.22.1 updates](https://github.com/void-linux/void-packages/pull/42861) could go before this

##### Commit naming / misc

~~`ffpmeg4` isn't "new", not sure what the commit messages should be really for the 4 and 5 split. Additionally xlint complains about `ffmpeg4` revision being 3 and not 1 because it's a "new" package, I assume that's right but not sure.~~

~~Not sure how commits should be separated. ffmpeg4/5 could be split and all the rev bumps included (otherwise it's over 100 commits). opencv was updated to 4.7.0 for ffmpeg5 so I figured that should be a separate commit?~~

I wouldn't mind moving the [intel packages](https://github.com/void-linux/void-packages/pull/41132) into here under another commit. That just got a potential fix that may allow merging but I imagine moving to ffmpeg5 will change and even remove some of those packages. (I won't really test these changes without Intel vaapi either way.)

Maintainer for previous ffmpeg(4) was orphaned, I can put my name in there if that matters, though I don't exactly see myself keeping up on ffmpeg.


##### STILL FFMPEG4

These are a mix of emulators, games and/or older packages.

- attract (multiple patches in master)
- audacity  (3.2.x should work but void is missing some libs? vst3sdk?)
- ccextractor (master patches? no release)
- vice
- mlt
- synfig (mlt)
- tvheadend
- ssr
- spek-alternative
- ppsspp
- olive
- moc
- mediastreamer
- libextractor
- idjc
- hedgewars
- ~~handbrake~~
- ffmpegthumbnailer
- ffmpegthumbs
- deadbeef
- omxplayer
- qtav (fork has ffmpeg 5 patch - https://github.com/cmguo/QtAV)
- ~~qt5-webengine~~ (need patch and version bump. ~~may work? if not gentoo has a patch? https://bugs.gentoo.org/831487~~)
- `vlc` (vlc4 will support ffmpeg5, there's a patch to build 3.x with ffmpeg5 but it will lack vaapi)
- `osg` (OpenSceneGraph plus `xine-lib`)
- `ytmdl` ? not sure but it uses `python3-ffmpeg-python` which being 6-8yr old I imagine is ffmpeg4


##### HAVE NOT BUILT YET (big-uns)

- omxplayer (rpi only?)
- kodi
- electron19
- ~~qt5-webengine~~ - some patches and version update
- ~~digikam~~ (qt5-webengine)
- ~~chromium~~ - ~~some patches but vaapi doesnt seem to be working~~ (use special flags)


##### UPDATED (for ffmpeg5)

- unpaper: update to 7.0.0.
- guvcview: update to 2.0.8.

- qt5: update to 5.15.8
- qt5-webengine: update to 5.18.13
- shiboken2: revbump for qt5.15.8 (patch)
- python3-pyside2: update to 5.15.8 (patch)


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: draft: ffmpeg5 split
  2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
                   ` (28 preceding siblings ...)
  2023-05-05 13:20 ` zlice
@ 2023-05-05 13:20 ` zlice
  29 siblings, 0 replies; 31+ messages in thread
From: zlice @ 2023-05-05 13:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/pull/42936#issuecomment-1536253937

Comment:
Closing this in favor of https://github.com/void-linux/void-packages/pull/43761 since I have been running ffmpeg6 for a month now.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2023-05-05 13:20 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 22:39 [PR PATCH] draft: ffmpeg5 split zlice
2023-03-22 22:54 ` [PR PATCH] [Updated] " zlice
2023-03-22 22:59 ` zlice
2023-03-22 23:08 ` paper42
2023-03-22 23:09 ` [PR REVIEW] " paper42
2023-03-22 23:10 ` paper42
2023-03-22 23:10 ` paper42
2023-03-22 23:11 ` paper42
2023-03-22 23:19 ` paper42
2023-03-22 23:20 ` paper42
2023-03-22 23:25 ` zlice
2023-03-22 23:25 ` zlice
2023-03-22 23:28 ` paper42
2023-03-22 23:33 ` [PR PATCH] [Updated] " zlice
2023-03-22 23:36 ` [PR REVIEW] " zlice
2023-03-23  0:15 ` [PR PATCH] [Updated] " zlice
2023-03-23  2:05 ` sgn
2023-03-23 12:39 ` zlice
2023-03-23 12:50 ` [PR PATCH] [Updated] " zlice
2023-03-23 19:52 ` zlice
2023-03-23 20:01 ` zlice
2023-03-23 20:02 ` zlice
2023-03-31 13:03 ` zlice
2023-03-31 13:03 ` zlice
2023-04-04 13:18 ` zlice
2023-04-04 14:47 ` zlice
2023-04-23 15:23 ` zlice
2023-04-23 15:24 ` zlice
2023-05-05 13:20 ` [PR PATCH] [Closed]: " zlice
2023-05-05 13:20 ` zlice
2023-05-05 13:20 ` zlice

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).