1 | #!/opt/bin/perl |
1 | #!/opt/bin/perl |
2 | |
2 | |
|
|
3 | # do splash-screen thingy on win32 |
3 | my $startup_done = sub { }; |
4 | my $startup_done = sub { }; |
4 | our $PANGO = "1.5.0"; |
|
|
5 | |
|
|
6 | # do splash-screen thingy on win32 |
|
|
7 | BEGIN { |
5 | BEGIN { |
8 | if (%PAR::LibCache && $^O eq "MSWin32") { |
6 | if (%PAR::LibCache && $^O eq "MSWin32") { |
9 | while (my ($filename, $zip) = each %PAR::LibCache) { |
7 | while (my ($filename, $zip) = each %PAR::LibCache) { |
10 | $zip->extractMember ("SPLASH.bmp", "$ENV{PAR_TEMP}/SPLASH.bmp"); |
8 | $zip->extractMember ("SPLASH.bmp", "$ENV{PAR_TEMP}/SPLASH.bmp"); |
11 | } |
9 | } |
… | |
… | |
30 | # do things only needed for single-binary version (par) |
28 | # do things only needed for single-binary version (par) |
31 | BEGIN { |
29 | BEGIN { |
32 | if (%PAR::LibCache) { |
30 | if (%PAR::LibCache) { |
33 | @INC = grep ref, @INC; # weed out all paths except pars loader refs |
31 | @INC = grep ref, @INC; # weed out all paths except pars loader refs |
34 | |
32 | |
35 | my $tmp = $ENV{PAR_TEMP}; |
33 | my $root = $ENV{PAR_TEMP}; |
36 | |
34 | |
37 | while (my ($filename, $zip) = each %PAR::LibCache) { |
35 | while (my ($filename, $zip) = each %PAR::LibCache) { |
38 | for ($zip->memberNames) { |
36 | for ($zip->memberNames) { |
39 | next unless /^root\/(.*)/; |
37 | next unless /^root\/(.*)/; |
40 | $zip->extractMember ($_, "$tmp/$1") |
38 | $zip->extractMember ($_, "$root/$1") |
41 | unless -e "$tmp/$1"; |
39 | unless -e "$root/$1"; |
42 | } |
40 | } |
43 | } |
41 | } |
44 | |
42 | |
45 | if ($^O eq "MSWin32") { |
43 | if ($^O eq "MSWin32") { |
46 | # relocatable |
44 | # pango is relocatable on win32 |
47 | } else { |
45 | } else { |
|
|
46 | open my $fh, "<:perlio", "$root/pangoversion" |
|
|
47 | or die "pangoversion: $!"; |
|
|
48 | my $PANGO = <$fh>; |
48 | # unix, need to patch pango rc file |
49 | # unix, need to patch pango rc file |
49 | open my $fh, "<:perlio", "$tmp/usr/lib/pango/$PANGO/module-files.d/libpango1.0-0.modules" |
50 | open my $fh, "<:perlio", "$root/usr/lib/pango/$PANGO/module-files.d/libpango1.0-0.modules" |
50 | or die "$tmp/usr/lib/$PANGO/module-files.d/libpango1.0-0.modules: $!"; |
51 | or die "$root/usr/lib/$PANGO/module-files.d/libpango1.0-0.modules: $!"; |
51 | local $/; |
52 | local $/; |
52 | my $rc = <$fh>; |
53 | my $rc = <$fh>; |
53 | $rc =~ s/^\//$tmp\//gm; # replace abs paths by relative ones |
54 | $rc =~ s/^\//$root\//gm; # replace abs paths by relative ones |
54 | |
55 | |
55 | mkdir "$tmp/pango-modules"; |
56 | mkdir "$root/pango-modules"; |
56 | open my $fh, ">:perlio", "$tmp/pango-modules/pango.modules" |
57 | open my $fh, ">:perlio", "$root/pango-modules/pango.modules" |
57 | or die "$tmp/pango-modules/pango.modules: $!"; |
58 | or die "$root/pango-modules/pango.modules: $!"; |
58 | print $fh $rc; |
59 | print $fh $rc; |
59 | |
60 | |
60 | $ENV{PANGO_RC_FILE} = "$tmp/pango.rc"; |
61 | $ENV{PANGO_RC_FILE} = "$root/pango.rc"; |
61 | open my $fh, ">:perlio", $ENV{PANGO_RC_FILE} |
62 | open my $fh, ">:perlio", $ENV{PANGO_RC_FILE} |
62 | or die "$ENV{PANGO_RC_FILE}: $!"; |
63 | or die "$ENV{PANGO_RC_FILE}: $!"; |
63 | print $fh "[Pango]\nModuleFiles = $tmp/pango-modules\n"; |
64 | print $fh "[Pango]\nModuleFiles = $root/pango-modules\n"; |
64 | } |
65 | } |
65 | |
66 | |
66 | unshift @INC, $tmp; |
67 | unshift @INC, $root; |
67 | } |
68 | } |
68 | } |
69 | } |
69 | |
70 | |
70 | # need to do it again because that pile of garbage called PAR nukes it before main |
71 | # need to do it again because that pile of garbage called PAR nukes it before main |
71 | unshift @INC, $ENV{PAR_TEMP} |
72 | unshift @INC, $ENV{PAR_TEMP} |