The issue of targeting many distros with different package versions is already solved by Valve's Steam Linux Runtime. They use namespaces/container to provide the same environment on any distro.
https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/b...