If you want to stay on stable branch, you need the corresponding PKGBUILD for stable branch (as of right now it is mesa 22.3.1-1
).
insert the line that include the codecs
-D microsoft-clc=disabled \
-D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc \
-D valgrind=enabled
…and build it.
makepkg -si