Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506122 - dev-java/jaxp-1.4-r1 fails to set correct CLASSPATH in package.env [PREFIX]
Summary: dev-java/jaxp-1.4-r1 fails to set correct CLASSPATH in package.env [PREFIX]
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-29 00:59 UTC by Steven Trogdon
Modified: 2016-03-12 08:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Trogdon 2014-03-29 00:59:17 UTC
This may be a java-utils-2.eclass bug. After installing the subject jaxp I get for the CLASSPATH

$ java-config --classpath=jaxp
/usr/share/jaxp/lib/jaxp.jar:/storage/strogdon/gentoo-redlizard//usr/share/jaxp/lib/jaxp-ri.jar

In prefix the "/usr/share/jaxp/lib/jaxp.jar" presents a problem because in ebuilds things like

java-pkg_jar-from jaxp jaxp-ri.jar gnujaxp.jar

fail with

 * ERROR: sci-chemistry/jmol-applet-14.0.11::local-overlay failed (prepare phase):
 *   Installation problems with jars in jaxp - is it installed?
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_prepare
 *   environment, line 3914:  Called java-pkg_jar-from 'jaxp' 'jaxp-ri.jar' 'gnujaxp.jar'
 *   environment, line 2792:  Called die
 * The specific snippet of code:
 *               die "Installation problems with jars in ${target_pkg} - is it installed?";

The problematic line in the ebuild is

        java-pkg_regjar /usr/share/${PN}/lib/jaxp.jar

If instead of the above I implement (this seems to be what's implied on line of java-utils-2.eclass)

        java-pkg_regjar ${ED}/usr/share/${PN}/lib/jaxp.jar

then I get for the CLASSPATH

$ java-config --classpath=jaxp
storage/strogdon/gentoo-redlizard//usr/share/jaxp/lib/jaxp.jar:/storage/strogdon/gentoo-redlizard//usr/share/jaxp/lib/jaxp-ri.jar

and the leading "/" before "storage" is missing. 


This sort of works (modulo the "//" before usr)

        java-pkg_regjar ${EPREFIX}/usr/share/${PN}/lib/jaxp.jar

$ java-config --classpath=jaxp
/storage/strogdon/gentoo-redlizard/usr/share/jaxp/lib/jaxp.jar:/storage/strogdon/gentoo-redlizard//usr/share/jaxp/lib/jaxp-ri.jar
Comment 1 Steven Trogdon 2014-03-29 01:03:29 UTC
The line in java-utils-2.eclass is 2764 which didn't appear above.
Comment 2 Steven Trogdon 2014-03-29 18:52:37 UTC
This

        java-pkg_regjar ${EPREFIX}/usr/share/${PN}/lib/jaxp.jar

is not the thing to do and is incorrect! It only "worked" because I tested where jaxp.jar was already installed from a previous install and I should have realized this. It would seem that

        java-pkg_regjar ${ED}/usr/share/${PN}/lib/jaxp.jar

is probably what is desired which doesn't work. So perhaps a parsing bug in java-utils-2.eclass?
Comment 3 Steven Trogdon 2014-03-30 01:42:59 UTC
This seems to fix things:

--- java-utils-2.eclass.orig    2014-03-29 20:31:15.243129661 -0500
+++ java-utils-2.eclass 2014-03-29 20:31:48.703192071 -0500
@@ -335,7 +335,7 @@
                        #    java-pkg_regjar ${ED}/opt/java/*.jar
                        # such call will fall into this case (-e ${jar}) and will
                        # record paths with ${D} in package.env
-                       java-pkg_append_ JAVA_PKG_CLASSPATH     "${jar#${D}}"
+                       java-pkg_append_ JAVA_PKG_CLASSPATH     "${jar#${D%/}}"
                else
                        if [[ ${jar} = *\** ]]; then
                                eerror "The argument ${jar} to ${FUNCNAME}"

With the patch, after a fresh install of jaxp, I have

$ java-config --classpath=jaxp
/storage/strogdon/gentoo-redlizard//usr/share/jaxp/lib/jaxp.jar:/storage/strogdon/gentoo-redlizard//usr/share/jaxp/lib/jaxp-ri.jar

which seems to be correct.
Comment 4 Fabian Groffen gentoo-dev 2014-03-30 07:12:34 UTC
I applied your (latest) patch, which makes sense, but I'm not sure how this is supposed to work in non-prefix, because they just remove ${D} as well there.
Comment 5 Steven Trogdon 2014-03-30 13:02:27 UTC
I though I has checked this is non-prefix but apparently no. Adding ${ED} to the ebuild as

        java-pkg_regjar ${ED}/usr/share/${PN}/lib/jaxp.jar

and patching the eclass gives in non-prefix

# java-config --classpath=jaxp
/usr/share/jaxp/lib/jaxp-ri.jar://usr/share/jaxp/lib/jaxp.jar

So there is the "//".
Comment 6 Pacho Ramos gentoo-dev 2016-03-12 08:51:36 UTC
this packages were removed per bug 566232