[svn:languages] r88 - in chitchat/trunk: . config src t

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sun Nov 22 15:54:14 UTC 2009


Author: fperrad
Date: Sun Nov 22 15:54:13 2009
New Revision: 88
URL: https://trac.parrot.org/languages/changeset/88

Log:
[chitchat] modernize infrastructure with setup.pir (distutils)

Added:
   chitchat/trunk/setup.pir   (contents, props changed)
   chitchat/trunk/src/builtins.pir   (contents, props changed)
Deleted:
   chitchat/trunk/Configure.pl
   chitchat/trunk/config/
   chitchat/trunk/t/harness
Modified:
   chitchat/trunk/   (props changed)
   chitchat/trunk/chitchat.pir
   chitchat/trunk/src/   (props changed)

Deleted: chitchat/trunk/Configure.pl
==============================================================================
--- chitchat/trunk/Configure.pl	Sun Nov 22 15:54:13 2009	(r87)
+++ /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: chitchat/trunk/chitchat.pir
==============================================================================
--- chitchat/trunk/chitchat.pir	Sun Nov 22 11:45:54 2009	(r87)
+++ chitchat/trunk/chitchat.pir	Sun Nov 22 15:54:13 2009	(r88)
@@ -65,7 +65,7 @@
 .end
 
 
-.include 'src/gen_builtins.pir'
+.include 'src/builtins.pir'
 .include 'src/gen_grammar.pir'
 .include 'src/gen_actions.pir'
 

Added: chitchat/trunk/setup.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ chitchat/trunk/setup.pir	Sun Nov 22 15:54:13 2009	(r88)
@@ -0,0 +1,74 @@
+#! /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'] = 'Chitchat'
+    $P0['abstract'] = 'Chitchat'
+    $P0['description'] = 'Chitchat'
+    $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/bf/trunk'
+    $P0['browser_uri'] = 'https://trac.parrot.org/languages/browser/bf'
+    $P0['project_uri'] = 'https://trac.parrot.org/parrot/wiki/Languages'
+
+    # build
+    $P1 = new 'Hash'
+    $P1['src/gen_grammar.pir'] = 'src/parser/grammar.pg'
+    $P0['pir_pge'] = $P1
+
+    $P2 = new 'Hash'
+    $P2['src/gen_actions.pir'] = 'src/parser/actions.pm'
+    $P0['pir_nqp'] = $P2
+
+    $P3 = new 'Hash'
+    $P4 = split "\n", <<'SOURCES'
+chitchat.pir
+src/gen_grammar.pir
+src/gen_actions.pir
+src/builtins.pir
+src/builtins/say.pir
+SOURCES
+    $P3['chitchat.pbc'] = $P4
+    $P0['pbc_pir'] = $P3
+
+    $P5 = new 'Hash'
+    $P5['parrot-chitchat'] = 'chitchat.pbc'
+    $P0['installable_pbc'] = $P5
+
+    # test
+    $S0 = get_parrot()
+    $S0 .= ' chitchat.pbc'
+    $P0['prove_exec'] = $S0
+
+    .tailcall setup(args :flat, $P0 :flat :named)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: chitchat/trunk/src/builtins.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ chitchat/trunk/src/builtins.pir	Sun Nov 22 15:54:13 2009	(r88)
@@ -0,0 +1,10 @@
+# $Id$
+
+.include 'src/builtins/say.pir'
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+

Deleted: chitchat/trunk/t/harness
==============================================================================
--- chitchat/trunk/t/harness	Sun Nov 22 15:54:13 2009	(r87)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,8 +0,0 @@
-#! perl
-
-# $Id$
-
-use FindBin;
-use lib qw( . lib ../lib ../../lib );
-use Parrot::Test::Harness language => 'ChitChat', compiler => 'chitchat.pbc';
-


More information about the parrot-commits mailing list