This is already done, most files which have Wine code are labeled so atop of the file ("Some parts are taken from Wine project..."). What I see is that Dmitry Timoshkov says this is not enough.
It should be enough if the original copyright notices are kept. No need to research origins of every piece of code.
LGPL 2.1:
- You may copy and distribute verbatim copies of the Library's complete
source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; [...]
- You may modify your copy or copies of the Library or any portion of
it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, [...]
GPL-HOWTO:
If you have copied code from other programs covered by the same license, copy their copyright notices too. Put all the copyright notices together, right near the top of each file.