-
Notifications
You must be signed in to change notification settings - Fork 138
/
mk_inno_language.pl
executable file
·153 lines (129 loc) · 4.92 KB
/
mk_inno_language.pl
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#! perl
# Copyright (C) 2009-2012, Parrot Foundation.
=head1 TITLE
tools/dev/mk_inno_language.pl - Create a script for Inno Setup
=head1 SYNOPSIS
% cd languages/lang
% perl ../../tools/dev/mk_inno_language.pl lang
=head1 DESCRIPTION
From L<http://www.jrsoftware.org/>: Inno Setup is a free installer for
Windows programs.
=cut
use strict;
use warnings;
use lib qw( ../../lib );
use Parrot::Config;
unless (@ARGV) {
die "usage: $0 lang\n";
}
## determine the language we're trying to build
my $lang = $ARGV[0];
my $lclang = lc $lang;
my $uclang = ucfirst $lang;
my $version = $PConfig{VERSION} . $PConfig{DEVEL};
my $prefix = $PConfig{prefix};
$prefix =~ s/\//\\/g;
my @now = gmtime;
my $date = sprintf("%04d%02d%02d", 1900 + $now[5], 1 + $now[4], $now[3]);
my $license = -f 'LICENSE'
? qq{LicenseFile=LICENSE}
: -f 'COPYING'
? qq{LicenseFile=COPYING}
: -f 'COPYRIGHT'
? qq{LicenseFile=COPYRIGHT}
: '; no LicenseFile';
my $exe = $lang eq 'rakudo'
? ( -f 'perl6.exe'
? qq{Source: ".\\perl6.exe"; DestDir: "{app}\\bin"; Flags:}
: '; no perl6.exe'
)
: ( <parrot-*.exe>
? qq{Source: ".\\parrot-*.exe"; DestDir: "{app}\\bin"; Flags:}
: '; no .exe'
);
my $pbc = <*.pbc> && ! -d $lang && $lang ne 'rakudo'
? qq{Source: ".\\*.pbc"; DestDir: "{app}\\lib\\parrot\\languages\\$lang"; Flags:}
: '; no .pbc';
my $lng = -d $lang
? qq{Source: ".\\$lang\\*.pbc"; DestDir: "{app}\\lib\\parrot\\languages\\$lang"; Flags: ignoreversion recursesubdirs}
: '; no lang';
my $pmc = <src/pmc/*.dll>
? qq{Source: ".\\src\\pmc\\*.dll"; DestDir: "{app}\\lib\\parrot\\dynext"; Flags:}
: '; no pmc';
my $ops = <src/ops/*.dll>
? qq{Source: ".\\src\\ops\\*.dll"; DestDir: "{app}\\lib\\parrot\\dynext"; Flags:}
: '; no ops';
my $dynext = <dynext/*.dll> && !<src/pmc/*.dll> && !<src/ops/*.dll>
? qq{Source: ".\\dynext\\*.dll"; DestDir: "{app}\\lib\\parrot\\dynext"; Flags:}
: '; no dynext';
my $man = -d 'man'
? qq{Source: ".\\man\\*"; DestDir: "{app}\\man\\parrot"; Flags: ignoreversion recursesubdirs}
: '; no man';
my $doc = -d 'doc'
? qq{Source: ".\\doc\\*"; DestDir: "{app}\\share\\doc\\parrot\\languages\\$lang"; Flags: ignoreversion recursesubdirs}
: -d 'docs'
? qq{Source: ".\\docs\\*"; DestDir: "{app}\\share\\doc\\parrot\\languages\\$lang"; Flags: ignoreversion recursesubdirs}
: '; no doc';
my $readme = -f 'README'
? qq{Source: ".\\README"; DestDir: "{app}\\share\\doc\\parrot\\languages\\$lang"; Flags:}
: '; no README';
my $rakudo = $lang eq 'rakudo'
? <<'RAKUDO' : '';
; nqp is required by rakudo
Source: ".\nqp\nqp.exe"; DestDir: "{app}\bin"; Flags:
Source: ".\nqp\src\pmc\*.dll"; DestDir: "{app}\lib\parrot\dynext"; Flags:
Source: ".\nqp\src\ops\*.dll"; DestDir: "{app}\lib\parrot\dynext"; Flags:
Source: ".\nqp\ModuleLoader.pbc"; DestDir: "{app}\lib\parrot\library"; Flags:
Source: ".\nqp\PASTRegex.pbc"; DestDir: "{app}\lib\parrot\library"; Flags:
Source: ".\nqp\QAST.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\nqp\NQPP6QRegex.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\nqp\NQPHLL.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\nqp\NQPCORE.setting.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\nqp\nqpmo.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\nqp\nqp.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\nqp\QRegex.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\blib\Perl6\*.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib\Perl6"; Flags:
Source: ".\perl6.pbc"; DestDir: "{app}\lib\parrot\languages\perl6"; Flags:
Source: ".\*.setting.pbc"; DestDir: "{app}\lib\parrot\languages\perl6\lib"; Flags:
Source: ".\lib\Test.pm"; DestDir: "{app}\lib\parrot\languages\perl6\lib"; Flags:
Source: ".\lib\lib.pm"; DestDir: "{app}\lib\parrot\languages\perl6\lib"; Flags:
Source: ".\lib\Pod\To\Text.pm"; DestDir: "{app}\lib\parrot\languages\perl6\lib\Pod\To"; Flags:
RAKUDO
my $filename = 'parrot-' . $lclang . '.iss';
open my $OUT, '>', $filename
or die "Can't open $filename ($!)";
print $OUT qq{
; generated by tools/dev/mk_inno_language.pl for the Inno Setup Script Compiler.
[Setup]
AppName=Parrot-$uclang
AppVerName=Parrot-$version-$uclang-$date
AppPublisher=Parrot Foundation
AppPublisherURL=http://www.parrot.org/
DefaultDirName={sd}$prefix
DefaultGroupName=Parrot
AllowNoIcons=yes
$license
OutputDir=.\\
OutputBaseFilename=setup-parrot-$version-$lclang-$date
Compression=lzma
SolidCompression=yes
Uninstallable=no
[Files]
$rakudo
$exe
$pbc
$lng
$pmc
$ops
$dynext
$man
$doc
$readme
};
close $OUT;
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: