shell.nix is missing a depencency on the UserNotifications framework on macOS with Apple silicon. Unfortunately we can't just unconditionally include this dependency because Nixpkgs uses a different macOS SDK version for macOS on an Intel processor compared to macOS on Apple silicon. The older SDK version 10.12 on Intel does not have the UserNotifications framework, which would lead to an "attribute missing" error when trying to execute `nix-shell`. The condition can be dropped when the macOS SDK version for Intel processors is finally updated. See https://github.com/NixOS/nixpkgs/issues/101229 for progress on that.
See https://github.com/NixOS/nixpkgs/pull/137512 for more context.
Closes https://github.com/kovidgoyal/kitty/issues/4352.
Remove the dependency on installShellFiles as it is not needed for building kitty itself and is only used in Nixpkgs for conveniently installing man pages and shell completions.
pkgconfig has been renamed to pkg-config.
Use `with python3Packages;` to reduce code duplication. This is how it's done in Nixpkgs as well.
Also sort the packages in nativeBuildInputs.
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.