3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #176180 from aaronjheng/git-lfs

git-lfs: use buildGoModule
This commit is contained in:
Mario Rodas 2022-06-04 19:37:03 -05:00 committed by GitHub
commit f910bc55af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,43 +1,56 @@
{ lib, buildGoPackage, fetchFromGitHub, ronn, installShellFiles }:
{ lib, buildGoModule, fetchFromGitHub, ronn, installShellFiles, git, testers, git-lfs }:
buildGoPackage rec {
buildGoModule rec {
pname = "git-lfs";
version = "3.2.0";
src = fetchFromGitHub {
rev = "v${version}";
owner = "git-lfs";
repo = "git-lfs";
rev = "v${version}";
sha256 = "sha256-3gVUPfZs5GViEA3D7Zm5NdxhuEz9DhwPLoQqHFdGCrI=";
leaveDotGit = true;
};
goPackagePath = "github.com/git-lfs/git-lfs";
vendorSha256 = null;
nativeBuildInputs = [ ronn installShellFiles ];
ldflags = [ "-s" "-w" "-X ${goPackagePath}/config.Vendor=${version}" "-X ${goPackagePath}/config.GitCommit=${src.rev}" ];
ldflags = [
"-s"
"-w"
"-X github.com/git-lfs/git-lfs/v${lib.versions.major version}/config.Vendor=${version}"
];
subPackages = [ "." ];
preBuild = ''
pushd go/src/github.com/git-lfs/git-lfs
go generate ./commands
popd
'';
postBuild = ''
make -C go/src/${goPackagePath} man
make man
'';
checkInputs = [ git ];
preCheck = ''
unset subPackages
'';
postInstall = ''
installManPage go/src/${goPackagePath}/man/man*/*
installManPage man/man*/*
'';
passthru.tests.version = testers.testVersion {
package = git-lfs;
};
meta = with lib; {
description = "Git extension for versioning large files";
homepage = "https://git-lfs.github.com/";
changelog = "https://github.com/git-lfs/git-lfs/raw/v${version}/CHANGELOG.md";
license = [ licenses.mit ];
maintainers = [ maintainers.twey maintainers.marsam ];
license = licenses.mit;
maintainers = with maintainers; [ twey marsam ];
};
}