If you want homemade calcium you can dissolve eggshells in vinegar and let it ferment. You can also use gypsum which is calcium sulfate, dissolve in water and water in.
For magnesium I would use brown rice flour, brown rice, or oats fermented in water. The fermentation helps make the minerals...