Spectral gamma-ray signatures of cosmological dark matter annihilations