Cook up your batch of homemade Cal-Mag supplements, using Epsom Salts (magnesium sulfate) and Calcium nitrate (a common fertilizer).
The ideal ratio is two parts calcium to one part of magnesium. A safe homemade Cal-Mag concentration would be 380ppm, with 260ppm Calcium and 120ppm Magnesium.
For reference, you would need around 6g of calcium nitrate and 4.5g of Epsom salts per gallon of water.