The cabal-extract is an auxiliary target that is intended to be run
interactively by the port developer. It populates Cabal cache and then tries
to fetch the main distribution file from Hackage package database. However,
some packages reside on GitHub and other hostings, in which case this target
fails. I modified it in such way that it does the usual make extract in this
case, but preserve Cabal cache.
I'm a but unsure about .if expresions I added. Maybe they can be made more concise?