Put the onions, ginger and oil in a large saucepan and gently cook for 15 mins until soft. Stir in the spices and curry leaves and fry for a few mins, then add the tomato purée and tamarind and fry for a few mins more.
Stir in the aubergines, raisins, sugar and vinegar. Heat gently until the sugar has dissolved, then simmer for 20 mins until the chutney has thickened. Leave for 10 mins, then spoon into sterilised jars and seal.