D-terms and supersymmetry breaking from branes