2023-12-01 00:09:15 +03:00
|
|
|
{pkgs ? import <nixpkgs> {}}:
|
|
|
|
with pkgs; let
|
2020-07-02 11:53:41 +03:00
|
|
|
inherit (lib) optional optionals;
|
|
|
|
inherit (xorg) libX11 libXrandr libXinerama libXcursor libXi libXext;
|
2023-01-13 15:57:33 +03:00
|
|
|
inherit (darwin.apple_sdk.frameworks) Cocoa CoreGraphics Foundation IOKit Kernel OpenGL UniformTypeIdentifiers;
|
2023-12-01 00:09:15 +03:00
|
|
|
harfbuzzWithCoreText = harfbuzz.override {withCoreText = stdenv.isDarwin;};
|
2020-07-02 11:53:41 +03:00
|
|
|
in
|
2023-12-01 00:09:15 +03:00
|
|
|
with python3Packages;
|
|
|
|
mkShell rec {
|
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
harfbuzzWithCoreText
|
|
|
|
ncurses
|
|
|
|
lcms2
|
|
|
|
xxhash
|
|
|
|
]
|
|
|
|
++ optionals stdenv.isDarwin [
|
|
|
|
Cocoa
|
|
|
|
CoreGraphics
|
|
|
|
Foundation
|
|
|
|
IOKit
|
|
|
|
Kernel
|
|
|
|
OpenGL
|
|
|
|
UniformTypeIdentifiers
|
|
|
|
libpng
|
|
|
|
python3
|
|
|
|
zlib
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.isDarwin && (builtins.hasAttr "UserNotifications" darwin.apple_sdk.frameworks)) [
|
|
|
|
darwin.apple_sdk.frameworks.UserNotifications
|
|
|
|
]
|
|
|
|
++ optionals stdenv.isLinux [
|
|
|
|
fontconfig
|
|
|
|
libunistring
|
|
|
|
libcanberra
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libXinerama
|
|
|
|
libXcursor
|
|
|
|
libxkbcommon
|
|
|
|
libXi
|
|
|
|
libXext
|
|
|
|
wayland-protocols
|
|
|
|
wayland
|
|
|
|
openssl
|
|
|
|
xxHash
|
|
|
|
dbus
|
|
|
|
]
|
|
|
|
++ checkInputs;
|
2020-07-02 11:53:41 +03:00
|
|
|
|
2023-12-01 00:09:15 +03:00
|
|
|
nativeBuildInputs =
|
|
|
|
[
|
|
|
|
ncurses
|
|
|
|
pkg-config
|
|
|
|
sphinx
|
|
|
|
furo
|
|
|
|
sphinx-copybutton
|
|
|
|
sphinxext-opengraph
|
|
|
|
sphinx-inline-tabs
|
|
|
|
]
|
|
|
|
++ optionals stdenv.isDarwin [
|
|
|
|
imagemagick
|
|
|
|
libicns # For the png2icns tool.
|
|
|
|
];
|
2020-07-02 11:53:41 +03:00
|
|
|
|
2023-12-01 00:09:15 +03:00
|
|
|
propagatedBuildInputs = optional stdenv.isLinux libGL;
|
2020-07-02 11:53:41 +03:00
|
|
|
|
2023-12-01 00:09:15 +03:00
|
|
|
checkInputs = [
|
|
|
|
pillow
|
|
|
|
];
|
2020-07-02 11:53:41 +03:00
|
|
|
|
2023-12-01 00:09:15 +03:00
|
|
|
# Causes build failure due to warning when using Clang
|
|
|
|
hardeningDisable = ["strictoverflow"];
|
2020-07-02 11:53:41 +03:00
|
|
|
|
2023-12-01 00:09:15 +03:00
|
|
|
shellHook =
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then ''
|
|
|
|
export KITTY_NO_LTO=
|
|
|
|
''
|
|
|
|
else ''
|
|
|
|
export KITTY_EGL_LIBRARY='${lib.getLib libGL}/lib/libEGL.so.1'
|
|
|
|
export KITTY_STARTUP_NOTIFICATION_LIBRARY='${libstartup_notification}/lib/libstartup-notification-1.so'
|
|
|
|
export KITTY_CANBERRA_LIBRARY='${libcanberra}/lib/libcanberra.so'
|
|
|
|
'';
|
|
|
|
}
|