[svn:languages] r95 - in pheme/trunk: . config t
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Sun Nov 22 17:33:36 UTC 2009
Author: fperrad
Date: Sun Nov 22 17:33:35 2009
New Revision: 95
URL: https://trac.parrot.org/languages/changeset/95
Log:
[pheme] modernize infrastructure with setup.pir (distutils)
Added:
pheme/trunk/setup.pir (contents, props changed)
Deleted:
pheme/trunk/Configure.pl
pheme/trunk/config/
pheme/trunk/t/harness
Modified:
pheme/trunk/ (props changed)
pheme/trunk/README
Deleted: pheme/trunk/Configure.pl
==============================================================================
--- pheme/trunk/Configure.pl Sun Nov 22 17:33:35 2009 (r94)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,66 +0,0 @@
-# Copyright (C) 2009, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use 5.008;
-
-# Get a list of parrot-configs to invoke.
-my @parrot_config_exe = (
- 'parrot/parrot_config',
- '../../parrot_config',
- 'parrot_config',
-);
-
-# Get configuration information from parrot_config
-my %config = read_parrot_config(@parrot_config_exe);
-unless (%config) {
- die "Unable to locate parrot_config.";
-}
-
-# Create the Makefile using the information we just got
-create_makefiles(%config);
-
-sub read_parrot_config {
- my @parrot_config_exe = @_;
- my %config = ();
- for my $exe (@parrot_config_exe) {
- no warnings;
- if (open my $PARROT_CONFIG, '-|', "$exe --dump") {
- print "Reading configuration information from $exe\n";
- while (<$PARROT_CONFIG>) {
- $config{$1} = $2 if (/(\w+) => '(.*)'/);
- }
- close $PARROT_CONFIG;
- last if %config;
- }
- }
- %config;
-}
-
-
-# Generate Makefiles from a configuration
-sub create_makefiles {
- my %config = @_;
- my %makefiles = (
- 'config/makefiles/root.in' => 'Makefile',
-# 'config/makefiles/pmc.in' => 'src/pmc/Makefile',
-# 'config/makefiles/ops.in' => 'src/ops/Makefile',
- );
- my $build_tool = $config{libdir} . $config{versiondir}
- . '/tools/dev/gen_makefile.pl';
-
- foreach my $template (keys %makefiles) {
- my $makefile = $makefiles{$template};
- print "Creating $makefile\n";
- system($config{perl}, $build_tool, $template, $makefile);
- }
-}
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-
Modified: pheme/trunk/README
==============================================================================
--- pheme/trunk/README Sun Nov 22 17:24:30 2009 (r94)
+++ pheme/trunk/README Sun Nov 22 17:33:35 2009 (r95)
@@ -1,7 +1,7 @@
This is Pheme, version 0.1.0
----------------------------
-Copyright (C) 2006 - 2007, Parrot Foundation.
+Copyright (C) 2006 - 2009, Parrot Foundation.
Pheme is a Parrot-based implementation of Scheme, in the sense that it has the
same syntax (what syntax it has) and shares the name of some built-ins. Please
@@ -20,8 +20,8 @@
Compile Pheme:
- $ make
- $ make test
+ $ parrot setup.pir
+ $ parrot setup.pir make test
Note that the tests are actual Pheme programs, written entirely in Pheme
(except for the test library, which is a PIR program).
Added: pheme/trunk/setup.pir
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ pheme/trunk/setup.pir Sun Nov 22 17:33:35 2009 (r95)
@@ -0,0 +1,75 @@
+#! /usr/local/bin/parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=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'
+
+ $P0 = new 'Hash'
+ $P0['name'] = 'Pheme'
+ $P0['abstract'] = 'Yet Another Scheme'
+ $P0['description'] = 'Pheme is a Parrot-based implementation of Scheme.'
+ $P0['license_type'] = 'Artistic License 2.0'
+ $P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0'
+ $P0['copyright_holder'] = 'Parrot Foundation'
+ $P0['generated_by'] = 'Francois Perrad <francois.perrad at gadz.org>'
+ $P0['checkout_uri'] = 'https://svn.parrot.org/languages/pheme/trunk'
+ $P0['browser_uri'] = 'https://trac.parrot.org/languages/browser/pheme'
+ $P0['project_uri'] = 'https://trac.parrot.org/parrot/wiki/Languages'
+
+ # build
+ $P1 = new 'Hash'
+ $P1['lib/pheme_grammar_gen.pir'] = 'lib/pheme.g'
+ $P0['pir_pge'] = $P1
+
+ $P2 = new 'Hash'
+ $P2['lib/ASTGrammar.pir'] = 'lib/pge2past.tg'
+ $P0['pir_tge'] = $P2
+
+ $P3 = new 'Hash'
+ $P4 = split "\n", <<'SOURCES'
+pheme.pir
+lib/pheme_grammar_gen.pir
+lib/ASTGrammar.pir
+lib/PhemeObjects.pir
+lib/PhemeSymbols.pir
+SOURCES
+ $P3['pheme.pbc'] = $P4
+ $P0['pbc_pir'] = $P3
+
+ $P5 = new 'Hash'
+ $P5['parrot-pheme'] = 'pheme.pbc'
+ $P0['installable_pbc'] = $P5
+
+ # test
+ $S0 = get_parrot()
+ $S0 .= ' pheme.pbc'
+ $P0['prove_exec'] = $S0
+ $P0['prove_files'] = 't/*.t t/phemer/*.t'
+
+ .tailcall setup(args :flat, $P0 :flat :named)
+.end
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
Deleted: pheme/trunk/t/harness
==============================================================================
--- pheme/trunk/t/harness Sun Nov 22 17:33:35 2009 (r94)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,8 +0,0 @@
-#! perl
-
-use strict;
-use warnings;
-
-use lib 'lib', '../../lib';
-
-use Parrot::Test::Harness language => 'pheme', compiler => 'pheme.pbc';
More information about the parrot-commits
mailing list