diff options
-rw-r--r-- | pkgs/applications/misc/kitty/default.nix | 18 | ||||
-rw-r--r-- | pkgs/applications/misc/kitty/fix-paths.patch | 27 |
2 files changed, 35 insertions, 10 deletions
diff --git a/pkgs/applications/misc/kitty/default.nix b/pkgs/applications/misc/kitty/default.nix index 4febac10806f..8cff766371ea 100644 --- a/pkgs/applications/misc/kitty/default.nix +++ b/pkgs/applications/misc/kitty/default.nix @@ -1,5 +1,5 @@ -{ stdenv, fetchFromGitHub, python3Packages, glfw, libunistring, harfbuzz, - fontconfig, pkgconfig, ncurses, imagemagick, xsel, +{ stdenv, substituteAll, fetchFromGitHub, python3Packages, glfw, libunistring, + harfbuzz, fontconfig, pkgconfig, ncurses, imagemagick, xsel, libstartup_notification, libX11, libXrandr, libXinerama, libXcursor, libxkbcommon, libXi, libXext, wayland-protocols, wayland, which, dbus @@ -28,14 +28,12 @@ buildPythonApplication rec { outputs = [ "out" "terminfo" ]; - postPatch = '' - substituteInPlace kitty/utils.py \ - --replace "find_library('startup-notification-1')" "'${libstartup_notification}/lib/libstartup-notification-1.so'" - - substituteInPlace docs/Makefile \ - --replace 'python3 .. +launch :sphinx-build' \ - 'PYTHONPATH=$PYTHONPATH:.. HOME=$TMPDIR/nowhere sphinx-build' - ''; + patches = [ + (substituteAll { + src = ./fix-paths.patch; + libstartup_notification = "${libstartup_notification}/lib/libstartup-notification-1.so"; + }) + ]; buildPhase = '' python3 setup.py linux-package diff --git a/pkgs/applications/misc/kitty/fix-paths.patch b/pkgs/applications/misc/kitty/fix-paths.patch new file mode 100644 index 000000000000..e22f4570a4b7 --- /dev/null +++ b/pkgs/applications/misc/kitty/fix-paths.patch @@ -0,0 +1,27 @@ +--- a/kitty/desktop.c ++++ b/kitty/desktop.c +@@ -30,7 +30,7 @@ + static PyObject* + init_x11_startup_notification(PyObject UNUSED *self, PyObject *args) { + static bool done = false; +- static const char* libname = "libstartup-notification-1.so"; ++ static const char* libname = "@libstartup_notification@"; + if (!done) { + done = true; + +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -3,7 +3,7 @@ +# Patching is needed here for the following reasons: +# * `sphinx-build` in nixpkgs is not a Python file but a wrapper shell script +# * importing the `constants` package from Kitty has a side effect that it +# creates the user configuration directory. This package gets imported +# while sphinx scans the code for documentation strings. +# + # You can set these variables from the command line. + SPHINXOPTS = -T $(FAIL_WARN) +-SPHINXBUILD = python3 .. +launch :sphinx-build ++SPHINXBUILD = PYTHONPATH=${PYTHONPATH}:.. HOME=${TMPDIR}/kitty-build-home sphinx-build + SPHINXPROJ = kitty + SOURCEDIR = . + BUILDDIR = _build |