summaryrefslogtreecommitdiff
path: root/dev-java/fec
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-java/fec
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-java/fec')
-rw-r--r--dev-java/fec/Manifest9
-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, 276 insertions, 0 deletions
diff --git a/dev-java/fec/Manifest b/dev-java/fec/Manifest
new file mode 100644
index 000000000000..2fc39810dc16
--- /dev/null
+++ b/dev-java/fec/Manifest
@@ -0,0 +1,9 @@
+AUX fec-1.0.4-build.patch 890 SHA256 685365e4d7cf4ad4f3868cd593ef4492bc0ccbe0894bd2b502316a983ec0c7ae SHA512 d92960acd70d4f494e6875f1f5472d4da889c12a7bf8a232d291a557b0d17160a048290ab9dd9e90746a7954bd71681d36433d9dc422add7b9ea9ab956d8c90e WHIRLPOOL 8dc570dea85a55ed3c7a7ad47970679f11613016b0a796d97d1ef1bc6fe18d6cdbcaf433ed00d87df0283ca82bfbdf145d6cc6a33ad4a44c30098eae759c3090
+AUX fec-1.0.4-libfec8path.patch 1087 SHA256 687f024751ab0d634bc45a6b93c3c264a4e8e092bd4a00b307c845e3dbf83532 SHA512 7f46eedf2eb21eff04f0cee30a0e454d4796f29a22df4c33100255133c43cce07ac95e8e7eae5957412a2ce0da626cdbfffc57c5398f9f2c56660000805a60a0 WHIRLPOOL 9973c5424b16dbc048f1815f997b140d3e9c4572483aeeb190612282c4447da48dde4e5b45dab93dd04ffb150b36efde24e0916877a60581cf628e1be27ad8ff
+AUX fec-1.0.4-remove-concurrent-util-imports.patch 3142 SHA256 99b99a95a8120a3d62ade87f23e8c13e76a92b589ed62853a17cbe3bd8c43a08 SHA512 195d2d5ec252d9e8c83762de318393b50d08fd50c900a13489e082e6d08bcc6f85b6425dd350fe1d24e2aab5ed8753ce25dc87f35aa8754721cdf5949ad49aa6 WHIRLPOOL 9d342d188282772bd40eae5b6ea5f568c5c45153b8e02f661d06180cf607751140b17faee70b1665daeb39dc7a19f812f548a67c4f505dfb5dcd9b18b901721a
+AUX fec-1.0.4-soname.patch 786 SHA256 b6da1e1015a72d952d6fde0e51916cef01e5ec7628760e789447e24d9f6bca20 SHA512 d75e6198f2f7193fbb65b686118f597c289576726d77ce3d65e122b4d6ca1f790fb8530e42e3e174c97a4b45083f95407478499f11b457d813d06e85b5d21c1d WHIRLPOOL 87c7762bcbae3a4b59af23e665c34f21d568098472c56e2f5f5b96857e2a8d20970357d74c6d62e17b96e8faf10c45b23c377b74d9782758563072a90366a16f
+DIST fec-1.0.4.tar.gz 449406 SHA256 b33f5558f53e1abd9a4e58b5898cd605607698f22679f577f5fdf6cb1a2dd48a SHA512 0244de5e44ab108e921c6ca4cf341ce7b3ba807a76d24b768cfe3de71ffd525c9ebf389f9981e7eaa83fec301a65ba60ef4f51c5b3befa6c7af42b793d430343 WHIRLPOOL 3179b18a341b65b6cd295cf5f716887f8c90f03f81017444468dd57220afa4c4e58c5112fd4ef898d4f7fd7a307eb5846ffed6bead8d13fedfc30dc41fbb23d5
+EBUILD fec-1.0.4-r2.ebuild 1512 SHA256 e0de83f719b10ffcb231aab5d90dc6531134784033e16221ffed859e7f04a102 SHA512 ca83c503d157a694dfc338a7027dab4a3ef2415ca19f464e9a877c4ca5c938145d140bff18325f3cfc8a56935094120a802e1734545299f4eec05400423e1a01 WHIRLPOOL b76db37de665038172b900cb3488a1710596c5535400e62e1501c896261df1fd1cb76d6825b8f593ef7638e24584533a20aea97fbe007b0e2380d31dd0767f5a
+MISC ChangeLog 3903 SHA256 46cb3e07647cad6e73eb821de16e3c793a99b20c9f48164a6a7c817a34b7c8bb SHA512 4863cd8071f556031a8f0c7c0ce2c6616b640e3f069d301f01b62130235ed414dfcc13571e93fab092220db826832b3013221b607896718782c2d1be1e3616e7 WHIRLPOOL 6dbb8e0a58bd1f615e3e528258dd96e632e0e84b36a2b565b7418bb425525d7067858b86cad7f23def7a4ec97f687d2bc0e5d1eff82d3fb9367849be025e2993
+MISC ChangeLog-2015 2189 SHA256 7d3dd926673ea007b27b01f6452cd5a2340c642fb8387e4723127caa61aa4668 SHA512 ee2ab5ec77351b9b53eff9b15d0def8119253ad34d668a3bed5e0ff3b2d174c8a32c459176567f85c7a62b213c02c9881b3a445cc16d39302d69206108fe37c6 WHIRLPOOL 9fb001b276867d7e2c1f9c30e1147deecfede2c6eec223dc0a527c458f98ad052ea2520ebf035448d99c97c2e578570b6eede419c10e81eda7e70a22c95d7037
+MISC metadata.xml 434 SHA256 3b98a15704fd3944b62dcd4ae0183de525b37967923c6170bd6d75dab9b555a7 SHA512 bdbd0a880e9267ffee492085dd0d6a260e14b9981087cd24cfd2572079ac77b6a629556ca56e08155439f0a37a3bb97e16a2687ebe6ad3aa25340023f7c628f1 WHIRLPOOL 28549b06e96056484440bc502d16685db9d67b194ae2845003e30cd806a8a072effb9177b83341b9d5d434c73aaa9a567b6c0e58a6c5898e16d5290ca1ed918f
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>