[PATCH] gnu: xterm: Make big cursors work.

DoneSubmitted by dannym.
Details
2 participants
  • dannym
  • Ludovic Courtès
Owner
unassigned
Severity
normal
D
D
dannym wrote on 2 Apr 12:15 +0200
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20220402101548.6760-1-dannym@scratchpost.org
From: Danny Milosavljevic <dannym@scratchpost.org>

* gnu/packages/patches/xterm-370-explicit-xcursor.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/xorg.scm (xterm)[source]: Add it.
[arguments]<#:configure-flags>: Add "-lXcursor".
---
gnu/local.mk | 1 +
.../patches/xterm-370-explicit-xcursor.patch | 37 +++++++++++++++++++
gnu/packages/xorg.scm | 7 +++-
3 files changed, 43 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/xterm-370-explicit-xcursor.patch

Toggle diff (79 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ac8992885e..3896f13074 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1975,6 +1975,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch	\
   %D%/packages/patches/xsane-support-ipv6.patch			\
   %D%/packages/patches/xsane-tighten-default-umask.patch	\
+  %D%/packages/patches/xterm-370-explicit-xcursor.patch		\
   %D%/packages/patches/xygrib-fix-finding-data.patch		\
   %D%/packages/patches/yggdrasil-extra-config.patch	\
   %D%/packages/patches/ytfzf-programs.patch        \
diff --git a/gnu/packages/patches/xterm-370-explicit-xcursor.patch b/gnu/packages/patches/xterm-370-explicit-xcursor.patch
new file mode 100644
index 0000000000..2500ccf0c8
--- /dev/null
+++ b/gnu/packages/patches/xterm-370-explicit-xcursor.patch
@@ -0,0 +1,37 @@
+From: Danny Milosavljevic <dannym@scratchpost.org>
+Date: Thu, 2 Apr 2022 12:10:00 +0200
+Subject: Make xterm use libxcursor directly
+
+Fixes <https://issues.guix.gnu.org/54654>.
+
+This patch makes xterm use libxcursor directly.
+Without it, libx11 would try to dlopen("libXcursor.so.1") and fail.
+
+--- xterm-370/misc.c.orig	2022-04-02 11:52:26.225131854 +0200
++++ xterm-370/misc.c	2022-04-02 12:06:13.091482385 +0200
+@@ -79,6 +79,9 @@
+ #ifdef HAVE_LIBXPM
+ #include <X11/xpm.h>
+ #endif
++#ifdef HAVE_LIB_XCURSOR
++#include <X11/Xcursor/Xcursor.h>
++#endif
+ 
+ #ifdef HAVE_LANGINFO_CODESET
+ #include <langinfo.h>
+@@ -866,7 +869,14 @@
+ 		 * 0, 2 a shape, 3 a mask for 2, etc.  <X11/cursorfont.h>
+ 		 * contains defined names for each shape.
+ 		 */
+-		c = XCreateGlyphCursor(dpy,
++		c = XcursorTryShapeCursor(dpy,
++				       myFont.fs->fid, /* source_font */
++				       myFont.fs->fid, /* mask_font */
++				       c_index + 0, /* source_char */
++				       c_index + 1, /* mask_char */
++				       &foreground,
++				       &background);
++		if (c == None) c = XCreateGlyphCursor(dpy,
+ 				       myFont.fs->fid,	/* source_font */
+ 				       myFont.fs->fid,	/* mask_font */
+ 				       c_index + 0,	/* source_char */
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 14cd3bc789..75a7bbd01c 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -6144,12 +6144,15 @@ (define-public xterm
              (string-append "ftp://ftp.invisible-island.net/xterm/"
                             "xterm-" version ".tgz")))
        (sha256
-        (base32 "10lc72spa69n9d7zg9nwhgwz70qzidp5i17jgw3lq3qg1a25sg4n"))))
+        (base32 "10lc72spa69n9d7zg9nwhgwz70qzidp5i17jgw3lq3qg1a25sg4n"))
+       (patches
+         (search-patches "xterm-370-explicit-xcursor.patch"))))
     (build-system gnu-build-system)
     (arguments
      '(#:configure-flags '("--enable-wide-chars" "--enable-load-vt-fonts"
                            "--enable-i18n" "--enable-doublechars"
-                           "--enable-luit" "--enable-mini-luit")
+                           "--enable-luit" "--enable-mini-luit"
+                           "X_EXTRA_LIBS=-lXcursor")
        #:tests? #f                      ; no test suite
        #:phases
        (modify-phases %standard-phases
-- 
2.34.0
L
L
Ludovic Courtès wrote on 3 Apr 12:39 +0200
(address . dannym@scratchpost.org)(address . 54680@debbugs.gnu.org)
87y20mv4c3.fsf@gnu.org
Hi Danny,

dannym@scratchpost.org skribis:

Toggle quote (7 lines)
> From: Danny Milosavljevic <dannym@scratchpost.org>
>
> * gnu/packages/patches/xterm-370-explicit-xcursor.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/xorg.scm (xterm)[source]: Add it.
> [arguments]<#:configure-flags>: Add "-lXcursor".

Well done. :-) LGTM, please push!

Thanks,
Ludo’.
D
D
Danny Milosavljevic wrote on 3 Apr 13:51 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 54680-done@debbugs.gnu.org)
20220403135152.5fdc47da@scratchpost.org
Hi Ludo,

On Sun, 03 Apr 2022 12:39:08 +0200
Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (11 lines)
> dannym@scratchpost.org skribis:
>
> > From: Danny Milosavljevic <dannym@scratchpost.org>
> >
> > * gnu/packages/patches/xterm-370-explicit-xcursor.patch: New file.
> > * gnu/local.mk (dist_patch_DATA): Add it.
> > * gnu/packages/xorg.scm (xterm)[source]: Add it.
> > [arguments]<#:configure-flags>: Add "-lXcursor".
>
> Well done. :-) LGTM, please push!

Thanks :)

Pushed to guix master as commit 32d1f71593dc381880b42a3277fdf457df0be25d.

Now I can stop wiggling my mouse wildly to find where the tiny cursor is.
Phiew :)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAmJJilgACgkQ5xo1VCww
uqXu0Qf/SbpIzaPL3nBo3rhZa6/0iEFxUe6Rt+BQIXBRsCPZz19sqlmnG1e5xNFz
EfmyYy4ZG7odIt/xoJ+y1RQqD4sO41Ui+Eyb3XrhrXitZRDdJXU7MpqNX/r39bzc
YsVTo4Q0OKA011jLyICm0LmsUdFboRvJulgk4svg2OHtL0cxdxPjY51iC6hZ/mFZ
/WaO+13livXQ/9TfmezrVN4lYQCjIlmHHg12+52pnzBiFwsjgxS/HUawbVDjrvJt
x/JHn2j6wNWajhKyyU2BukQlEmbwIfYLsetFNsnrZHLM9lPVrXjl00I22TXLyCwF
5t2TsizB2V6PZBAzhda9BeK+foBZ7w==
=3nrW
-----END PGP SIGNATURE-----


Closed
L
L
Ludovic Courtès wrote on 4 Apr 22:14 +0200
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 54680-done@debbugs.gnu.org)
875ynotxlt.fsf@gnu.org
Danny Milosavljevic <dannym@scratchpost.org> skribis:

Toggle quote (3 lines)
> Now I can stop wiggling my mouse wildly to find where the tiny cursor is.
> Phiew :)

It’s a problem I’ve been having but didn’t dare mention publicly. :-)
So thank you!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 54680@debbugs.gnu.org