2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2024-07-27 06:49:29 +00:00
|
|
|
, fetchpatch
|
2023-07-15 17:15:38 +00:00
|
|
|
, installShellFiles
|
|
|
|
, testers
|
|
|
|
, go-task
|
|
|
|
}:
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "go-task";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "3.38.0";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = "task";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-mz/07DONaO3kCxOXEnvWglY0b9JXxCXjTrVIEbsbl98=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
vendorHash = "sha256-2M/FrXip0Tz0wguCd81qbBDW3XIJlAWwVzD+hIFm6sw=";
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# fix version resolution when passed in though ldflags
|
|
|
|
# remove on next release
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-ldflags-version.patch";
|
|
|
|
url = "https://github.com/go-task/task/commit/9ee4f21d62382714ac829df6f9bbf1637406eb5b.patch?full_index=1";
|
|
|
|
hash = "sha256-wu5//aZ/vzuObb03AjUUlVFjPr175mn1vVAZgqSGIZ0=";
|
|
|
|
})
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
subPackages = [ "cmd/task" ];
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
2023-07-15 17:15:38 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X=github.com/go-task/task/v3/internal/version.version=${version}"
|
2020-08-20 17:08:02 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-03-20 04:20:00 +00:00
|
|
|
ln -s $out/bin/task $out/bin/go-task
|
2021-12-30 13:39:12 +00:00
|
|
|
|
|
|
|
installShellCompletion completion/{bash,fish,zsh}/*
|
2020-08-20 17:08:02 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.tests = {
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = go-task;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://taskfile.dev/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Task runner / simpler Make alternative written in Go";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/go-task/task/blob/v${version}/CHANGELOG.md";
|
2020-08-20 17:08:02 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ parasrah ];
|
|
|
|
};
|
|
|
|
}
|