A library roof which has been hit by leak problems is set to be replaced