Lightly fry the onion in a little butter until softened.
Add the chopped mango slices and the finely chopped ginger followed by the vinegar and sugar. Stir until the sugar is dissolved.
I use an old device designed for making a single cup with loose tea but is very useful for adding pickling spices. Alternatively you can wrap the star anise, the cardamons and the seeds in a piece of muslin. Add to the pot along with a little salt and pepper and simmer until the mixture thickens, about 30 minutes.
Pour into a clean and sterilised jar and seal tightly.
Some may find this too hot so simply reduce the amount of curry powder.