Skip to content

Commit e67d838

Browse files
jotta-cli: 0.15.107955 -> 0.16.129390 (NixOS#388203)
2 parents d73069e + eb64988 commit e67d838

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

pkgs/by-name/jo/jotta-cli/package.nix

+24-19
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,45 @@
33
stdenv,
44
fetchzip,
55
nixosTests,
6+
installShellFiles,
67
}:
78

8-
let
9-
arch = "amd64";
10-
in
119
stdenv.mkDerivation rec {
1210
pname = "jotta-cli";
13-
version = "0.15.107955";
11+
version = "0.16.129390";
12+
1413
src = fetchzip {
15-
url = "https://repo.jotta.us/archives/linux/${arch}/jotta-cli-${version}_linux_${arch}.tar.gz";
16-
sha256 = "sha256-qCG3yi0ACmqOnn+gaCN8GedciUobpOww50Kz5AdknqU=";
14+
url = "https://repo.jotta.us/archives/linux/amd64/jotta-cli-${version}_linux_amd64.tar.gz";
15+
hash = "sha256-iw8OZ6clpK+CnBFNK5jOSGQ3ReU4pnOQSJFE2LTJNxE=";
1716
stripRoot = false;
1817
};
1918

20-
installPhase = ''
21-
install -D usr/bin/jotta-cli usr/bin/jottad -t $out/bin/
22-
mkdir -p $out/share/bash-completion/completions
23-
'';
19+
nativeBuildInputs = [ installShellFiles ];
20+
21+
installPhase =
22+
''
23+
runHook preInstall
24+
25+
install -Dm0755 usr/bin/jotta-cli usr/bin/jottad -t $out/bin/
2426
25-
postFixup = ''
26-
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/bin/jotta-cli
27-
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/bin/jottad
28-
$out/bin/jotta-cli completion bash > $out/share/bash-completion/completions/jotta-cli.bash
29-
'';
27+
runHook postInstall
28+
''
29+
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
30+
installShellCompletion --cmd jotta-cli \
31+
--bash <($out/bin/jotta-cli completion bash) \
32+
--fish <($out/bin/jotta-cli completion fish) \
33+
--zsh <($out/bin/jotta-cli completion zsh)
34+
'';
3035

3136
passthru.tests = { inherit (nixosTests) jotta-cli; };
3237

33-
meta = with lib; {
38+
meta = {
3439
description = "Jottacloud CLI";
3540
homepage = "https://www.jottacloud.com/";
3641
downloadPage = "https://repo.jotta.us/archives/linux/";
37-
maintainers = with maintainers; [ evenbrenden ];
38-
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
39-
license = licenses.unfree;
42+
maintainers = with lib.maintainers; [ evenbrenden ];
43+
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
44+
license = lib.licenses.unfree;
4045
platforms = [ "x86_64-linux" ];
4146
};
4247
}

0 commit comments

Comments
 (0)