They just need to be careful how they draw the lines. SCOTUS has already ruled drawing lines to favor one party is NOT unconstitutional as long as it doesn't discriminate racially.
And remember, the only people who whine about gerrymandering are the people not drawing the lines.