diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/build/Makefile.in | 95 | ||||
-rw-r--r-- | tools/build/bin-install.pl | 10 | ||||
-rw-r--r-- | tools/build/module-install.pl | 10 | ||||
-rw-r--r-- | tools/lib/NQP/Configure.pm | 17 | ||||
-rw-r--r-- | tools/star/Makefile | 16 | ||||
-rw-r--r-- | tools/star/release-guide.pod | 12 |
6 files changed, 119 insertions, 41 deletions
diff --git a/tools/build/Makefile.in b/tools/build/Makefile.in index 540e9dd..e4352a6 100644 --- a/tools/build/Makefile.in +++ b/tools/build/Makefile.in @@ -1,60 +1,107 @@ # Copyright (C) 2006-2014, The Perl Foundation. # $Id$ -PARROT_DIR = parrot -NQP_DIR = nqp -RAKUDO_DIR = rakudo +PARROT_DIR = parrot +MOAR_DIR = moarvm +NQP_DIR = nqp +RAKUDO_DIR = rakudo STAR_VERSION = 2014.03 -# values from parrot_config +# install location PREFIX_DIR = @prefix@ + +# values from parrot_config PARROT_BIN_DIR = @bindir@ PARROT_VERSION = @versiondir@ PARROT_LIB_DIR = @libdir@$(PARROT_VERSION) +# JVM install location +JVM_BIN_DIR = $(PREFIX_DIR)/bin + +# MoarVM install location +MOAR_BIN_DIR = $(PREFIX_DIR)/bin + EXE = @exe@ +BAT = @bat@ PERL = @perl@ CP = $(PERL) -MExtUtils::Command -e cp RM_F = $(PERL) -MExtUtils::Command -e rm_f MKPATH = $(PERL) -MExtUtils::Command -e mkpath CHMOD = $(PERL) -MExtUtils::Command -e chmod -# locations of parrot resources -PARROT_EXE = $(PARROT_BIN_DIR)/parrot$(EXE) -P_NQP_EXE = $(PARROT_BIN_DIR)/nqp-p$(EXE) -PBC_TO_EXE = $(PARROT_BIN_DIR)/pbc_to_exe$(EXE) +PERL6_P_EXE = perl6-p$(EXE) +PERL6_P_LANG_DIR = $(PARROT_LIB_DIR)/languages/perl6 +PERL6_P_INSTALL = $(PARROT_BIN_DIR)/$(PERL6_P_EXE) -PERL6_EXE = perl6-p$(EXE) -PERL6_LANG_DIR = $(PARROT_LIB_DIR)/languages/perl6 -PERL6_INSTALL = $(PARROT_BIN_DIR)/$(PERL6_EXE) +PERL6_J_EXE = perl6-j$(BAT) +PERL6_J_LANG_DIR = $(PREFIX_DIR)/languages/perl6 +PERL6_J_INSTALL = $(JVM_BIN_DIR)/$(PERL6_J_EXE) +PERL6_M_EXE = perl6-m$(BAT) +PERL6_M_LANG_DIR = $(PREFIX_DIR)/languages/perl6 +PERL6_M_INSTALL = $(MOAR_BIN_DIR)/$(PERL6_M_EXE) + +PERL6_EXE = perl6$(EXE) + +<<<<<<< HEAD +======= MODULES = modules/MODULES.txt +>>>>>>> origin/tristar all: rakudo -rakudo: $(RAKUDO_DIR)/$(PERL6_EXE) -$(RAKUDO_DIR)/$(PERL6_EXE): +rakudo: @backend_exes@ + +@backend_exes@: @echo "== Configuring and building Rakudo" cd $(RAKUDO_DIR) && $(PERL) Configure.pl --prefix=$(PREFIX_DIR) && $(MAKE) + rakudo-test: rakudo cd $(RAKUDO_DIR) && $(MAKE) test + rakudo-spectest: rakudo cd $(RAKUDO_DIR) && $(MAKE) spectest + rakudo-install: rakudo cd $(RAKUDO_DIR) && $(MAKE) install - @win32_libparrot_copy@ - $(CP) $(DESTDIR)$(PERL6_INSTALL) $(PERL6_EXE) + $(CP) $(DESTDIR)@default_backend_exe@ $(PERL6_EXE) $(CHMOD) 755 $(PERL6_EXE) + @win32_libparrot_copy@ + +modules-install: @backend_modules_install@ + +modules-install-p: + @echo "== Installing modules for Parrot" + $(PERL) tools/build/module-install.pl $(DESTDIR)$(PERL6_P_INSTALL) $(DESTDIR)$(PERL6_P_LANG_DIR)/lib pir pir $(MODULES) + @echo "== Installing binaries for Parrot" + $(PERL) tools/build/bin-install.pl $(PERL6_P_INSTALL) $(DESTDIR)$(PARROT_BIN_DIR) p modules/ufo/bin/ufo modules/panda/bin/panda modules/doc/bin/p6doc -modules-install: rakudo-install - @echo "== Installing modules" - $(PERL) tools/build/module-install.pl $(DESTDIR)$(PERL6_INSTALL) $(DESTDIR)$(PERL6_LANG_DIR)/lib $(MODULES) - @echo "== Installing binaries" - $(PERL) tools/build/bin-install.pl $(PERL6_INSTALL) $(DESTDIR)$(PARROT_BIN_DIR) modules/ufo/bin/ufo modules/panda/bin/panda modules/doc/bin/p6doc +<<<<<<< HEAD +======= +modules-install-j: + @echo "== Installing modules for JVM" + $(PERL) tools/build/module-install.pl $(DESTDIR)$(PERL6_J_INSTALL) $(DESTDIR)$(PERL6_J_LANG_DIR)/lib jar jar $(MODULES) + @echo "== Installing binaries for JVM" + $(PERL) tools/build/bin-install.pl $(PERL6_J_INSTALL) $(DESTDIR)$(JVM_BIN_DIR) j modules/ufo/bin/ufo modules/panda/bin/panda modules/doc/bin/p6doc -modules-test: - $(PERL) tools/build/modules-test.pl $(CURDIR) $(DESTDIR)$(PERL6_INSTALL) modules/MODULES.txt +modules-install-m: + @echo "== Installing modules for MoarVM" + $(PERL) tools/build/module-install.pl $(DESTDIR)$(PERL6_M_INSTALL) $(DESTDIR)$(PERL6_M_LANG_DIR)/lib moarvm mbc $(MODULES) + @echo "== Installing binaries for MoarVM" + $(PERL) tools/build/bin-install.pl $(PERL6_M_INSTALL) $(DESTDIR)$(MOAR_BIN_DIR) m modules/ufo/bin/ufo modules/panda/bin/panda modules/doc/bin/p6doc +modules-test: @backend_modules_test@ + +modules-test-p: + $(PERL) tools/build/modules-test.pl $(CURDIR) $(DESTDIR)$(PERL6_P_INSTALL) modules/MODULES.txt + +modules-test-j: + $(PERL) tools/build/modules-test.pl $(CURDIR) $(DESTDIR)$(PERL6_J_INSTALL) modules/MODULES.txt + +modules-test-m: + $(PERL) tools/build/modules-test.pl $(CURDIR) $(DESTDIR)$(PERL6_M_INSTALL) modules/MODULES.txt + +>>>>>>> origin/tristar install: rakudo-install modules-install test: @@ -62,7 +109,7 @@ test: @echo "To run the Rakudo compiler tests, use '$(MAKE) rakudo-test'" @echo "To run the Perl 6 spectests, use '$(MAKE) rakudo-spectest'" @echo "" - @echo "To run tests for individual modules, try:" + @echo "To run tests for individual modules, install and then try:" @echo " prove -e ./perl6 -r modules/<name>/t" @echo "" @@ -111,8 +158,6 @@ help: config: $(PERL) Configure.pl -$(PARROT_EXE): - CRITIC_FILES=Configure.pl tools/build/ perlcritic: diff --git a/tools/build/bin-install.pl b/tools/build/bin-install.pl index 1c71cea..1b47942 100644 --- a/tools/build/bin-install.pl +++ b/tools/build/bin-install.pl @@ -4,7 +4,7 @@ use strict; use warnings; use File::Spec; -my ($p6bin, $dest, @files) = @ARGV; +my ($p6bin, $dest, $post, @files) = @ARGV; die "Usage: $0 <perl6_binary> <destination_path> <source_files>" unless $p6bin && $dest; @@ -25,4 +25,12 @@ for my $filename (@files) { close $OUT or die "Error while closing file '$dest/$basename': $!"; close $IN; chmod 0755, "$dest/$basename"; + open my $ALIAS, '>', "$dest/$basename-$post" + or die "Cannot write file '$dest/$basename-$post' for installing it: $!"; + printf { $ALIAS } <<'EOA', $p6bin, $dest, $basename; +#!/bin/sh +exec %s %s/%s "$@" +EOA + close $ALIAS or die "Error while closing file '$dest/$basename-$post': $!"; + chmod 0755, "$dest/$basename-$post"; } diff --git a/tools/build/module-install.pl b/tools/build/module-install.pl index 2ed2589..b6be9c7 100644 --- a/tools/build/module-install.pl +++ b/tools/build/module-install.pl @@ -9,6 +9,8 @@ use File::Basename; my $perl6bin = shift @ARGV; my $perl6lib = shift @ARGV; +my $compext = shift @ARGV; +my $comptarget = shift @ARGV; my @pmfiles; my @mod_pms; @@ -22,14 +24,14 @@ while (<>) { find({ no_chdir=>1, wanted => \&libcopy }, $mlib); sub libcopy { - return unless /\.pm6?|\.pod/; + return unless /\.pm6?$|\.pod$/; my $source = $File::Find::name; my $target = $source; $target =~ s/\Q$mlib\E/$perl6lib/; print "$source => $target\n"; mkpath dirname($target); copy($source, $target) or die "copy failed: $!\n"; - push @mod_pms, $target if $target =~ /\.pm6?/; + push @mod_pms, $target if $target =~ /\.pm6?$/; } my %usages_of; @@ -76,8 +78,8 @@ do { chdir 'rakudo'; foreach my $pm (@pmfiles) { my $out = $pm; - $out =~ s/\.pm6?$/.pir/; - my @cmd = ($perl6bin, '--target=pir', "--output=$out", $pm); + $out =~ s/\.pm6?$/.$compext/; + my @cmd = ($perl6bin, "--target=$comptarget", "--output=$out", $pm); print join(' ', @cmd), "\n"; system(@cmd); } diff --git a/tools/lib/NQP/Configure.pm b/tools/lib/NQP/Configure.pm index 641d2c6..cb95cc9 100644 --- a/tools/lib/NQP/Configure.pm +++ b/tools/lib/NQP/Configure.pm @@ -274,11 +274,13 @@ sub gen_nqp { my $backends = $options{'backends'}; my $gen_nqp = $options{'gen-nqp'}; + my $gen_moar = $options{'gen-moar'}; my $gen_parrot = $options{'gen-parrot'}; my $prefix = $options{'prefix'} || cwd().'/install'; my $startdir = cwd(); my $PARROT_REVISION = 'nqp/tools/build/PARROT_REVISION'; + my $MOAR_REVISION = 'nqp/tools/build/MOAR_REVISION'; my (%impls, %need); @@ -321,7 +323,7 @@ sub gen_nqp { return %impls unless %need; - if (defined $gen_nqp || defined $gen_parrot) { + if (defined $gen_nqp || defined $gen_parrot || defined $gen_moar) { git_checkout($nqp_git, 'nqp', $nqp_want, $nqp_push); } @@ -333,11 +335,18 @@ sub gen_nqp { $impls{parrot}{config} = \%c; } - return %impls unless defined($gen_nqp) || defined($gen_parrot); + if ($need{moar} && defined $gen_moar) { + my ($moar_want) = split(' ', slurp($MOAR_REVISION)); + my $moar = gen_moar($moar_want, %options, prefix => $prefix); + $impls{moar}{bin} = "$prefix/bin/nqp-m$bat"; + } + + return %impls unless defined($gen_nqp) || defined($gen_parrot) || defined($gen_moar); my $backends_to_build = join ',', sort keys %need; my @cmd = ($^X, 'Configure.pl', "--prefix=$prefix", "--backends=$backends", "--make-install"); + print "Building NQP ...\n"; chdir("$startdir/nqp"); print "@cmd\n"; @@ -425,7 +434,7 @@ sub gen_moar { my $startdir = cwd(); my $moar_exe = "$prefix/bin/moar$exe"; - my $moar_have = qx{ $moar_exe --version }; + my $moar_have = -e $moar_exe ? qx{ $moar_exe --version } : undef; if ($moar_have) { $moar_have = $moar_have =~ /version (\S+)/ ? $1 : undef; } @@ -443,7 +452,7 @@ sub gen_moar { my $moar_repo = git_checkout($moar_git, 'MoarVM', $gen_moar || $moar_want, $moar_push); - unless (cmp_rev($moar_repo, $moar_want) >= 0) { + if (defined($moar_repo) && cmp_rev($moar_repo, $moar_want) < 0) { die "You asked me to build $gen_moar, but $moar_repo is not new enough to satisfy version $moar_want\n"; } diff --git a/tools/star/Makefile b/tools/star/Makefile index e13c2a2..772bfeb 100644 --- a/tools/star/Makefile +++ b/tools/star/Makefile @@ -1,6 +1,7 @@ RAKUDO_VER = 2014.03.01 NQP_VER = 2014.03 PARROT_VER = 6.1.0 +MOAR_VER = 2014.03 STAR_REL = rakudo-star-$(VERSION) STAR_TGZ = $(STAR_REL).tar.gz @@ -16,12 +17,15 @@ NQP_SRC = $(SRC_DIR)/$(NQP_TGZ) PARROT_TGZ = parrot-$(PARROT_VER).tar.gz PARROT_URL = http://ftp.parrot.org/releases/all/$(PARROT_VER)/$(PARROT_TGZ) PARROT_SRC = $(SRC_DIR)/$(PARROT_TGZ) +MOAR_TGZ = MoarVM-$(MOAR_VER).tar.gz +MOAR_URL = http://www.moarvm.org/releases/$(MOAR_TGZ) +MOAR_SRC = $(SRC_DIR)/$(MOAR_TGZ) PERL = perl PREFIX = $(PERL) $(CURDIR)/tools/star/prefix.pl WGET = wget --no-check-certificate -all: rakudo nqp parrot manifest +all: rakudo nqp parrot moar manifest always: @@ -32,7 +36,7 @@ $(RAKUDO_SRC): mkdir -p $(SRC_DIR) $(WGET) $(RAKUDO_URL) -O $(RAKUDO_SRC) -nqp: parrot $(NQP_SRC) +nqp: parrot moar $(NQP_SRC) tar --xform 's!nqp-[^/]*!nqp!' -xvzf $(NQP_SRC) $(NQP_SRC): @@ -46,6 +50,13 @@ $(PARROT_SRC): mkdir -p $(SRC_DIR) $(WGET) $(PARROT_URL) -O $(PARROT_SRC) +moar: $(MOAR_SRC) + tar --xform 's!MoarVM-[^/]*!MoarVM!' -xvzf $(MOAR_SRC) + +$(MOAR_SRC): + mkdir -p $(SRC_DIR) + $(WGET) $(MOAR_URL) -O $(MOAR_SRC) + modules/zavolaj/lib: @echo "Updating submodules" git submodule init @@ -56,6 +67,7 @@ manifest: modules/zavolaj/lib git ls-files >>MANIFEST $(PREFIX) rakudo/ rakudo/MANIFEST >>MANIFEST $(PREFIX) nqp/ nqp/MANIFEST >>MANIFEST + $(PREFIX) MoarVM/ MoarVM/MANIFEST >>MANIFEST cut -d' ' -f1 parrot/MANIFEST | $(PREFIX) parrot/ >>MANIFEST git submodule foreach --quiet 'git ls-files | $(PREFIX) $$path/' >>MANIFEST grep -v -f tools/star/MANIFEST.exclude MANIFEST >MANIFEST.1 diff --git a/tools/star/release-guide.pod b/tools/star/release-guide.pod index c255150..2e77810 100644 --- a/tools/star/release-guide.pod +++ b/tools/star/release-guide.pod @@ -11,7 +11,8 @@ are also free to choose older releases of the compiler, NQP, and/or Parrot. The goal is to balance end-user stability needs with progress being made on the compiler, modules, and other runtime components. Currently Star is on a monthly release cycle; we -expect to slow down to quarterly releases again sometime in 2013. +expect to slow down to quarterly releases again sometime in the +future. =head2 Steps to create a release @@ -50,12 +51,13 @@ reports a clean repository. Change to the star repository directory, and edit the first three lines of tools/star/Makefile to indicate the desired releases of -Rakudo, NQP, and Parrot to use. +Rakudo, NQP, MoarVM, and Parrot to use. Usually that means the last Rakudo release, the NQP version that is in the -released Rakudo's F<tools/build/NQP_REVISION> file, and the parrot version -in the F<tools/build/PARROT_REVISION> file that is include in the NQP -release. +released Rakudo's F<tools/build/NQP_REVISION> file, the MoarVM version that +is in the F<tools/build/MOAR_REVISION> file that is included in the NQP +release, and the Parrot version in the F<tools/build/PARROT_REVISION> file +that is include in the NQP release. $ cd star $ vi tools/star/Makefile |