Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 139225 - [Tracker] Patch packages which fail to build with Java 1.5
Summary: [Tracker] Patch packages which fail to build with Java 1.5
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: Tracker
Depends on: 118291 137967 137968 137969 137970 139218 139219 139221
Blocks:
  Show dependency tree
 
Reported: 2006-07-04 12:19 UTC by Josh Nichols (RETIRED)
Modified: 2009-07-01 16:55 UTC (History)
1 user (show)

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 Josh Nichols (RETIRED) gentoo-dev 2006-07-04 12:19:07 UTC
With the new Java system, we are able to do some magic to get around packages which don't deal well with Java 1.5.

There are two primary cases where this will happen.

The first is the introduction of the enum keyword. Instead of patching to rename the variables named enum, it is better to use -source 1.4, to use 1.4 source. This usually involves patching the build.xml to add add source="1.4" and target="1.4" to javac tasks.
Alternatively, and easier, is to inherit java-ant-2, and in depend, depend on:
>=virtual/jdk-1.4. java-ant-2 will then rewrite build.xml to have target="1.4" ans source="1.4". If there's a src_unpack function, it needs to be renamed to ant_src_unpack.

The other is cases where the package uses XML APIs that changed between 1.4 and 1.5. Most of the time, there are new abstract methods in 1.5 that need to be implemented. To work around this, it can DEPEND on:
=virtual/jdk-1.4*

The result is that the package will switch to a 1.4 JDK, which shouldn't have any problems.

This is really a short-term solution. Ideally, the source will be patched to implement these methods. The quickest way to do this is to just throw UnsupportedOperationExcpetion in the method.

The issue should be reported upstream so that we don't have to continually patch the source.
Comment 1 Josh Nichols (RETIRED) gentoo-dev 2006-07-04 13:39:57 UTC
For future reference, please do not file bugs / patches for packages where you either:
patch build.xml to have source="1.4" target="1.4"
patch source to rename variables from enum to something else.

java-ant-2.eclass will handle rewriting build.xml files in this case.
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2008-07-10 11:15:26 UTC
A quick grep shows there's still quite a number of ebuilds requiring JDK 1.4. You're aware that Sun drops security support for 1.4.2 end of October this year?!
Comment 3 Petteri Räty (RETIRED) gentoo-dev 2008-07-10 20:47:37 UTC
(In reply to comment #2)
> A quick grep shows there's still quite a number of ebuilds requiring JDK 1.4.
> You're aware that Sun drops security support for 1.4.2 end of October this
> year?!
> 

Well we can always change JDKs so that they can only be used to build things and not run.
Comment 4 Krzysztof Pawlik (RETIRED) gentoo-dev 2008-07-10 21:06:21 UTC
(In reply to comment #2)
> A quick grep shows there's still quite a number of ebuilds requiring JDK 1.4.
> You're aware that Sun drops security support for 1.4.2 end of October this
> year?!

Yes, I'm working on deprecating 1.4.
Comment 5 Serkan Kaba (RETIRED) gentoo-dev 2009-07-01 16:55:41 UTC
Last package fixed.