nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 73 lines 2.2 kB view raw
1{ lib, stdenv, fetchFromGitHub, pkg-config, python3Packages, makeWrapper 2, bash, libsamplerate, libsndfile, readline, eigen, celt 3, wafHook 4# Darwin Dependencies 5, aften, AudioUnit, CoreAudio, libobjc, Accelerate 6 7# Optional Dependencies 8, dbus ? null, libffado ? null, alsa-lib ? null 9, libopus ? null 10 11# Extra options 12, prefix ? "" 13}: 14 15with lib; 16let 17 inherit (python3Packages) python dbus-python; 18 shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null; 19 20 libOnly = prefix == "lib"; 21 22 optDbus = if stdenv.isDarwin then null else shouldUsePkg dbus; 23 optPythonDBus = if libOnly then null else shouldUsePkg dbus-python; 24 optLibffado = if libOnly then null else shouldUsePkg libffado; 25 optAlsaLib = if libOnly then null else shouldUsePkg alsa-lib; 26 optLibopus = shouldUsePkg libopus; 27in 28stdenv.mkDerivation rec { 29 pname = "${prefix}jack2"; 30 version = "1.9.19"; 31 32 src = fetchFromGitHub { 33 owner = "jackaudio"; 34 repo = "jack2"; 35 rev = "v${version}"; 36 sha256 = "01s8i64qczxqawgrzrw19asaqmcspf5l2h3203xzg56wnnhhzcw7"; 37 }; 38 39 nativeBuildInputs = [ pkg-config python makeWrapper wafHook ]; 40 buildInputs = [ libsamplerate libsndfile readline eigen celt 41 optDbus optPythonDBus optLibffado optAlsaLib optLibopus 42 ] ++ optionals stdenv.isDarwin [ 43 aften AudioUnit CoreAudio Accelerate libobjc 44 ]; 45 46 prePatch = '' 47 substituteInPlace svnversion_regenerate.sh \ 48 --replace /bin/bash ${bash}/bin/bash 49 ''; 50 51 dontAddWafCrossFlags = "true"; 52 wafConfigureFlags = [ 53 "--classic" 54 "--autostart=${if (optDbus != null) then "dbus" else "classic"}" 55 ] ++ optional (optDbus != null) "--dbus" 56 ++ optional (optLibffado != null) "--firewire" 57 ++ optional (optAlsaLib != null) "--alsa"; 58 59 postInstall = (if libOnly then '' 60 rm -rf $out/{bin,share} 61 rm -rf $out/lib/{jack,libjacknet*,libjackserver*} 62 '' else '' 63 wrapProgram $out/bin/jack_control --set PYTHONPATH $PYTHONPATH 64 ''); 65 66 meta = { 67 description = "JACK audio connection kit, version 2 with jackdbus"; 68 homepage = "https://jackaudio.org"; 69 license = licenses.gpl2Plus; 70 platforms = platforms.unix; 71 maintainers = with maintainers; [ goibhniu ]; 72 }; 73}