22 # Optional Dependencies
35 inherit (python3Packages) python dbus-python;
37 pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
39 libOnly = prefix == "lib";
41 optDbus = if stdenv.hostPlatform.isDarwin then null else shouldUsePkg dbus;
42 optPythonDBus = if libOnly then null else shouldUsePkg dbus-python;
43 optLibffado = if libOnly then null else shouldUsePkg libffado;
44 optAlsaLib = if libOnly then null else shouldUsePkg alsa-lib;
45 optLibopus = shouldUsePkg libopus;
47 stdenv.mkDerivation (finalAttrs: {
48 pname = "${prefix}jack2";
51 src = fetchFromGitHub {
54 rev = "v${finalAttrs.version}";
55 sha256 = "sha256-Cslfys5fcZDy0oee9/nM5Bd1+Cg4s/ayXjJJOSQCL4E=";
67 ] ++ lib.optionals (optDbus != null) [ makeWrapper ];
81 ++ lib.optionals stdenv.hostPlatform.isDarwin [
92 name = "jack2-waf2.0.26.patch";
93 url = "https://github.com/jackaudio/jack2/commit/250420381b1a6974798939ad7104ab1a4b9a9994.patch";
94 hash = "sha256-M/H72lLTeddefqth4BSkEfySZRYMIzLErb7nIgVN0u8=";
99 patchShebangs --build svnversion_regenerate.sh
105 "--autostart=${if (optDbus != null) then "dbus" else "classic"}"
107 ++ lib.optional (optDbus != null) "--dbus"
108 ++ lib.optional (optLibffado != null) "--firewire"
109 ++ lib.optional (optAlsaLib != null) "--alsa";
114 rm -rf $out/{bin,share}
115 rm -rf $out/lib/{jack,libjacknet*,libjackserver*}
118 lib.optionalString (optDbus != null) ''
119 wrapProgram $out/bin/jack_control --set PYTHONPATH $PYTHONPATH
124 substituteInPlace "$dev/lib/pkgconfig/jack.pc" \
125 --replace "$out/include" "$dev/include"
128 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
131 description = "JACK audio connection kit, version 2 with jackdbus";
132 homepage = "https://jackaudio.org";
133 license = licenses.gpl2Plus;
134 pkgConfigModules = [ "jack" ];
135 platforms = platforms.unix;