You need the older model speedo drive, with the cable in front.
Make sure if you find one, the cable turns clockwise.
Most speedo drives turn anti clockwise.
Fit the drive to the wheel with the drive output following the front fork tube, fit the speedo to its bracket. then measure between the two, the cable length doesn't alter with the fork action so the cable just needs to follow the front fork tube.
My notes on cables say 24 3/4" and 25" also depends if you have the early or late bracket, but as Tim says, best to measure on the bike, I have seen some cables that are way too long!
On the NOS speedo's, best check beforehand, if it turns freely, sometimes the grease is all hardened, and your nice new cable will break immediately you take it out for a test ride! best thing is to have it cleaned completely, and new lubricant added, you will lose the seal on the side, but what can you do? I once put an NOS speedo in the oven, at very low heat, and NOT upside down, as the grease/lubricant will drip on the inside of the glass, (don't ask how I know!) and everything might free up nicely. (no guarantees!)