about summary refs log tree commit diff
path: root/pkgs/applications/networking/juju
diff options
context:
space:
mode:
authorAaron Jheng <wentworth@outlook.com>2024-05-19 21:27:22 +0800
committerAaron Jheng <wentworth@outlook.com>2024-05-19 22:34:18 +0800
commit0af7ef7e4f3b3a21706edd669bdf5b627af4e25b (patch)
treeebd6d3b5428615b66d9629cca1426dbe80804d90 /pkgs/applications/networking/juju
parent0bdd49cb10eeb85852292b0f272f199017fb992c (diff)
juju: 3.3.0 -> 3.3.5
Diffstat (limited to 'pkgs/applications/networking/juju')
-rw-r--r--pkgs/applications/networking/juju/default.nix29
1 files changed, 21 insertions, 8 deletions
diff --git a/pkgs/applications/networking/juju/default.nix b/pkgs/applications/networking/juju/default.nix
index 1a914a065b095..8780e74a73e84 100644
--- a/pkgs/applications/networking/juju/default.nix
+++ b/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.3.5";
 
   src = fetchFromGitHub {
     owner = "juju";
     repo = "juju";
-    rev = "juju-${version}";
-    sha256 = "sha256-8VSSTeN4a1zvMi4L4dR3q+kWKgYq8Jg1jDvFjEBD7jI=";
+    rev = "v${version}";
+    hash = "sha256-sp4KLRKII1oEmdbCHzs5fbE/68NbKrHE3bxO14byYFk=";
   };
 
-  vendorHash = "sha256-3hZywUpJe6g8IujbK0hcp12S6OKswLj/YYJGuPG06Es=";
-
-  # Disable tests because it attempts to use a mongodb instance
-  doCheck = false;
+  vendorHash = "sha256-a50W9V1xxmItHS2DZkkXYEZ7I6aJxDo1+IriOlMPDyw=";
 
   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";