2022-12-02 08:20:57 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, asciidoctor, installShellFiles, git, testers, git-lfs }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "git-lfs";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.5.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "git-lfs";
|
|
|
|
repo = "git-lfs";
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-xSLXbAvIoY3c341qi89pTrjBZdXh/bPrweJD2O2gkjY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
vendorHash = "sha256-N8HB2qwBxjzfNucftHxmX2W9srCx62pjmkCWzwiCj/I=";
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
nativeBuildInputs = [ asciidoctor installShellFiles ];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/git-lfs/git-lfs/v${lib.versions.major version}/config.Vendor=${version}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
preBuild = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
GOARCH= go generate ./commands
|
2022-01-26 04:04:25 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
postBuild = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
make man
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ git ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
unset subPackages
|
2020-05-03 17:38:23 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
installManPage man/man*/*
|
2023-08-04 22:07:22 +00:00
|
|
|
installShellCompletion --cmd git-lfs \
|
|
|
|
--bash <($out/bin/git-lfs completion bash) \
|
|
|
|
--fish <($out/bin/git-lfs completion fish) \
|
|
|
|
--zsh <($out/bin/git-lfs completion zsh)
|
2020-05-03 17:38:23 +00:00
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = git-lfs;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Git extension for versioning large files";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://git-lfs.github.com/";
|
|
|
|
changelog = "https://github.com/git-lfs/git-lfs/raw/v${version}/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ twey ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "git-lfs";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|