Heat the remaining two tablespoons of olive oil in a pan. Add the garlic and cook over a medium heat until soft - around 2 minutes.
Add the tomatoes, sugar, oregano and chilli flakes. Cook over a medium heat for around 20 minutes, stirring occasionally, until the sauce has thickened.
Meanwhile, put a pan of water on to boil for the pasta and cook as per the packet instructions.
When the sauce is thickened, add the eggplant and stir to mix well.
When the pasta is cooked, reserve a cup of the cooking water before draining.
Add the drained pasta to the tomato and eggplant sauce and stir to combine. If it is too thick, add a little of the pasta water.
Stir in the grated pecorino and chopped basil and serve.