summary refs log tree commit diff
path: root/pkgs/applications/audio/puredata/wrapper.nix
blob: 0a30037b22688f1b26159dd73961b7e96325d361 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 ]; })