Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 117 lines (92 sloc) 2.67 KB
#!/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: