1{
2 stdenv,
3 lib,
4
5 fetchFromGitHub,
6
7 pkg-config,
8 meson,
9 ninja,
10
11 jack,
12 alsa-lib,
13 libopus,
14 libsamplerate,
15 libsndfile,
16 readline,
17 zita-alsa-pcmi,
18 zita-resampler,
19
20 enableAlsa ? stdenv.hostPlatform.isLinux,
21}:
22
23stdenv.mkDerivation (final: {
24 pname = "jack-example-tools";
25 version = "4";
26
27 src = fetchFromGitHub {
28 owner = "jackaudio";
29 repo = "jack-example-tools";
30 rev = "tags/${final.version}";
31 hash = "sha256-5jmynNxwNVLxEZ1MaqQUG6kRwipDkjhrdDCbZHtmAHk=";
32 };
33
34 postPatch = ''
35 patchShebangs scripts
36 '';
37
38 nativeBuildInputs = [
39 pkg-config
40 meson
41 ninja
42 ];
43 buildInputs = [
44 jack
45 libopus
46 libsamplerate
47 libsndfile
48 readline
49 ]
50 ++ lib.optionals enableAlsa [
51 alsa-lib
52 zita-alsa-pcmi
53 zita-resampler
54 ];
55
56 mesonFlags = [
57 (lib.mesonEnable "alsa_in_out" enableAlsa)
58 (lib.mesonEnable "zalsa" enableAlsa)
59 ];
60
61 # no tests defined, but prepare for some in the future.
62 doCheck = true;
63
64 meta = with lib; {
65 description = "Official examples and tools from the JACK project";
66 homepage = "https://jackaudio.org";
67 license = licenses.gpl2Plus;
68 platforms = platforms.unix;
69 maintainers = [ ];
70 };
71})