1{ lib
2, stdenv
3, rustPlatform
4, fetchFromGitHub
5, libiconv
6, openssl
7, pkg-config
8, xclip
9, AppKit
10, Security
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "gitui";
15 version = "0.24.3";
16
17 src = fetchFromGitHub {
18 owner = "extrawurst";
19 repo = pname;
20 rev = "v${version}";
21 hash = "sha256-mT5toF4mKRP0dlwlfKHjmFFQJ/cWSb2vwg1uZbhZRhI=";
22 };
23
24 cargoHash = "sha256-8j0NtJB2ErrpljPHSMRD/4IGZuqA8wLuzPnuQqxaXRg=";
25
26 nativeBuildInputs = [ pkg-config ];
27
28 buildInputs = [ openssl ]
29 ++ lib.optional stdenv.isLinux xclip
30 ++ lib.optionals stdenv.isDarwin [ libiconv Security AppKit ];
31
32 # Needed to get openssl-sys to use pkg-config.
33 OPENSSL_NO_VENDOR = 1;
34
35 # The cargo config overrides linkers for some targets, breaking the build
36 # on e.g. `aarch64-linux`. These overrides are not required in the Nix
37 # environment: delete them.
38 postPatch = "rm .cargo/config";
39
40
41 # Getting app_config_path fails with a permission denied
42 checkFlags = [
43 "--skip=keys::key_config::tests::test_symbolic_links"
44 ];
45
46
47 meta = with lib; {
48 description = "Blazing fast terminal-ui for Git written in Rust";
49 homepage = "https://github.com/extrawurst/gitui";
50 changelog = "https://github.com/extrawurst/gitui/blob/v${version}/CHANGELOG.md";
51 mainProgram = "gitui";
52 license = licenses.mit;
53 maintainers = with maintainers; [ Br1ght0ne yanganto mfrw ];
54 };
55}