forked from mirrors/nixpkgs
261f090079
Since commit 0b0119f1ea
on 2022-Jun-04,
`git-lfs` no longer builds with `--option substituters ""`:
```
error: hash mismatch in fixed-output derivation '/nix/store/2g1jwczzld8l190s2apc0ihffmil385f-source.drv':
specified: sha256-3gVUPfZs5GViEA3D7Zm5NdxhuEz9DhwPLoQqHFdGCrI=
got: sha256-D7ZA04HZOG8DcejW+S91c5HjVIW+SLMzXZHylpARwrQ=
note: keeping build directory '/tmp/nix-build-source.drv-3'
error: 1 dependencies of derivation '/nix/store/jzl8ypirdrii6aik2pss84df7sds7vqr-git-lfs-3.2.0.drv' failed to build
``
It appears that the hash
`sha256-3gVUPfZs5GViEA3D7Zm5NdxhuEz9DhwPLoQqHFdGCrI=` was calculated
based on `fetchDotGit=false`, and was in cachix, so nobody noticed
that the hash doesn't match the fetcher expression.
This is yet another case of an ongoing problem with nixpkgs: we have
no way of noticing when a fetcher expression has the wrong hash if
that incorrect hash happens to be the hash of something that is in
cachix. Apparently nobody (else) is checking that nixpkgs works with
`--option substituters ""`.
56 lines
1.1 KiB
Nix
56 lines
1.1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, ronn, installShellFiles, git, testers, git-lfs }:
|
|
|
|
buildGoModule rec {
|
|
pname = "git-lfs";
|
|
version = "3.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "git-lfs";
|
|
repo = "git-lfs";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-3gVUPfZs5GViEA3D7Zm5NdxhuEz9DhwPLoQqHFdGCrI=";
|
|
};
|
|
|
|
vendorSha256 = null;
|
|
|
|
nativeBuildInputs = [ ronn installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/git-lfs/git-lfs/v${lib.versions.major version}/config.Vendor=${version}"
|
|
];
|
|
|
|
subPackages = [ "." ];
|
|
|
|
preBuild = ''
|
|
GOARCH= go generate ./commands
|
|
'';
|
|
|
|
postBuild = ''
|
|
make man
|
|
'';
|
|
|
|
checkInputs = [ git ];
|
|
|
|
preCheck = ''
|
|
unset subPackages
|
|
'';
|
|
|
|
postInstall = ''
|
|
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 = with maintainers; [ twey marsam ];
|
|
};
|
|
}
|