From 02b0fcbb539a7d9518e3095ee8aea1ceed105eb7 Mon Sep 17 00:00:00 2001 From: Patrice Clement Date: Wed, 7 Oct 2015 23:08:48 +0000 Subject: [PATCH] dev-java/colt: Remove dev-java/concurrent-util dependency. Fixes bug 546496. Monkey patch sources and make use of java.concurrent.util packages from the SDK instead. Raise jdk/jre to 1.7. Drop ppc+ppc64. Package-Manager: portage-2.2.20.1 Signed-off-by: Patrice Clement --- dev-java/colt/colt-1.2.0-r3.ebuild | 48 ++++ ...1.2.0-remove-concurrent-util-imports.patch | 210 ++++++++++++++++++ 2 files changed, 258 insertions(+) create mode 100644 dev-java/colt/colt-1.2.0-r3.ebuild create mode 100644 dev-java/colt/files/colt-1.2.0-remove-concurrent-util-imports.patch diff --git a/dev-java/colt/colt-1.2.0-r3.ebuild b/dev-java/colt/colt-1.2.0-r3.ebuild new file mode 100644 index 000000000000..68ae524fcede --- /dev/null +++ b/dev-java/colt/colt-1.2.0-r3.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +JAVA_PKG_IUSE="source doc" + +inherit java-pkg-2 java-ant-2 eutils + +DESCRIPTION="A set of Open Source Libraries for High Performance Scientific and Technical Computing in Java" +SRC_URI="http://dsd.lbl.gov/~hoschek/colt-download/releases/${P}.tar.gz" +HOMEPAGE="http://www-itg.lbl.gov/~hoschek/colt/" + +LICENSE="colt" +IUSE="" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +DEPEND=">=virtual/jdk-1.7" +RDEPEND=">=virtual/jre-1.7" + +S="${WORKDIR}/${PN}" + +EANT_BUILD_TARGET="javac jar" +JAVA_ANT_REWRITE_CLASSPATH="true" +JAVA_ANT_ENCODING="ISO-8859-1" + +# [0]: I don't know but it must be useful. +# [1]: Monkey patch manually some classes to get rid of the +# oswego.edu.concurrent.util imports. +PATCHES=( + "${FILESDIR}/${P}-benchmark-no-deprecation.patch" + "${FILESDIR}/${P}-remove-concurrent-util-imports.patch" +) + +java_prepare() { + epatch "${PATCHES[@]}" + + find "${S}" -name \*.jar -exec rm -v {} \; || die +} + +src_install() { + java-pkg_dojar "lib/${PN}.jar" + + dohtml README.html || die + use doc && java-pkg_dojavadoc doc/api + use source && java-pkg_dosrc src/* +} diff --git a/dev-java/colt/files/colt-1.2.0-remove-concurrent-util-imports.patch b/dev-java/colt/files/colt-1.2.0-remove-concurrent-util-imports.patch new file mode 100644 index 000000000000..2cfbef761baf --- /dev/null +++ b/dev-java/colt/files/colt-1.2.0-remove-concurrent-util-imports.patch @@ -0,0 +1,210 @@ +--- src/cern/colt/matrix/linalg/SmpBlas.java.orig 2015-10-07 22:23:44.969486000 +0000 ++++ src/cern/colt/matrix/linalg/SmpBlas.java 2015-10-07 22:29:15.475486000 +0000 +@@ -10,7 +10,8 @@ + + import cern.colt.matrix.DoubleMatrix1D; + import cern.colt.matrix.DoubleMatrix2D; +-import EDU.oswego.cs.dl.util.concurrent.FJTask; ++ ++import java.util.concurrent.ForkJoinTask; + /** + Parallel implementation of the Basic Linear Algebra System for symmetric multi processing boxes. + Currently only a few algorithms are parallelised; the others are fully functional, but run in sequential mode. +@@ -198,7 +199,7 @@ + + // set up concurrent tasks + int span = width/noOfTasks; +- final FJTask[] subTasks = new FJTask[noOfTasks]; ++ final ForkJoinTask[] subTasks = new ForkJoinTask[noOfTasks]; + for (int i=0; i1) { +- this.taskGroup = new FJTaskRunnerGroup(maxThreads); ++ this.taskGroup = new ForkJoinPool(maxThreads); + } + else { // avoid parallel overhead + this.taskGroup = null; + } + } +-/** +- * Clean up deamon threads, if necessary. +- */ +-public void finalize() { +- if (this.taskGroup!=null) this.taskGroup.interruptAll(); +-} + protected void run(final DoubleMatrix2D[] blocksA, final DoubleMatrix2D[] blocksB, final double[] results, final Matrix2DMatrix2DFunction function) { +- final FJTask[] subTasks = new FJTask[blocksA.length]; ++ final ForkJoinTask[] subTasks = new ForkJoinTask[blocksA.length]; + for (int i=0; i