1{ lib
2, stdenv
3, fetchFromGitHub
4, installShellFiles
5, zig
6}:
7
8stdenv.mkDerivation rec {
9 pname = "linuxwave";
10 version = "0.1.3";
11
12 src = fetchFromGitHub {
13 owner = "orhun";
14 repo = "linuxwave";
15 rev = "v${version}";
16 hash = "sha256-e+QTteyHAyYmU4vb86Ju92DxNFFX01g/rsViNI5ba1s=";
17 fetchSubmodules = true;
18 };
19
20 nativeBuildInputs = [
21 installShellFiles
22 zig
23 ];
24
25 postConfigure = ''
26 export XDG_CACHE_HOME=$(mktemp -d)
27 '';
28
29 buildPhase = ''
30 runHook preBuild
31
32 zig build -Drelease-safe -Dcpu=baseline
33
34 runHook postBuild
35 '';
36
37 checkPhase = ''
38 runHook preCheck
39
40 zig build test
41
42 runHook postCheck
43 '';
44
45 installPhase = ''
46 runHook preInstall
47
48 zig build -Drelease-safe -Dcpu=baseline --prefix $out install
49
50 installManPage man/linuxwave.1
51
52 runHook postInstall
53 '';
54
55 meta = with lib; {
56 description = "Generate music from the entropy of Linux";
57 homepage = "https://github.com/orhun/linuxwave";
58 changelog = "https://github.com/orhun/linuxwave/blob/${src.rev}/CHANGELOG.md";
59 license = licenses.mit;
60 maintainers = with maintainers; [ figsoda ];
61 platforms = platforms.all;
62 };
63}