The Gentoo ebuild of jython 2.1 does not include the zxJDBC module (com.ziclix.python.sql). Anybody doing any kind of database work with Jython needs this module. It is included in the jython.jar that is downloaded from www.jython.org, but not in the jython-2.1.jar in Gentoo. jython.jar (jython.org) contains 365 files, while jython-2.1.jar (Gentoo) contains 285 files. Reproducible: Always Steps to Reproduce: 1. 2. 3.
My ebuild-fu is weak, but the error would appear to come from the src_compile() function. It decides what source files to build with the lines: find org -name "*.java" ${exclude} | xargs ${javac} -source 1.3 -classpath ${cp} -nowarn || die "Failed to compile" find org -name "*.class" | xargs jar cf jython-${PV}.jar which the keen observer will notice excludes the com.ziclix branch containing zxJDBC. Also, why is the servlet use flag, and thus PyServlet, commented out?
Oh. Wow. Now I see why zxJDBC is commented out. Its dependencies are significant, if it's to be compiled from source, since it builds against the JDBC drivers from PostgreSQL, MySQL, Oracle, and Informix. Plus the MySQL code builds against an old package name for the driver. So, it's a non-trivial tweak to the ebuild logic and patches to the code, which is distributed in that goofy .class bundle file. Oh, Jython, Jython. We want so badly to like you, but you make it so hard.
indeed, how important are these features? would it be worth also making a jython-bin ebuild or some other way around it
Given the dependencies, making a binary package sounds like a good idea. If you need to do anything with a database in Jython you need zxJDBC. It can be frustrating for the end-user to install Jython on Gentoo and then spend some time figuring out why his/her database code fails to work.
Created attachment 66219 [details] jython 2.1 with mysql support throgh zxJDBC I have made a rather quick hack to make zxJDBC work with the new Mysql connector/j and a ebuild that uses it ... this is a very quick ebuild .. so there are no use flags and no dependencies!!!
In the future, please don't attach tarballs. Instead, just attach diffs against previous ebuilds, and any new files that are needed. Also, I can't get the tar to extract, so I have no idea what changes you made... Anyways, I looked into this a little bit a couple of days ago. Support for each database comes in the form of an adapter. So, we could have USE flags for each database, and delete the adapter if that USE flag isn't present. I know the mysql driver classname changed, but I think its just a matter of changing the classname the adapter uses. It also seems the postgresql driver classname changed as well, but I wasn't sure which class to be using.
Believe this is fixed in jython-2.2.1-r1 which is about to go stable.