evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / go / go-task / package.nix
blob4a122d634874cb5d1d4545b6df8cf07596efdfef
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 , testers
6 , go-task
7 }:
9 buildGoModule rec {
10   pname = "go-task";
11   version = "3.39.2";
13   src = fetchFromGitHub {
14     owner = "go-task";
15     repo = "task";
16     rev = "refs/tags/v${version}";
17     hash = "sha256-B5o3oAey7zJg5JBf4GO69cLmVbnkKedkjWP108XRGR8=";
18   };
20   vendorHash = "sha256-P9J69WJ2C2xgdU9xydiaY8iSKB7ZfexLNYi7dyHDTIk=";
22   doCheck = false;
24   nativeBuildInputs = [ installShellFiles ];
26   subPackages = [ "cmd/task" ];
28   ldflags = [
29     "-s"
30     "-w"
31     "-X=github.com/go-task/task/v3/internal/version.version=${version}"
32   ];
34   CGO_ENABLED = 0;
36   postInstall = ''
37     ln -s $out/bin/task $out/bin/go-task
39     installShellCompletion completion/{bash,fish,zsh}/*
41     substituteInPlace $out/share/bash-completion/completions/task.bash \
42       --replace-fail 'complete -F _task task' 'complete -F _task task go-task'
43     substituteInPlace $out/share/fish/vendor_completions.d/task.fish \
44       --replace-fail 'complete -c $GO_TASK_PROGNAME' 'complete -c $GO_TASK_PROGNAME -c go-task'
45     substituteInPlace $out/share/zsh/site-functions/_task \
46       --replace-fail '#compdef task' '#compdef task go-task'
47   '';
49   passthru.tests = {
50     version = testers.testVersion {
51       package = go-task;
52     };
53   };
55   meta = with lib; {
56     homepage = "https://taskfile.dev/";
57     description = "Task runner / simpler Make alternative written in Go";
58     changelog = "https://github.com/go-task/task/blob/v${version}/CHANGELOG.md";
59     license = licenses.mit;
60     maintainers = with maintainers; [ parasrah ];
61   };