about summary refs log tree commit diff
path: root/pkgs/applications/misc/rxvt_unicode/wrapper.nix
blob: 146ac9704f43603b78856f40ba75a07f5998f2da (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
24
25
26
27
28
{ stdenv, buildEnv, rxvt_unicode, makeWrapper, plugins }:

let
  rxvt = rxvt_unicode.override {
    perlSupport = true;
  };

  drv = buildEnv {
    name = "${rxvt.name}-with-plugins";

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