summary refs log tree commit diff
path: root/pkgs/applications/audio/faust
diff options
context:
space:
mode:
authorolaf <olaf@klingt.org>2023-04-02 22:25:48 +0200
committerolaf <olaf@klingt.org>2023-04-22 15:59:25 +0200
commit655b1cabfcb3511ff6f1152725d6e0e637d0588a (patch)
tree6945069f557969fee85ec1a0e560baa93ee299b9 /pkgs/applications/audio/faust
parenta5f21729595f01a2de196ed9fb9cc0d18e0b8c88 (diff)
faust: make faust2sc available
Diffstat (limited to 'pkgs/applications/audio/faust')
-rw-r--r--pkgs/applications/audio/faust/faust2.nix2
-rw-r--r--pkgs/applications/audio/faust/faust2sc.nix38
2 files changed, 39 insertions, 1 deletions
diff --git a/pkgs/applications/audio/faust/faust2.nix b/pkgs/applications/audio/faust/faust2.nix
index d1dd74a35ddeb..8ac13f1c7e43d 100644
--- a/pkgs/applications/audio/faust/faust2.nix
+++ b/pkgs/applications/audio/faust/faust2.nix
@@ -50,7 +50,7 @@ let
 
 
     passthru = {
-      inherit wrap wrapWithBuildEnv;
+      inherit wrap wrapWithBuildEnv faust2ApplBase;
     };
 
 
diff --git a/pkgs/applications/audio/faust/faust2sc.nix b/pkgs/applications/audio/faust/faust2sc.nix
new file mode 100644
index 0000000000000..02844773d4229
--- /dev/null
+++ b/pkgs/applications/audio/faust/faust2sc.nix
@@ -0,0 +1,38 @@
+{ faust
+, baseName ? "faust2sc"
+, supercollider
+, makeWrapper
+, python3
+, stdenv
+}@args:
+let
+  faustDefaults = faust.faust2ApplBase
+    (args // {
+      baseName = "${baseName}.py";
+    });
+in
+stdenv.mkDerivation (faustDefaults // {
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  propagatedBuildInputs = [ python3 faust supercollider ];
+
+  postInstall = ''
+    mv "$out/bin/${baseName}.py" "$out"/bin/${baseName}
+  '';
+
+  postFixup = ''
+    # export parts of the build environment
+    mkdir "$out"/include
+    # until pr #887 is merged and released in faust we need to link the header folders
+    ln -s "${supercollider}"/include/SuperCollider/plugin_interface "$out"/include/plugin_interface
+    ln -s "${supercollider}"/include/SuperCollider/common "$out"/include/common
+    ln -s "${supercollider}"/include/SuperCollider/server "$out"/include/server
+    wrapProgram "$out"/bin/${baseName} \
+      --append-flags "--import-dir ${faust}/share/faust" \
+      --append-flags "--architecture-dir ${faust}/share/faust" \
+      --append-flags "--architecture-dir ${faust}/include" \
+      --append-flags "-p $out" \
+      --prefix PATH : "$PATH"
+  '';
+})