After an emerge --depclean:
!!! existing preserved libs:
>>> package: media-libs/alsa-lib-220.127.116.11
* - /usr/lib64/libasound.so.2
* - /usr/lib64/libasound.so.2.0.0
* used by /usr/lib64/icedtea7/jre/lib/amd64/libjsoundalsa.so (dev-java/icedtea-7.2.0-r3)
>>> package: x11-libs/libXtst-1.2.0
* - /usr/lib64/libXtst.so.6
* - /usr/lib64/libXtst.so.6.1.0
* used by /usr/lib64/icedtea7/jre/lib/amd64/xawt/libmawt.so (dev-java/icedtea-7.2.0-r3)
It's not automagic, the dependencies are unconditional at build time until upstream solves it or somebody provides a patch. We added the flags for RDEPEND deps to help people with headless servers using binpkgs. Icedtea will work fine without the libraries until you actually try to run Java code that needs them.
We should document this via local use description at least. We also consider revdep mask file, or even removing the libraries that link to the deps, in case it won't break the package.
In 18.104.22.168 and 6.1.11 xawt is no longer installed with USE=-X for an improved headless build (see bug #399367) and local use descriptions were added as was the revdep mask.
Removing libjsoundalsa.so is still under investigation.
(In reply to comment #2)
> Removing libjsoundalsa.so is still under investigation.
Removing crashes the vm, looks like it would need a stub in case neither alsa nor pulseaudio is enabled.
*** Bug 421437 has been marked as a duplicate of this bug. ***
(In reply to Ralph Sennhauser from comment #3)
> (In reply to comment #2)
> > Removing libjsoundalsa.so is still under investigation.
> Removing crashes the vm, looks like it would need a stub in case neither
> alsa nor pulseaudio is enabled.
This is now fixed in icedtea and icedtea-bin. I went ahead and removed libjsoundalsa.so anyway. It doesn't "crash" the VM per se but an exception does occur if you try to play a sound, which isn't surprising. This would happen anyway if libasound.so were missing. The alsa USE flag is enabled by default so if it gets forcefully disabled and the user tries to play a sound then they get to keep the pieces. We have already been doing this on oracle-jdk-bin for over a month and no one has complained. In the future, we will want to enforce this via a sound USE flag on virtual/jre. This alone isn't sufficient as java-config needs to ensure a VM with the flag enabled is chosen at runtime.