For a permanent way to block out the sun within a 5 mile radius, the Spellcraft DC is 450 without Mitigating factors.

Because it's permanent, the DC for everything before duration is counted is 90, any increase here increases the total DC by 5. In order to destroy the sun, I'd assume you needed an Epic Spell with the DC of at least 1000.
If the sun is positive energy, based on it's ability to destroy certain undead, I'd guess this...

Negative Energy function of the Slay Seed.
250d4 Negative Levels (to hit at least 1000 levels of energy)
A range of up to 4965840000000 feet, to hit our sun.
Fortitude save DC is 1000 to compete with what I'd assume a star would have, not to beat, just be equal.
Caster Level check is also 1000 to compete with the Spell Resistance a star could have.

So, time to break down the Spellcraft DCs.
2d4 Negative Levels: 25
248d4 Negative Levels: 992
Increase Range from 300 feet to 4965840000000 feet: 33105599998
Increase Save by 950: 1900
Increase Caster Level check to overcome Spell Resistance: 1900
Final DC: 33105604815

And this only works if the sun fails it's Spell Resistance and Fortitude Save rolls. Also no mitigating factors were counted in creating this spell.

The development cost of this spell would be.
297950443335000gp
59590008867 days
11918017733400exp

Maybe a 40th Level Character shouldn't try casting this alone, or try getting some more levels first. Most of the DC for this Spell actually comes from the range and that's assuming the sun is on par with ours for how far away it is from our world. It can be done, but you'd better hope your DM brings it a little closer to the world and makes it into a mere burning ball of positive energy radiation. 1000d100 is a low amount as well, hopefully whoever's DMing will be as generous as I'm being, otherwise I don't see it being possible for a PC.