summary refs log tree commit diff
path: root/pkgs/applications/audio/deadbeef/wrapper.nix
blob: b612f195af3f5d59bbbd304478bfc182a199790b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ stdenv, buildEnv, deadbeef, makeWrapper, plugins }:

let
drv = buildEnv {
  name = "deadbeef-with-plugins-" + (builtins.parseDrvName deadbeef.name).version;

  paths = [ deadbeef ] ++ 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 ${deadbeef}/bin/*; do
        ln -s $i $out/bin
      done
    fi
    wrapProgram $out/bin/deadbeef \
      --set DEADBEEF_PLUGIN_DIR "$out/lib/deadbeef"
  '';
  };
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })