travis: Determine dependencies for each test dynamically

Since the installation of all packages alone takes several minutes this
should speed up testing quite a bit.