shakespeare-parrot / setup.pir

#!/usr/bin/env parrot

=head1 NAME

setup.pir - Python distutils style

=head1 DESCRIPTION

No Configure step, no Makefile generated.

See F<runtime/library/distutils.pir>.

=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' spectest = 'spectest'
    register_step('spectest', spectest)

    $P0 = new 'Hash'
    $P0['name'] = 'Shakespeare'
    $P0['abstract'] = 'The Shakespeare Programming Language, on Parrot'
    $P0['authority'] = 'http://bitbucket.org/riffraff/'
    $P0['description'] = 'The Shakespeare Programming Language, on Parrot'
    $P0['license_type'] = 'BEER-WARE LICENSE'
#    $P0['license_uri'] = ''
    $P0['copyright_holder'] = 'Parrot Foundation'
    $P0['checkout_uri'] = 'http://bitbucket.org/riffraff/shakespeare-parrot/'
    $P0['browser_uri'] = 'http://bitbucket.org/riffraff/shakespeare-parrot/src/'
    $P0['project_uri'] = 'http://bitbucket.org/riffraff/shakespeare-parrot/'

    # build
    $P1 = new 'Hash'
    $P2 = split ' ', 'src/parser/grammar.pg src/parser/words.pg'
    $P1['src/gen_grammar.pir'] = $P2
    $P0['pir_pge'] = $P1

    $P3 = new 'Hash'
    $P3['src/gen_actions.pir'] = 'src/parser/actions.pm'
    $P0['pir_nqp'] = $P3

    $P4 = new 'Hash'
    $P5 = split "\n", <<'SOURCES'
shakespeare.pir
src/gen_grammar.pir
src/gen_actions.pir
src/builtins/base.pir
SOURCES
    $S0 = pop $P5
    $P4['shakespeare.pbc'] = $P5
    $P0['pbc_pir'] = $P4

    $P5 = new 'Hash'
    $P5['parrot-shakespeare'] = 'shakespeare.pbc'
    $P0['installable_pbc'] = $P5

    # test
    $S0 = get_parrot()
    $S0 .= ' shakespeare.pbc'
    $P0['prove_exec'] = $S0

    # dist
    $P10 = glob('manual.txt example/*.spl t/test.rb')
    $P0['manifest_includes'] = $P10

    .tailcall setup(args :flat, $P0 :flat :named)
.end

.sub 'spectest' :anon
    .param pmc kv :slurpy :named
    run_step('build', kv :flat :named)

    .local string cmd
    cmd = 'prove --exec=ruby t/test.rb'
    system(cmd, 1 :named('verbose'))
.end

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.