]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/perl5lib_and_wrappers.mdwn
close bug, add changelog
[ikiwiki.git] / doc / forum / perl5lib_and_wrappers.mdwn
1 I don't know if I'm doing this right...  I'm using a server provider that doesn't allow me to install into standard perl locations, so I used PREFIX to install things in my home dir.  The problem is that when the wrapper is run by the CGI server, it can't find the perl modules I installed.  There didn't seem to be a way to set the PERL5LIB from the standard config, so I added one.  Patch attached.  Or did I miss something and this was already possible?
2
3 diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
4 index 79b9eb3..e88118b 100644
5 --- a/IkiWiki/Wrapper.pm
6 +++ b/IkiWiki/Wrapper.pm
7 @@ -37,6 +41,13 @@ sub gen_wrapper () { #{{{
8  EOF
9         }
10         
11 +       my $wrapperperllib="";
12 +       if (defined $config{wrapperperl5lib}) {
13 +           $wrapperperllib =<<"EOF"
14 +           newenviron[i++]="PERL5LIB=$config{wrapperperl5lib}";
15 +EOF
16 +       }
17 +
18         $Data::Dumper::Indent=0; # no newlines
19         my $configstring=Data::Dumper->Dump([\%config], ['*config']);
20         $configstring=~s/\\/\\\\/g;
21 @@ -72,6 +83,7 @@ int main (int argc, char **argv) {
22  $envsave
23         newenviron[i++]="HOME=$ENV{HOME}";
24         newenviron[i++]="WRAPPED_OPTIONS=$configstring";
25 +$wrapperperllib
26         newenviron[i]=NULL;
27         environ=newenviron;
28