git: 859d9a5a49a0 - main - x11/kitty: Update to 0.35.2

From: Nicola Vitale <nivit_at_FreeBSD.org>
Date: Wed, 03 Jul 2024 15:58:46 UTC
The branch main has been updated by nivit:

URL: https://cgit.FreeBSD.org/ports/commit/?id=859d9a5a49a016e897d59ce56d46c0de41af1208

commit 859d9a5a49a016e897d59ce56d46c0de41af1208
Author:     Nicola Vitale <nivit@FreeBSD.org>
AuthorDate: 2024-07-03 15:51:11 +0000
Commit:     Nicola Vitale <nivit@FreeBSD.org>
CommitDate: 2024-07-03 15:58:33 +0000

    x11/kitty: Update to 0.35.2
    
    - Pet portfmt
    - Add a couple of patches to fix these compilation errors:
    
    1)
    
    glfw/wl_init.c:653:5: error: use of undeclared identifier errno
        errno = ENOSYS;
        ^
    glfw/wl_init.c:653:13: error: use of undeclared identifier ENOSYS
        errno = ENOSYS;
                ^
    glfw/wl_init.c:639:25: error: unused parameter fd [-Werror,-Wunused-parameter]
    get_socket_peer_pid(int fd) {
                            ^
    3 errors generated.
     done
    Compiling [wayland] glfw/wl_init.c ...
    cc -MMD -DNDEBUG -DEPOLL_SHIM_DISABLE_WRAPPER_MACROS -I/usr/local/include/libepoll-shim -D_GLFW_WAYLAND -D_GLFW_BUILD_DLL -Wextra -Wfloat-conversion -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11 -pedantic-errors -Werror -O3 -fwrapv -fstack-pro
    tector-strong -pipe -fvisibility=hidden -fno-plt -fPIC -O2 -pipe -Wno-error=invalid-utf8 -Winvalid-utf8 -fstack-protector-strong -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -flto -I/usr/local/include -fcf-protection=full -fPIC -pthread -I/usr/local/include -I/usr/loc
    al/include/libepoll-shim -I/usr/local/include -I/usr/local/include/libepoll-shim -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -c glfw/wl_init.c -o build/glfw-wayland-glfw-wl_init.c.o
    *** Error code 1
    
    2)
    
    [21/120] Compiling kitty/line.c ...
    glfw/wl_client_side_decorations.c:809:19: error: use of undeclared identifier BTN_LEFT
        if (button == BTN_LEFT) {
                      ^
    glfw/wl_client_side_decorations.c:846:24: error: use of undeclared identifier BTN_RIGHT
        else if (button == BTN_RIGHT) {
                           ^
    2 errors generated.
     done
    Compiling [wayland] glfw/wl_client_side_decorations.c ...
    cc -MMD -DNDEBUG -DEPOLL_SHIM_DISABLE_WRAPPER_MACROS -I/usr/local/include/libepoll-shim -D_GLFW_WAYLAND -D_GLFW_BUILD_DLL -Wextra -Wfloat-conversion -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11 -pedantic-errors -Werror -O3 -fwrapv -fstack-pro
    tector-strong -pipe -fvisibility=hidden -fno-plt -fPIC -O2 -pipe -Wno-error=invalid-utf8 -Winvalid-utf8 -fstack-protector-strong -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -flto -I/usr/local/include -fcf-protection=full -fPIC -pthread -I/usr/local/include -I/usr/loc
    al/include/libepoll-shim -I/usr/local/include -I/usr/local/include/libepoll-shim -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -c glfw/wl_client_side_decorations.c -o build/glfw-wayland-glfw-wl_client_side_decorations.c.o
    *** Error code 1
    
    Release changes:        https://sw.kovidgoyal.net/kitty/changelog/#detailed-list-of-changes
    Reported by:    portscout
---
 x11/kitty/Makefile                                 |  9 +++----
 x11/kitty/distinfo                                 | 10 +++----
 x11/kitty/files/patch-docs_changelog.rst           |  6 ++---
 .../patch-glfw_wl__client__side__decorations.c     | 26 ++++++++++++++++++
 x11/kitty/files/patch-glfw_wl__init.c              | 18 +++++++++++++
 x11/kitty/files/patch-setup.py                     | 31 +---------------------
 ...ish_vendor__conf.d_kitty-shell-integration.fish | 21 ++-------------
 x11/kitty/pkg-plist                                |  7 ++++-
 8 files changed, 65 insertions(+), 63 deletions(-)

diff --git a/x11/kitty/Makefile b/x11/kitty/Makefile
index 38d0df5b3554..db0ec4b04c6b 100644
--- a/x11/kitty/Makefile
+++ b/x11/kitty/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	kitty
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.33.1
-PORTREVISION=	4
+DISTVERSION=	0.35.2
+PORTREVISION=	0
 CATEGORIES=	x11 wayland
 
 MAINTAINER=	nivit@FreeBSD.org
@@ -17,8 +17,8 @@ BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}furo>0:textproc/py-furo@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}sphinx-inline-tabs>0:textproc/py-sphinx-inline-tabs@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}sphinxext-opengraph>0:textproc/py-sphinxext-opengraph@${PY_FLAVOR} \
 		roboto-fonts-ttf>0:x11-fonts/roboto-fonts-ttf \
-		sphinx-build:textproc/py-sphinx@${PY_FLAVOR} \
 		simde>=0.7.6:devel/simde \
+		sphinx-build:textproc/py-sphinx@${PY_FLAVOR} \
 		wayland-protocols>=0:graphics/wayland-protocols
 LIB_DEPENDS=	libcanberra.so:audio/libcanberra \
 		libdbus-1.so:devel/dbus \
@@ -42,8 +42,7 @@ CPE_VENDOR=	kitty_project
 USE_GL=		gl
 USE_XORG=	x11 xcb xcursor xi xinerama xrandr
 
-SHEBANG_FILES=	build-terminfo count-lines-of-code mypy-editor-integration \
-		update-on-ox
+SHEBANG_FILES=	build-terminfo count-lines-of-code update-on-ox
 SHEBANG_GLOB=	*.py
 
 GO_MODULE=	github.com/kovidgoyal/kitty
diff --git a/x11/kitty/distinfo b/x11/kitty/distinfo
index 314a228fa091..bcddd337073e 100644
--- a/x11/kitty/distinfo
+++ b/x11/kitty/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1711028602
-SHA256 (go/x11_kitty/kitty-v0.33.1/v0.33.1.mod) = 97db06cc839bf036265de51b099813c47d974135cef9afc02fb502571581c7b7
-SIZE (go/x11_kitty/kitty-v0.33.1/v0.33.1.mod) = 1049
-SHA256 (go/x11_kitty/kitty-v0.33.1/v0.33.1.zip) = aaf429874de0afa15461f895fbaa59f19e963e110994f9c02521e9a66f7b48f1
-SIZE (go/x11_kitty/kitty-v0.33.1/v0.33.1.zip) = 8586033
+TIMESTAMP = 1719230646
+SHA256 (go/x11_kitty/kitty-v0.35.2/v0.35.2.mod) = 949b79c576c4ea1338d9eceae3e964bfa281d66d33a5c9c2978ff71ab6ea5372
+SIZE (go/x11_kitty/kitty-v0.35.2/v0.35.2.mod) = 1237
+SHA256 (go/x11_kitty/kitty-v0.35.2/v0.35.2.zip) = a3a19216e0445658cbef63761508afeef61e1ac5dfd21ed9f6638a6d2137d3bf
+SIZE (go/x11_kitty/kitty-v0.35.2/v0.35.2.zip) = 8549754
diff --git a/x11/kitty/files/patch-docs_changelog.rst b/x11/kitty/files/patch-docs_changelog.rst
index 537aa9a64055..8d9b96141ae6 100644
--- a/x11/kitty/files/patch-docs_changelog.rst
+++ b/x11/kitty/files/patch-docs_changelog.rst
@@ -1,6 +1,6 @@
 --- docs/changelog.rst.orig	1979-11-29 23:00:00 UTC
 +++ docs/changelog.rst
-@@ -3187,7 +3187,7 @@ - A :doc:`new kitten <kittens/panel>` to create dock p
+@@ -3391,7 +3391,7 @@ - A :doc:`new kitten <kittens/panel>` to create dock p
  - A :doc:`new kitten <kittens/panel>` to create dock panels on X11 desktops
    showing the output from arbitrary terminal programs.
  
@@ -9,7 +9,7 @@
  
  - Implement changing the font size for individual top level (OS) windows
    (:iss:`408`)
-@@ -3302,7 +3302,7 @@ - Implement support for the SGR *faint* escape code to
+@@ -3506,7 +3506,7 @@ - Implement support for the SGR *faint* escape code to
  - Implement support for the SGR *faint* escape code to make text blend
    into the background (:iss:`446`).
  
@@ -18,7 +18,7 @@
    so that URLs that stretch over multiple lines are detected. Also improve
    detection of surrounding brackets/quotes.
  
-@@ -3314,7 +3314,7 @@ - Expand environment variables in config file include 
+@@ -3518,7 +3518,7 @@ - Expand environment variables in config file include 
  
  - Expand environment variables in config file include directives
  
diff --git a/x11/kitty/files/patch-glfw_wl__client__side__decorations.c b/x11/kitty/files/patch-glfw_wl__client__side__decorations.c
new file mode 100644
index 000000000000..649ae6bd325d
--- /dev/null
+++ b/x11/kitty/files/patch-glfw_wl__client__side__decorations.c
@@ -0,0 +1,26 @@
+--- glfw/wl_client_side_decorations.c.orig	1979-11-29 23:00:00 UTC
++++ glfw/wl_client_side_decorations.c
+@@ -8,10 +8,23 @@
+ #include "wl_client_side_decorations.h"
+ 
+ #include "backend_utils.h"
++#include <sys/param.h>
++#include <sys/ucred.h>
+ #include <sys/mman.h>
+ #include <errno.h>
+ #include <string.h>
+ #include <stdlib.h>
++
++// Needed for the BTN_* definitions
++#ifdef __has_include
++#if __has_include(<linux/input.h>)
++#include <linux/input.h>
++#elif __has_include(<dev/evdev/input.h>)
++#include <dev/evdev/input.h>
++#endif
++#else
++#include <linux/input.h>
++#endif
+ 
+ #define decs window->wl.decorations
+ #define debug debug_rendering
diff --git a/x11/kitty/files/patch-glfw_wl__init.c b/x11/kitty/files/patch-glfw_wl__init.c
new file mode 100644
index 000000000000..8e69b3d3f923
--- /dev/null
+++ b/x11/kitty/files/patch-glfw_wl__init.c
@@ -0,0 +1,18 @@
+--- glfw/wl_init.c.orig	1979-11-29 23:00:00 UTC
++++ glfw/wl_init.c
+@@ -36,6 +36,7 @@
+ #include "wayland-text-input-unstable-v3-client-protocol.h"
+ 
+ #include <stdio.h>
++#include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/mman.h>
+@@ -637,6 +638,7 @@ get_socket_peer_pid(int fd) {
+ 
+ static pid_t
+ get_socket_peer_pid(int fd) {
++    (void)fd;
+ #ifdef __linux__
+     struct ucred ucred;
+     socklen_t len = sizeof(struct ucred);
diff --git a/x11/kitty/files/patch-setup.py b/x11/kitty/files/patch-setup.py
index 21df40b73c3a..95bfcb34ff8c 100644
--- a/x11/kitty/files/patch-setup.py
+++ b/x11/kitty/files/patch-setup.py
@@ -1,35 +1,6 @@
 --- setup.py.orig	1979-11-29 23:00:00 UTC
 +++ setup.py
-@@ -218,25 +218,10 @@ def libcrypto_flags() -> Tuple[List[str], List[str]]:
-     # Apple use their special snowflake TLS libraries and additionally
-     # have an ancient broken system OpenSSL, so we need to check for one
-     # installed by all the various macOS package managers.
--    extra_pc_dir = ''
-+    cflags = [f"-I{sys.prefix}/include"]
-+    libs = [f"-L{sys.prefix}/lib", "-lcrypto"]
- 
--    try:
--        cflags = pkg_config('libcrypto', '--cflags-only-I', fatal=False)
--    except subprocess.CalledProcessError:
--        if is_macos:
--            import ssl
--            v = ssl.OPENSSL_VERSION_INFO
--            pats = f'{v[0]}.{v[1]}', f'{v[0]}'
--            for pat in pats:
--                q = f'opt/openssl@{pat}/lib/pkgconfig'
--                openssl_dirs = glob.glob(f'/opt/homebrew/{q}') + glob.glob(f'/usr/local/{q}')
--                if openssl_dirs:
--                    break
--            if not openssl_dirs:
--                raise SystemExit(f'Failed to find OpenSSL version {v[0]}.{v[1]} on your system')
--            extra_pc_dir = os.pathsep.join(openssl_dirs)
--        cflags = pkg_config('libcrypto', '--cflags-only-I', extra_pc_dir=extra_pc_dir)
--    return cflags, pkg_config('libcrypto', '--libs', extra_pc_dir=extra_pc_dir)
-+    return cflags, libs
- 
- 
- def at_least_version(package: str, major: int, minor: int = 0) -> None:
-@@ -1170,8 +1155,8 @@ def create_linux_bundle_gunk(ddir: str, args: Options)
+@@ -1333,8 +1333,8 @@ def create_linux_bundle_gunk(ddir: str, args: Options)
      base = Path(ddir)
      in_src_launcher = base / (f'{libdir_name}/kitty/kitty/launcher/kitty')
      launcher = base / 'bin/kitty'
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
index 6c3f554d8a5f..67f8ab615a0a 100644
--- 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
@@ -1,28 +1,11 @@
 --- shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish.orig	1979-11-29 23:00:00 UTC
 +++ shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish
-@@ -112,12 +112,12 @@ function __ksi_schedule --on-event fish_prompt -d "Set
+@@ -126,7 +126,7 @@ function __ksi_schedule --on-event fish_prompt -d "Set
      # 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 2> /dev/null || echo "x")
--        and not test -r "/usr/share/terminfo/x/xterm-kitty" -o -r "/usr/share/terminfo/78/xterm-kitty" 
+-        and not test -r "/usr/share/terminfo/x/xterm-kitty" -o -r "/usr/share/terminfo/78/xterm-kitty"
 +        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"
-             for arg in $argv
--                if string match -q -- "-e" "$arg" or string match -q -- "--edit" "$arg" 
-+                if string match -q -- "-e" "$arg" or string match -q -- "--edit" "$arg"
-                     set is_sudoedit "y"
-                     break
-                 end
-@@ -145,8 +145,8 @@ function __ksi_schedule --on-event fish_prompt -d "Set
-             and return 0
-             return 1
-         end
--        if _ksi_s_is_ok "venv" 
--            and test -n "$VIRTUAL_ENV" -a -r "$venv" 
-+        if _ksi_s_is_ok "venv"
-+            and test -n "$VIRTUAL_ENV" -a -r "$venv"
-             set _ksi_sourced "y"
-             set --erase VIRTUAL_ENV _OLD_FISH_PROMPT_OVERRIDE  # activate.fish stupidly exports _OLD_FISH_PROMPT_OVERRIDE
-             source "$venv"
diff --git a/x11/kitty/pkg-plist b/x11/kitty/pkg-plist
index bb196668c5df..ded2bcdb2381 100644
--- a/x11/kitty/pkg-plist
+++ b/x11/kitty/pkg-plist
@@ -15,6 +15,7 @@ share/applications/kitty.desktop
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_actions_1745a1bd.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_binary_478594b0.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_build_7ee1e14e.png
+%%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_changelog_0413c894.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_clipboard_673291d1.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_color-stack_587105f7.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_conf_6d817f14.png
@@ -41,7 +42,7 @@ share/applications/kitty.desktop
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_kittens_hyperlinked_grep_bce050dc.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_kittens_icat_8f870112.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_kittens_intro_2aa247aa.png
-%%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_kittens_panel_60319d79.png
+%%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_kittens_panel_acc427d1.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_kittens_query_terminal_bcf6bdb9.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_kittens_remote_file_c5782e6e.png
 %%PORTDOCS%%%%DOCSDIR%%/_images/social_previews/summary_kittens_ssh_d0cb65fa.png
@@ -769,6 +770,9 @@ share/icons/hicolor/scalable/apps/kitty.svg
 %%DATADIR%%/kitty/rc/__pycache__/resize_window%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
 %%DATADIR%%/kitty/rc/__pycache__/resize_window%%PYTHON_EXT_SUFFIX%%.opt-2.pyc
 %%DATADIR%%/kitty/rc/__pycache__/resize_window%%PYTHON_EXT_SUFFIX%%.pyc
+%%DATADIR%%/kitty/rc/__pycache__/run%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%DATADIR%%/kitty/rc/__pycache__/run%%PYTHON_EXT_SUFFIX%%.opt-2.pyc
+%%DATADIR%%/kitty/rc/__pycache__/run%%PYTHON_EXT_SUFFIX%%.pyc
 %%DATADIR%%/kitty/rc/__pycache__/scroll_window%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
 %%DATADIR%%/kitty/rc/__pycache__/scroll_window%%PYTHON_EXT_SUFFIX%%.opt-2.pyc
 %%DATADIR%%/kitty/rc/__pycache__/scroll_window%%PYTHON_EXT_SUFFIX%%.pyc
@@ -840,6 +844,7 @@ share/icons/hicolor/scalable/apps/kitty.svg
 %%DATADIR%%/kitty/rc/remove_marker.py
 %%DATADIR%%/kitty/rc/resize_os_window.py
 %%DATADIR%%/kitty/rc/resize_window.py
+%%DATADIR%%/kitty/rc/run.py
 %%DATADIR%%/kitty/rc/scroll_window.py
 %%DATADIR%%/kitty/rc/select_window.py
 %%DATADIR%%/kitty/rc/send_key.py