diff options
author | Patrice Clement <monsieurp@gentoo.org> | 2015-10-18 16:23:18 +0000 |
---|---|---|
committer | Patrice Clement <monsieurp@gentoo.org> | 2015-10-18 16:35:19 +0000 |
commit | e2f2848d96675369f493348b9262d209796984ae (patch) | |
tree | c7f75ba3f51ad596a6a7b1fc3e87c04515308e86 /dev-java/fec | |
parent | dev-java/colt: Clean up old. (diff) | |
download | gentoo-e2f2848d96675369f493348b9262d209796984ae.tar.gz gentoo-e2f2848d96675369f493348b9262d209796984ae.tar.bz2 gentoo-e2f2848d96675369f493348b9262d209796984ae.zip |
dev-java/fec: Remove dev-java/concurrent-util dependency. Fixes bug 546500.
Package-Manager: portage-2.2.20.1
Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
Diffstat (limited to 'dev-java/fec')
-rw-r--r-- | dev-java/fec/Manifest | 1 | ||||
-rw-r--r-- | dev-java/fec/fec-1.0.4-r2.ebuild | 67 | ||||
-rw-r--r-- | dev-java/fec/files/fec-1.0.4-build.patch | 10 | ||||
-rw-r--r-- | dev-java/fec/files/fec-1.0.4-libfec8path.patch | 13 | ||||
-rw-r--r-- | dev-java/fec/files/fec-1.0.4-remove-concurrent-util-imports.patch | 101 |
5 files changed, 180 insertions, 12 deletions
diff --git a/dev-java/fec/Manifest b/dev-java/fec/Manifest index d85a1e356a5b..d77a48e4c768 100644 --- a/dev-java/fec/Manifest +++ b/dev-java/fec/Manifest @@ -1 +1,2 @@ DIST fec-1.0.4.tar.bz2 611131 SHA256 978d0ef609ec334ea85e3f70e46a94f6c2cc04393b590a2addfc74e03634b8dd SHA512 45e33fc4b71fcd78a7c5310f2b58df8b83a988500d0de7efebbeade712f5c93d57bbe63fd7dc148ccb1cc6418fc9c79e27be6fe0512e2294c289b192c01ab871 WHIRLPOOL cef5de5b24ddc33f6a85581cd149d3c5887f8f49843df5918158d137b263a58b888149fe68e293bc697db0b7b74e3952fabc1842f8b8f80932de379f2c7bf0d2 +DIST fec-1.0.4.tar.gz 449406 SHA256 b33f5558f53e1abd9a4e58b5898cd605607698f22679f577f5fdf6cb1a2dd48a SHA512 0244de5e44ab108e921c6ca4cf341ce7b3ba807a76d24b768cfe3de71ffd525c9ebf389f9981e7eaa83fec301a65ba60ef4f51c5b3befa6c7af42b793d430343 WHIRLPOOL 3179b18a341b65b6cd295cf5f716887f8c90f03f81017444468dd57220afa4c4e58c5112fd4ef898d4f7fd7a307eb5846ffed6bead8d13fedfc30dc41fbb23d5 diff --git a/dev-java/fec/fec-1.0.4-r2.ebuild b/dev-java/fec/fec-1.0.4-r2.ebuild new file mode 100644 index 000000000000..f589f89eb993 --- /dev/null +++ b/dev-java/fec/fec-1.0.4-r2.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +JAVA_PKG_IUSE="doc source" + +inherit flag-o-matic toolchain-funcs java-pkg-2 java-ant-2 + +DESCRIPTION="Forward Error Correction library in Java" +HOMEPAGE="https://bitbucket.org/onionnetworks/" +SRC_URI="http://dev.gentoo.org/~monsieurp/packages/${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +CDEPEND="dev-java/log4j:0" + +RDEPEND=">=virtual/jre-1.6 + ${CDEPEND}" +DEPEND=">=virtual/jdk-1.6 + app-arch/unzip + ${CDEPEND}" + +PATCHES=( + "${FILESDIR}"/"${P}-libfec8path.patch" + "${FILESDIR}"/"${P}-build.patch" + "${FILESDIR}"/"${P}-soname.patch" + "${FILESDIR}"/"${P}-remove-concurrent-util-imports.patch" +) + +JAVA_ANT_REWRITE_CLASSPATH="yes" +EANT_GENTOO_CLASSPATH="log4j" +EANT_BUILD_TARGET="jars" + +# There seems to be unit tests, but they are in such a state. +RESTRICT="test" + +java_prepare() { + # In fact, we'll wipe tests altogether. + rm -rf tests || die + + # Apply patches. + epatch "${PATCHES[@]}" + + # Get rid of bundled jars. + java-pkg_clean +} + +src_compile() { + java-pkg-2_src_compile + einfo "Sucessfully compiled Java classes!" + + cd "${S}"/src/csrc || die + append-flags -fPIC + emake CC=$(tc-getCC) CFLAGS="${CFLAGS} $(java-pkg_get-jni-cflags)" || die + einfo "Sucessfully compiled C files!" +} + +src_install() { + java-pkg_newjar "lib/onion-${PN}.jar" "${PN}.jar" + use doc && java-pkg_dojavadoc javadoc + use source && java-pkg_dosrc src/com + dolib.so src/csrc/libfec{8,16}.so || die +} diff --git a/dev-java/fec/files/fec-1.0.4-build.patch b/dev-java/fec/files/fec-1.0.4-build.patch index 3920dcec4c7d..c47eb5459045 100644 --- a/dev-java/fec/files/fec-1.0.4-build.patch +++ b/dev-java/fec/files/fec-1.0.4-build.patch @@ -1,8 +1,6 @@ -Index: csrc/Makefile -=================================================================== ---- src/csrc.orig/Makefile -+++ src/csrc/Makefile -@@ -28,11 +28,8 @@ fec8-jinterf.o: fec-jinterf.c +--- src/csrc/Makefile.orig 2015-10-18 14:31:56.752486000 +0000 ++++ src/csrc/Makefile 2015-10-18 14:33:11.502486000 +0000 +@@ -28,11 +28,8 @@ -I$(JAVA_HOME)/include/linux fec-jinterf.c \ -o fec8-jinterf.o @@ -16,7 +14,7 @@ Index: csrc/Makefile libfec16.so: fec16.o fec16-jinterf.o $(CC) $(LDFLAGS) -shared fec16-jinterf.o fec16.o -o libfec16.so -@@ -42,11 +39,8 @@ fec16-jinterf.o: fec-jinterf.c +@@ -42,11 +39,8 @@ -I$(JAVA_HOME)/include/linux fec-jinterf.c \ -o fec16-jinterf.o diff --git a/dev-java/fec/files/fec-1.0.4-libfec8path.patch b/dev-java/fec/files/fec-1.0.4-libfec8path.patch index 503db7c837eb..58eb89efb730 100644 --- a/dev-java/fec/files/fec-1.0.4-libfec8path.patch +++ b/dev-java/fec/files/fec-1.0.4-libfec8path.patch @@ -1,5 +1,5 @@ ---- src/com/onionnetworks/fec/Native8Code.java 2009-08-21 02:37:00.515004583 +0200 -+++ src/com/onionnetworks/fec/Native8Code.java.new 2009-08-21 02:37:57.829254678 +0200 +--- src/com/onionnetworks/fec/Native8Code.java.orig 2015-10-18 14:27:06.160486000 +0000 ++++ src/com/onionnetworks/fec/Native8Code.java 2015-10-18 14:30:32.557486000 +0000 @@ -3,6 +3,7 @@ //import java.security.AccessController; //import sun.security.action.*; @@ -16,14 +16,15 @@ - (Native8Code.class.getClassLoader(),"fec8"); - if (path != null) { - System.load(path); -+ File path = new File("/usr/lib/libfec8.so"); -+ System.out.println("Loading FEC lib ["+path.getAbsolutePath()+']'); -+ System.load(path.getAbsolutePath()); - initFEC(); +- initFEC(); - } else { - System.out.println("Unable to find native library for fec8 for platform "+NativeDeployer.OS_ARCH); - System.out.println(path); - } ++ File path = new File("/usr/lib/libfec8.so"); ++ System.out.println("Loading FEC lib ["+path.getAbsolutePath()+']'); ++ System.load(path.getAbsolutePath()); ++ initFEC(); } public Native8Code(int k, int n) { diff --git a/dev-java/fec/files/fec-1.0.4-remove-concurrent-util-imports.patch b/dev-java/fec/files/fec-1.0.4-remove-concurrent-util-imports.patch new file mode 100644 index 000000000000..87a9473ed937 --- /dev/null +++ b/dev-java/fec/files/fec-1.0.4-remove-concurrent-util-imports.patch @@ -0,0 +1,101 @@ +--- src/com/onionnetworks/fec/io/FECFile.java.orig 2015-10-18 15:38:26.000000000 +0000 ++++ src/com/onionnetworks/fec/io/FECFile.java 2015-10-18 16:06:51.159486000 +0000 +@@ -10,7 +10,9 @@ + import com.onionnetworks.fec.FECCodeFactory; + import com.onionnetworks.io.RAF; + import com.onionnetworks.util.*; +-import EDU.oswego.cs.dl.util.concurrent.*; ++ ++import java.util.concurrent.locks.ReadWriteLock; ++import java.util.concurrent.locks.ReentrantReadWriteLock; + + /** + * This class provides the necessary file IO routines to go along with the raw +@@ -129,9 +131,9 @@ + this.raf = new RAF(f,mode); // synched RandomAccessFile + + // Create the locks. +- locks = new ReadWriteLock[blockCount]; ++ locks = new ReentrantReadWriteLock[blockCount]; + for (int i=0;i<locks.length;i++) { +- locks[i] = new ReentrantWriterPreferenceReadWriteLock(); ++ locks[i] = new ReentrantReadWriteLock(); + } + + // add the default exception handler. +@@ -258,7 +260,7 @@ + byte[] b = null; + + try { +- locks[blockNum].readLock().acquire(); ++ locks[blockNum].readLock().lock(); + try { + + // This raf check then pp access is safe because all +@@ -296,9 +298,9 @@ + return; + } + } finally { +- locks[blockNum].readLock().release(); ++ locks[blockNum].readLock().unlock(); + } +- } catch (InterruptedException e) { ++ } catch (Exception e) { + throw new InterruptedIOException(e.toString()); + } + +@@ -342,13 +344,13 @@ + + int result = -1; + try { +- locks[blockNum].writeLock().acquire(); ++ locks[blockNum].writeLock().lock(); + try { + result = write0(pkt,blockNum,stripeNum); + } finally { +- locks[blockNum].writeLock().release(); ++ locks[blockNum].writeLock().unlock(); + } +- } catch (InterruptedException e) { ++ } catch (Exception e) { + throw new InterruptedIOException(e.toString()); + } + +@@ -444,16 +446,16 @@ + } + + try { +- locks[blockNum].writeLock().acquire(); ++ locks[blockNum].writeLock().lock(); + try { + // seek and write the decoded block. + raf.seekAndWrite(blockNum*blockSize,b,0,b.length); + // Update the placement to show decoded entries. + pp.setBlockDecoded(blockNum); + } finally { +- locks[blockNum].writeLock().release(); ++ locks[blockNum].writeLock().unlock(); + } +- } catch (InterruptedException e) { ++ } catch (Exception e) { + throw new InterruptedIOException(e.toString()); + } + +@@ -468,7 +470,7 @@ + */ + public void acquireAllWriteLocks() throws InterruptedException { + for (int i=0;i<locks.length;i++) { +- locks[i].writeLock().acquire(); ++ locks[i].writeLock().lock(); + } + } + +@@ -479,7 +481,7 @@ + */ + public void releaseAllWriteLocks() throws InterruptedException { + for (int i=0;i<locks.length;i++) { +- locks[i].writeLock().release(); ++ locks[i].writeLock().unlock(); + } + } + |