Package: pixelmed
Version: 20120508-1
Followup-For: Bug #678383
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu quantal ubuntu-patch

Dear Maintainer,

This patch fixes FTBFS errors with pixelmed.
It bumps the java version from 1.5 to 1.7 and fixes the deprecated
library issue when saving a JPEG image.

In Ubuntu, the attached patch was applied to achieve the following:

  * debian/patch/target_java_1.7.patch: Fixes FTBFS by targeting Java 1.7.

Thanks for considering the patch.


-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500,
'precise'), (100, 'precise-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-25-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

diff -Nru pixelmed-20120508/debian/changelog pixelmed-20120508/debian/changelog
diff -Nru pixelmed-20120508/debian/patches/series pixelmed-20120508/debian/patches/series
--- pixelmed-20120508/debian/patches/series	2012-05-08 08:25:37.000000000 -0500
+++ pixelmed-20120508/debian/patches/series	2012-06-27 15:45:58.000000000 -0500
@@ -8,3 +8,4 @@
 addmanifest.patch
 fixfonts.patch
 removetest.patch
+target_java_1.7.patch
diff -Nru pixelmed-20120508/debian/patches/target_java_1.7.patch pixelmed-20120508/debian/patches/target_java_1.7.patch
--- pixelmed-20120508/debian/patches/target_java_1.7.patch	1969-12-31 18:00:00.000000000 -0600
+++ pixelmed-20120508/debian/patches/target_java_1.7.patch	2012-06-27 16:09:46.000000000 -0500
@@ -0,0 +1,89 @@
+Description: Update java to use version 1.7 instead of 1.5.
+This patch updates the Makefiles to use Java 1.7. This fixes some issues
+but causes an issue in com.pixelmed.display.ApplicationFrame. This issue
+is due to a deprecated library to be used when writing and encoding files.
+This has been updated to use the ImageIO library.
+
+Author: Chris J Arges <chris.j.ar...@canonical.com>
+Bug-Ubuntu: https://launchpad.net/bugs/888993
+Last-Update: 2012-06-28
+
+---
+
+Index: pixelmed-20120508/Makefile.common.mk
+===================================================================
+--- pixelmed-20120508.orig/Makefile.common.mk	2012-06-27 16:08:02.222956169 -0500
++++ pixelmed-20120508/Makefile.common.mk	2012-06-27 16:08:02.250956168 -0500
+@@ -43,9 +43,9 @@
+ 
+ .SUFFIXES:	.class .java .ico .png
+ 
+-#JAVACOPTIONS = -O -target 1.5 -encoding "UTF8" -Xlint:deprecation -Xlint:unchecked
+-JAVACOPTIONS = -O -target 1.5 -encoding "UTF8" -Xlint:deprecation
+-#JAVACOPTIONS = -g -O -target 1.5 -encoding "UTF8" -Xlint:deprecation
++#JAVACOPTIONS = -O -target 1.7 -encoding "UTF8" -Xlint:deprecation -Xlint:unchecked
++JAVACOPTIONS = -O -target 1.7 -encoding "UTF8" -Xlint:deprecation
++#JAVACOPTIONS = -g -O -target 1.7 -encoding "UTF8" -Xlint:deprecation
+ 
+ .java.class:
+ 	javac ${JAVACOPTIONS} -classpath ${PATHTOROOT} -sourcepath ${PATHTOROOT} $<
+Index: pixelmed-20120508/com/pixelmed/test/Makefile
+===================================================================
+--- pixelmed-20120508.orig/com/pixelmed/test/Makefile	2012-06-27 16:08:02.246956169 -0500
++++ pixelmed-20120508/com/pixelmed/test/Makefile	2012-06-27 16:08:02.250956168 -0500
+@@ -73,7 +73,7 @@
+ .SUFFIXES:	.class .java
+ 
+ .java.class:
+-	javac ${JAVACOPTIONS} -classpath ${PATHTOROOT}:${VIEWERADDITIONALJARS}:${JUNITJAR} -sourcepath ${PATHTOROOT} -target 1.5 -encoding "UTF8" $<
++	javac ${JAVACOPTIONS} -classpath ${PATHTOROOT}:${VIEWERADDITIONALJARS}:${JUNITJAR} -sourcepath ${PATHTOROOT} -target 1.7 -encoding "UTF8" $<
+ 
+ archive:
+ 	tar -cvf - Makefile *.java | gzip -best > ../../../test.`date '+%Y%m%d'`.tar.gz
+Index: pixelmed-20120508/com/pixelmed/display/ApplicationFrame.java
+===================================================================
+--- pixelmed-20120508.orig/com/pixelmed/display/ApplicationFrame.java	2012-06-27 16:08:02.238956169 -0500
++++ pixelmed-20120508/com/pixelmed/display/ApplicationFrame.java	2012-06-27 16:09:35.226953167 -0500
+@@ -9,6 +9,7 @@
+ import java.awt.event.*; 
+ import java.util.*; 
+ import java.io.*; 
++import javax.imageio.*;
+ import javax.swing.*; 
+ import javax.swing.event.*; 
+ 
+@@ -163,7 +164,7 @@
+ 		try {
+ 			snapShotFile = File.createTempFile("snap",".jpg",new File(System.getProperty("user.home")));
+ 			java.awt.image.BufferedImage snapShotImage = new Robot().createScreenCapture(extent);
+-			com.sun.image.codec.jpeg.JPEGCodec.createJPEGEncoder(new FileOutputStream(snapShotFile)).encode(snapShotImage);
++			ImageIO.write(snapShotImage, "jpeg", snapShotFile);
+ 		}
+ 		catch (Exception ex) {
+ 			ex.printStackTrace();
+Index: pixelmed-20120508/com/pixelmed/dose/Makefile
+===================================================================
+--- pixelmed-20120508.orig/com/pixelmed/dose/Makefile	2012-06-27 16:08:01.422956195 -0500
++++ pixelmed-20120508/com/pixelmed/dose/Makefile	2012-06-27 16:08:02.270956168 -0500
+@@ -28,7 +28,7 @@
+ .SUFFIXES:	.class .java
+ 
+ .java.class:
+-	javac ${JAVACOPTIONS} -classpath ${PATHTOROOT} -sourcepath ${PATHTOROOT} -target 1.5 -encoding "UTF8" $<
++	javac ${JAVACOPTIONS} -classpath ${PATHTOROOT} -sourcepath ${PATHTOROOT} -target 1.7 -encoding "UTF8" $<
+ 
+ archive:
+ 	tar -cvf - Makefile *.java | gzip -best > ../../../dose.`date '+%Y%m%d'`.tar.gz
+Index: pixelmed-20120508/com/pixelmed/doseocr/Makefile
+===================================================================
+--- pixelmed-20120508.orig/com/pixelmed/doseocr/Makefile	2012-06-27 16:08:01.438956195 -0500
++++ pixelmed-20120508/com/pixelmed/doseocr/Makefile	2012-06-27 16:08:02.306956167 -0500
+@@ -13,7 +13,7 @@
+ include ${PATHTOROOT}/Makefile.common.mk
+ 
+ .java.class:
+-	javac ${JAVACOPTIONS} -classpath ${PATHTOROOT}:${JUNITJAR} -sourcepath ${PATHTOROOT} -target 1.5 -encoding "UTF8" $<
++	javac ${JAVACOPTIONS} -classpath ${PATHTOROOT}:${JUNITJAR} -sourcepath ${PATHTOROOT} -target 1.7 -encoding "UTF8" $<
+ 
+ clean:
+ 	rm -f *~ *.class core *.bak ${OBJS}

Reply via email to