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

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 ` zlice
2023-05-05 13:20 ` [PR PATCH] [Closed]: " 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).