From b4f88bf62aa3058bb29967d54ee51cadaf4cb7d4 Mon Sep 17 00:00:00 2001 From: Bart Brouns Date: Thu, 8 Jan 2015 13:53:16 +0100 Subject: [PATCH] fully functional faust2jack. had to upgrade to faust git version, because of bug in 0.9.67 --- .../audio/faust-compiler/default.nix | 19 ++++++-- pkgs/applications/audio/faust/default.nix | 47 ++++++++++++++----- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/audio/faust-compiler/default.nix b/pkgs/applications/audio/faust-compiler/default.nix index 5e980691df6..f4bf9d4c659 100644 --- a/pkgs/applications/audio/faust-compiler/default.nix +++ b/pkgs/applications/audio/faust-compiler/default.nix @@ -1,14 +1,23 @@ -{ fetchurl, stdenv, unzip, pkgconfig, makeWrapper, libsndfile, libmicrohttpd, vim }: +{ fetchgit, stdenv, unzip, pkgconfig, makeWrapper, libsndfile, libmicrohttpd, vim }: stdenv.mkDerivation rec { - version = "0.9.67"; + version = "8-1-2015"; name = "faust-compiler-${version}"; - src = fetchurl { - url = "http://downloads.sourceforge.net/project/faudiostream/faust-${version}.zip"; - sha256 = "068vl9536zn0j4pknwfcchzi90rx5pk64wbcbd67z32w0csx8xm1"; + src = fetchgit { + url = git://git.code.sf.net/p/faudiostream/code; + rev = "4db76fdc02b6aec8d15a5af77fcd5283abe963ce"; + sha256 = "f1ac92092ee173e4bcf6b2cb1ac385a7c390fb362a578a403b2b6edd5dc7d5d0"; }; + # this version has a bug that manifests when doing faust2jack: + /*version = "0.9.67";*/ + /*name = "faust-compiler-${version}";*/ + /*src = fetchurl {*/ + /*url = "http://downloads.sourceforge.net/project/faudiostream/faust-${version}.zip";*/ + /*sha256 = "068vl9536zn0j4pknwfcchzi90rx5pk64wbcbd67z32w0csx8xm1";*/ + /*};*/ + buildInputs = [ unzip pkgconfig makeWrapper libsndfile libmicrohttpd vim]; diff --git a/pkgs/applications/audio/faust/default.nix b/pkgs/applications/audio/faust/default.nix index 9d25573ccc8..96258cefca3 100644 --- a/pkgs/applications/audio/faust/default.nix +++ b/pkgs/applications/audio/faust/default.nix @@ -1,21 +1,32 @@ -{ fetchurl, stdenv, bash, alsaLib, atk, cairo, faust-compiler, fontconfig, freetype -, gcc, gdk_pixbuf, glib, gtk, makeWrapper, pango, pkgconfig, unzip +{ fetchgit, stdenv, bash, alsaLib, atk, cairo, faust-compiler, fontconfig, freetype +, gcc, gdk_pixbuf, glib, gtk, jack2, makeWrapper, opencv, pango, pkgconfig, unzip , gtkSupport ? true +, jackaudioSupport ? true }: stdenv.mkDerivation rec { - version = "0.9.67"; + version = "8-1-2015"; name = "faust-${version}"; - src = fetchurl { - url = "http://downloads.sourceforge.net/project/faudiostream/faust-${version}.zip"; - sha256 = "068vl9536zn0j4pknwfcchzi90rx5pk64wbcbd67z32w0csx8xm1"; + src = fetchgit { + url = git://git.code.sf.net/p/faudiostream/code; + rev = "4db76fdc02b6aec8d15a5af77fcd5283abe963ce"; + sha256 = "f1ac92092ee173e4bcf6b2cb1ac385a7c390fb362a578a403b2b6edd5dc7d5d0"; }; + # this version has a bug that manifests when doing faust2jack: + /*version = "0.9.67";*/ + /*name = "faust-${version}";*/ + /*src = fetchurl {*/ + /*url = "http://downloads.sourceforge.net/project/faudiostream/faust-${version}.zip";*/ + /*sha256 = "068vl9536zn0j4pknwfcchzi90rx5pk64wbcbd67z32w0csx8xm1";*/ + /*};*/ + buildInputs = [ bash unzip faust-compiler gcc makeWrapper pkgconfig ] ++ stdenv.lib.optionals gtkSupport [ alsaLib atk cairo fontconfig freetype gdk_pixbuf glib gtk pango ] + ++ stdenv.lib.optional jackaudioSupport jack2 ; makeFlags="PREFIX=$(out)"; @@ -24,11 +35,15 @@ stdenv.mkDerivation rec { phases = [ "unpackPhase installPhase postInstall" ]; installPhase = '' + sed -i 23,24d tools/faust2appls/faust2jack mkdir $out/bin install tools/faust2appls/faust2alsaconsole $out/bin install tools/faust2appls/faustpath $out/bin install tools/faust2appls/faustoptflags $out/bin install tools/faust2appls/faust2alsa $out/bin + install tools/faust2appls/faust2jack $out/bin + + patchShebangs $out/bin wrapProgram $out/bin/faust2alsaconsole \ --prefix PKG_CONFIG_PATH : ${alsaLib}/lib/pkgconfig \ @@ -41,17 +56,23 @@ stdenv.mkDerivation rec { --prefix PKG_CONFIG_PATH : ${alsaLib}/lib/pkgconfig:$GTK_PKGCONFIG_PATHS \ --set FAUSTLIB ${faust-compiler}/lib/faust \ --set FAUSTINC ${faust-compiler}/include/ \ - '' + stdenv.lib.optionalString (!gtkSupport) "rm $out/bin/faust2alsa" - ; + + wrapProgram $out/bin/faust2jack \ + --prefix PKG_CONFIG_PATH : ${jack2}/lib/pkgconfig:${opencv}/lib/pkgconfig:$GTK_PKGCONFIG_PATHS \ + --set FAUSTLIB ${faust-compiler}/lib/faust \ + --set FAUSTINC ${faust-compiler}/include/ \ + + '' + + stdenv.lib.optionalString (!gtkSupport) "rm $out/bin/faust2alsa" + + stdenv.lib.optionalString (!gtkSupport || !jackaudioSupport) "rm $out/bin/faust2jack" + ; postInstall = '' - find $out/bin/ -name "faust2*" -type f | xargs sed "s@/bin/bash@${bash}/bin/bash@g" -i - sed -i "s@/bin/bash@${bash}/bin/bash@g" $out/bin/faustpath sed -e "s@\$FAUST_INSTALL /usr/local /usr /opt /opt/local@${faust-compiler}@g" -i $out/bin/faustpath sed -i "s@/bin/bash@${bash}/bin/bash@g" $out/bin/faustoptflags - find $out/bin/ -name "faust2*" -type f | xargs sed "s@pkg-config@${pkgconfig}/bin/pkg-config@g" -i - find $out/bin/ -name "faust2*" -type f | xargs sed "s@CXX=g++@CXX=${gcc}/bin/g++@g" -i - find $out/bin/ -name "faust2*" -type f | xargs sed "s@faust -i -a @${faust-compiler}/bin/faust -i -a ${faust-compiler}/lib/faust/@g" -i + find $out/bin/ -name "*faust2*" -type f | xargs sed "s@pkg-config@${pkgconfig}/bin/pkg-config@g" -i + find $out/bin/ -name "*faust2*" -type f | xargs sed "s@CXX=g++@CXX=${gcc}/bin/g++@g" -i + find $out/bin/ -name "*faust2*" -type f | xargs sed "s@faust -i -a @${faust-compiler}/bin/faust -i -a ${faust-compiler}/lib/faust/@g" -i ''; meta = with stdenv.lib; {