Move a variable definition from header to source file. This fixes the build on FreeBSD 13+. While we are at it, rename patches in accordance with makepatch conventions and add missing dependencies.