about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/audio/linuxwave/default.nix
blob: 6c3d6ce2f1b76c936f043d6e4dccf67dcb89e174 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, zig
}:

stdenv.mkDerivation rec {
  pname = "linuxwave";
  version = "0.1.3";

  src = fetchFromGitHub {
    owner = "orhun";
    repo = "linuxwave";
    rev = "v${version}";
    hash = "sha256-e+QTteyHAyYmU4vb86Ju92DxNFFX01g/rsViNI5ba1s=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    installShellFiles
    zig
  ];

  postConfigure = ''
    export XDG_CACHE_HOME=$(mktemp -d)
  '';

  buildPhase = ''
    runHook preBuild

    zig build -Drelease-safe -Dcpu=baseline

    runHook postBuild
  '';

  checkPhase = ''
    runHook preCheck

    zig build test

    runHook postCheck
  '';

  installPhase = ''
    runHook preInstall

    zig build -Drelease-safe -Dcpu=baseline --prefix $out install

    installManPage man/linuxwave.1

    runHook postInstall
  '';

  meta = with lib; {
    description = "Generate music from the entropy of Linux";
    homepage = "https://github.com/orhun/linuxwave";
    changelog = "https://github.com/orhun/linuxwave/blob/${src.rev}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ figsoda ];
    platforms = platforms.all;
  };
}