about summary refs log tree commit diff
path: root/pkgs/applications/audio/puredata
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/audio/puredata')
-rw-r--r--pkgs/applications/audio/puredata/wrapper.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/applications/audio/puredata/wrapper.nix b/pkgs/applications/audio/puredata/wrapper.nix
new file mode 100644
index 000000000000..0a30037b2268
--- /dev/null
+++ b/pkgs/applications/audio/puredata/wrapper.nix
@@ -0,0 +1,23 @@
+{ stdenv, buildEnv, puredata, makeWrapper, plugins }:
+
+let
+puredataFlags = map (x: "-path ${x}/") plugins;
+drv = buildEnv {
+  name = "puredata-with-plugins-" + (builtins.parseDrvName puredata.name).version;
+
+  paths = [ puredata ] ++ plugins;
+
+  postBuild = ''
+    # TODO: This could be avoided if buildEnv could be forced to create all directories
+    if [ -L $out/bin ]; then
+      rm $out/bin
+      mkdir $out/bin
+      for i in ${puredata}/bin/*; do
+        ln -s $i $out/bin
+      done
+    fi
+    wrapProgram $out/bin/pd \
+      --add-flags "${toString puredataFlags}"
+  '';
+  };
+in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })