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 for about half an hour or until the mixture thickens.
Pour into a clean and sterilised jar. and seal tightly.
Some may find this too hot so simply reduce the amount of curry powder.