Heat the olive oil in a large frying pan. Add the onion and sprinkle with the sugar. Cook over medium heat, stirring occasionally, for about 15 minutes or until the onion is soft and lightly caramelised.
Sprinkle the flour over the onion, stir and cook for 1 minute. Gradually stir in the stock and then the wine. Bring to the boil, then reduce the heat and leave to simmer gently until thickened.