jnv: 0.4.2 -> 0.5.0 (#371655)
[NixPkgs.git] / pkgs / by-name / aw / await / package.nix
blobb2b74d8a0eb0e37a282c9c11da4a23d43db1bcde
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   installShellFiles,
6   versionCheckHook,
7 }:
9 stdenv.mkDerivation rec {
10   pname = "await";
11   version = "1.0.7";
13   src = fetchFromGitHub {
14     owner = "slavaGanzin";
15     repo = "await";
16     rev = version;
17     hash = "sha256-Yrit1WdWIfjwqbjvyjrPT3EqSSkooYX+uoOstbxy//I=";
18   };
20   nativeBuildInputs = [ installShellFiles ];
22   buildPhase = ''
23     runHook preBuild
24     $CC await.c -o await -l pthread
25     runHook postBuild
26   '';
28   installPhase = ''
29     runHook preInstall
31     install -Dm755 await -t $out/bin
32     install -Dm444 LICENSE -t $out/share/licenses/await
33     install -Dm444 README.md -t $out/share/doc/await
34     installShellCompletion --cmd await autocompletions/await.{bash,fish,zsh}
36     runHook postInstall
37   '';
39   nativeInstallCheckInputs = [
40     versionCheckHook
41   ];
42   doInstallCheck = true;
43   versionCheckProgramArg = [ "--version" ];
45   meta = with lib; {
46     description = "Small binary that runs a list of commands in parallel and awaits termination";
47     homepage = "https://await-cli.app";
48     license = licenses.mit;
49     maintainers = with maintainers; [ chewblacka ];
50     platforms = platforms.all;
51     mainProgram = "await";
52   };