unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54701] [PATCH v3 0/3] Make big cursors work in programs running on openjdk.
@ 2022-04-03 23:05 dannym
  2022-04-03 23:17 ` [bug#54701] [PATCH v3 1/3] gnu: openjdk15: Make big cursors work dannym
  2022-04-18 11:01 ` bug#54701: [PATCH v3 0/3] Make big cursors work in programs running on openjdk Danny Milosavljevic
  0 siblings, 2 replies; 5+ messages in thread
From: dannym @ 2022-04-03 23:05 UTC (permalink / raw)
  To: 54701; +Cc: Danny Milosavljevic

From: Danny Milosavljevic <dannym@scratchpost.org>

This patch makes xterm use libxcursor directly.
Without it, libx11 would try to dlopen("libXcursor.so.1") and fail.

Fixes <https://issues.guix.gnu.org/54654>

Danny Milosavljevic (3):
  gnu: openjdk15: Make big cursors work.
  gnu: openjdk16: Make big cursors work.
  gnu: openjdk17: Make big cursors work.

 gnu/local.mk                                  |  1 +
 gnu/packages/java.scm                         | 15 +++-
 .../openjdk-15-xcursor-no-dynamic.patch       | 72 +++++++++++++++++++
 3 files changed, 85 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/openjdk-15-xcursor-no-dynamic.patch

-- 
2.34.0





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#54701] [PATCH v3 1/3] gnu: openjdk15: Make big cursors work.
  2022-04-03 23:05 [bug#54701] [PATCH v3 0/3] Make big cursors work in programs running on openjdk dannym
@ 2022-04-03 23:17 ` dannym
  2022-04-03 23:17   ` [bug#54701] [PATCH v3 2/3] gnu: openjdk16: " dannym
  2022-04-03 23:17   ` [bug#54701] [PATCH v3 3/3] gnu: openjdk17: " dannym
  2022-04-18 11:01 ` bug#54701: [PATCH v3 0/3] Make big cursors work in programs running on openjdk Danny Milosavljevic
  1 sibling, 2 replies; 5+ messages in thread
From: dannym @ 2022-04-03 23:17 UTC (permalink / raw)
  To: 54701; +Cc: Danny Milosavljevic

From: Danny Milosavljevic <dannym@scratchpost.org>

* gnu/packages/patches/openjdk-15-xcursor-no-dynamic.patch: New file.
* gnu/local.mk (dist_patch_DATA):  Add it.
* gnu/packages/java.scm (openjdk15)[source]: Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/java.scm                         |  7 +-
 .../openjdk-15-xcursor-no-dynamic.patch       | 72 +++++++++++++++++++
 3 files changed, 79 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/openjdk-15-xcursor-no-dynamic.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index a704161abc..ac8992885e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1564,6 +1564,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/opencascade-oce-glibc-2.26.patch		\
   %D%/packages/patches/openfoam-4.1-cleanup.patch			\
   %D%/packages/patches/openjdk-10-idlj-reproducibility.patch	\
+  %D%/packages/patches/openjdk-15-xcursor-no-dynamic.patch	\
   %D%/packages/patches/openmpi-mtl-priorities.patch		\
   %D%/packages/patches/openssh-hurd.patch			\
   %D%/packages/patches/openresolv-restartcmd-guix.patch	\
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index b27892841e..b0908cc15a 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2185,7 +2185,12 @@ (define-public openjdk15
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "168cr08nywp0q3vyj8njkhsmmnyd8rz9r58hk4xhzdzc6bdfkl1i"))))
+                "168cr08nywp0q3vyj8njkhsmmnyd8rz9r58hk4xhzdzc6bdfkl1i"))
+              (patches
+                (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
+    (inputs
+     (cons `("libxcursor" ,libxcursor) ; for our patch to work
+           (package-inputs openjdk14)))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("openjdk14:jdk" ,openjdk14 "jdk")
diff --git a/gnu/packages/patches/openjdk-15-xcursor-no-dynamic.patch b/gnu/packages/patches/openjdk-15-xcursor-no-dynamic.patch
new file mode 100644
index 0000000000..9325dd3da6
--- /dev/null
+++ b/gnu/packages/patches/openjdk-15-xcursor-no-dynamic.patch
@@ -0,0 +1,72 @@
+From: Danny Milosavljevic <dannym@scratchpost.org>
+Date: Thu, 31 Mar 2022 17:02:00 +0200
+Subject: Make openjdk use libxcursor directly
+
+Fixes <https://issues.guix.gnu.org/54654>.
+
+This patch makes openjdk use libxcursor directly.
+Without it, libx11 would try to dlopen("libXcursor.so.1") and fail.
+
+diff -ru orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/make/modules/java.desktop/lib/Awt2dLibraries.gmk 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/make/modules/java.desktop/lib/Awt2dLibraries.gmk
+--- orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/make/modules/java.desktop/lib/Awt2dLibraries.gmk	2022-03-31 15:34:08.773419480 +0200
++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/make/modules/java.desktop/lib/Awt2dLibraries.gmk	2022-03-31 21:36:27.854273411 +0200
+@@ -217,7 +217,7 @@
+       endif
+     endif
+ 
+-    LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm
++    LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXcursor -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm
+ 
+     ifeq ($(call isTargetOs, linux), true)
+       LIBAWT_XAWT_LIBS += -lpthread
+diff -ru orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c
+--- orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c	2022-03-31 15:34:11.917502206 +0200
++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c	2022-03-31 21:38:16.417253535 +0200
+@@ -40,10 +40,12 @@
+ #include <X11/keysym.h>
+ #include <X11/Sunkeysym.h>
+ #include <X11/Xlib.h>
++#include <X11/Xlibint.h>
+ #include <X11/Xatom.h>
+ #include <X11/XKBlib.h>
+ #include <X11/Xos.h>
+ #include <X11/Xutil.h>
++#include <X11/Xcursor/Xcursor.h>
+ 
+ #if defined(AIX)
+ #undef X_HAVE_UTF8_STRING
+@@ -972,10 +974,21 @@
+ 
+ }
+ 
++static XColor _Xconst foreground = { 0,    0,     0,     0  };  /* black */
++static XColor _Xconst background = { 0, 65535, 65535, 65535 };  /* white */
++
+ JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XCreateFontCursor
+ (JNIEnv *env, jclass clazz, jlong display, jint shape) {
+     AWT_CHECK_HAVE_LOCK_RETURN(0);
+-    return XCreateFontCursor((Display *) jlong_to_ptr(display), (int) shape);
++    Display * dpy = (Display *) jlong_to_ptr(display);
++    if (dpy->cursor_font == None) {
++        dpy->cursor_font = XLoadFont(dpy, "cursor");
++        if (dpy->cursor_font == None) return None;
++    }
++    Cursor result = XcursorTryShapeCursor(dpy, dpy->cursor_font, dpy->cursor_font, (int) shape, (int) shape + 1, &foreground, &background);
++    if (!result)
++        result = XCreateFontCursor(dpy, (int) shape);
++    return result;
+ }
+ 
+ /*
+diff -ru orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/test/jdk/java/awt/JAWT/Makefile.unix 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/test/jdk/java/awt/JAWT/Makefile.unix
+--- orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/test/jdk/java/awt/JAWT/Makefile.unix	2022-03-31 15:34:10.553466316 +0200
++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/test/jdk/java/awt/JAWT/Makefile.unix	2022-03-31 21:36:27.854273411 +0200
+@@ -31,7 +31,7 @@
+ 
+ J_INC =		$(TESTJAVA)/include
+ INCLUDES =	-I$(J_INC) -I$(J_INC)/$(SYST) -I.
+-LIBS =		-L$(TESTJAVA)/lib -ljawt -lX11
++LIBS =		-L$(TESTJAVA)/lib -ljawt -lX11 -lXcursor
+ 
+ all:		$(CLASSES) libmylib.so
+ 
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#54701] [PATCH v3 2/3] gnu: openjdk16: Make big cursors work.
  2022-04-03 23:17 ` [bug#54701] [PATCH v3 1/3] gnu: openjdk15: Make big cursors work dannym
@ 2022-04-03 23:17   ` dannym
  2022-04-03 23:17   ` [bug#54701] [PATCH v3 3/3] gnu: openjdk17: " dannym
  1 sibling, 0 replies; 5+ messages in thread
From: dannym @ 2022-04-03 23:17 UTC (permalink / raw)
  To: 54701; +Cc: Danny Milosavljevic

From: Danny Milosavljevic <dannym@scratchpost.org>

* gnu/packages/java.scm (openjdk16)[source]: Add patch.
---
 gnu/packages/java.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index b0908cc15a..169e104c05 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2213,7 +2213,9 @@ (define-public openjdk16
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1ggddsbsar4dj2fycfqqqagqil7prhb30afvq6933rz7pa9apm2f"))))
+                "1ggddsbsar4dj2fycfqqqagqil7prhb30afvq6933rz7pa9apm2f"))
+              (patches
+                (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("openjdk15:jdk" ,openjdk15 "jdk")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#54701] [PATCH v3 3/3] gnu: openjdk17: Make big cursors work.
  2022-04-03 23:17 ` [bug#54701] [PATCH v3 1/3] gnu: openjdk15: Make big cursors work dannym
  2022-04-03 23:17   ` [bug#54701] [PATCH v3 2/3] gnu: openjdk16: " dannym
@ 2022-04-03 23:17   ` dannym
  1 sibling, 0 replies; 5+ messages in thread
From: dannym @ 2022-04-03 23:17 UTC (permalink / raw)
  To: 54701; +Cc: Danny Milosavljevic

From: Danny Milosavljevic <dannym@scratchpost.org>

* gnu/packages/java.scm (openjdk17)[source]: Add patch.
---
 gnu/packages/java.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 169e104c05..43422f383f 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2250,7 +2250,9 @@ (define-public openjdk17
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1l1jgbz8q7zq66npfg88r0l5xga427vrz35iys09j44b6qllrldd"))))
+                "1l1jgbz8q7zq66npfg88r0l5xga427vrz35iys09j44b6qllrldd"))
+              (patches
+                (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("openjdk16:jdk" ,openjdk16 "jdk")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#54701: [PATCH v3 0/3] Make big cursors work in programs running on openjdk.
  2022-04-03 23:05 [bug#54701] [PATCH v3 0/3] Make big cursors work in programs running on openjdk dannym
  2022-04-03 23:17 ` [bug#54701] [PATCH v3 1/3] gnu: openjdk15: Make big cursors work dannym
@ 2022-04-18 11:01 ` Danny Milosavljevic
  1 sibling, 0 replies; 5+ messages in thread
From: Danny Milosavljevic @ 2022-04-18 11:01 UTC (permalink / raw)
  To: 54701-done

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

Pushed openjdk big cursors to guix master as these commits:

* Commit f4dd7bf94e1c21e0ecc1ecc1bc0afb9dce403cf5 for openjdk15
* Commit aa01b37ef66fad2cf35f4a4ca85cc8d930d12ce4 for openjdk16
* Commit 237d90a7808cfdced34b34595eba16632cbcb89e for openjdk17

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-18 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 23:05 [bug#54701] [PATCH v3 0/3] Make big cursors work in programs running on openjdk dannym
2022-04-03 23:17 ` [bug#54701] [PATCH v3 1/3] gnu: openjdk15: Make big cursors work dannym
2022-04-03 23:17   ` [bug#54701] [PATCH v3 2/3] gnu: openjdk16: " dannym
2022-04-03 23:17   ` [bug#54701] [PATCH v3 3/3] gnu: openjdk17: " dannym
2022-04-18 11:01 ` bug#54701: [PATCH v3 0/3] Make big cursors work in programs running on openjdk Danny Milosavljevic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).