FRAMINGHAM, Mass. — Staples to buy competitor Office Depot in deal that would create an office-supply giant.