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

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

55 lines
1.3 KiB
Nix
Raw Normal View History

2023-02-13 04:20:00 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, pkg-config
, openssl
, libgit2
, IOKit
, CoreFoundation
, fetchpatch
}:
2020-03-07 09:20:00 +00:00
rustPlatform.buildRustPackage rec {
pname = "git-trim";
2023-01-19 23:00:26 +00:00
version = "0.4.4";
2020-03-07 09:20:00 +00:00
src = fetchFromGitHub {
owner = "foriequal0";
repo = pname;
rev = "v${version}";
2023-01-19 23:00:26 +00:00
sha256 = "sha256-XAO3Qg5I2lYZVNx4+Z5jKHRIFdNwBJsUQwJXFb4CbvM=";
2020-03-07 09:20:00 +00:00
};
2023-02-13 04:20:00 +00:00
cargoHash = "sha256-mS8kNkZs8jX99ryG4XkU+U/iWIIcmET2vOfG1YNNZFU=";
cargoPatches = [
# Update git2 https://github.com/foriequal0/git-trim/pull/202
(fetchpatch {
url = "https://github.com/foriequal0/git-trim/commit/4355cd1d6f605455087c4d7ad16bfb92ffee941f.patch";
sha256 = "sha256-C1pX4oe9ZCgvqYTBJeSjMdr0KFyjv2PNVMJDlwCAngY=";
})
];
OPENSSL_NO_VENDOR = 1;
2020-03-07 09:20:00 +00:00
nativeBuildInputs = [ pkg-config ];
2023-02-13 04:20:00 +00:00
buildInputs = [ openssl libgit2 ]
++ lib.optionals stdenv.isDarwin [ IOKit CoreFoundation ];
2020-03-07 09:20:00 +00:00
postInstall = ''
2020-04-14 09:20:00 +00:00
install -Dm644 -t $out/share/man/man1/ docs/git-trim.1
2020-03-07 09:20:00 +00:00
'';
# fails with sandbox
doCheck = false;
meta = with lib; {
2020-03-07 09:20:00 +00:00
description = "Automatically trims your branches whose tracking remote refs are merged or gone";
homepage = "https://github.com/foriequal0/git-trim";
license = licenses.mit;
maintainers = [ maintainers.marsam ];
};
}