Skip to content

Commit 0b0119f

Browse files
committed
git-lfs: use buildGoModule
1 parent bd7aa1e commit 0b0119f

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

  • pkgs/applications/version-management/git-lfs
Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,56 @@
1-
{ lib, buildGoPackage, fetchFromGitHub, ronn, installShellFiles }:
1+
{ lib, buildGoModule, fetchFromGitHub, ronn, installShellFiles, git, testers, git-lfs }:
22

3-
buildGoPackage rec {
3+
buildGoModule rec {
44
pname = "git-lfs";
55
version = "3.2.0";
66

77
src = fetchFromGitHub {
8-
rev = "v${version}";
98
owner = "git-lfs";
109
repo = "git-lfs";
10+
rev = "v${version}";
1111
sha256 = "sha256-3gVUPfZs5GViEA3D7Zm5NdxhuEz9DhwPLoQqHFdGCrI=";
12+
leaveDotGit = true;
1213
};
1314

14-
goPackagePath = "github.com/git-lfs/git-lfs";
15+
vendorSha256 = null;
1516

1617
nativeBuildInputs = [ ronn installShellFiles ];
1718

18-
ldflags = [ "-s" "-w" "-X ${goPackagePath}/config.Vendor=${version}" "-X ${goPackagePath}/config.GitCommit=${src.rev}" ];
19+
ldflags = [
20+
"-s"
21+
"-w"
22+
"-X github.com/git-lfs/git-lfs/v${lib.versions.major version}/config.Vendor=${version}"
23+
];
1924

2025
subPackages = [ "." ];
2126

2227
preBuild = ''
23-
pushd go/src/github.com/git-lfs/git-lfs
24-
go generate ./commands
25-
popd
28+
go generate ./commands
2629
'';
2730

2831
postBuild = ''
29-
make -C go/src/${goPackagePath} man
32+
make man
33+
'';
34+
35+
checkInputs = [ git ];
36+
37+
preCheck = ''
38+
unset subPackages
3039
'';
3140

3241
postInstall = ''
33-
installManPage go/src/${goPackagePath}/man/man*/*
42+
installManPage man/man*/*
3443
'';
3544

45+
passthru.tests.version = testers.testVersion {
46+
package = git-lfs;
47+
};
48+
3649
meta = with lib; {
3750
description = "Git extension for versioning large files";
38-
homepage = "https://git-lfs.github.com/";
39-
changelog = "https://github.com/git-lfs/git-lfs/raw/v${version}/CHANGELOG.md";
40-
license = [ licenses.mit ];
41-
maintainers = [ maintainers.twey maintainers.marsam ];
51+
homepage = "https://git-lfs.github.com/";
52+
changelog = "https://github.com/git-lfs/git-lfs/raw/v${version}/CHANGELOG.md";
53+
license = licenses.mit;
54+
maintainers = with maintainers; [ twey marsam ];
4255
};
4356
}

0 commit comments

Comments
 (0)