summaryrefslogtreecommitdiff
path: root/dev-java/freenet-ext
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/freenet-ext')
-rw-r--r--dev-java/freenet-ext/Manifest4
-rw-r--r--dev-java/freenet-ext/files/freenet-ext-29-convert-jcpuid.patch46
-rw-r--r--dev-java/freenet-ext/freenet-ext-29.ebuild79
-rw-r--r--dev-java/freenet-ext/metadata.xml10
4 files changed, 139 insertions, 0 deletions
diff --git a/dev-java/freenet-ext/Manifest b/dev-java/freenet-ext/Manifest
new file mode 100644
index 000000000000..1abfda470b0e
--- /dev/null
+++ b/dev-java/freenet-ext/Manifest
@@ -0,0 +1,4 @@
+AUX freenet-ext-29-convert-jcpuid.patch 1139 BLAKE2B 10dadb5963d4f85ac32402c19a8395ffea7c8a10ad81b8b1f478c099796c796197ff9c40f273a261ed1e26beb3889e90256d900eba60cc306e58c5a061711804 SHA512 251ae92c20465d3d4c63fbff25255861e86d548e7c56a27e519604704995ee75edcf6dd704f89e888c8311d1c4373067b409c0cb4b8775c8b3d1075118fc1df7
+DIST freenet-ext-29.tar.gz 4328779 BLAKE2B a9dc6dc34d6dbccc9f89c955f35b35024a7067aa8e89cf195492e77a8ebc92b73cc98e779c7f75ba6a430e994e856937be018a6505e1cda07eeea275925ee0e7 SHA512 11cf0942042483403cf526684a18c2b1766d3f6fb15c2ca4bdb59d95382ed86fcdb71a66d9f43a504abf3ca5c53f9da749086e462bbb56826beb95a2a7f1cbfa
+EBUILD freenet-ext-29.ebuild 1703 BLAKE2B c402cc5544ca0eda66102095c96f6722a816773c02c10b9904a0243add108dba27f03fab6c309b54b521e2732f2f6f5a00a4fa91389571ae674e317805808ad3 SHA512 99f30581efa81d9304c8c4a1cd638efcf81ccf9938fe891ddec15bb99534f489df07b8bcf8a42dbffa74450d44f06aaa91f24cdbdd2dd4294e2109577a2319d4
+MISC metadata.xml 298 BLAKE2B 651f820698c9f24c0d59225657cc71feb33c8170c41424180a3653e5d63d68610595c666af1fb595d7573005ee7a75d880d8501c5ab768a626d8cd4e8516522f SHA512 e7f0045030fadf55d88b49bd0dab5045003607a3b3eaa7dce1f95562ad5eb835f5d34f20d071be2a960228d68ce56e1e60845cbdfb5f19d1997fb9b7c7f7c121
diff --git a/dev-java/freenet-ext/files/freenet-ext-29-convert-jcpuid.patch b/dev-java/freenet-ext/files/freenet-ext-29-convert-jcpuid.patch
new file mode 100644
index 000000000000..e4c84b58ffee
--- /dev/null
+++ b/dev-java/freenet-ext/files/freenet-ext-29-convert-jcpuid.patch
@@ -0,0 +1,46 @@
+Backported from:
+
+From ec11ea4ca73646a790f20adf8ded2e48dedd96e5 Mon Sep 17 00:00:00 2001
+From: scintilla <scintilla>
+Date: Sun, 19 Dec 2004 06:25:27 +0000
+Subject: [PATCH] * Convert native jcpuid code from C++ to C. This should
+ alleviate build problems experienced by some users.
+
+--- /dev/null
++++ b/jcpuid/src/jcpuid.c
+@@ -0,0 +1,35 @@
++#include "jcpuid.h"
++
++//Executes the indicated subfunction of the CPUID operation
++JNIEXPORT jobject JNICALL Java_freenet_support_CPUInformation_CPUID_doCPUID
++ (JNIEnv * env, jclass cls, jint iFunction)
++{
++ int a,b,c,d;
++ jclass clsResult = (*env)->FindClass(env, "freenet/support/CPUInformation/CPUID$CPUIDResult");
++ jmethodID constructor = (*env)->GetMethodID(env, clsResult,"<init>","(IIII)V" );
++ #ifdef _MSC_VER
++ //Use MSVC assembler notation
++ _asm
++ {
++ mov eax, iFunction
++ cpuid
++ mov a, eax
++ mov b, ebx
++ mov c, ecx
++ mov d, edx
++ }
++ #else
++ //Use GCC assembler notation
++ asm
++ (
++ "cpuid"
++ : "=a" (a),
++ "=b" (b),
++ "=c"(c),
++ "=d"(d)
++ :"a"(iFunction)
++ );
++ #endif
++ return (*env)->NewObject(env, clsResult,constructor,a,b,c,d);
++}
++
diff --git a/dev-java/freenet-ext/freenet-ext-29.ebuild b/dev-java/freenet-ext/freenet-ext-29.ebuild
new file mode 100644
index 000000000000..b2818e3c7f56
--- /dev/null
+++ b/dev-java/freenet-ext/freenet-ext-29.ebuild
@@ -0,0 +1,79 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc source"
+MAVEN_ID="" # Empty since we only pick what's not packaged
+
+inherit java-pkg-2 java-pkg-simple toolchain-funcs
+
+DESCRIPTION="Freenet REference Daemon"
+HOMEPAGE="https://github.com/hyphanet/contrib/"
+SRC_URI="https://github.com/hyphanet/contrib/archive/v${PV}.tar.gz -> freenet-ext-${PV}.tar.gz"
+S="${WORKDIR}/contrib-${PV}"
+
+LICENSE="public-domain"
+SLOT="29"
+KEYWORDS="~amd64"
+
+DEPEND="
+ dev-libs/gmp:0=
+ >=virtual/jdk-1.8:*
+"
+RDEPEND=">=virtual/jre-1.8:*"
+
+PATCHES=(
+ "${FILESDIR}/freenet-ext-29-convert-jcpuid.patch"
+)
+
+JAVA_SRC_DIR=(
+ "freenet"
+ "freenet_ext"
+ "i2p"
+)
+
+src_prepare() {
+ default
+ java-pkg-2_src_prepare
+ mkdir -p i2p/net freenet || die
+ # From the java directory we need "java/net/i2p"
+ mv {java,i2p}/net/i2p || die
+ # and "java/freenet".
+ mv {java,freenet}/freenet || die
+}
+
+src_compile() {
+ java-pkg-simple_src_compile
+
+ local compile_lib
+ compile_lib() {
+ local name="${1}"
+ local file="${2}"
+ shift 2
+
+ "$(tc-getCC)" "${@}" ${CFLAGS} $(java-pkg_get-jni-cflags) \
+ ${LDFLAGS} -shared -fPIC "-Wl,-soname,lib${name}.so" \
+ "${file}" -o "lib${name}.so"
+ }
+
+ cd "${S}/NativeBigInteger/jbigi" || die "unable to cd to jbigi"
+ compile_lib jbigi src/jbigi.c -Iinclude -lgmp ||
+ die "unable to build jbigi"
+
+ if use amd64 || use x86; then
+ cd "${S}/jcpuid" || die "unable to cd to jcpuid"
+ compile_lib jcpuid src/jcpuid.c -Iinclude ||
+ die "unable to build jcpuid"
+ fi
+}
+
+src_install() {
+ java-pkg-simple_src_install
+
+ java-pkg_doso NativeBigInteger/jbigi/libjbigi.so
+
+ if use amd64 || use x86; then
+ java-pkg_doso jcpuid/libjcpuid.so
+ fi
+}
diff --git a/dev-java/freenet-ext/metadata.xml b/dev-java/freenet-ext/metadata.xml
new file mode 100644
index 000000000000..f76b8843b198
--- /dev/null
+++ b/dev-java/freenet-ext/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">hyphanet/contrib</remote-id>
+ </upstream>
+</pkgmetadata>