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

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

61 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, asciidoctor, installShellFiles, git, testers, git-lfs }:
2016-06-03 11:37:23 +00:00
2022-06-04 03:14:28 +00:00
buildGoModule rec {
pname = "git-lfs";
version = "3.5.1";
2016-06-03 11:37:23 +00:00
src = fetchFromGitHub {
2017-04-18 17:53:51 +00:00
owner = "git-lfs";
repo = "git-lfs";
2022-06-04 03:14:28 +00:00
rev = "v${version}";
hash = "sha256-xSLXbAvIoY3c341qi89pTrjBZdXh/bPrweJD2O2gkjY=";
2016-06-03 11:37:23 +00:00
};
vendorHash = "sha256-N8HB2qwBxjzfNucftHxmX2W9srCx62pjmkCWzwiCj/I=";
2020-05-01 09:20:00 +00:00
nativeBuildInputs = [ asciidoctor installShellFiles ];
2020-05-01 09:20:00 +00:00
2022-06-04 03:14:28 +00:00
ldflags = [
"-s"
"-w"
"-X github.com/git-lfs/git-lfs/v${lib.versions.major version}/config.Vendor=${version}"
];
subPackages = [ "." ];
preBuild = ''
2022-06-15 20:43:46 +00:00
GOARCH= go generate ./commands
'';
2020-05-01 09:20:00 +00:00
postBuild = ''
2022-06-04 03:14:28 +00:00
make man
'';
nativeCheckInputs = [ git ];
2022-06-04 03:14:28 +00:00
preCheck = ''
unset subPackages
2020-05-01 09:20:00 +00:00
'';
postInstall = ''
2022-06-04 03:14:28 +00:00
installManPage man/man*/*
2023-07-30 04:20:00 +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-01 09:20:00 +00:00
'';
2022-06-04 03:14:28 +00:00
passthru.tests.version = testers.testVersion {
package = git-lfs;
};
meta = with lib; {
2017-04-18 17:53:51 +00:00
description = "Git extension for versioning large files";
2022-06-04 03:14:28 +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-04-24 04:20:00 +00:00
maintainers = with maintainers; [ twey ];
2023-11-27 01:17:53 +00:00
mainProgram = "git-lfs";
2017-04-18 17:53:51 +00:00
};
2016-06-03 11:37:23 +00:00
}