about summary refs log tree commit diff
path: root/pkgs/by-name/aw/await/package.nix
blob: 40376c646e676bb2f9b3ed2b0c14b26af786ab69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib, stdenv, fetchFromGitHub }:

stdenv.mkDerivation rec {
  pname = "await";
  version = "0.999";

  src = fetchFromGitHub {
    owner = "slavaGanzin";
    repo = "await";
    rev = "v${version}";
    hash = "sha256-z178TKA0x6UnpBQaA8dig2FLeJKGxPndfvwtmylAD90=";
  };

  buildPhase = ''
    runHook preBuild
    $CC await.c -o await -l pthread
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    install -Dm755 await -t $out/bin
    install -Dm444 LICENSE -t $out/share/licenses/await
    install -Dm444 README.md -t $out/share/doc/await

    runHook postInstall
  '';

  meta = with lib; {
    description = "Small binary that runs a list of commands in parallel and awaits termination";
    homepage = "https://await-cli.app";
    license = licenses.mit;
    maintainers = with maintainers; [ chewblacka ];
    platforms = platforms.all;
    mainProgram = "await";
  };
}