From f96feeef7cab221539f51ca035926daca1871354 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sat, 20 Jun 2020 13:28:12 +0200 Subject: [PATCH] kitty: 0.17.4 -> 0.18.0 https://github.com/kovidgoyal/kitty/releases/tag/v0.18.0 I submitted a patch to kitty, so that the library paths can now be passed as arguments to the build system, eliminating the need for patching. This should reduce the required maintenance effort in the future. This commit removes the dependency on `which`, which is no longer necessary since 5e4fe584fab49bfd5d278e513c146b36e76900b5. It was introduced in 481e61fad8b806a48aa30d736344cae4be88dfa6. The configure phase is now ignored because kitty has no configure script. The kitty tests are now run after compilation. The zsh completions no longer need to be invoked with `source` since 38eb73784527587f3fc6df724629b87da66188d0, so remove the outdated comment. There is now a link to the changelog. --- pkgs/applications/misc/kitty/default.nix | 32 +++++++++------- .../misc/kitty/library-paths.patch | 38 ------------------- pkgs/applications/misc/kitty/no-lto.patch | 2 +- 3 files changed, 19 insertions(+), 53 deletions(-) delete mode 100644 pkgs/applications/misc/kitty/library-paths.patch diff --git a/pkgs/applications/misc/kitty/default.nix b/pkgs/applications/misc/kitty/default.nix index 80cf90ced16e..12db0cd87e98 100644 --- a/pkgs/applications/misc/kitty/default.nix +++ b/pkgs/applications/misc/kitty/default.nix @@ -3,7 +3,7 @@ libstartup_notification, libGL, libX11, libXrandr, libXinerama, libXcursor, libxkbcommon, libXi, libXext, wayland-protocols, wayland, installShellFiles, - which, dbus, + dbus, Cocoa, CoreGraphics, Foundation, @@ -20,14 +20,14 @@ with python3Packages; buildPythonApplication rec { pname = "kitty"; - version = "0.17.4"; + version = "0.18.0"; format = "other"; src = fetchFromGitHub { owner = "kovidgoyal"; repo = "kitty"; rev = "v${version}"; - sha256 = "1rbyj84y8r6h7qd6w7cw58v2abspippignj458ihv2m26i4als2x"; + sha256 = "15i4ld65a5rfbaxxdh6kgg9h0ih73iqjskk82h8j72qgzkc6g3hf"; }; buildInputs = [ @@ -50,7 +50,7 @@ buildPythonApplication rec { ]; nativeBuildInputs = [ - pkgconfig which sphinx ncurses + pkgconfig sphinx ncurses ] ++ stdenv.lib.optionals stdenv.isDarwin [ imagemagick libicns # For the png2icns tool. @@ -63,13 +63,6 @@ buildPythonApplication rec { patches = [ ./fix-paths.patch - ] ++ stdenv.lib.optionals stdenv.isLinux [ - (substituteAll { - src = ./library-paths.patch; - libstartup_notification = "${libstartup_notification}/lib/libstartup-notification-1.so"; - libcanberra = "${libcanberra}/lib/libcanberra.so"; - libEGL = "${stdenv.lib.getLib libGL}/lib/libEGL.so.1"; - }) ] ++ stdenv.lib.optionals stdenv.isDarwin [ ./no-lto.patch ]; @@ -77,11 +70,23 @@ buildPythonApplication rec { # Causes build failure due to warning hardeningDisable = stdenv.lib.optional stdenv.isDarwin "strictoverflow"; + dontConfigure = true; + buildPhase = if stdenv.isDarwin then '' ${python.interpreter} setup.py kitty.app --update-check-interval=0 make man '' else '' - ${python.interpreter} setup.py linux-package --update-check-interval=0 + ${python.interpreter} setup.py linux-package \ + --update-check-interval=0 \ + --egl-library='${stdenv.lib.getLib libGL}/lib/libEGL.so.1' \ + --startup-notification-library='${libstartup_notification}/lib/libstartup-notification-1.so' \ + --canberra-library='${libcanberra}/lib/libcanberra.so' + ''; + + checkInputs = [ pillow ]; + + checkPhase = '' + ${python.interpreter} test.py ''; installPhase = '' @@ -100,8 +105,6 @@ buildPythonApplication rec { wrapProgram "$out/bin/kitty" --prefix PATH : "$out/bin:${stdenv.lib.makeBinPath [ imagemagick xsel ncurses.dev ]}" runHook postInstall - # ZSH completions need to be invoked with `source`: - # https://github.com/kovidgoyal/kitty/blob/8ceb941051b89b7c50850778634f0b6137aa5e6e/docs/index.rst#zsh mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions} "$out/bin/kitty" + complete setup fish > "$out/share/fish/vendor_completions.d/kitty.fish" "$out/bin/kitty" + complete setup bash > "$out/share/bash-completion/completions/kitty.bash" @@ -125,6 +128,7 @@ buildPythonApplication rec { homepage = "https://github.com/kovidgoyal/kitty"; description = "A modern, hackable, featureful, OpenGL based terminal emulator"; license = licenses.gpl3; + changelog = "https://sw.kovidgoyal.net/kitty/changelog.html"; platforms = platforms.darwin ++ platforms.linux; maintainers = with maintainers; [ tex rvolosatovs ma27 Luflosi ]; }; diff --git a/pkgs/applications/misc/kitty/library-paths.patch b/pkgs/applications/misc/kitty/library-paths.patch deleted file mode 100644 index 608dfb80d61f..000000000000 --- a/pkgs/applications/misc/kitty/library-paths.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/glfw/egl_context.c -+++ b/glfw/egl_context.c -@@ -314,7 +314,7 @@ bool _glfwInitEGL(void) - #elif defined(__CYGWIN__) - "libEGL-1.so", - #else -- "libEGL.so.1", -+ "@libEGL@", - #endif - NULL - }; - ---- a/kitty/desktop.c -+++ b/kitty/desktop.c -@@ -34,10 +34,7 @@ init_x11_startup_notification(PyObject UNUSED *self, PyObject *args) { - done = true; - - const char* libnames[] = { -- "libstartup-notification-1.so", -- // some installs are missing the .so symlink, so try the full name -- "libstartup-notification-1.so.0", -- "libstartup-notification-1.so.0.0.0", -+ "@libstartup_notification@", - NULL - }; - for (int i = 0; libnames[i]; i++) { -@@ -113,10 +110,7 @@ load_libcanberra(void) { - if (done) return; - done = true; - const char* libnames[] = { -- "libcanberra.so", -- // some installs are missing the .so symlink, so try the full name -- "libcanberra.so.0", -- "libcanberra.so.0.2.5", -+ "@libcanberra@", - NULL - }; - for (int i = 0; libnames[i]; i++) { diff --git a/pkgs/applications/misc/kitty/no-lto.patch b/pkgs/applications/misc/kitty/no-lto.patch index 8073c11fbd2a..b1f38f9fd49f 100644 --- a/pkgs/applications/misc/kitty/no-lto.patch +++ b/pkgs/applications/misc/kitty/no-lto.patch @@ -1,6 +1,6 @@ --- a/setup.py +++ b/setup.py -@@ -277,10 +277,6 @@ def init_env( +@@ -287,10 +287,6 @@ def init_env( cppflags += shlex.split(os.environ.get('CPPFLAGS', '')) cflags += shlex.split(os.environ.get('CFLAGS', '')) ldflags += shlex.split(os.environ.get('LDFLAGS', ''))