Here's a pretty good article about the state of gerrymandering law and court decisions as of November 2016.
One thing it says that in recent court decisions shape is not enough. Partisan demographics and racial demographics are enough to determine that a gerrymander has happened to the point that a court can throw it out. I think this implicitly declares that in order to do it right the first time, these features of demography would have to be accounted for in the initial district drawing after a Census. Party affiliation isn't part of the Census, but it's State data in the voter registration files.
Designing districts towards demographic ends is at best gerrymandering for good or shoddy proportional representation.
I still think that if we want proportional representation then we should actually do that and not fake it with badly drawn districts. I think we need an answer to the question: what is a district for? I think it is for representing a locality or a region. But, in practice, maybe it's for electing a representative. And we want our representatives to follow our population; and that means some kind of proportionality. So, if locality or region doesn't matter, and we have to have districts, then draw the district however is needed to meet the demographic goals. And now my logic is eating its own tail and I'm back to the conclusion I started with, we want proportional representation, and we should do it right.