I make this often though I do a few things differently. I don't ground the spices and I add curry powder (I make my own with turmeric, cumin, coriander seeds, and hot chili powder). Also, instead of putting the eggplant with the onions, I saute the onions until they are slightly brown and then add some tomatoes instead of tamarind. The mixture is cooked until tomatoes turn to mush and then I add eggplant. If adding tamarind, a bit of sugar is needed to counter the taste.
This is best served with naan bread or tandoori Roti with a plain lentil soup (split yellow peas boiled with salt and turmeric and then tempered with black mustard seeds and asafetida.)