Preheat the oven to 180C/160C Fan/Gas 4 and line a 15x20cm/6x8in cake tin with baking paper. Alternatively use 2 x 20cm/8in round cake tins (the shape of the tin does not matter as the cake will be broken up for the trifle).
For the sponge, in a large bowl whisk the eggs and sugar on high using an electric whisk for 3 minutes, or until thick, creamy and at least doubled in size. Pour in the melted butter in a steady stream, mixing all the time. Gently fold the flour into the mixture.
Pour the mixture into the prepared tin and bake for 20-25 minutes. Remove from the oven and leave to cool in the tin slightly before transferring to a wire rack to fully cool.
For the lemon syrup, in a saucepan combine all the ingredients with 100ml/3½fl oz water and bring to the boil. Once syrupy, remove from the heat and set aside to cool.
For the compôte, combine all the ingredients with 150ml/¼ pint water in a saucepan. Gently simmer for about 10 minutes. Remove from the heat and set aside to cool.
For the lemon curd, in a saucepan gently bring the lemon juice, zest, butter and half of the sugar to a simmer. In a bowl, combine the remaining sugar with the eggs and lightly whisk. Slowly pour the juice mixture over the eggs, whisking constantly. Pour back into the pan and place over a low heat. Stir constantly for about 5 minutes until thickened. Pass through a sieve and keep refrigerated until needed.
For the custard, gently heat the milk, cream and vanilla in a saucepan until just boiling. Remove from the heat. Combine the sugar and cornflour in a mixing bowl and gradually whisk in the eggs and yolks.
Pour the warm milk mixture over the eggs, a little at a time, whisking constantly. Return to the pan and stir constantly over a low heat until thickened. Pass through a sieve and remove the vanilla pod. Cover the surface with baking paper to prevent a skin forming while the custard cools.
To assemble the trifle, start by layering pieces of the sponge in the bottom of a serving dish or individual glasses. Pour over the syrup and let it soak in for about 5 minutes or so.
Add a layer of the raspberry compôte and then the lemon curd. Spoon the custard on top. Finish with the whipped cream and sprinkle over the crushed pistachios. Refrigerate until ready to serve.