--- deliantra/Deliantra-Client/bin/cfplus 2007/04/24 01:13:54 1.153 +++ deliantra/Deliantra-Client/bin/cfplus 2007/05/09 11:46:49 1.154 @@ -31,17 +31,38 @@ if (%PAR::LibCache) { @INC = grep ref, @INC; # weed out all paths except pars loader refs + my $tmp = $ENV{PAR_TEMP}; + while (my ($filename, $zip) = each %PAR::LibCache) { for ($zip->memberNames) { next unless /^root\/(.*)/; - $zip->extractMember ($_, "$ENV{PAR_TEMP}/$1") - unless -e "$ENV{PAR_TEMP}/$1"; + $zip->extractMember ($_, "$tmp/$1") + unless -e "$tmp/$1"; } } - # TODO: pango-rc file, anybody? + if ($^O eq "MSWin32") { + # relocatable + } else { + # unix, need to patch pango rc file + open my $fh, "<:perlio", "$tmp/usr/lib/pango/1.5.0/module-files.d/libpango1.0-0.modules" + or die "$tmp/usr/lib/1.5.0/module-files.d/libpango1.0-0.modules: $!"; + local $/; + my $rc = <$fh>; + $rc =~ s/^\//$tmp\//gm; # replace abs paths by relative ones + + mkdir "$tmp/pango-modules"; + open my $fh, ">:perlio", "$tmp/pango-modules/pango.modules" + or die "$tmp/pango-modules/pango.modules: $!"; + print $fh $rc; + + $ENV{PANGO_RC_FILE} = "$tmp/pango.rc"; + open my $fh, ">:perlio", $ENV{PANGO_RC_FILE} + or die "$ENV{PANGO_RC_FILE}: $!"; + print $fh "[Pango]\nModuleFiles = $tmp/pango-modules\n"; + } - unshift @INC, $ENV{PAR_TEMP}; + unshift @INC, $tmp; } }