Preheat the oven to 180º C. Make a crumble dough of butter, flour, cheese, pine nuts and a pinch of salt and put it in the fridge for 30 minutes. Meanwhile, place the tomato cubes in a sieve, sprinkle with some salt and drain well. Fry the onion in 1 tbsp olive oil. Mix the drained tomatoes with the sugar, garlic and basil. Spread a baking dish with olive oil and spread the onion on the bottom, followed by the tomatoes. Put the herbs in between and cover with the crumbly pastry. Put in the oven and bake for 30 minutes.