summary refs log tree commit diff
path: root/pkgs/development/tools/misc/sqitch/default.nix
blob: 8328433a823f0e4bcdf6cd97636ca72c24d350ef (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
{ name, stdenv, perl, makeWrapper, sqitchModule, databaseModule }:

stdenv.mkDerivation {
  name = "${name}-${sqitchModule.version}";

  buildInputs = [ perl makeWrapper sqitchModule databaseModule ];

  src = sqitchModule;
  dontBuild = true;

  installPhase = ''
    mkdir -p $out/bin
    for d in bin/sqitch etc lib share ; do
      # make sure dest alreay exists before symlink
      # this prevents installing a broken link into the path
      if [ -e ${sqitchModule}/$d ]; then
        ln -s ${sqitchModule}/$d $out/$d
      fi
    done
  '';
  dontStrip = true;
  postFixup = "wrapProgram $out/bin/sqitch --prefix PERL5LIB : $PERL5LIB";

  meta = {
    platforms = stdenv.lib.platforms.unix;
  };
}