summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorBart Brouns <bart@magnetophon.nl>2014-11-26 18:08:30 +0100
committerBart Brouns <bart@magnetophon.nl>2014-11-27 13:23:13 +0100
commitcfe24446a4a40ccccca401683c10eb714d8dab25 (patch)
tree171a6b37710172a97f3d78edb4ff2bed26874ca5 /pkgs
parent61d7fb934b0e356cd108afcd293c09837efcc6bf (diff)
downloadnixlib-cfe24446a4a40ccccca401683c10eb714d8dab25.tar
nixlib-cfe24446a4a40ccccca401683c10eb714d8dab25.tar.gz
nixlib-cfe24446a4a40ccccca401683c10eb714d8dab25.tar.bz2
nixlib-cfe24446a4a40ccccca401683c10eb714d8dab25.tar.lz
nixlib-cfe24446a4a40ccccca401683c10eb714d8dab25.tar.xz
nixlib-cfe24446a4a40ccccca401683c10eb714d8dab25.tar.zst
nixlib-cfe24446a4a40ccccca401683c10eb714d8dab25.zip
Fully functional faust, faust2alsa and faust2alsaconsole
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/faust-compiler/default.nix70
-rw-r--r--pkgs/applications/audio/faust/default.nix79
-rw-r--r--pkgs/top-level/all-packages.nix3
3 files changed, 142 insertions, 10 deletions
diff --git a/pkgs/applications/audio/faust-compiler/default.nix b/pkgs/applications/audio/faust-compiler/default.nix
index f924fe2953d7..5e980691df6d 100644
--- a/pkgs/applications/audio/faust-compiler/default.nix
+++ b/pkgs/applications/audio/faust-compiler/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, unzip }:
+{ fetchurl, stdenv, unzip, pkgconfig, makeWrapper, libsndfile, libmicrohttpd, vim }:
 
 stdenv.mkDerivation rec {
 
@@ -9,20 +9,70 @@ stdenv.mkDerivation rec {
     sha256 = "068vl9536zn0j4pknwfcchzi90rx5pk64wbcbd67z32w0csx8xm1";
   };
 
-  buildInputs = [ unzip ];
+  buildInputs = [ unzip pkgconfig makeWrapper libsndfile libmicrohttpd vim];
+
+
+  makeFlags="PREFIX = $(out)";
+  FPATH="$out"; # <- where to search
 
   patchPhase = ''
-    sed -i '77,101d' Makefile
-    sed -i 's#?= $(shell uname -s)#:= Linux#g'  architecture/osclib/oscpack/Makefile
-    sed -e "s@\$FAUST_INSTALL /usr/local /usr /opt /opt/local@$out@g" -i tools/faust2appls/faustpath
-  '';
+    sed -i 's@?= $(shell uname -s)@:= Linux@g'  architecture/osclib/oscpack/Makefile
+    sed -i 's@faust/misc.h@../../architecture/faust/misc.h@g' tools/sound2faust/sound2faust.cpp
+    sed -i 's@faust/gui/@../../architecture/faust/gui/@g' architecture/faust/misc.h
+    '';
+
+  buildPhase = ''
+    make -C compiler -f Makefile.unix
+    make -C architecture/osclib
+	g++ -O3 tools/sound2faust/sound2faust.cpp `pkg-config --cflags --static --libs sndfile` -o tools/sound2faust/sound2faust
+    make httpd
 
-  postInstallPhase = ''
-    rm -rf $out/include/
   '';
 
-  makeFlags = "PREFIX=$(out)";
-  FPATH = "$out"; # <- where to search
+  installPhase = ''
+
+    echo install faust itself
+    mkdir -p $out/bin/
+    mkdir -p $out/include/
+	mkdir -p $out/include/faust/
+	mkdir -p $out/include/faust/osc/
+    install compiler/faust $out/bin/
+
+    echo install architecture and faust library files
+    mkdir -p $out/lib/faust
+    cp architecture/*.lib $out/lib/faust/
+    cp architecture/*.cpp $out/lib/faust/
+
+    echo install math documentation files
+	cp architecture/mathdoctexts-*.txt $out/lib/faust/
+	cp architecture/latexheader.tex $out/lib/faust/
+
+    echo install additional binary libraries: osc, http
+	([ -e architecture/httpdlib/libHTTPDFaust.a ] && cp architecture/httpdlib/libHTTPDFaust.a $out/lib/faust/) || echo libHTTPDFaust not available	
+	cp architecture/osclib/*.a $out/lib/faust/
+	cp -r architecture/httpdlib/html/js $out/lib/faust/js
+	([ -e architecture/httpdlib/src/hexa/stylesheet ] && cp architecture/httpdlib/src/hexa/stylesheet $out/lib/faust/js/stylesheet.js) || echo stylesheet not available
+	([ -e architecture/httpdlib/src/hexa/jsscripts ] && cp architecture/httpdlib/src/hexa/jsscripts $out/lib/faust/js/jsscripts.js) || echo jsscripts not available
+
+    echo install includes files for architectures
+	cp -r architecture/faust $out/include/
+
+    echo install additional includes files for binary libraries:  osc, http
+	cp architecture/osclib/faust/faust/OSCControler.h $out/include/faust/gui/
+	cp architecture/osclib/faust/faust/osc/*.h $out/include/faust/osc/
+	cp architecture/httpdlib/src/include/*.h $out/include/faust/gui/
+
+
+    echo patch header and cpp files
+    find $out/include/ -name "*.h" -type f | xargs sed "s@#include \"faust/@#include \"$out/include/faust/@g" -i
+    find $out/lib/faust/ -name "*.cpp" -type f | xargs sed "s@#include \"faust/@#include \"$out/include/faust/@g" -i
+    sed -i "s@../../architecture/faust/gui/@$out/include/faust/gui/@g"  $out/include/faust/misc.h
+
+    wrapProgram $out/bin/faust \
+    --set FAUSTLIB $out/lib/faust \
+    --set FAUST_LIB_PATH  $out/lib/faust \
+    --set FAUSTINC $out/include/
+  '';
 
   meta = with stdenv.lib; {
     description = "A functional programming language for realtime audio signal processing";
diff --git a/pkgs/applications/audio/faust/default.nix b/pkgs/applications/audio/faust/default.nix
new file mode 100644
index 000000000000..9d25573ccc81
--- /dev/null
+++ b/pkgs/applications/audio/faust/default.nix
@@ -0,0 +1,79 @@
+{ fetchurl, stdenv, bash, alsaLib, atk, cairo, faust-compiler, fontconfig, freetype
+, gcc, gdk_pixbuf, glib, gtk, makeWrapper, pango, pkgconfig, unzip
+, gtkSupport ? true
+}:
+
+stdenv.mkDerivation rec {
+
+  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
+    ]
+  ;
+
+  makeFlags="PREFIX=$(out)";
+  FPATH="$out"; # <- where to search
+
+  phases = [ "unpackPhase installPhase postInstall" ];
+
+  installPhase  = ''
+    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
+
+    wrapProgram $out/bin/faust2alsaconsole \
+    --prefix PKG_CONFIG_PATH : ${alsaLib}/lib/pkgconfig \
+    --set FAUSTLIB ${faust-compiler}/lib/faust \
+    --set FAUSTINC ${faust-compiler}/include/
+
+    GTK_PKGCONFIG_PATHS=${gtk}/lib/pkgconfig:${pango}/lib/pkgconfig:${glib}/lib/pkgconfig:${cairo}/lib/pkgconfig:${gdk_pixbuf}/lib/pkgconfig:${atk}/lib/pkgconfig:${freetype}/lib/pkgconfig:${fontconfig}/lib/pkgconfig
+
+    wrapProgram  $out/bin/faust2alsa \
+    --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"
+  ;
+
+  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
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A functional programming language for realtime audio signal processing";
+    longDescription = ''
+      FAUST (Functional Audio Stream) is a functional programming
+      language specifically designed for real-time signal processing
+      and synthesis. FAUST targets high-performance signal processing
+      applications and audio plug-ins for a variety of platforms and
+      standards.
+      The Faust compiler translates DSP specifications into very
+      efficient C++ code. Thanks to the notion of architecture,
+      FAUST programs can be easily deployed on a large variety of
+      audio platforms and plugin formats (jack, alsa, ladspa, maxmsp,
+      puredata, csound, supercollider, pure, vst, coreaudio) without
+      any change to the FAUST code.
+    '';
+    homepage = http://faust.grame.fr/;
+    downloadPage = http://sourceforge.net/projects/faudiostream/files/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.magnetophon ];
+  };
+}
+
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 99c5caa16493..03d829869432 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -12394,6 +12394,9 @@ let
 
   fakenes = callPackage ../misc/emulators/fakenes { };
 
+
+  faust = callPackage ../applications/audio/faust { };
+
   faust-compiler = callPackage ../applications/audio/faust-compiler { };
 
   fceux = callPackage ../misc/emulators/fceux { };