summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2023-12-01 15:30:06 +0100
committerNicola Vitale <nivit@FreeBSD.org>2023-12-01 15:34:10 +0100
commit9792df1e16be41a313cc76824bbc3a8bb558d5f1 (patch)
treec9d3d2477371b55ff81dbce268c1c0570385a391
parentx11/gtklock: add new port (diff)
x11/kitty: Fix error with kitty+fish without sudo
If a user has fish as shell and sudo is not installed, then kitty prints the following error: type: Could not find 'sudo' test: Expected a combining operator like '-a' at index 5 -n /usr/local/share/kitty/terminfo -a file = ^ Standard input (line 114): and test -n "$TERMINFO" -a "file" = (type -t sudo) ^ in function '__ksi_schedule' in event handler: handler for generic event 'fish_prompt' - Add a patch to fix that error and to tests the presence of the xterm-kitty file in DATADIR - Bump PORTREVISION PR: 275339
-rw-r--r--x11/kitty/Makefile4
-rw-r--r--x11/kitty/files/patch-shell-integration_fish_vendor__conf.d_kitty-shell-integration.fish13
2 files changed, 16 insertions, 1 deletions
diff --git a/x11/kitty/Makefile b/x11/kitty/Makefile
index 9369483e83c0..f13c8bd2147a 100644
--- a/x11/kitty/Makefile
+++ b/x11/kitty/Makefile
@@ -1,7 +1,7 @@
PORTNAME= kitty
DISTVERSIONPREFIX= v
DISTVERSION= 0.31.0
-PORTREVISION= 0
+PORTREVISION= 1
CATEGORIES= x11 wayland
MAINTAINER= nivit@FreeBSD.org
@@ -103,6 +103,8 @@ EXTRA_PATCHES= ${PATCHDIR}/extra-patch-kitty_data-types.h
post-patch:
${REINPLACE_CMD} -i.bak -e "s:'go':'${GO_CMD}':1" ${WRKSRC}/setup.py
+ ${REINPLACE_CMD} -i.bak -e "s:%%DATADIR%%:${DATADIR}:1" \
+ ${WRKSRC}/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish
# For librsync, we need to set header and library path
do-build:
diff --git a/x11/kitty/files/patch-shell-integration_fish_vendor__conf.d_kitty-shell-integration.fish b/x11/kitty/files/patch-shell-integration_fish_vendor__conf.d_kitty-shell-integration.fish
new file mode 100644
index 000000000000..3a6ccbc8db7a
--- /dev/null
+++ b/x11/kitty/files/patch-shell-integration_fish_vendor__conf.d_kitty-shell-integration.fish
@@ -0,0 +1,13 @@
+--- shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish.orig 2023-12-01 13:31:58 UTC
++++ shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish
+@@ -111,8 +111,8 @@ function __ksi_schedule --on-event fish_prompt -d "Set
+ # Note that neither alias nor function is recursive in fish so if the user defines an alias/function
+ # for sudo it will be clobbered by us, so only install this if sudo is not already function
+ if not contains "no-sudo" $_ksi
+- and test -n "$TERMINFO" -a "file" = (type -t sudo)
+- and not test -r "/usr/share/terminfo/x/xterm-kitty" -o -r "/usr/share/terminfo/78/xterm-kitty"
++ and test -n "$TERMINFO" -a "file" = "(type -t sudo)"
++ and not test -r "%%DATADIR%%/terminfo/x/xterm-kitty" -o -r "/usr/share/terminfo/x/xterm-kitty" -o -r "/usr/share/terminfo/78/xterm-kitty"
+ # Ensure terminfo is available in sudo
+ function sudo
+ set --local is_sudoedit "n"