I’ve written a bunch of scripts to clone, build and package RetroArch for Slackware. You can use them to build one component at a time, or build them all at once.
https://github.com/duganchen/slackware-libretro
I don’t have scripts to build the mame2010 or ffmpeg cores. Everything else should be covered. I’ve tested them on both a well-used 64-bit multilib system, and on a clean 32-bit VM, both running 14.1.