Just recently during a kdelibs (see bug #188151) I found I needed to enable midi. I had built my alsa packages without it.
So I edited /etc/portage/package.use and added two lines for the alsa packages that were installed:
# emerge --newuse world
These are the packages that would be merged, in order:
Calculating world dependencies ..... ..... ........ done!
[ebuild R ] media-sound/alsa-utils-1.0.14 USE="midi* -nls" 0 kB
[ebuild R ] media-libs/alsa-lib-1.0.14a-r1 USE="midi* -alisp -debug -doc" ALSA_PCM_PLUGINS="adpcm alaw copy dshare dsnoop extplug file hooks ladspa lfloat linear meter mulaw multi null rate route share shm" 0 kB
[ebuild U ] kde-base/kdelibs-3.5.7-r3 [3.5.7-r2] USE="acl alsa fam tiff -arts -avahi -branding -cups -debug -doc -jpeg2k -kdeenablefinal -kdehiddenvisibility -kerberos -legacyssl -lua -openexr -spell -utempter -xinerama" 0 kB
Total: 3 packages (1 upgrade, 2 reinstalls), Size of downloads: 0 kB
>>> Verifying ebuild Manifests...
>>> starting parallel fetching
>>> Emerging (1 of 3) media-sound/alsa-utils-1.0.14 to /
* alsa-utils-1.0.14.tar.bz2 RMD160 ;-) ... [ ok ]
* alsa-utils-1.0.14.tar.bz2 SHA1 ;-) ... [ ok ]
* alsa-utils-1.0.14.tar.bz2 SHA256 ;-) ... [ ok ]
* alsa-utils-1.0.14.tar.bz2 size ;-) ... [ ok ]
* checking ebuild checksums ;-) ... [ ok ]
* checking auxfile checksums ;-) ... [ ok ]
* checking miscfile checksums ;-) ... [ ok ]
* checking alsa-utils-1.0.14.tar.bz2 ;-) ...[ ok ]
* To be able to build alsa-utils with midi support you need
* to have built media-libs/alsa-lib with midi USE flag.
* ERROR: media-sound/alsa-utils-1.0.14 failed.
* Call stack:
* ebuild.sh, line 1670: Called dyn_setup
* ebuild.sh, line 719: Called qa_call 'pkg_setup'
* ebuild.sh, line 44: Called pkg_setup
* alsa-utils-1.0.14.ebuild, line 35: Called die
* Missing midi USE flag on media-libs/alsa-lib
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/media-sound/alsa-utils-1.0.14/temp/build.log'.
As you can see it's a real awkward dependency, it needs alsa-lib to be re-merged with the new flag first and then alsa-utils after.
I have made this as an enhancement rather than a bug because I'm not sure how portage should respond to this.
Reproducible: Didn't try
Steps to Reproduce:
1. Emerge alsa without midi support
2. Add midi flag to alsa
3. Re-emerge alsa
Fails to emerge alsa
Expected alsa to install
Obviously this was easy to work around, I just needed to re-merge alsa-lib on its own and then continue with the rebuild.
> * Missing midi USE flag on media-libs/alsa-lib
Yeah, re-emerge alsa-lib w/ USE=midi. What's exactly your request/defect here? No, portage won't do it for you.
*** This bug has been marked as a duplicate of bug 2272 ***