Line the base and sides of a 20cm/8in square cake tin (not loose-based) with greaseproof paper and butter the paper. Set oven to 180C/Gas 4/fan oven 160C.
Cream the butter and sugar together until light. Gradually beat in the eggs, adding a little flour towards the end to prevent curdling. Beat in the limezest, then fold in the flour and almonds. Fold in enough lime juice – about 3 tablespoons – to give you a good dropping consistency (the mixture should drop easily from the spoon when tapped).
Fold in three quarters of the blueberries and raspberries and turn into the prepared tin. Smooth the surface, then scatter the remaining fruit on top – it will sink as the cake rises.
Bake for about 1 hour (cover with foil if beginning to brown too much), or until firm to a gentle prod in the centre. A skewer pushed into the centre should be clean when removed.
Meanwhile make the syrup: put the lime juice, zest and sugar in a small saucepan. Put over a gentle heat and stir, without allowing to bubble. The sugar should dissolve a little. As soon as the cake comes out of the oven, prick all over with a skewer then spoon the syrup over it. To store, cool before wrapping in paper and/or foil.
Carefully remove the cake from the tin, discard the lining paper and cut into 12 pieces to serve.