me
/
guix
Archived
1
0
Fork 0

gnu: kitty: Update to 0.21.2.

There are newer versions of kitty but there are additional requirements.  From
v0.22.0 kitty requires additional Sphinx packages which use node to build
themes.  From v0.27.0 kitty additionally uses Go to build statically compiled,
standalone binaries to use on servers.  This will require more work to
package, if possible at all currently (in the case of node and sphinx themes).

* gnu/packages/patches/kitty-fix-wayland-protocols.patch: New file.
* gnu/local.mk: Add it.
* gnu/packages/terminals.scm (kitty): Update to 0.21.2.
[source]: Use kitty-fix-wayland-protocols.patch.
[native-inputs, inputs]: Remove labels.
[phases]: Use gexps.  Improve style.  Use search-input-file.
Remove trailing #t.
{check}: Respect tests?.
John Kehayias 2023-07-30 18:34:40 -04:00
parent 5e9db8ad3f
commit 62e917a0c6
No known key found for this signature in database
GPG Key ID: 499097AE5EA815D9
3 changed files with 101 additions and 64 deletions

View File

@ -1454,6 +1454,7 @@ dist_patch_DATA = \
%D%/packages/patches/kinit-kdeinit-extra_libs.patch \ %D%/packages/patches/kinit-kdeinit-extra_libs.patch \
%D%/packages/patches/kio-search-smbd-on-PATH.patch \ %D%/packages/patches/kio-search-smbd-on-PATH.patch \
%D%/packages/patches/kismet-unbundle-boost.patch \ %D%/packages/patches/kismet-unbundle-boost.patch \
%D%/packages/patches/kitty-fix-wayland-protocols.patch \
%D%/packages/patches/kmod-module-directory.patch \ %D%/packages/patches/kmod-module-directory.patch \
%D%/packages/patches/kmscon-runtime-keymap-switch.patch \ %D%/packages/patches/kmscon-runtime-keymap-switch.patch \
%D%/packages/patches/kobodeluxe-paths.patch \ %D%/packages/patches/kobodeluxe-paths.patch \

View File

@ -0,0 +1,37 @@
See <https://github.com/kovidgoyal/kitty/issues/6422> for details.
Modified with further fixes from <https://github.com/kovidgoyal/kitty/issues/6422#issuecomment-1622071032>.
From 95d15648fa375bb131ff897f0db03b764dabaf65 Mon Sep 17 00:00:00 2001
From: Kovid Goyal <kovid@kovidgoyal.net>
Date: Wed, 5 Jul 2023 10:29:33 +0530
Subject: [PATCH] Fix not building with wayland-protocols 1.32
Fix #6422
diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h
index f35b55e94..42c90b1fa 100644
--- a/glfw/wl_platform.h
+++ b/glfw/wl_platform.h
@@ -122,6 +122,7 @@ typedef enum WaylandWindowState {
TOPLEVEL_STATE_TILED_RIGHT = 32,
TOPLEVEL_STATE_TILED_TOP = 64,
TOPLEVEL_STATE_TILED_BOTTOM = 128,
+ TOPLEVEL_STATE_SUSPENDED = 256,
} WaylandWindowState;
diff --git a/glfw/wl_window.c b/glfw/wl_window.c
index f7e329609..23868154f 100644
--- a/glfw/wl_window.c
+++ b/glfw/wl_window.c
@@ -420,6 +420,9 @@ static void xdgToplevelHandleConfigure(void* data,
C(TOPLEVEL_STATE_TILED_RIGHT);
C(TOPLEVEL_STATE_TILED_TOP);
C(TOPLEVEL_STATE_TILED_BOTTOM);
+#ifdef XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION
+ C(TOPLEVEL_STATE_SUSPENDED);
+ #endif
#undef C
}
}

View File

@ -1205,7 +1205,7 @@ tmux.")
(define-public kitty (define-public kitty
(package (package
(name "kitty") (name "kitty")
(version "0.20.3") (version "0.21.2")
(home-page "https://sw.kovidgoyal.net/kitty/") (home-page "https://sw.kovidgoyal.net/kitty/")
(source (source
(origin (origin
@ -1215,7 +1215,8 @@ tmux.")
(commit (string-append "v" version)))) (commit (string-append "v" version))))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "13qv4469q9q2xdrb77lbyw4dz491zf1qvqx4adp0dd9annnlir5c")) (base32 "0y0mg8rr18mn0wzym7v48x6kl0ixd5q387kr5jhbdln55ph2jk9d"))
(patches (search-patches "kitty-fix-wayland-protocols.patch"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
@ -1231,70 +1232,68 @@ tmux.")
#t)))) #t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs
`(("libdbus" ,dbus) (list dbus
("libgl1-mesa" ,mesa) mesa
("libxcursor" ,libxcursor) libxcursor
("libxi" ,libxi) libxi
("libxinerama" ,libxinerama) libxinerama
("libxkbcommon" ,libxkbcommon) libxkbcommon
("libxrandr" ,libxrandr) libxrandr
("ncurses" ,ncurses) ;; for tic command ncurses ;; for tic command
("pkg-config" ,pkg-config) pkg-config
("sphinx" ,python-sphinx) python-sphinx
("wayland-protocols" ,wayland-protocols))) wayland-protocols))
(inputs (inputs
`(("fontconfig" ,fontconfig) (list fontconfig
("freetype" ,freetype) freetype
("harfbuzz" ,harfbuzz) harfbuzz
("lcms" ,lcms) lcms
("libcanberra" ,libcanberra) libcanberra
("libpng" ,libpng) libpng
("pygments" ,python-pygments) python-pygments
("python" ,python-wrapper) python-wrapper
("wayland" ,wayland) wayland
("zlib" ,zlib))) zlib))
(arguments (arguments
'(#:phases (modify-phases %standard-phases (list
(delete 'configure) ;no configure script #:phases
(replace 'build #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (delete 'configure) ;no configure script
;; The "kitty" sub-directory must be writable prior to (replace 'build
;; configuration (e.g., un-setting updates). (lambda* (#:key inputs #:allow-other-keys)
(for-each make-file-writable (find-files "kitty")) ;; The "kitty" sub-directory must be writable prior to
;; configuration (e.g., un-setting updates).
(invoke "python3" "setup.py" "linux-package" (for-each make-file-writable (find-files "kitty"))
;; Do not phone home. (invoke "python3" "setup.py" "linux-package"
"--update-check-interval=0" ;; Do not phone home.
;; Wayland backend requires EGL, which isn't "--update-check-interval=0"
;; found out-of-the-box for some reason. ;; Wayland backend requires EGL, which isn't
(string-append "--egl-library=" ;; found out-of-the-box for some reason.
(assoc-ref inputs "libgl1-mesa") (string-append "--egl-library="
"/lib/libEGL.so.1")))) (search-input-file inputs "/lib/libEGL.so.1")))))
(replace 'check (replace 'check
(lambda _ (lambda* (#:key tests? #:allow-other-keys)
;; Fix "cannot find kitty executable" error when running (when tests?
;; tests. ;; Fix "cannot find kitty executable" error when running
(setenv "PATH" (string-append "linux-package/bin:" ;; tests.
(getenv "PATH"))) (setenv "PATH" (string-append "linux-package/bin:"
(invoke "python3" "test.py"))) (getenv "PATH")))
(add-before 'install 'rm-pycache (invoke "python3" "test.py"))))
;; created python cache __pycache__ are non deterministic (add-before 'install 'rm-pycache
(lambda _ ;; created python cache __pycache__ are non deterministic
(let ((pycaches (find-files "linux-package/" (lambda _
"__pycache__" (let ((pycaches (find-files "linux-package/"
#:directories? #t))) "__pycache__"
(for-each delete-file-recursively pycaches) #:directories? #t)))
#t))) (for-each delete-file-recursively pycaches))))
(replace 'install (replace 'install
(lambda _ (lambda _
(let* ((out (assoc-ref %outputs "out")) (let* ((obin (string-append #$output "/bin"))
(obin (string-append out "/bin")) (olib (string-append #$output "/lib"))
(olib (string-append out "/lib")) (oshare (string-append #$output "/share")))
(oshare (string-append out "/share"))) (copy-recursively "linux-package/bin" obin)
(copy-recursively "linux-package/bin" obin) (copy-recursively "linux-package/share" oshare)
(copy-recursively "linux-package/share" oshare) (copy-recursively "linux-package/lib" olib)))))))
(copy-recursively "linux-package/lib" olib)
#t))))))
(synopsis "Fast, featureful, GPU based terminal emulator") (synopsis "Fast, featureful, GPU based terminal emulator")
(description "Kitty is a fast and featureful GPU-based terminal emulator: (description "Kitty is a fast and featureful GPU-based terminal emulator:
@itemize @itemize