Skip to content

Commit

Permalink
Check RAKUDO_DIR for perl6.pbc
Browse files Browse the repository at this point in the history
  • Loading branch information
viklund committed Mar 18, 2009
1 parent 5db9a01 commit c2480ac
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
15 changes: 14 additions & 1 deletion Makefile.PL
Expand Up @@ -9,6 +9,9 @@ use File::Spec;
my $parrot_dir = $ENV{PARROT_DIR}
or die 'Please set $PARROT_DIR (see README).'."\n";

my $rakudo_dir = $ENV{RAKUDO_DIR}
or die 'Please set $RAKUDO_DIR (see README).'."\n";

$ENV{PERL6LIB}
or die 'Please set $PERL6LIB (see README).'."\n";

Expand All @@ -17,7 +20,16 @@ if ( ! -d $parrot_dir ) {
exit 1;
} elsif ( ! -x File::Spec->catfile( $parrot_dir, 'parrot' )) {
print STDERR "Couldn't find parrot executable in $parrot_dir, "
. "have you compiled?";
. "have you compiled?\n";
exit 1;
}

if ( ! -d $rakudo_dir ) {
print STDERR "Not a directory $rakudo_dir, exiting...\n";
exit 1;
} elsif ( ! -f File::Spec->catfile( $rakudo_dir, 'perl6.pbc' )) {
print STDERR "Couldn't find perl6.pbc file in $rakudo_dir, "
. "have you compiled?\n";
exit 1;
}

Expand All @@ -26,6 +38,7 @@ my @infiles = map { $_.'.in' } qw< Makefile test_wiki.sh wiki.sh >;

my %replacements = (
PARROT_DIR => $parrot_dir,
RAKUDO_DIR => $rakudo_dir,
);

if ( !-e 'lib/Test.pm' ) {
Expand Down
5 changes: 3 additions & 2 deletions Makefile.in
@@ -1,4 +1,5 @@
PARROT_DIR=<PARROT_DIR>
RAKUDO_DIR=<RAKUDO_DIR>

SOURCES=lib/CGI.pm lib/Text/Markup/Wiki/Minimal.pm \
lib/Text/Markup/Wiki/MediaWiki.pm lib/Test.pm \
Expand All @@ -13,13 +14,13 @@ PIRS=$(SOURCES:.pm=.pir)
all: $(PIRS)

%.pir: %.pm
$(PARROT_DIR)/parrot $(PARROT_DIR)/languages/rakudo/perl6.pbc --target=pir --output=$@ $<
$(PARROT_DIR)/parrot $(RAKUDO_DIR)/perl6.pbc --target=pir --output=$@ $<

clean:
rm -f $(PIRS)

tests: test

test: all
prove -e '$(PARROT_DIR)/parrot $(PARROT_DIR)/languages/rakudo/perl6.pbc'\
prove -e '$(PARROT_DIR)/parrot $(RAKUDO_DIR)/perl6.pbc'\
-r --nocolor t/
7 changes: 4 additions & 3 deletions README
Expand Up @@ -54,11 +54,12 @@ REPOSITORY LAYOUT
RUNNING NOVEMBER
----------------

Before building November you have to set the PARROT_DIR and PERL6LIB
environment variables to include the lib/ subdirectory of the November
repository. In bash, that would look like this:
Before building November you have to set the PARROT_DIR, RAKUDO_DIR and
PERL6LIB environment variables to include the lib/ subdirectory of the
November repository. In bash, that would look like this:

$ export PARROT_DIR=/path/to/parrot
$ export RAKUDO_DIR=/path/to/rakudo
$ export PERL6LIB=/path/to/repository/of/november/lib

After that, you can build as usual.
Expand Down
3 changes: 2 additions & 1 deletion test_wiki.sh.in
Expand Up @@ -2,8 +2,9 @@

QS=$1
PARROT_DIR=<PARROT_DIR>
RAKUDO_DIR=<RAKUDO_DIR>
env REQUEST_METHOD=GET \
SERVER_NAME='test.foo' \
SERVER_PORT='80' \
REQUEST_URI=$QS \
$PARROT_DIR/parrot $PARROT_DIR/languages/rakudo/perl6.pbc wiki
$PARROT_DIR/parrot $RAKUDO_DIR/perl6.pbc wiki
3 changes: 2 additions & 1 deletion wiki.sh.in
@@ -1,4 +1,5 @@
#!/bin/sh

PARROT_DIR=<PARROT_DIR>
exec $PARROT_DIR/parrot $PARROT_DIR/languages/rakudo/perl6.pbc wiki
RAKUDO_DIR=<RAKUDO_DIR>
exec $PARROT_DIR/parrot $RAKUDO_DIR/perl6.pbc wiki

0 comments on commit c2480ac

Please sign in to comment.