@@ -1,21 +1,32 @@
1−{ fetchurl, stdenv, bash, alsaLib, atk, cairo, faust-compiler, fontconfig, freetype
2−, gcc, gdk_pixbuf, glib, gtk, makeWrapper, pango, pkgconfig, unzip
1+{ fetchgit, stdenv, bash, alsaLib, atk, cairo, faust-compiler, fontconfig, freetype
2+, gcc, gdk_pixbuf, glib, gtk, jack2, makeWrapper, opencv, pango, pkgconfig, unzip
33, gtkSupport ? true
4+, jackaudioSupport ? true
45}:
56
67stdenv.mkDerivation rec {
78
8− version = "0.9.67";
9+ version = "8-1-2015";
910 name = "faust-${version}";
10− src = fetchurl {
11− url = "http://downloads.sourceforge.net/project/faudiostream/faust-${version}.zip";
12− sha256 = "068vl9536zn0j4pknwfcchzi90rx5pk64wbcbd67z32w0csx8xm1";
11+ src = fetchgit {
12+ url = git://git.code.sf.net/p/faudiostream/code;
13+ rev = "4db76fdc02b6aec8d15a5af77fcd5283abe963ce";
14+ sha256 = "f1ac92092ee173e4bcf6b2cb1ac385a7c390fb362a578a403b2b6edd5dc7d5d0";
1315 };
1416
17+ # this version has a bug that manifests when doing faust2jack:
18+ /*version = "0.9.67";*/
19+ /*name = "faust-${version}";*/
20+ /*src = fetchurl {*/
21+ /*url = "http://downloads.sourceforge.net/project/faudiostream/faust-${version}.zip";*/
22+ /*sha256 = "068vl9536zn0j4pknwfcchzi90rx5pk64wbcbd67z32w0csx8xm1";*/
23+ /*};*/
24+
1525 buildInputs = [ bash unzip faust-compiler gcc makeWrapper pkgconfig ]
1626 ++ stdenv.lib.optionals gtkSupport [
1727 alsaLib atk cairo fontconfig freetype gdk_pixbuf glib gtk pango
1828 ]
29+ ++ stdenv.lib.optional jackaudioSupport jack2
1930 ;
2031
2132 makeFlags="PREFIX=$(out)";
@@ -24,11 +35,15 @@ stdenv.mkDerivation rec {
2435 phases = [ "unpackPhase installPhase postInstall" ];
2536
2637 installPhase = ''
38+ sed -i 23,24d tools/faust2appls/faust2jack
2739 mkdir $out/bin
2840 install tools/faust2appls/faust2alsaconsole $out/bin
2941 install tools/faust2appls/faustpath $out/bin
3042 install tools/faust2appls/faustoptflags $out/bin
3143 install tools/faust2appls/faust2alsa $out/bin
44+ install tools/faust2appls/faust2jack $out/bin
45+
46+ patchShebangs $out/bin
3247
3348 wrapProgram $out/bin/faust2alsaconsole \
3449 --prefix PKG_CONFIG_PATH : ${alsaLib}/lib/pkgconfig \
@@ -41,17 +56,23 @@ stdenv.mkDerivation rec {
4156 --prefix PKG_CONFIG_PATH : ${alsaLib}/lib/pkgconfig:$GTK_PKGCONFIG_PATHS \
4257 --set FAUSTLIB ${faust-compiler}/lib/faust \
4358 --set FAUSTINC ${faust-compiler}/include/ \
44− '' + stdenv.lib.optionalString (!gtkSupport) "rm $out/bin/faust2alsa"
45− ;
4659
60+
61+ wrapProgram $out/bin/faust2jack \
62+ --prefix PKG_CONFIG_PATH : ${jack2}/lib/pkgconfig:${opencv}/lib/pkgconfig:$GTK_PKGCONFIG_PATHS \
63+ --set FAUSTLIB ${faust-compiler}/lib/faust \
64+ --set FAUSTINC ${faust-compiler}/include/ \
65+
66+ ''
67+ + stdenv.lib.optionalString (!gtkSupport) "rm $out/bin/faust2alsa"
68+ + stdenv.lib.optionalString (!gtkSupport || !jackaudioSupport) "rm $out/bin/faust2jack"
69+ ;
4770 postInstall = ''
48− find $out/bin/ -name "faust2*" -type f | xargs sed "s@/bin/bash@${bash}/bin/bash@g" -i
49− sed -i "s@/bin/bash@${bash}/bin/bash@g" $out/bin/faustpath
5071 sed -e "s@\$FAUST_INSTALL /usr/local /usr /opt /opt/local@${faust-compiler}@g" -i $out/bin/faustpath
5172 sed -i "s@/bin/bash@${bash}/bin/bash@g" $out/bin/faustoptflags
52− find $out/bin/ -name "faust2*" -type f | xargs sed "s@pkg-config@${pkgconfig}/bin/pkg-config@g" -i
53− find $out/bin/ -name "faust2*" -type f | xargs sed "s@CXX=g++@CXX=${gcc}/bin/g++@g" -i
54− 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
73+ find $out/bin/ -name "*faust2*" -type f | xargs sed "s@pkg-config@${pkgconfig}/bin/pkg-config@g" -i
74+ find $out/bin/ -name "*faust2*" -type f | xargs sed "s@CXX=g++@CXX=${gcc}/bin/g++@g" -i
75+ 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
5576 '';
5677
5778 meta = with stdenv.lib; {