nixpkgs/pkgs/by-name/gi/gitui/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.6 KiB
Nix
Raw Normal View History

2022-02-02 03:15:59 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, libiconv
, openssl
, pkg-config
, xclip
2024-04-15 09:11:27 +00:00
, darwin
2022-02-02 03:15:59 +00:00
}:
2020-05-01 14:28:35 +00:00
rustPlatform.buildRustPackage rec {
pname = "gitui";
2024-04-15 09:07:28 +00:00
version = "0.26.1";
2020-05-01 14:28:35 +00:00
src = fetchFromGitHub {
owner = "extrawurst";
2024-04-15 09:07:28 +00:00
repo = "gitui";
2020-05-01 14:28:35 +00:00
rev = "v${version}";
2024-04-15 09:07:28 +00:00
hash = "sha256-JqxZbxjZrrdsXWhpYu0E9F18gMldtOLrAYd+uiY8IcQ=";
2020-05-01 14:28:35 +00:00
};
2024-04-15 09:07:28 +00:00
cargoHash = "sha256-zEoNyIiHQT6HBNSe+H7pz229K4eD0WMhp3I/6zJQHuU=";
2022-02-02 03:15:59 +00:00
nativeBuildInputs = [ pkg-config ];
2020-05-01 14:28:35 +00:00
2020-12-22 12:57:26 +00:00
buildInputs = [ openssl ]
2021-01-15 13:21:58 +00:00
++ lib.optional stdenv.isLinux xclip
2024-04-15 09:11:27 +00:00
++ lib.optionals stdenv.isDarwin [
libiconv
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.AppKit
];
2020-05-01 14:28:35 +00:00
2024-04-15 09:07:28 +00:00
postPatch = ''
# The cargo config overrides linkers for some targets, breaking the build
# on e.g. `aarch64-linux`. These overrides are not required in the Nix
# environment: delete them.
rm .cargo/config
2021-09-15 00:47:17 +00:00
2024-04-15 09:07:28 +00:00
# build script tries to get version information from git
rm build.rs
substituteInPlace Cargo.toml --replace-fail 'build = "build.rs"' ""
'';
2022-11-19 18:13:04 +00:00
2024-04-15 09:07:28 +00:00
GITUI_BUILD_NAME = version;
# Needed to get openssl-sys to use pkg-config.
OPENSSL_NO_VENDOR = 1;
# Getting app_config_path fails with a permission denied
checkFlags = [
"--skip=keys::key_config::tests::test_symbolic_links"
];
2024-04-15 09:07:28 +00:00
meta = {
2022-02-02 03:15:59 +00:00
description = "Blazing fast terminal-ui for Git written in Rust";
2020-05-01 14:28:35 +00:00
homepage = "https://github.com/extrawurst/gitui";
changelog = "https://github.com/extrawurst/gitui/blob/v${version}/CHANGELOG.md";
mainProgram = "gitui";
2024-04-15 09:07:28 +00:00
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ Br1ght0ne yanganto mfrw ];
2020-05-01 14:28:35 +00:00
};
}