-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.pir
executable file
·116 lines (92 loc) · 2.67 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
#!/usr/bin/env parrot
=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)
$P0 = new 'Hash'
$P0['name'] = 'Steme'
$P0['abstract'] = 'Scheme for Parrot'
$P0['authority'] = 'http://github.com/tene'
$P0['description'] = 'Scheme for Parrot'
$P1 = split ';', 'scheme;lisp'
$P0['keywords'] = $P1
$P0['license_type'] = 'MIT/X11'
$P0['license_uri'] = 'http://www.opensource.org/licenses/mit-license.php'
$P0['copyright_holder'] = 'Stephen Weeks'
$P0['checkout_uri'] = 'git://github.com/tene/steme.git'
$P0['browser_uri'] = 'http://github.com/tene/steme'
$P0['project_uri'] = 'http://github.com/tene/steme'
# build
$P2 = new 'Hash'
$P2['steme/gen_grammar.pir'] = 'steme/pct/grammar.pg'
$P2['steme/gen_actions.pir'] = 'steme/pct/actions.pm'
$P0['pir_nqp-rx'] = $P2
$P3 = new 'Hash'
$P4 = split "\n", <<'SOURCES'
steme/steme.pir
steme/gen_grammar.pir
steme/gen_actions.pir
steme/gen_builtins.pir
SOURCES
$S0 = pop $P4
$P3['steme/steme.pbc'] = $P4
$P3['steme.pbc'] = 'steme.pir'
$P0['pbc_pir'] = $P3
$P5 = new 'Hash'
$P5['parrot-steme'] = 'steme.pbc'
$P0['installable_pbc'] = $P5
# test
$S0 = get_parrot()
$S0 .= ' steme.pbc'
$P0['prove_exec'] = $S0
# install
$P0['inst_lang'] = 'steme/steme.pbc'
# dist
$P10 = glob('steme/builtins/*.pir')
$P0['manifest_includes'] = $P10
$P0['manifest_excludes'] = 'steme/gen_builtins.pir'
$P0['doc_files'] = 'README'
.tailcall setup(args :flat, $P0 :flat :named)
.end
.sub 'prebuild' :anon
.param pmc kv :slurpy :named
$P1 = split "\n", <<'BUILTINS_PIR'
steme/builtins/std.pir
steme/builtins/say.pir
steme/builtins/math.pir
steme/builtins/cmp.pir
steme/builtins/library.pir
steme/builtins/control.pir
BUILTINS_PIR
$S0 = pop $P1
$I0 = newer('steme/gen_builtins.pir', $P1)
if $I0 goto L1
$S0 = "# generated by setup.pir\n\n.include '"
$S1 = join "'\n.include '", $P1
$S0 .= $S1
$S0 .= "'\n\n"
spew('steme/gen_builtins.pir', $S0, 1 :named('verbose'))
L1:
.end
.sub 'clean' :anon
.param pmc kv :slurpy :named
unlink('steme/gen_builtins.pir', 1 :named('verbose'))
.end
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: