summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinori Hattori <hattya@gentoo.org>2022-09-11 10:46:47 +0900
committerAkinori Hattori <hattya@gentoo.org>2022-09-11 10:46:47 +0900
commitfb87abe19150270ba0448d6192e0d6d0d5e782cc (patch)
tree2dd6bbb28643131687fb1ec89c81f2cd4a025d72 /app-text/hyperestraier
parentdev-lang/php: Version bump for 8.0.23 (diff)
downloadgentoo-fb87abe19150270ba0448d6192e0d6d0d5e782cc.tar.gz
gentoo-fb87abe19150270ba0448d6192e0d6d0d5e782cc.tar.bz2
gentoo-fb87abe19150270ba0448d6192e0d6d0d5e782cc.zip
app-text/hyperestraier: fix build with Java 11+
Closes: https://bugs.gentoo.org/867862 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Akinori Hattori <hattya@gentoo.org>
Diffstat (limited to 'app-text/hyperestraier')
-rw-r--r--app-text/hyperestraier/files/hyperestraier-java-11.patch78
-rw-r--r--app-text/hyperestraier/hyperestraier-1.4.13-r2.ebuild (renamed from app-text/hyperestraier/hyperestraier-1.4.13-r1.ebuild)3
2 files changed, 80 insertions, 1 deletions
diff --git a/app-text/hyperestraier/files/hyperestraier-java-11.patch b/app-text/hyperestraier/files/hyperestraier-java-11.patch
new file mode 100644
index 000000000000..fa143fb23872
--- /dev/null
+++ b/app-text/hyperestraier/files/hyperestraier-java-11.patch
@@ -0,0 +1,78 @@
+--- a/javanative/Database.java
++++ b/javanative/Database.java
+@@ -135,7 +135,7 @@
+ /** last happened error code */
+ private int ecode;
+ /** callback function to inform of database events */
+- private DatabaseInformer informer;
++ private long informer;
+ //----------------------------------------------------------------
+ // constructors and finalizers
+ //----------------------------------------------------------------
+--- a/javanative/database.c
++++ b/javanative/database.c
+@@ -19,7 +19,7 @@
+
+
+ /* global variables */
+-JNIEnv *infoenv = NULL;
++static JavaVM* jvm = NULL;
+
+
+ /* private function prototypes */
+@@ -181,8 +181,8 @@
+ err = TRUE;
+ }
+ (*env)->SetLongField(env, obj, fid, 0);
+- fid = (*env)->GetFieldID(env, cls, "informer", "L" CLSDBINFO ";");
+- if((infoobj = (*env)->GetObjectField(env, obj, fid)) != NULL)
++ fid = (*env)->GetFieldID(env, cls, "informer", "J");
++ if((infoobj = (jobject)(*env)->GetLongField(env, obj, fid)) != NULL)
+ (*env)->DeleteGlobalRef(env, infoobj);
+ (*env)->SetObjectField(env, obj, fid, NULL);
+ return err ? FALSE : TRUE;
+@@ -735,16 +735,17 @@
+ throwillarg(env);
+ return;
+ }
+- fid = (*env)->GetFieldID(env, cls, "informer", "L" CLSDBINFO ";");
+- if((oldobj = (*env)->GetObjectField(env, obj, fid)) != NULL)
++ fid = (*env)->GetFieldID(env, cls, "informer", "J");
++ if((oldobj = (jobject)(*env)->GetLongField(env, obj, fid)) != NULL)
+ (*env)->DeleteGlobalRef(env, oldobj);
+ (*env)->SetObjectField(env, obj, fid, NULL);
+ if(!(informer = (*env)->NewGlobalRef(env, informer))){
+ throwoutmem(env);
+ return;
+ }
+- (*env)->SetObjectField(env, obj, fid, informer);
+- infoenv = env;
++ (*env)->SetLongField(env, obj, fid, (PTRNUM)informer);
++ if(jvm == NULL)
++ (*env)->GetJavaVM(env, &jvm);
+ est_mtdb_set_informer((ESTMTDB *)(PTRNUM)coreptr, dbinform, informer);
+ }
+
+@@ -767,10 +768,12 @@
+
+ /* callback function for database events */
+ static void dbinform(const char *message, void *opaque){
++ JNIEnv *infoenv;
+ jstring msgobj;
+ jobject opobj;
+ jclass cls;
+ jmethodID mid;
++ (*jvm)->GetEnv(jvm, (void **)&infoenv, JNI_VERSION_1_8);
+ if(!(msgobj = (*infoenv)->NewStringUTF(infoenv, message))) return;
+ opobj = (jobject)opaque;
+ cls = (*infoenv)->GetObjectClass(infoenv, opobj);
+--- a/javanative/myconf.h
++++ b/javanative/myconf.h
+@@ -69,7 +69,6 @@
+ #define CLSDOC "estraier/Document"
+ #define CLSCOND "estraier/Condition"
+ #define CLSDB "estraier/Database"
+-#define CLSDBINFO "estraier/DatabaseInformer"
+ #define CLSRES "estraier/Result"
+
+
diff --git a/app-text/hyperestraier/hyperestraier-1.4.13-r1.ebuild b/app-text/hyperestraier/hyperestraier-1.4.13-r2.ebuild
index 28d438f7c840..94667fffd8b0 100644
--- a/app-text/hyperestraier/hyperestraier-1.4.13-r1.ebuild
+++ b/app-text/hyperestraier/hyperestraier-1.4.13-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
@@ -31,6 +31,7 @@ S="${WORKDIR}/all/${P}"
PATCHES=(
"${FILESDIR}"/${PN}-configure.patch
+ "${FILESDIR}"/${PN}-java-11.patch
"${FILESDIR}"/${PN}-perl.patch
"${FILESDIR}"/${PN}-ruby19.patch
)