From ab0ac18279d6497bdeb616cbe7cd0797d6534739 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 2 Nov 2016 14:20:58 +0100 Subject: [PATCH] libjack2Unstable: fix evaluation broken by f64933596c58329d59eae7485f4868b53955fc3a --- pkgs/misc/jackaudio/unstable.nix | 79 ++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 pkgs/misc/jackaudio/unstable.nix diff --git a/pkgs/misc/jackaudio/unstable.nix b/pkgs/misc/jackaudio/unstable.nix new file mode 100644 index 00000000000..1f8a41da32f --- /dev/null +++ b/pkgs/misc/jackaudio/unstable.nix @@ -0,0 +1,79 @@ +{ stdenv, fetchFromGitHub, pkgconfig, python2Packages, makeWrapper +, bash, libsamplerate, libsndfile, readline, eigen, celt + +# Optional Dependencies +, dbus ? null, libffado ? null, alsaLib ? null +, libopus ? null + +# Extra options +, prefix ? "" +}: + +with stdenv.lib; +let + inherit (python2Packages) python dbus-python; + shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null; + + libOnly = prefix == "lib"; + + optDbus = shouldUsePkg dbus; + optPythonDBus = if libOnly then null else shouldUsePkg dbus-python; + optLibffado = if libOnly then null else shouldUsePkg libffado; + optAlsaLib = if libOnly then null else shouldUsePkg alsaLib; + optLibopus = shouldUsePkg libopus; +in +stdenv.mkDerivation rec { + name = "${prefix}jack2-unstable-${version}"; + version = "2016-08-18"; + + src = fetchFromGitHub { + owner = "jackaudio"; + repo = "jack2"; + rev = "f2ece2418c875eb7e7ac3d25fbb484ddda47ab46"; + sha256 = "0cvb0m6qz3k8a5njwyw65l4y3izi2rsh512hv5va97kjc6wzzx4j"; + }; + + nativeBuildInputs = [ pkgconfig python makeWrapper ]; + buildInputs = [ + python + + libsamplerate libsndfile readline eigen celt + + optDbus optPythonDBus optLibffado optAlsaLib optLibopus + ]; + + patchPhase = '' + substituteInPlace svnversion_regenerate.sh --replace /bin/bash ${bash}/bin/bash + ''; + + configurePhase = '' + python waf configure --prefix=$out \ + ${optionalString (optDbus != null) "--dbus"} \ + --classic \ + --profile \ + ${optionalString (optLibffado != null) "--firewire"} \ + ${optionalString (optAlsaLib != null) "--alsa"} \ + --autostart=${if (optDbus != null) then "dbus" else "classic"} \ + ''; + + buildPhase = '' + python waf build + ''; + + installPhase = '' + python waf install + '' + (if libOnly then '' + rm -rf $out/{bin,share} + rm -rf $out/lib/{jack,libjacknet*,libjackserver*} + '' else '' + wrapProgram $out/bin/jack_control --set PYTHONPATH $PYTHONPATH + ''); + + meta = { + description = "JACK audio connection kit, version 2 with jackdbus"; + homepage = "http://jackaudio.org"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ goibhniu wkennington ]; + }; +}