about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/juju
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/juju')
-rw-r--r--nixpkgs/pkgs/applications/networking/juju/default.nix29
1 files changed, 21 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/applications/networking/juju/default.nix b/nixpkgs/pkgs/applications/networking/juju/default.nix
index 1a914a065b09..cce7f1e7c88f 100644
--- a/nixpkgs/pkgs/applications/networking/juju/default.nix
+++ b/nixpkgs/pkgs/applications/networking/juju/default.nix
@@ -1,25 +1,38 @@
-{ lib, fetchFromGitHub, buildGoModule }:
+{ lib, fetchFromGitHub, buildGoModule, installShellFiles, testers, juju }:
 
 buildGoModule rec {
   pname = "juju";
-  version = "3.3.0";
+  version = "3.5.1";
 
   src = fetchFromGitHub {
     owner = "juju";
     repo = "juju";
-    rev = "juju-${version}";
-    sha256 = "sha256-8VSSTeN4a1zvMi4L4dR3q+kWKgYq8Jg1jDvFjEBD7jI=";
+    rev = "v${version}";
+    hash = "sha256-VOGkAv42dus2uxoffffIn6dwC18idwF2tycEHLd6I4s=";
   };
 
-  vendorHash = "sha256-3hZywUpJe6g8IujbK0hcp12S6OKswLj/YYJGuPG06Es=";
-
-  # Disable tests because it attempts to use a mongodb instance
-  doCheck = false;
+  vendorHash = "sha256-2JNEN8fmxflEyP5lHAv75Bjt9sbKoWL5O+87hxK89vU=";
 
   subPackages = [
     "cmd/juju"
   ];
 
+  nativeBuildInputs = [ installShellFiles ];
+
+  # Disable tests because it attempts to use a mongodb instance
+  doCheck = false;
+
+  postInstall = ''
+    for file in etc/bash_completion.d/*; do
+      installShellCompletion --bash "$file"
+    done
+  '';
+
+  passthru.tests.version = testers.testVersion {
+    package = juju;
+    command = "HOME=\"$(mktemp -d)\" juju --version";
+  };
+
   meta = with lib; {
     description = "Open source modelling tool for operating software in the cloud";
     homepage = "https://juju.is";