2021-05-14 08:21:00 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, go-bindata, installShellFiles }:
|
2020-12-21 09:30:19 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "waypoint";
|
2022-02-24 21:48:45 +00:00
|
|
|
version = "0.7.2";
|
2020-12-21 09:30:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hashicorp";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-02-24 21:48:45 +00:00
|
|
|
sha256 = "sha256-ek3WOL1sNPAIkZN/cWDSmlNtN41VL3SKb7Qb4kew8vo=";
|
2020-12-21 09:30:19 +00:00
|
|
|
};
|
|
|
|
|
2022-02-24 21:48:45 +00:00
|
|
|
vendorSha256 = "sha256-a0O36zyQQSVrGXWpTdCkAAwNAXU23pcFJBB+o2KYnWw=";
|
2020-12-21 09:30:19 +00:00
|
|
|
|
2021-05-14 08:21:00 +00:00
|
|
|
nativeBuildInputs = [ go-bindata installShellFiles ];
|
2020-12-21 09:30:19 +00:00
|
|
|
|
2021-02-07 17:00:41 +00:00
|
|
|
# GIT_{COMMIT,DIRTY} filled in blank to prevent trying to run git and ending up blank anyway
|
2020-12-21 09:30:19 +00:00
|
|
|
buildPhase = ''
|
2021-02-24 13:56:21 +00:00
|
|
|
runHook preBuild
|
2021-02-07 17:00:41 +00:00
|
|
|
make bin GIT_DESCRIBE="v${version}" GIT_COMMIT="" GIT_DIRTY=""
|
2021-02-24 13:56:21 +00:00
|
|
|
runHook postBuild
|
2020-12-21 09:30:19 +00:00
|
|
|
'';
|
|
|
|
|
2021-05-14 08:21:00 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-12-21 09:30:19 +00:00
|
|
|
installPhase = ''
|
2021-02-24 13:56:21 +00:00
|
|
|
runHook preInstall
|
2021-05-14 08:21:00 +00:00
|
|
|
|
|
|
|
local INSTALL="$out/bin/waypoint"
|
2021-02-07 17:00:41 +00:00
|
|
|
install -D waypoint $out/bin/waypoint
|
2021-05-14 08:21:00 +00:00
|
|
|
|
2021-06-04 13:44:17 +00:00
|
|
|
# waypoint's completion install command alters your <something>rc files
|
|
|
|
# below is the equivalent of what it injects
|
|
|
|
|
2021-05-14 08:21:00 +00:00
|
|
|
# Write to a file as it doesn't like EOF within <()
|
|
|
|
cat > waypoint.fish <<EOF
|
|
|
|
function __complete_waypoint
|
|
|
|
set -lx COMP_LINE (commandline -cp)
|
|
|
|
test -z (commandline -ct)
|
|
|
|
and set COMP_LINE "$COMP_LINE "
|
|
|
|
$INSTALL
|
|
|
|
end
|
|
|
|
complete -f -c waypoint -a "(__complete_waypoint)"
|
|
|
|
EOF
|
|
|
|
installShellCompletion --cmd waypoint \
|
|
|
|
--bash <(echo "complete -C $INSTALL waypoint") \
|
|
|
|
--fish <(cat waypoint.fish) \
|
|
|
|
--zsh <(echo "complete -o nospace -C $INSTALL waypoint")
|
|
|
|
|
2021-02-24 13:56:21 +00:00
|
|
|
runHook postInstall
|
2020-12-21 09:30:19 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-24 13:56:21 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
# `version` tries to write to ~/.config/waypoint
|
|
|
|
export HOME="$TMPDIR"
|
|
|
|
|
|
|
|
$out/bin/waypoint --help
|
2021-04-21 15:50:17 +00:00
|
|
|
$out/bin/waypoint version | grep "CLI: v${version}"
|
2021-02-24 13:56:21 +00:00
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Binary is static
|
2021-02-07 17:00:41 +00:00
|
|
|
dontPatchELF = true;
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
2020-12-21 09:30:19 +00:00
|
|
|
meta = with lib; {
|
2021-02-07 17:00:41 +00:00
|
|
|
homepage = "https://waypointproject.io";
|
|
|
|
changelog = "https://github.com/hashicorp/waypoint/blob/v${version}/CHANGELOG.md";
|
2020-12-21 09:30:19 +00:00
|
|
|
description = "A tool to build, deploy, and release any application on any platform";
|
|
|
|
longDescription = ''
|
2021-02-07 17:00:41 +00:00
|
|
|
Waypoint allows developers to define their application build, deploy, and
|
|
|
|
release lifecycle as code, reducing the time to deliver deployments
|
|
|
|
through a consistent and repeatable workflow.
|
2020-12-21 09:30:19 +00:00
|
|
|
'';
|
|
|
|
license = licenses.mpl20;
|
2022-01-14 19:13:10 +00:00
|
|
|
maintainers = with maintainers; [ winpat jk techknowlogick ];
|
2020-12-21 09:30:19 +00:00
|
|
|
};
|
|
|
|
}
|