This repository has been archived by the owner on Jun 9, 2018. It is now read-only.
/
setup.pir
executable file
·176 lines (148 loc) · 4.66 KB
/
setup.pir
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/env parrot
# Copyright (C) 2009, Parrot Foundation.
=head1 NAME
setup.pir - Python distutils style
=head1 DESCRIPTION
No Configure step, no Makefile generated.
=head1 USAGE
$ parrot setup.pir build
$ parrot setup.pir test
$ sudo parrot setup.pir install
=cut
.sub 'main' :main
.param pmc args
$S0 = shift args
load_bytecode 'distutils.pbc'
.const 'Sub' prebuild = 'prebuild'
register_step_before('build', prebuild)
.const 'Sub' clean = 'clean'
register_step_before('clean', clean)
.const 'Sub' testclean = 'testclean'
register_step_after('test', testclean)
register_step_after('clean', testclean)
.const 'Sub' pmctest = 'pmctest'
register_step('pmctest', pmctest)
$P0 = new 'Hash'
$P0['name'] = 'WMLScript'
$P0['abstract'] = 'WMLScript Bytecode Translator'
$P0['authority'] = 'http://github.com/fperrad'
$P0['description'] = 'WMLScript Bytecode Translator'
$P5 = split ',', 'wmlscript,wap'
$P0['keywords'] = $P5
$P0['license_type'] = 'Artistic License 2.0'
$P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0'
$P0['copyright_holder'] = 'Parrot Foundation'
$P0['checkout_uri'] = 'git://github.com/fperrad/wmlscript.git'
$P0['browser_uri'] = 'http://github.com/fperrad/wmlscript'
$P0['project_uri'] = 'http://github.com/fperrad/wmlscript'
# build
$P1 = new 'Hash'
$P1['wmls_ops'] = 'dynext/ops/wmls.ops'
$P0['dynops'] = $P1
$P2 = new 'Hash'
$P3 = split "\n", <<'SOURCES'
dynext/pmc/wmlsinteger.pmc
dynext/pmc/wmlsfloat.pmc
dynext/pmc/wmlsstring.pmc
dynext/pmc/wmlsboolean.pmc
dynext/pmc/wmlsinvalid.pmc
dynext/pmc/wmlsbytecode.pmc
SOURCES
$S0 = pop $P3
$P2['wmls_group'] = $P3
$P0['dynpmc'] = $P2
$P4 = new 'Hash'
$P5 = split "\n", <<'SOURCES'
wmlscript/WMLScript.pir
wmlscript/script.pir
wmlscript/wmlsstdlibs.pir
wmlscript/opcode.pir
wmlscript/stdlibs.pir
SOURCES
$S0 = pop $P5
$P4['wmlscript/wmlscript.pbc'] = $P5
$P4['wmlscript/library/wmlslang.pbc'] = 'wmlscript/library/wmlslang.pir'
$P4['wmlscript/library/wmlsfloat.pbc'] = 'wmlscript/library/wmlsfloat.pir'
$P4['wmlscript/library/wmlsstring.pbc'] = 'wmlscript/library/wmlsstring.pir'
$P4['wmlscript/library/wmlsconsole.pbc'] = 'wmlscript/library/wmlsconsole.pir'
$P4['wmlsi.pbc'] = 'wmlsi.pir'
$P4['wmlsd.pbc'] = 'wmlsd.pir'
$P0['pbc_pir'] = $P4
$P6 = new 'Hash'
$P6['parrot-wmlsi'] = 'wmlsi.pbc'
$P6['parrot-wmlsd'] = 'wmlsd.pbc'
$P0['installable_pbc'] = $P6
# test
$S0 = get_parrot()
$P0['prove_exec'] = $S0
$P0['prove_files'] = 't/pmc/*.t t/*.t'
# install
$P7 = split "\n", <<'LIBS'
wmlscript/wmlscript.pbc
wmlscript/library/wmlslang.pbc
wmlscript/library/wmlsfloat.pbc
wmlscript/library/wmlsstring.pbc
wmlscript/library/wmlsconsole.pbc
LIBS
$S0 = pop $P7
$P0['inst_lang'] = $P7
# dist
$P8 = glob('wmls2p*.pir t/helpers.pir build/*.pl build/SRM/*.pm wmlscript/translation.rules wmlscript/wmlslibs.cfg')
$P0['manifest_includes'] = $P8
$P9 = split ' ', 'wmlscript/opcode.pir wmlscript/stdlibs.pir'
$P0['manifest_excludes'] = $P9
$P10 = split ' ', 'CREDITS MAINTAINER README'
$P0['doc_files'] = $P10
.tailcall setup(args :flat, $P0 :flat :named)
.end
.sub 'prebuild' :anon
.param pmc kv :slurpy :named
.local string cmd, srm
srm = 'Stack'
$P0 = split "\n", <<'SOURCES'
wmlscript/translation.rules
build/translator.pl
build/SRM/Stack.pm
build/SRM/Register.pm
SOURCES
$S0 = pop $P0
$I0 = newer('wmlscript/opcode.pir', $P0)
if $I0 goto L1
cmd = 'perl build/translator.pl'
cmd .= ' --output wmlscript/opcode.pir'
cmd .= ' --srm '
cmd .= srm
cmd .= ' wmlscript/translation.rules'
system(cmd, 1 :named('verbose'))
L1:
$P0 = split ' ', 'wmlscript/wmlslibs.cfg build/stdlibs.pl'
$I0 = newer('wmlscript/stdlibs.pir', $P0)
if $I0 goto L2
cmd = 'perl build/stdlibs.pl'
cmd .= ' --output wmlscript/stdlibs.pir'
cmd .= ' wmlscript/wmlslibs.cfg'
system(cmd, 1 :named('verbose'))
L2:
.end
.sub 'clean' :anon
.param pmc kv :slurpy :named
unlink('wmlscript/opcode.pir', 1 :named('verbose'))
unlink('wmlscript/stdlibs.pir', 1 :named('verbose'))
.end
.sub 'testclean' :anon
.param pmc kv :slurpy :named
system("perl -MExtUtils::Command -e rm_f test_*.wmls test_*.wmlsc")
.end
.sub 'pmctest' :anon
.param pmc kv :slurpy :named
run_step('build', kv :flat :named)
$P0 = glob('t/pmc/*.t')
$P0 = sort_strings($P0)
$S0 = get_parrot()
runtests($P0 :flat, $S0 :named('exec'))
.end
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: