svn commit: r321060 - in head/java/java3d: . files

Stefan Walter stefan at FreeBSD.org
Sun Jun 16 17:05:56 UTC 2013


Author: stefan
Date: Sun Jun 16 17:05:55 2013
New Revision: 321060
URL: http://svnweb.freebsd.org/changeset/ports/321060

Log:
  - Fix build with JDK 1.7. [1]
  - Propagate Make environment to Ant to use the correct JDK and not just the one
    that Ant was built with.
  
  PR:		173505 [1]
  Submitted by:	James Raynard <james.raynard at pobox.com> [1]
  Patch by:	Piotr Smyrak <piotr.smyrak at gmail.com> [1]
  Obtained from:	https://launchpad.net/ubuntu/+source/java3d/1.5.2+dfsg-8 [1]

Added:
  head/java/java3d/files/patch-ImageComponentState.java   (contents, props changed)
Modified:
  head/java/java3d/Makefile
  head/java/java3d/files/patch-freebsd

Modified: head/java/java3d/Makefile
==============================================================================
--- head/java/java3d/Makefile	Sun Jun 16 16:59:34 2013	(r321059)
+++ head/java/java3d/Makefile	Sun Jun 16 17:05:55 2013	(r321060)
@@ -3,7 +3,7 @@
 
 PORTNAME=	java3d
 PORTVERSION=	1.5.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	java graphics games devel
 MASTER_SITES=	https://sites.google.com/site/daemonwizard/
 DISTNAME=	java3d-${PORTVERSION}
@@ -29,10 +29,17 @@ PORTDOCS=	*
 .include <bsd.port.options.mk>
 
 do-build:
-	cd ${WRKSRC}/vecmath && ${ANT} dist
-	cd ${WRKSRC}/j3d-core && ${ANT} -Dbuild.type=fcs -Dis${OPSYS}=yes -Dports.localbase=${LOCALBASE} jar-opt
+	cd ${WRKSRC}/vecmath && ${SETENV} ${MAKE_ENV} ${ANT} dist
+	cd ${WRKSRC}/j3d-core \
+		&& ${SETENV} ${MAKE_ENV} ${ANT} -Dbuild.type=fcs \
+						-Dis${OPSYS}=yes \
+						-Dports.localbase=${LOCALBASE} \
+						jar-opt
 .if ${PORT_OPTIONS:MDOCS}
-	cd ${WRKSRC}/j3d-core && ${ANT} -Dbuild.type=fcs -Dis${OPSYS}=yes docs-public
+	cd ${WRKSRC}/j3d-core \
+		&& ${SETENV} ${MAKE_ENV} ${ANT} -Dbuild.type=fcs \
+						-Dis${OPSYS}=yes \
+						docs-public
 .endif
 
 do-install:

Added: head/java/java3d/files/patch-ImageComponentState.java
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/java/java3d/files/patch-ImageComponentState.java	Sun Jun 16 17:05:55 2013	(r321060)
@@ -0,0 +1,50 @@
+work/java3d-1.5.2/j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d
+--- j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ImageComponentState.java.orig
++++ j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ImageComponentState.java
+@@ -61,10 +61,7 @@ import com.sun.j3d.utils.scenegraph.io.r
+ import com.sun.j3d.utils.scenegraph.io.retained.SGIORuntimeException;
+ import java.awt.color.ColorSpace;
+ import java.awt.image.DataBuffer;
+-import com.sun.image.codec.jpeg.JPEGImageEncoder;
+-import com.sun.image.codec.jpeg.JPEGImageDecoder;
+-import com.sun.image.codec.jpeg.JPEGCodec;
+-import com.sun.image.codec.jpeg.JPEGEncodeParam;
++import javax.imageio.ImageIO;
+ 
+ public abstract class ImageComponentState extends NodeComponentState {
+ 
+@@ -203,10 +200,9 @@ public abstract class ImageComponentStat
+     
+     private void writeBufferedImageJpegCompression( DataOutput out, BufferedImage image ) throws IOException {
+         ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+-        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder( byteStream );
+-
+-        encoder.encode( image );
+-        byteStream.close();
++        if (!ImageIO.write(image, "jpeg", byteStream)) {
++            throw new AssertionError("No JPEG encoder available");
++        }
+         
+         byte[] buffer = byteStream.toByteArray();
+         out.writeInt( buffer.length );
+@@ -261,11 +257,15 @@ public abstract class ImageComponentStat
+         byte[] buffer = new byte[ size ];
+         in.readFully( buffer );
+         ByteArrayInputStream byteStream = new ByteArrayInputStream( buffer );
+-        
+-        JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder( byteStream );
+-        byteStream.close();
+-        
+-        return decoder.decodeAsBufferedImage();
++        try {
++            BufferedImage img = ImageIO.read(byteStream);
++            if (img == null) {
++                throw new AssertionError("No ImageReader available.");
++            }
++            return img;
++        } finally {
++            byteStream.close();
++        }
+     }
+     
+     private void writeColorModel( DataOutput out, ColorModel colorModel ) throws IOException {

Modified: head/java/java3d/files/patch-freebsd
==============================================================================
--- head/java/java3d/files/patch-freebsd	Sun Jun 16 16:59:34 2013	(r321059)
+++ head/java/java3d/files/patch-freebsd	Sun Jun 16 17:05:55 2013	(r321060)
@@ -88,6 +88,14 @@ diff -ruN ../java3d-1.5.2/j3d-core/src/n
  	<property name="bldType" value="opt"/>
  	<property name="javahCoreSrc"     
  	 location="${src}/classes/share/javax/media/j3d"/>
+@@ -347,6 +360,7 @@
+     <javah destdir="${javahCoreTarget}" force="yes">
+ 	<classpath>
+ 	    <pathelement path="${build}/${platform}/${bldType}/classes"/>
++	    <pathelement path="${vecmath_home}/build/opt/lib/ext/vecmath.jar"/>
+ 	</classpath>
+ 	
+ 	<class name="javax.media.j3d.Background"/>
 diff -ruN ../java3d-1.5.2/j3d-core/src/native/ogl/build-freebsd.xml ./j3d-core/src/native/ogl/build-freebsd.xml
 --- ../java3d-1.5.2/j3d-core/src/native/ogl/build-freebsd.xml	1970-01-01 12:00:00.000000000 +1200
 +++ ./j3d-core/src/native/ogl/build-freebsd.xml	2009-07-12 13:21:41.000000000 +1200


More information about the svn-ports-all mailing list