summary refs log tree commit diff
path: root/pkgs/development/tools/misc/sqitch/default.nix
blob: bef21abc0f07a720d2007c6b1674007026e80e84 (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, writeScript, makeWrapper, sqitchModule }:
stdenv.mkDerivation rec {
  name = "sqitch-0.999";
  buildInputs = [ makeWrapper ];
  propagatedNativeBuildInputs = [ sqitchModule ];
  builder = writeScript (name + "-builder.sh") ''
    . ${stdenv}/setup
    mkdir -p $out/bin
    for d in bin/sqitch etc lib share ; do
      ln -s ${sqitchModule}/$d $out/$d
    done
    fixupPhase
    wrapProgram $out/bin/sqitch \
      --prefix PERL5LIB : \
      "$(for i in "$propagatedNativeBuildInputs" ; do
           for j in $(cat $i/nix-support/propagated-native-build-inputs) ; do
             echo -n "$j"/lib/perl5/site_perl:
           done
         done
         echo "$propagatedNativeBuildInputs"/lib/perl5/site_perl
        )"
  '';
}