# emerge -qC virtual/jdk virtual/jre >>> Unmerging virtual/jdk-1.6.0... >>> Unmerging virtual/jre-1.6.0... # emerge -pv jamvm [nomerge ] dev-java/jamvm-1.5.4-r2 USE="-debug -libffi" [ebuild N ] dev-java/gnu-classpath-0.98-r3 USE="alsa gmp gstreamer gtk xml -debug -doc -dssi -examples -gconf -gjdoc -qt4" 0 kB [ebuild N ~] virtual/jre-1.5.0-r1 0 kB [ebuild N ~] dev-java/jamvm-1.5.4-r2 USE="-debug -libffi" 0 kB Total: 3 packages (3 new), Size of downloads: 0 kB * Error: circular dependencies: (dev-java/gnu-classpath-0.98-r3::gentoo, ebuild scheduled for merge) depends on (virtual/jre-1.5.0-r1::gentoo, ebuild scheduled for merge) (runtime) (dev-java/jamvm-1.5.4-r2::gentoo, ebuild scheduled for merge) (runtime) (dev-java/gnu-classpath-0.98-r3::gentoo, ebuild scheduled for merge) (buildtime) This can be fixed by adding ">=virtual/jre-1.5" to PDEPEND instead of RDEPEND in gnu-classpath ebuild (gnu-classpath does not need JRE at build-time -- see bug #416819): # emerge -q jamvm >>> Verifying ebuild manifests >>> Starting parallel fetch >>> Emerging (1 of 4) virtual/jdk-1.6.0 >>> Installing (1 of 4) virtual/jdk-1.6.0 >>> Emerging (2 of 4) dev-java/gnu-classpath-0.98-r3 >>> Installing (2 of 4) dev-java/gnu-classpath-0.98-r3 >>> Emerging (3 of 4) dev-java/jamvm-1.5.4-r2 >>> Installing (3 of 4) dev-java/jamvm-1.5.4-r2 >>> Emerging (4 of 4) virtual/jre-1.5.0-r1 >>> Installing (4 of 4) virtual/jre-1.5.0-r1
Created attachment 315299 [details, diff] gnu-classpath.patch
gnu-classpath needs a jdk at build time which already provides a jre. Also RDEPEND is correct, PDEPEND only works if there are no reverse dependencies requiring the functionality added trough the availability of the package in PDEPEND. See jdom-jaxen for an example of how that can go wrong. So all there is to this is, the resolver isn't clever enough and jamvm must be installed in two steps, same as with icedtea. *** This bug has been marked as a duplicate of bug 382421 ***
I see now that PDEPEND doesn't work well. However, what about a simpler solution than waiting for bug #382421 to resolve? The only reason that gnu-classpath RDEPENDs on virtual/jre is the scripts in /usr/gnu-classpath-0.98/bin. I suspect that these scripts are rarely necessary -- e.g., jamvm supplies its own scripts in /usr/lib/jamvm/bin. I suggest separating installation of /usr/gnu-classpath-0.98/bin into a USE flag, say USE=tools. Should I open a separate enhancement request for that?
Separate enhancement request filed: bug #421223.