It’s not that hard. In fact, I’ve found that it wasn’t like the documentation stated. Let’s use KMix 4.8.0 as an example.

According to Bug 292595, KMix failed to compile with the new OSS4. I too affected by this. Luckily, the bug provide a patch as an attachment:

diff -ur kdemultimedia-4.8.0.orig/kmix/backends/mixer_oss4.cpp kdemultimedia-4.8.0/kmix/backends/mixer_oss4.cpp
--- kdemultimedia-4.8.0.orig/kmix/backends/mixer_oss4.cpp 2012-01-27 22:02:21.368720442 +0800
+++ kdemultimedia-4.8.0/kmix/backends/mixer_oss4.cpp 2012-01-27 22:10:27.844842363 +0800
@@ -430,7 +430,7 @@
 {
 Volume vol(ext.maxvalue, ext.minvalue,
 false, isCapture);
- vol.addVolumeChannel(VolumeChannel(Volume::MLEFT));
+ vol.addVolumeChannel(VolumeChannel(Volume::LEFT));
 
 MixDevice* md = new MixDevice (_mixer,
 QString::number(i),

Those lines are verbatim copies from the attachment and I save it to “$PORTAGE_TREE/kde-base/kmix/files/kmix-4.8.0-oss4-fix.patch”. I have $PORTAGE_TREE in “/usr/local/portage”; that might vary on you.

Then, in the “$PORTAGE_TREE/kde-base/kmix/kmix-4.8.0.ebuild” I add these lines before “src_configure”:

PATCHES=( 
 "${FILESDIR}/kmix-oss4.patch"
)

And generate the new checksum for it so that Gentoo won’t complain:

# ebuild /usr/local/portage/kde-base/kmix/kmix-4.8.0.ebuild digest

Voila! We do the routine as usual. No need to make “src_unpack()” function.