fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / go / go-task / package.nix
blobe4d80380bd61fa64192fdb851c5b987cfd73ef88
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 , testers
6 , nix-update-script
7 , go-task
8 }:
10 buildGoModule rec {
11   pname = "go-task";
12   version = "3.40.1";
14   src = fetchFromGitHub {
15     owner = "go-task";
16     repo = "task";
17     rev = "refs/tags/v${version}";
18     hash = "sha256-jQKPTKEzTfzqPlNlKFMduaAhvDsogRv3vCGtZ4KP/O4=";
19   };
21   vendorHash = "sha256-bw9NaJOMMKcKth0hRqNq8mqib/5zLpjComo0oj22A/U=";
23   doCheck = false;
25   nativeBuildInputs = [ installShellFiles ];
27   subPackages = [ "cmd/task" ];
29   ldflags = [
30     "-s"
31     "-w"
32     "-X=github.com/go-task/task/v3/internal/version.version=${version}"
33   ];
35   CGO_ENABLED = 0;
37   postInstall = ''
38     ln -s $out/bin/task $out/bin/go-task
40     installShellCompletion completion/{bash,fish,zsh}/*
42     substituteInPlace $out/share/bash-completion/completions/task.bash \
43       --replace-fail 'complete -F _task task' 'complete -F _task task go-task'
44     substituteInPlace $out/share/fish/vendor_completions.d/task.fish \
45       --replace-fail 'complete -c $GO_TASK_PROGNAME' 'complete -c $GO_TASK_PROGNAME -c go-task'
46     substituteInPlace $out/share/zsh/site-functions/_task \
47       --replace-fail '#compdef task' '#compdef task go-task'
48   '';
50   passthru = {
51     tests = {
52       version = testers.testVersion {
53         package = go-task;
54       };
55     };
57     updateScript = nix-update-script { };
58   };
60   meta = with lib; {
61     homepage = "https://taskfile.dev/";
62     description = "Task runner / simpler Make alternative written in Go";
63     changelog = "https://github.com/go-task/task/blob/v${version}/CHANGELOG.md";
64     license = licenses.mit;
65     maintainers = with maintainers; [ parasrah ];
66   };