Barcelona will sign Spain centre-back Eric Garcia on a contract until 2026 after his Manchester City contract expires next month.