nixpkgs/pkgs/applications/version-management/git-branchless/default.nix

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

77 lines
1.8 KiB
Nix
Raw Normal View History

2021-10-14 23:21:06 +02:00
{ lib
, fetchFromGitHub
, fetchpatch
2021-06-24 03:27:29 +02:00
, git
, libiconv
2021-06-24 03:27:29 +02:00
, ncurses
2021-10-14 23:21:06 +02:00
, openssl
, pkg-config
2021-06-24 03:27:29 +02:00
, rustPlatform
, sqlite
, stdenv
, Security
, SystemConfiguration
2021-06-24 03:27:29 +02:00
}:
rustPlatform.buildRustPackage rec {
pname = "git-branchless";
version = "0.8.0";
2021-06-24 03:27:29 +02:00
src = fetchFromGitHub {
owner = "arxanas";
repo = "git-branchless";
rev = "v${version}";
hash = "sha256-ev56NzrEF7xm3WmR2a0pHPs69Lvmb4He7+kIBYiJjKY=";
2021-06-24 03:27:29 +02:00
};
patches = [
# Fix tests with Git 2.44.0+
(fetchpatch {
url = "https://github.com/arxanas/git-branchless/pull/1245.patch";
hash = "sha256-gBm0A478Uhg9IQVLQppvIeTa8s1yHUMddxiUbpHUvGw=";
})
# Fix tests with Git 2.44.0+
(fetchpatch {
url = "https://github.com/arxanas/git-branchless/pull/1161.patch";
hash = "sha256-KHobEIXhlDar8CvIVUi4I695jcJZXgGRhU86b99x86Y=";
})
];
cargoHash = "sha256-Ppw5TN/6zMNxFAx90Q9hQ7RdGxV+TT8UlOm68ldK8oc=";
2021-06-24 03:27:29 +02:00
2021-10-14 23:21:06 +02:00
nativeBuildInputs = [ pkg-config ];
2021-06-24 03:27:29 +02:00
buildInputs = [
ncurses
2021-10-14 23:21:06 +02:00
openssl
2021-06-24 03:27:29 +02:00
sqlite
2021-10-14 23:21:06 +02:00
] ++ lib.optionals stdenv.isDarwin [
Security
SystemConfiguration
libiconv
2021-06-24 03:27:29 +02:00
];
postInstall = ''
$out/bin/git-branchless install-man-pages $out/share/man
'';
2021-06-24 03:27:29 +02:00
preCheck = ''
2022-03-28 01:39:51 +02:00
export TEST_GIT=${git}/bin/git
export TEST_GIT_EXEC_PATH=$(${git}/bin/git --exec-path)
2021-06-24 03:27:29 +02:00
'';
2021-12-05 14:08:35 +01:00
# FIXME: these tests deadlock when run in the Nix sandbox
checkFlags = [
2022-11-16 10:15:20 +01:00
"--skip=test_switch_pty"
2021-12-05 14:08:35 +01:00
"--skip=test_next_ambiguous_interactive"
2022-11-16 10:15:20 +01:00
"--skip=test_switch_auto_switch_interactive"
2021-12-05 14:08:35 +01:00
];
2021-06-24 03:27:29 +02:00
meta = with lib; {
description = "A suite of tools to help you visualize, navigate, manipulate, and repair your commit history";
homepage = "https://github.com/arxanas/git-branchless";
2021-10-14 23:21:06 +02:00
license = licenses.gpl2Only;
mainProgram = "git-branchless";
2024-04-27 20:51:42 +02:00
maintainers = with maintainers; [ nh2 hmenke ];
2021-06-24 03:27:29 +02:00
};
}