Preheat the oven to 200°C (400°F).
Slice the aubergines into 1-inch cubes and toss with olive oil, salt, and half the garlic.
Spread the aubergine cubes on a baking sheet and roast for 25-30 minutes until golden brown.
While the aubergines roast, cook the pasta according to package instructions until al dente.
In a large pan, heat olive oil over medium heat and sauté the remaining garlic until fragrant.
Add the canned tomatoes to the pan and break them up with a spoon; cook for about 15 minutes.
Stir in the roasted aubergines and simmer for an additional 5-10 minutes.
Combine the cooked pasta with the sauce, adding reserved pasta water as necessary for desired consistency.
Serve immediately, topped with dollops of ricotta and fresh basil leaves.