2021-10-14 23:21:06 +02:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2024-03-23 09:34:04 +01:00
|
|
|
, fetchpatch
|
2021-06-24 03:27:29 +02:00
|
|
|
, git
|
2021-08-31 12:31:25 +02:00
|
|
|
, 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
|
2021-08-31 12:31:25 +02:00
|
|
|
, stdenv
|
|
|
|
, Security
|
|
|
|
, SystemConfiguration
|
2021-06-24 03:27:29 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "git-branchless";
|
2023-08-29 06:06:29 +02:00
|
|
|
version = "0.8.0";
|
2021-06-24 03:27:29 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "arxanas";
|
|
|
|
repo = "git-branchless";
|
|
|
|
rev = "v${version}";
|
2023-08-29 06:06:29 +02:00
|
|
|
hash = "sha256-ev56NzrEF7xm3WmR2a0pHPs69Lvmb4He7+kIBYiJjKY=";
|
2021-06-24 03:27:29 +02:00
|
|
|
};
|
|
|
|
|
2024-03-23 09:34:04 +01: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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-08-29 06:06:29 +02:00
|
|
|
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 [
|
2021-08-31 12:31:25 +02:00
|
|
|
Security
|
|
|
|
SystemConfiguration
|
|
|
|
libiconv
|
2021-06-24 03:27:29 +02:00
|
|
|
];
|
|
|
|
|
2024-02-16 16:39:16 +01: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;
|
2023-08-29 06:06:29 +02:00
|
|
|
mainProgram = "git-branchless";
|
2024-04-27 20:51:42 +02:00
|
|
|
maintainers = with maintainers; [ nh2 hmenke ];
|
2021-06-24 03:27:29 +02:00
|
|
|
};
|
|
|
|
}
|