Preheat oven to 425°F Cook the pasta according to the package instructions. Drain well and return to the warm pan.
Heat the olive oil in a frying pan and when it is hot, but not smoking, cook the eggplant slices in batches for 2 minutes on each side until golden. Remove and place on paper towels. Repeat to cook all of the eggplant. Pour off all but 1 tablespoon of oil from the pan, add the onion and garlic and cook for 2-3 minutes, stirring often. Add the tomatoes, basil, red wine, 1 cup of water, sea salt and black pepper to taste and bring to a boil. Boil for 10 minutes, until you have a thickened sauce. Stir in the eggplant then add to the pasta and stir well.
Put the mixture in a large baking dish. Spoon the ricotta on top, sprinkle over the pecorino and bake in the preheated oven for 20 minutes until golden and crispy around the edges.