It wasn't just boycotts, however and unfortunately. The South African army was defeated militarily by FAPLA-Cuba. There's a reason why Nelson Mandela's first visit as chief of state was to thank Fidel Castro in person.
The history is a little more complicated than this…it is true that South Africa was eventually sanctioned by the US for its apartheid policies, and this helped lead to the end of apartheid. However, the US supported South Africa during much of the Cold War period as a bulwark against communism. Some US politicians were willing to look the other way when it came to apartheid before support for South Africa became increasingly politically difficult.