From 6367074e856ead95503f8a821a38836d1c5abd33 Mon Sep 17 00:00:00 2001 From: nik gaffney Date: Fri, 9 Feb 2024 14:12:42 +0100 Subject: [PATCH] Put in earplugs --- channel/zzkt/packages/kitty.scm | 236 ++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 channel/zzkt/packages/kitty.scm diff --git a/channel/zzkt/packages/kitty.scm b/channel/zzkt/packages/kitty.scm new file mode 100644 index 0000000..007902f --- /dev/null +++ b/channel/zzkt/packages/kitty.scm @@ -0,0 +1,236 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015-2021, 2023 Efraim Flashner +;;; Copyright © 2016 Mckinley Olsen +;;; Copyright © 2016, 2017, 2019 Alex Griffin +;;; Copyright © 2016 David Craven +;;; Copyright © 2016, 2017, 2019, 2020 Ludovic Courtès +;;; Copyright © 2016, 2017 José Miguel Sánchez García +;;; Copyright © 2017–2022 Tobias Geerinckx-Rice +;;; Copyright © 2017 Kei Kebreau +;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus +;;; Copyright © 2017 Petter +;;; Copyright © 2018 Hartmut Goebel +;;; Copyright © 2018 Arun Isaac +;;; Copyright © 2018 Gabriel Hondet +;;; Copyright © 2019 Rutger Helling +;;; Copyright © 2018, 2019, 2021 Eric Bavier +;;; Copyright © 2019 Julien Lepiller +;;; Copyright © 2019, 2021 Pierre Langlois +;;; Copyright © 2019, 2020 Brett Gilio +;;; Copyright © 2020 Jakub Kądziołka +;;; Copyright © 2020 Valentin Ignatev +;;; Copyright © 2020 Michael Rohleder +;;; Copyright © 2020, 2021 Marius Bakke +;;; Copyright © 2020, 2021 Nicolas Goaziou +;;; Copyright © 2020 Leo Famulari +;;; Copyright © 2020 luhux +;;; Copyright © 2021 Ekaitz Zarraga +;;; Copyright © 2021, 2022 Raphaël Mélotte +;;; Copyright © 2021 ikasero +;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2021 Solene Rapenne +;;; Copyright © 2021 Petr Hodina +;;; Copyright © 2021 Stefan Reichör +;;; Copyright © 2022 Felipe Balbi +;;; Copyright © 2022 ( +;;; Copyright © 2022, 2023 jgart +;;; Copyright © 2023 Aaron Covrig +;;; Copyright © 2023 Foundation Devices, Inc. +;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2023 Jaeme Sifat +;;; Copyright © 2024 nik gaffney +;;; +;;; This file is (not yet) part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (zzkt packages kitty) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cargo) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) + #:use-module (guix build-system glib-or-gtk) + #:use-module (guix build-system go) + #:use-module (guix build-system meson) + #:use-module (guix build-system pyproject) + #:use-module (guix build-system python) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages crates-io) + #:use-module (gnu packages crates-graphics) + #:use-module (gnu packages crypto) + #:use-module (gnu packages curl) + #:use-module (gnu packages dlang) + #:use-module (gnu packages docbook) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages fribidi) + #:use-module (gnu packages gettext) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages golang) + #:use-module (gnu packages gtk) + #:use-module (gnu packages image) + #:use-module (gnu packages libcanberra) + #:use-module (gnu packages libevent) + #:use-module (gnu packages libunwind) + #:use-module (gnu packages linux) + #:use-module (gnu packages man) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages perl-check) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages popt) + #:use-module (gnu packages protobuf) + #:use-module (gnu packages python) + #:use-module (gnu packages python-check) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages qt) + #:use-module (gnu packages serialization) + #:use-module (gnu packages sphinx) + #:use-module (gnu packages ssh) + #:use-module (gnu packages textutils) + #:use-module (gnu packages tls) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (srfi srfi-26)) + +;; via gnu/packages/terminals.scm + +(define-public kitty + (package + (name "kitty") + (version "0.32.1") + (home-page "https://sw.kovidgoyal.net/kitty/") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/kovidgoyal/kitty") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0gqxn2g1ws3whn6gfb6246pad9g0a656f51f0cjrgzk8xagz1rbp")) + (patches (search-patches "kitty-fix-wayland-protocols.patch")) + (modules '((guix build utils))) + (snippet + '(begin + ;; patch needed as sphinx-build is used as a python script + ;; whereas the guix package uses a bash script launching the + ;; python script + (substitute* "docs/conf.py" + (("(from kitty.constants import str_version)" kitty-imp) + (string-append "sys.path.append(\"..\")\n" kitty-imp))) + (substitute* "docs/Makefile" + (("^SPHINXBUILD[[:space:]]+= (python3.*)$") + "SPHINXBUILD = sphinx-build\n")) + #t)))) + (build-system gnu-build-system) + (native-inputs + (list dbus + mesa + libxcursor + libxi + libxinerama + libxkbcommon + libxrandr + ncurses ;; for tic command + pkg-config + python-sphinx + wayland-protocols)) + (inputs + (list fontconfig + freetype + harfbuzz + lcms + libcanberra + libpng + python-pygments + python-wrapper + wayland + zlib)) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ;no configure script + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; The "kitty" sub-directory must be writable prior to + ;; configuration (e.g., un-setting updates). + (for-each make-file-writable (find-files "kitty")) + (invoke "python3" "setup.py" "linux-package" + ;; Do not phone home. + "--update-check-interval=0" + ;; Wayland backend requires EGL, which isn't + ;; found out-of-the-box for some reason. + (string-append "--egl-library=" + (search-input-file inputs "/lib/libEGL.so.1"))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; Fix "cannot find kitty executable" error when running + ;; tests. + (setenv "PATH" (string-append "linux-package/bin:" + (getenv "PATH"))) + (invoke "python3" "test.py")))) + (add-before 'install 'rm-pycache + ;; created python cache __pycache__ are non deterministic + (lambda _ + (let ((pycaches (find-files "linux-package/" + "__pycache__" + #:directories? #t))) + (for-each delete-file-recursively pycaches)))) + (replace 'install + (lambda _ + (let* ((obin (string-append #$output "/bin")) + (olib (string-append #$output "/lib")) + (oshare (string-append #$output "/share"))) + (copy-recursively "linux-package/bin" obin) + (copy-recursively "linux-package/share" oshare) + (copy-recursively "linux-package/lib" olib))))))) + (synopsis "Fast, featureful, GPU based terminal emulator") + (description "Kitty is a fast and featureful GPU-based terminal emulator: +@itemize +@item Offloads rendering to the GPU for lower system load and buttery smooth +scrolling. Uses threaded rendering to minimize input latency. +@item Supports all modern terminal features: graphics (images), unicode, +true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed +paste and several new terminal protocol extensions. +@item Supports tiling multiple terminal windows side by side in different +layouts without needing to use an extra program like tmux. +@item Can be controlled from scripts or the shell prompt, even over SSH. +@item Has a framework for Kittens, small terminal programs that can be used to +extend kitty's functionality. For example, they are used for Unicode input, +hints, and side-by-side diff. +@item Supports startup sessions which allow you to specify the window/tab +layout, working directories and programs to run on startup. +@item Allows you to open the scrollback buffer in a separate window using +arbitrary programs of your choice. This is useful for browsing the history +comfortably in a pager or editor. +@end itemize") + (license license:gpl3+)))