diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/applications/audio/faust | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/applications/audio/faust')
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust1.nix | 207 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2.nix | 245 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2alqt.nix | 15 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2alsa.nix | 29 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2csound.nix | 20 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2firefox.nix | 14 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2jack.nix | 25 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2jaqt.nix | 24 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2ladspa.nix | 12 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faust2lv2.nix | 14 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/audio/faust/faustlive.nix | 35 |
11 files changed, 640 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/audio/faust/faust1.nix b/nixpkgs/pkgs/applications/audio/faust/faust1.nix new file mode 100644 index 000000000000..6e47d921d345 --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust1.nix @@ -0,0 +1,207 @@ +{ stdenv +, coreutils +, fetchurl +, makeWrapper +, pkgconfig +}: + +with stdenv.lib.strings; + +let + + version = "0.9.90"; + + src = fetchurl { + url = "mirror://sourceforge/project/faudiostream/faust-${version}.tgz"; + sha256 = "0d1fqwymyfb73zkmpwv4zk4gsg4ji7qs20mfsr20skmnqx30xvna"; + }; + + meta = with stdenv.lib; { + homepage = http://faust.grame.fr/; + downloadPage = https://sourceforge.net/projects/faudiostream/files/; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ magnetophon pmahoney ]; + }; + + faust = stdenv.mkDerivation { + name = "faust-${version}"; + + inherit src; + + buildInputs = [ makeWrapper ]; + + passthru = { + inherit wrap wrapWithBuildEnv; + }; + + preConfigure = '' + makeFlags="$makeFlags prefix=$out" + + # The faust makefiles use 'system ?= $(shell uname -s)' but nix + # defines 'system' env var, so undefine that so faust detects the + # correct system. + unset system + ''; + + # Remove most faust2appl scripts since they won't run properly + # without additional paths setup. See faust.wrap, + # faust.wrapWithBuildEnv. + postInstall = '' + # syntax error when eval'd directly + pattern="faust2!(*@(atomsnippets|graph|graphviewer|md|plot|sig|sigviewer|svg))" + (shopt -s extglob; rm "$out"/bin/$pattern) + ''; + + postFixup = '' + # Set faustpath explicitly. + substituteInPlace "$out"/bin/faustpath \ + --replace "/usr/local /usr /opt /opt/local" "$out" + + # The 'faustoptflags' is 'source'd into other faust scripts and + # not used as an executable, so patch 'uname' usage directly + # rather than use makeWrapper. + substituteInPlace "$out"/bin/faustoptflags \ + --replace uname "${coreutils}/bin/uname" + + # wrapper for scripts that don't need faust.wrap* + for script in "$out"/bin/faust2*; do + wrapProgram "$script" \ + --prefix PATH : "$out"/bin + done + ''; + + meta = meta // { + 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. + + This package has just the compiler, libraries, and headers. + Install faust2* for specific faust2appl scripts. + ''; + }; + + }; + + # Default values for faust2appl. + faust2ApplBase = + { baseName + , dir ? "tools/faust2appls" + , scripts ? [ baseName ] + , ... + }@args: + + args // { + name = "${baseName}-${version}"; + + inherit src; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/bin" + for script in ${concatStringsSep " " scripts}; do + cp "${dir}/$script" "$out/bin/" + done + + runHook postInstall + ''; + + postInstall = '' + # For the faust2appl script, change 'faustpath' and + # 'faustoptflags' to absolute paths. + for script in "$out"/bin/*; do + substituteInPlace "$script" \ + --replace ". faustpath" ". '${faust}/bin/faustpath'" \ + --replace ". faustoptflags" ". '${faust}/bin/faustoptflags'" + done + ''; + + meta = meta // { + description = "The ${baseName} script, part of faust functional programming language for realtime audio signal processing"; + }; + }; + + # Some 'faust2appl' scripts, such as faust2alsa, run faust to + # generate cpp code, then invoke the c++ compiler to build the code. + # This builder wraps these scripts in parts of the stdenv such that + # when the scripts are called outside any nix build, they behave as + # if they were running inside a nix build in terms of compilers and + # paths being configured (e.g. rpath is set so that compiled + # binaries link to the libs inside the nix store) + # + # The function takes two main args: the appl name (e.g. + # 'faust2alsa') and an optional list of propagatedBuildInputs. It + # returns a derivation that contains only the bin/${appl} script, + # wrapped up so that it will run as if it was inside a nix build + # with those build inputs. + # + # The build input 'faust' is automatically added to the + # propagatedBuildInputs. + wrapWithBuildEnv = + { baseName + , propagatedBuildInputs ? [ ] + , ... + }@args: + + stdenv.mkDerivation ((faust2ApplBase args) // { + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ makeWrapper ]; + + propagatedBuildInputs = [ faust ] ++ propagatedBuildInputs; + + postFixup = '' + + # export parts of the build environment + for script in "$out"/bin/*; do + wrapProgram "$script" \ + --set FAUSTLIB "${faust}/lib/faust" \ + --set FAUSTINC "${faust}/include/faust" \ + --prefix PATH : "$PATH" \ + --prefix PKG_CONFIG_PATH : "$PKG_CONFIG_PATH" \ + --set NIX_CFLAGS_COMPILE "$NIX_CFLAGS_COMPILE" \ + --set NIX_LDFLAGS "$NIX_LDFLAGS" + done + ''; + }); + + # Builder for 'faust2appl' scripts, such as faust2firefox that + # simply need to be wrapped with some dependencies on PATH. + # + # The build input 'faust' is automatically added to the PATH. + wrap = + { baseName + , runtimeInputs ? [ ] + , ... + }@args: + + let + + runtimePath = concatStringsSep ":" (map (p: "${p}/bin") ([ faust ] ++ runtimeInputs)); + + in stdenv.mkDerivation ((faust2ApplBase args) // { + + buildInputs = [ makeWrapper ]; + + postFixup = '' + for script in "$out"/bin/*; do + wrapProgram "$script" --prefix PATH : "${runtimePath}" + done + ''; + + }); + +in faust diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2.nix b/nixpkgs/pkgs/applications/audio/faust/faust2.nix new file mode 100644 index 000000000000..383d2deb10bb --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2.nix @@ -0,0 +1,245 @@ +{ stdenv +, coreutils +, fetchFromGitHub +, makeWrapper +, pkgconfig +, llvm +, emscripten +, openssl +, libsndfile +, libmicrohttpd +, vim +}: + +with stdenv.lib.strings; + +let + + version = "2.5.23"; + + src = fetchFromGitHub { + owner = "grame-cncm"; + repo = "faust"; + rev = "${version}"; + sha256 = "1pci8ac6sqrm3mb3yikmmr3iy35g3nj4iihazif1amqkbdz719rc"; + fetchSubmodules = true; + }; + + meta = with stdenv.lib; { + homepage = http://faust.grame.fr/; + downloadPage = https://sourceforge.net/projects/faudiostream/files/; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ magnetophon pmahoney ]; + }; + + faust = stdenv.mkDerivation { + + name = "faust-${version}"; + + inherit src; + + nativeBuildInputs = [ makeWrapper pkgconfig vim ]; + buildInputs = [ llvm emscripten openssl libsndfile libmicrohttpd ]; + + + passthru = { + inherit wrap wrapWithBuildEnv; + }; + + + preConfigure = '' + makeFlags="$makeFlags prefix=$out LLVM_CONFIG='${llvm}/bin/llvm-config' world" + + # The faust makefiles use 'system ?= $(shell uname -s)' but nix + # defines 'system' env var, so undefine that so faust detects the + # correct system. + unset system + # sed -e "232s/LLVM_STATIC_LIBS/LLVMLIBS/" -i compiler/Makefile.unix + + # The makefile sets LLVM_<version> depending on the current llvm + # version, but the detection code is quite brittle. + # + # Failing to properly detect the llvm version means that the macro + # LLVM_VERSION ends up being the raw output of `llvm-config --version`, while + # the code assumes that it's set to a symbol like `LLVM_35`. Two problems result: + # * <command-line>:0:1: error: macro names must be identifiers.; and + # * a bunch of undefined reference errors due to conditional definitions relying on + # LLVM_XY being defined. + # + # For now, fix this by 1) pinning the llvm version; 2) manually setting LLVM_VERSION + # to something the makefile will recognize. + sed '52iLLVM_VERSION=${stdenv.lib.getVersion llvm}' -i compiler/Makefile.unix + ''; + + postPatch = '' + # fix build with llvm 5.0.2 by adding it to the list of known versions + # TODO: check if still needed on next update + substituteInPlace compiler/Makefile.unix \ + --replace "5.0.0 5.0.1" "5.0.0 5.0.1 5.0.2" + ''; + + # Remove most faust2appl scripts since they won't run properly + # without additional paths setup. See faust.wrap, + # faust.wrapWithBuildEnv. + postInstall = '' + # syntax error when eval'd directly + pattern="faust2!(*@(atomsnippets|graph|graphviewer|md|plot|sig|sigviewer|svg))" + (shopt -s extglob; rm "$out"/bin/$pattern) + ''; + + postFixup = '' + # Set faustpath explicitly. + substituteInPlace "$out"/bin/faustpath \ + --replace "/usr/local /usr /opt /opt/local" "$out" + + # The 'faustoptflags' is 'source'd into other faust scripts and + # not used as an executable, so patch 'uname' usage directly + # rather than use makeWrapper. + substituteInPlace "$out"/bin/faustoptflags \ + --replace uname "${coreutils}/bin/uname" + + # wrapper for scripts that don't need faust.wrap* + for script in "$out"/bin/faust2*; do + wrapProgram "$script" \ + --prefix PATH : "$out"/bin + done + ''; + + meta = meta // { + 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. + + This package has just the compiler, libraries, and headers. + Install faust2* for specific faust2appl scripts. + ''; + }; + + }; + + # Default values for faust2appl. + faust2ApplBase = + { baseName + , dir ? "tools/faust2appls" + , scripts ? [ baseName ] + , ... + }@args: + + args // { + name = "${baseName}-${version}"; + + inherit src; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/bin" + for script in ${concatStringsSep " " scripts}; do + cp "${dir}/$script" "$out/bin/" + done + + runHook postInstall + ''; + + postInstall = '' + # For the faust2appl script, change 'faustpath' and + # 'faustoptflags' to absolute paths. + for script in "$out"/bin/*; do + substituteInPlace "$script" \ + --replace ". faustpath" ". '${faust}/bin/faustpath'" \ + --replace ". faustoptflags" ". '${faust}/bin/faustoptflags'" \ + --replace " error " "echo" + done + ''; + + meta = meta // { + description = "The ${baseName} script, part of faust functional programming language for realtime audio signal processing"; + }; + }; + + # Some 'faust2appl' scripts, such as faust2alsa, run faust to + # generate cpp code, then invoke the c++ compiler to build the code. + # This builder wraps these scripts in parts of the stdenv such that + # when the scripts are called outside any nix build, they behave as + # if they were running inside a nix build in terms of compilers and + # paths being configured (e.g. rpath is set so that compiled + # binaries link to the libs inside the nix store) + # + # The function takes two main args: the appl name (e.g. + # 'faust2alsa') and an optional list of propagatedBuildInputs. It + # returns a derivation that contains only the bin/${appl} script, + # wrapped up so that it will run as if it was inside a nix build + # with those build inputs. + # + # The build input 'faust' is automatically added to the + # propagatedBuildInputs. + wrapWithBuildEnv = + { baseName + , propagatedBuildInputs ? [ ] + , ... + }@args: + + stdenv.mkDerivation ((faust2ApplBase args) // { + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ makeWrapper ]; + + propagatedBuildInputs = [ faust ] ++ propagatedBuildInputs; + + + postFixup = '' + + # export parts of the build environment + for script in "$out"/bin/*; do + wrapProgram "$script" \ + --set FAUSTLIB "${faust}/share/faust" \ + --set FAUST_LIB_PATH "${faust}/share/faust" \ + --set FAUSTINC "${faust}/include/faust" \ + --prefix PATH : "$PATH" \ + --prefix PKG_CONFIG_PATH : "$PKG_CONFIG_PATH" \ + --set NIX_CFLAGS_COMPILE "$NIX_CFLAGS_COMPILE" \ + --set NIX_LDFLAGS "$NIX_LDFLAGS" + done + ''; + }); + + # Builder for 'faust2appl' scripts, such as faust2firefox that + # simply need to be wrapped with some dependencies on PATH. + # + # The build input 'faust' is automatically added to the PATH. + wrap = + { baseName + , runtimeInputs ? [ ] + , ... + }@args: + + let + + runtimePath = concatStringsSep ":" (map (p: "${p}/bin") ([ faust ] ++ runtimeInputs)); + + in stdenv.mkDerivation ((faust2ApplBase args) // { + + buildInputs = [ makeWrapper ]; + + postFixup = '' + for script in "$out"/bin/*; do + wrapProgram "$script" --prefix PATH : "${runtimePath}" + done + ''; + + }); + +in faust diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2alqt.nix b/nixpkgs/pkgs/applications/audio/faust/faust2alqt.nix new file mode 100644 index 000000000000..8ac26e488b37 --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2alqt.nix @@ -0,0 +1,15 @@ +{ faust +, alsaLib +, qt4 +}: + +faust.wrapWithBuildEnv { + + baseName = "faust2alqt"; + + propagatedBuildInputs = [ + alsaLib + qt4 + ]; + +} diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2alsa.nix b/nixpkgs/pkgs/applications/audio/faust/faust2alsa.nix new file mode 100644 index 000000000000..17cec46f6c6a --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2alsa.nix @@ -0,0 +1,29 @@ +{ faust +, alsaLib +, atk +, cairo +, fontconfig +, freetype +, gdk_pixbuf +, glib +, gtk2 +, pango +}: + +faust.wrapWithBuildEnv { + + baseName = "faust2alsa"; + + propagatedBuildInputs = [ + alsaLib + atk + cairo + fontconfig + freetype + gdk_pixbuf + glib + gtk2 + pango + ]; + +} diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2csound.nix b/nixpkgs/pkgs/applications/audio/faust/faust2csound.nix new file mode 100644 index 000000000000..eb5e5831cddd --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2csound.nix @@ -0,0 +1,20 @@ +{ faust +, csound +}: + +faust.wrapWithBuildEnv { + + baseName = "faust2csound"; + + propagatedBuildInputs = [ + csound + ]; + + # faust2csound generated .cpp files have + # #include "csdl.h" + # but that file is in the csound/ subdirectory + preFixup = '' + NIX_CFLAGS_COMPILE="$(printf '%s' "$NIX_CFLAGS_COMPILE" | sed 's%${csound}/include%${csound}/include/csound%')" + ''; + +} diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2firefox.nix b/nixpkgs/pkgs/applications/audio/faust/faust2firefox.nix new file mode 100644 index 000000000000..b2cc6f464575 --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2firefox.nix @@ -0,0 +1,14 @@ +{ faust +, xdg_utils +}: + +# This just runs faust2svg, then attempts to open a browser using +# 'xdg-open'. + +faust.wrap { + + baseName = "faust2firefox"; + + runtimeInputs = [ xdg_utils ]; + +} diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2jack.nix b/nixpkgs/pkgs/applications/audio/faust/faust2jack.nix new file mode 100644 index 000000000000..7762ca393690 --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2jack.nix @@ -0,0 +1,25 @@ +{ faust +, gtk2 +, jack2Full +, opencv +, libsndfile +}: + +faust.wrapWithBuildEnv { + + baseName = "faust2jack"; + + scripts = [ + "faust2jack" + "faust2jackinternal" + "faust2jackconsole" + ]; + + propagatedBuildInputs = [ + gtk2 + jack2Full + opencv + libsndfile + ]; + +} diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2jaqt.nix b/nixpkgs/pkgs/applications/audio/faust/faust2jaqt.nix new file mode 100644 index 000000000000..5a015e5ca31e --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2jaqt.nix @@ -0,0 +1,24 @@ +{ faust +, jack2Full +, opencv +, qt4 +, libsndfile +}: + +faust.wrapWithBuildEnv { + + baseName = "faust2jaqt"; + + scripts = [ + "faust2jaqt" + "faust2jackserver" + ]; + + propagatedBuildInputs = [ + jack2Full + opencv + qt4 + libsndfile + ]; + +} diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2ladspa.nix b/nixpkgs/pkgs/applications/audio/faust/faust2ladspa.nix new file mode 100644 index 000000000000..67de98cab9a2 --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2ladspa.nix @@ -0,0 +1,12 @@ +{ boost +, faust +, ladspaH +}: + +faust.wrapWithBuildEnv { + + baseName = "faust2ladspa"; + + propagatedBuildInputs = [ boost ladspaH ]; + +} diff --git a/nixpkgs/pkgs/applications/audio/faust/faust2lv2.nix b/nixpkgs/pkgs/applications/audio/faust/faust2lv2.nix new file mode 100644 index 000000000000..3472ce5047eb --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faust2lv2.nix @@ -0,0 +1,14 @@ +{ boost +, faust +, lv2 +, qt4 + +}: + +faust.wrapWithBuildEnv { + + baseName = "faust2lv2"; + + propagatedBuildInputs = [ boost lv2 qt4 ]; + +} diff --git a/nixpkgs/pkgs/applications/audio/faust/faustlive.nix b/nixpkgs/pkgs/applications/audio/faust/faustlive.nix new file mode 100644 index 000000000000..b8ff73f2cb32 --- /dev/null +++ b/nixpkgs/pkgs/applications/audio/faust/faustlive.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchFromGitHub +, llvm, qt48Full, libqrencode, libmicrohttpd, libjack2, alsaLib, faust, curl +, bc, coreutils, which +}: + +stdenv.mkDerivation rec { + name = "faustlive-${version}"; + version = "2017-12-05"; + src = fetchFromGitHub { + owner = "grame-cncm"; + repo = "faustlive"; + rev = "281fcb852dcd94f8c57ade1b2a7a3937542e1b2d"; + sha256 = "0sw44yd9928rid9ib0b5mx2x129m7zljrayfm6jz6hrwdc5q3k9a"; + }; + + buildInputs = [ + llvm qt48Full libqrencode libmicrohttpd libjack2 alsaLib faust curl + bc coreutils which + ]; + + makeFlags = [ "PREFIX=$(out)" ]; + + preBuild = "patchShebangs Build/Linux/buildversion"; + + meta = with stdenv.lib; { + description = "A standalone just-in-time Faust compiler"; + longDescription = '' + FaustLive is a standalone just-in-time Faust compiler. It tries to bring + together the convenience of a standalone interpreted language with the + efficiency of a compiled language. It's ideal for fast prototyping. + ''; + homepage = http://faust.grame.fr/; + license = licenses.gpl3; + }; +} |