Libya and North Korea were both exporters of terrorism at the time, such as the Lockerbie bombing and North Korea kidnapping Japanese off the beaches of Japan at night.
India had nukes before Pakistan, and built them because of China, not Pakistan. The order of development was:
US built them because of WW II, to beat Germany to them, and aid the War effort.
USSR, because US had them.
China, because USSR.
India, because China.
Pakistan, because India.