mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-21 03:27:55 +03:00
Add shell.nix
This makes it possible to execute `nix-shell` to create the correct environment to build kitty. Use `nix-shell --pure` to eliminate most of the influence of the outside system, e.g. globally installed packages.
This works on NixOS and any Linux or macOS system with the Nix package manager installed.
The build inputs are split into `buildInputs`, `nativeBuildInputs`, `propagatedBuildInputs` and `checkInputs` so it closely resembles 2bb3a9da24/pkgs/applications/terminal-emulators/kitty/default.nix
. This makes it easy to port changes between the two files.
This commit is contained in:
parent
3335f8602b
commit
5058fb9919
@ -78,6 +78,17 @@ you might have to rebuild the app.
|
||||
a self signed certificate, see for example, `here
|
||||
<https://stackoverflow.com/questions/27474751/how-can-i-codesign-an-app-without-being-in-the-mac-developer-program/27474942>`_.
|
||||
|
||||
Build and run from source with Nix
|
||||
-------------------------------------------
|
||||
|
||||
On NixOS or any other Linux or macOS system with the Nix package manager installed,
|
||||
execute ``nix-shell`` to create the correct environment to build kitty or use
|
||||
``nix-shell --pure`` instead to eliminate most of the influence of the outside system,
|
||||
e.g. globally installed packages. ``nix-shell`` will automatically fetch all required
|
||||
dependencies and make them available in the newly spawned shell.
|
||||
|
||||
Then proceed with ``make`` or ``make app`` according to the platform specific instructions above.
|
||||
|
||||
|
||||
Note for Linux/macOS packagers
|
||||
----------------------------------
|
||||
|
55
shell.nix
Normal file
55
shell.nix
Normal file
@ -0,0 +1,55 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
with pkgs;
|
||||
|
||||
let
|
||||
inherit (lib) optional optionals;
|
||||
inherit (xorg) libX11 libXrandr libXinerama libXcursor libXi libXext;
|
||||
inherit (darwin.apple_sdk.frameworks) Cocoa CoreGraphics Foundation IOKit Kernel OpenGL;
|
||||
harfbuzzWithCoreText = harfbuzz.override { withCoreText = stdenv.isDarwin; };
|
||||
in
|
||||
mkShell rec {
|
||||
buildInputs = [
|
||||
harfbuzzWithCoreText
|
||||
ncurses
|
||||
lcms2
|
||||
] ++ optionals stdenv.isDarwin [
|
||||
Cocoa
|
||||
CoreGraphics
|
||||
Foundation
|
||||
IOKit
|
||||
Kernel
|
||||
OpenGL
|
||||
libpng
|
||||
python3
|
||||
zlib
|
||||
] ++ optionals stdenv.isLinux [
|
||||
fontconfig libunistring libcanberra libX11
|
||||
libXrandr libXinerama libXcursor libxkbcommon libXi libXext
|
||||
wayland-protocols wayland dbus
|
||||
] ++ checkInputs;
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgconfig python3Packages.sphinx ncurses
|
||||
] ++ optionals stdenv.isDarwin [
|
||||
imagemagick
|
||||
libicns # For the png2icns tool.
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
propagatedBuildInputs = optional stdenv.isLinux libGL;
|
||||
|
||||
checkInputs = [
|
||||
python3Packages.pillow
|
||||
];
|
||||
|
||||
# Causes build failure due to warning when using Clang
|
||||
hardeningDisable = [ "strictoverflow" ];
|
||||
|
||||
shellHook = if stdenv.isDarwin then ''
|
||||
export KITTY_NO_LTO=
|
||||
'' else ''
|
||||
export KITTY_EGL_LIBRARY='${stdenv.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'
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user