|
3 | 3 | stdenv,
|
4 | 4 | fetchzip,
|
5 | 5 | nixosTests,
|
| 6 | + installShellFiles, |
6 | 7 | }:
|
7 | 8 |
|
8 |
| -let |
9 |
| - arch = "amd64"; |
10 |
| -in |
11 | 9 | stdenv.mkDerivation rec {
|
12 | 10 | pname = "jotta-cli";
|
13 |
| - version = "0.15.107955"; |
| 11 | + version = "0.16.129390"; |
| 12 | + |
14 | 13 | 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="; |
17 | 16 | stripRoot = false;
|
18 | 17 | };
|
19 | 18 |
|
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/ |
24 | 26 |
|
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 | + ''; |
30 | 35 |
|
31 | 36 | passthru.tests = { inherit (nixosTests) jotta-cli; };
|
32 | 37 |
|
33 |
| - meta = with lib; { |
| 38 | + meta = { |
34 | 39 | description = "Jottacloud CLI";
|
35 | 40 | homepage = "https://www.jottacloud.com/";
|
36 | 41 | 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; |
40 | 45 | platforms = [ "x86_64-linux" ];
|
41 | 46 | };
|
42 | 47 | }
|
0 commit comments