summaryrefslogtreecommitdiff
path: root/dev-java/fec
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-java/fec
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-java/fec')
-rw-r--r--dev-java/fec/Manifest7
-rw-r--r--dev-java/fec/fec-1.0.4-r2.ebuild69
-rw-r--r--dev-java/fec/files/fec-1.0.4-build.patch30
-rw-r--r--dev-java/fec/files/fec-1.0.4-libfec8path.patch30
-rw-r--r--dev-java/fec/files/fec-1.0.4-remove-concurrent-util-imports.patch101
-rw-r--r--dev-java/fec/files/fec-1.0.4-soname.patch22
-rw-r--r--dev-java/fec/metadata.xml15
7 files changed, 274 insertions, 0 deletions
diff --git a/dev-java/fec/Manifest b/dev-java/fec/Manifest
new file mode 100644
index 000000000000..f1bbec4b3383
--- /dev/null
+++ b/dev-java/fec/Manifest
@@ -0,0 +1,7 @@
+AUX fec-1.0.4-build.patch 890 BLAKE2B 58dcca98815ecf53dfee025e1f11ca5a9a86adcfe672561a376c11d14d0635e9a858cb28a88b6f5187d03e1f5cf6412078caf1984ad58b1f46b28be0f1a9c0ea SHA512 d92960acd70d4f494e6875f1f5472d4da889c12a7bf8a232d291a557b0d17160a048290ab9dd9e90746a7954bd71681d36433d9dc422add7b9ea9ab956d8c90e
+AUX fec-1.0.4-libfec8path.patch 1087 BLAKE2B 085c732b1ebf4bd8a6e6d7ddd7f5995c29177e165972360f9cec74dc8bc13f331ec32bf31f531c9efb4f63e796fd91142d87b94695ecff31cf4997e63379f3f1 SHA512 7f46eedf2eb21eff04f0cee30a0e454d4796f29a22df4c33100255133c43cce07ac95e8e7eae5957412a2ce0da626cdbfffc57c5398f9f2c56660000805a60a0
+AUX fec-1.0.4-remove-concurrent-util-imports.patch 3142 BLAKE2B 028451e332afc9ec5d5afdacc9bc75364708dc5700d8691a428fde2e7c24595dba5d1e39901555095aa4577180e884000c21bf2f55a375616de59b82244a3a14 SHA512 195d2d5ec252d9e8c83762de318393b50d08fd50c900a13489e082e6d08bcc6f85b6425dd350fe1d24e2aab5ed8753ce25dc87f35aa8754721cdf5949ad49aa6
+AUX fec-1.0.4-soname.patch 786 BLAKE2B 0037363c6a8a8506f1981980296708cc202815ecb48b0357a71ff2f7a1cb9a6a438974d35b548f10688dffa6cef736f1c24b56ef27a3b6767b63c56b4698d088 SHA512 d75e6198f2f7193fbb65b686118f597c289576726d77ce3d65e122b4d6ca1f790fb8530e42e3e174c97a4b45083f95407478499f11b457d813d06e85b5d21c1d
+DIST fec-1.0.4.tar.gz 449406 BLAKE2B 132bb87ff0da35b9a1830d014c46fb82209b344d159b88c6dbf36c706de668cdb2dfc10894690009e9a47f461100beaf9cf25ad1c75a3b18194e5499457bcb6b SHA512 0244de5e44ab108e921c6ca4cf341ce7b3ba807a76d24b768cfe3de71ffd525c9ebf389f9981e7eaa83fec301a65ba60ef4f51c5b3befa6c7af42b793d430343
+EBUILD fec-1.0.4-r2.ebuild 1512 BLAKE2B 29fecbf8036b2eb60a998547b17172a814ce73962229ba050350fe8784045936f226eca3ea6c72722013e0419d11b7bba1430d91fecfb6819b7a7f8fe9e7a1a5 SHA512 ca83c503d157a694dfc338a7027dab4a3ef2415ca19f464e9a877c4ca5c938145d140bff18325f3cfc8a56935094120a802e1734545299f4eec05400423e1a01
+MISC metadata.xml 434 BLAKE2B 5d425c2f0f2e1a03b58db97d2a16fe676852acee35af62283445b4046935fe6ade6c2bfabbfeb8fe155ab0eb4bc175bbc45a7a4a2f9af75e56a91177d2acd6a5 SHA512 bdbd0a880e9267ffee492085dd0d6a260e14b9981087cd24cfd2572079ac77b6a629556ca56e08155439f0a37a3bb97e16a2687ebe6ad3aa25340023f7c628f1
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..e1b2f635b328
--- /dev/null
+++ b/dev-java/fec/fec-1.0.4-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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="https://dev.gentoo.org/~monsieurp/packages/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+CDEPEND="dev-java/log4j:0"
+
+RDEPEND="
+ ${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="
+ ${CDEPEND}
+ >=virtual/jdk-1.6
+ app-arch/unzip"
+
+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
new file mode 100644
index 000000000000..c47eb5459045
--- /dev/null
+++ b/dev-java/fec/files/fec-1.0.4-build.patch
@@ -0,0 +1,30 @@
+--- 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
+
+-fec8.o: fec.h fec8.S
+- $(CC) $(CFLAGS) -DGF_BITS=8 -c -o fec8.o fec8.S
+-
+-fec8.S: fec.c Makefile
+- $(CC) $(CFLAGS) -DGF_BITS=8 -S -o fec8.S fec.c
++fec8.o: fec.h fec.c
++ $(CC) $(CFLAGS) -DGF_BITS=8 -c -o fec8.o fec.c
+
+ libfec16.so: fec16.o fec16-jinterf.o
+ $(CC) $(LDFLAGS) -shared fec16-jinterf.o fec16.o -o libfec16.so
+@@ -42,11 +39,8 @@
+ -I$(JAVA_HOME)/include/linux fec-jinterf.c \
+ -o fec16-jinterf.o
+
+-fec16.o: fec.h fec16.S
+- $(CC) $(CFLAGS) -DGF_BITS=16 -c -o fec16.o fec16.S
+-
+-fec16.S: fec.c Makefile
+- $(CC) $(CFLAGS) -DGF_BITS=16 -S -o fec16.S fec.c
++fec16.o: fec.h fec.c
++ $(CC) $(CFLAGS) -DGF_BITS=16 -c -o fec16.o fec.c
+
+ clean:
+ - rm -f *.o *.S fec *.so
diff --git a/dev-java/fec/files/fec-1.0.4-libfec8path.patch b/dev-java/fec/files/fec-1.0.4-libfec8path.patch
new file mode 100644
index 000000000000..58eb89efb730
--- /dev/null
+++ b/dev-java/fec/files/fec-1.0.4-libfec8path.patch
@@ -0,0 +1,30 @@
+--- 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.*;
+ import com.onionnetworks.util.*;
++import java.io.File;
+
+ /**
+ * This class is the frontend for the JNI wrapper for the C implementation of
+@@ -21,15 +22,10 @@
+ final private long code;
+
+ static {
+- String path = NativeDeployer.getLibraryPath
+- (Native8Code.class.getClassLoader(),"fec8");
+- if (path != null) {
+- System.load(path);
+- 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();
+ }
+ }
+
diff --git a/dev-java/fec/files/fec-1.0.4-soname.patch b/dev-java/fec/files/fec-1.0.4-soname.patch
new file mode 100644
index 000000000000..ae00449ced40
--- /dev/null
+++ b/dev-java/fec/files/fec-1.0.4-soname.patch
@@ -0,0 +1,22 @@
+--- src/csrc/Makefile.bak 2010-02-27 00:51:38.000000000 +1300
++++ src/csrc/Makefile 2010-02-27 00:56:06.000000000 +1300
+@@ -21,7 +21,8 @@
+ $(CC) $(CFLAGS) -DGF_BITS=8 -o fec fec8.o test.c
+
+ libfec8.so: fec8.o fec8-jinterf.o
+- $(CC) $(LDFLAGS) -shared fec8-jinterf.o fec8.o -o libfec8.so
++ $(CC) $(LDFLAGS) -shared fec8-jinterf.o fec8.o -o libfec8.so \
++ -Wl,-soname=libfec8.so
+
+ fec8-jinterf.o: fec-jinterf.c
+ $(CC) $(CFLAGS) -DGF_BITS=8 -c \
+@@ -35,7 +36,8 @@
+ $(CC) $(CFLAGS) -DGF_BITS=8 -S -o fec8.S fec.c
+
+ libfec16.so: fec16.o fec16-jinterf.o
+- $(CC) $(LDFLAGS) -shared fec16-jinterf.o fec16.o -o libfec16.so
++ $(CC) $(LDFLAGS) -shared fec16-jinterf.o fec16.o -o libfec16.so \
++ -Wl,-soname=libfec16.so
+
+ fec16-jinterf.o: fec-jinterf.c
+ $(CC) $(CFLAGS) -DGF_BITS=16 -c \
diff --git a/dev-java/fec/metadata.xml b/dev-java/fec/metadata.xml
new file mode 100644
index 000000000000..78df3f661631
--- /dev/null
+++ b/dev-java/fec/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>tommy@gentoo.org</email>
+ <name>Thomas Sachau (Tommy[D])</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="bitbucket">onionnetworks</remote-id>
+ </upstream>
+</pkgmetadata>