about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/cluster/waypoint/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/cluster/waypoint/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/cluster/waypoint/default.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/cluster/waypoint/default.nix b/nixpkgs/pkgs/applications/networking/cluster/waypoint/default.nix
new file mode 100644
index 000000000000..7675dc0de880
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/cluster/waypoint/default.nix
@@ -0,0 +1,60 @@
+{ lib, buildGoModule, fetchFromGitHub, go-bindata }:
+
+buildGoModule rec {
+  pname = "waypoint";
+  version = "0.2.4";
+
+  src = fetchFromGitHub {
+    owner = "hashicorp";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-6sV2e/m0qVSRWgdvVZ9VxEL/J57nTcTClxHF5X8/8PQ=";
+  };
+
+  deleteVendor = true;
+  vendorSha256 = "sha256-NPE3YHulqllWDGrxQgPmy/KKE7xFPOUorLQNIU8cP50=";
+
+  nativeBuildInputs = [ go-bindata ];
+
+  # GIT_{COMMIT,DIRTY} filled in blank to prevent trying to run git and ending up blank anyway
+  buildPhase = ''
+    runHook preBuild
+    make bin GIT_DESCRIBE="v${version}" GIT_COMMIT="" GIT_DIRTY=""
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -D waypoint $out/bin/waypoint
+    runHook postInstall
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+    # `version` tries to write to ~/.config/waypoint
+    export HOME="$TMPDIR"
+
+    $out/bin/waypoint --help
+    $out/bin/waypoint version # | grep "Waypoint v${version}"
+    runHook postInstallCheck
+  '';
+
+  # Binary is static
+  dontPatchELF = true;
+  dontPatchShebangs = true;
+
+  meta = with lib; {
+    homepage = "https://waypointproject.io";
+    changelog = "https://github.com/hashicorp/waypoint/blob/v${version}/CHANGELOG.md";
+    description = "A tool to build, deploy, and release any application on any platform";
+    longDescription = ''
+      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.
+    '';
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ winpat jk ];
+    platforms = platforms.linux;
+  };
+}