Commits

Anonymous committed f3a07ba

Issue 5. Change \r\n to \n in setup.py.
Add the svn.executable properties for setup.py and runtests.py.

Comments (0)

Files changed (2)

File contents unchanged.
-#!/usr/bin/env python
-
-from distutils.core import setup
-from distutils.command.build import build
-from distutils.dep_util import newer_group, newer
-from distutils.spawn import spawn
-from subprocess import Popen,PIPE
-from re import compile
-from fileinput import input
-from os import mkdir, remove
-from os.path import exists
-from sys import executable
-
-pc_raw = Popen("parrot_config --dump", shell=True, stdout=PIPE).stdout.readlines()
-if not pc_raw:
-    print "\nplease check parrot_config is in your PATH!"
-    exit(1)
-    
-pc = {}
-rx = compile("(.*) => '(.*)'")
-
-for l in pc_raw:
-    m = rx.match(l)
-    if m:
-        pc[m.group(1)] = m.group(2)
-        
-
-PARROT        = "%s/parrot%s" % (pc['bin_dir'], pc['exe'])
-GRAMMAR_GEN   = "%s/%s/library/PGE/Perl6Grammar.pbc" % (pc['lib_dir'], pc['versiondir'])
-NQP           = "%s/%s/languages/nqp/nqp.pbc" % (pc['lib_dir'], pc['versiondir'])
-PCT           = "%s/library/PCT.pbc" % pc['lib_dir']
-
-GEN_SOURCES = [
-  'include/gen_grammar.pir',
-  'include/gen_actions.pir',
-  'include/gen_builtins.pir',
-]
-
-SOURCES = GEN_SOURCES + [ 'pynie.pir',
-  'src/parser/indent.pir' ]
-
-BUILTINS_PIR = [
-  'src/builtins/funcs.pir', 
-  'src/builtins/io.pir', 
-  'src/builtins/lists.pir', 
-  'src/builtins/oper.pir' ]
-
-CLEANUPS = GEN_SOURCES + [
-  'pynie.pbc',
-  'pynie%s' % pc['exe'],
-  'installable_pynie%s' % pc['exe'] ]
-  
-def real_build():
-    if not exists('include'):
-        mkdir('include')
-        
-    if newer_group(BUILTINS_PIR, 'include/gen_builtins.pir'):
-        f = open('include/gen_builtins.pir', 'w')
-        for l in input(BUILTINS_PIR): f.write(l)
-        f.close()
-
-    if newer('Grammar/Grammar.pg', 'include/gen_grammar.pir'):
-        spawn([PARROT, GRAMMAR_GEN, '--output=include/gen_grammar.pir', 'Grammar/Grammar.pg'])
-
-    if newer('Grammar/Actions.nqp','include/gen_actions.pir'):
-        spawn([PARROT, NQP, '--output=include/gen_actions.pir', '--encoding=fixed_8', '--target=pir', 'Grammar/Actions.nqp'])
-    
-    if newer_group(SOURCES + BUILTINS_PIR, 'pynie.pbc'):
-        spawn([PARROT, '-o', 'pynie.pbc', 'pynie.pir'])    
-  
-class build_pynie(build):
-    def run(self):
-        real_build()
-        build.run(self)
-
-class test_pynie(build):
-    def run(self):
-        real_build()
-        spawn([executable, 'runtests.py'])
-        build.run(self)
-        
-class clean_pynie(build):
-    def run(self):
-        [remove(f) for f in CLEANUPS if exists(f)]
-        build.run(self)
-        
-
-class help_pynie(build):
-    def run(self):
-        print """
-            Following targets are available for the user:
-
-              build:             pynie.pbc and pynie$(EXE) executable
-                                 This is the default.
-
-              test:              Run the test suite.
-
-              clean:             Basic cleaning up.
-
-              help:              Print this help message.        
-        """
-
-setup(name='Pynie',
-      version='0.1',
-      description='Pynie - Python on Parrot',
-      url='http://code.google.com/p/pynie/',
-      cmdclass = {
-            'build': build_pynie,
-            'clean': clean_pynie,
-            'test':  test_pynie,
-            'help':  help_pynie,
-      }
-)
-
-    
+#!/usr/bin/env python
+
+from distutils.core import setup
+from distutils.command.build import build
+from distutils.dep_util import newer_group, newer
+from distutils.spawn import spawn
+from subprocess import Popen,PIPE
+from re import compile
+from fileinput import input
+from os import mkdir, remove
+from os.path import exists
+from sys import executable
+
+pc_raw = Popen("parrot_config --dump", shell=True, stdout=PIPE).stdout.readlines()
+if not pc_raw:
+    print "\nplease check parrot_config is in your PATH!"
+    exit(1)
+    
+pc = {}
+rx = compile("(.*) => '(.*)'")
+
+for l in pc_raw:
+    m = rx.match(l)
+    if m:
+        pc[m.group(1)] = m.group(2)
+        
+
+PARROT        = "%s/parrot%s" % (pc['bin_dir'], pc['exe'])
+GRAMMAR_GEN   = "%s/%s/library/PGE/Perl6Grammar.pbc" % (pc['lib_dir'], pc['versiondir'])
+NQP           = "%s/%s/languages/nqp/nqp.pbc" % (pc['lib_dir'], pc['versiondir'])
+PCT           = "%s/library/PCT.pbc" % pc['lib_dir']
+
+GEN_SOURCES = [
+  'include/gen_grammar.pir',
+  'include/gen_actions.pir',
+  'include/gen_builtins.pir',
+]
+
+SOURCES = GEN_SOURCES + [ 'pynie.pir',
+  'src/parser/indent.pir' ]
+
+BUILTINS_PIR = [
+  'src/builtins/funcs.pir', 
+  'src/builtins/io.pir', 
+  'src/builtins/lists.pir', 
+  'src/builtins/oper.pir' ]
+
+CLEANUPS = GEN_SOURCES + [
+  'pynie.pbc',
+  'pynie%s' % pc['exe'],
+  'installable_pynie%s' % pc['exe'] ]
+  
+def real_build():
+    if not exists('include'):
+        mkdir('include')
+        
+    if newer_group(BUILTINS_PIR, 'include/gen_builtins.pir'):
+        f = open('include/gen_builtins.pir', 'w')
+        for l in input(BUILTINS_PIR): f.write(l)
+        f.close()
+
+    if newer('Grammar/Grammar.pg', 'include/gen_grammar.pir'):
+        spawn([PARROT, GRAMMAR_GEN, '--output=include/gen_grammar.pir', 'Grammar/Grammar.pg'])
+
+    if newer('Grammar/Actions.nqp','include/gen_actions.pir'):
+        spawn([PARROT, NQP, '--output=include/gen_actions.pir', '--encoding=fixed_8', '--target=pir', 'Grammar/Actions.nqp'])
+    
+    if newer_group(SOURCES + BUILTINS_PIR, 'pynie.pbc'):
+        spawn([PARROT, '-o', 'pynie.pbc', 'pynie.pir'])    
+  
+class build_pynie(build):
+    def run(self):
+        real_build()
+        build.run(self)
+
+class test_pynie(build):
+    def run(self):
+        real_build()
+        spawn([executable, 'runtests.py'])
+        build.run(self)
+        
+class clean_pynie(build):
+    def run(self):
+        [remove(f) for f in CLEANUPS if exists(f)]
+        build.run(self)
+        
+
+class help_pynie(build):
+    def run(self):
+        print """
+            Following targets are available for the user:
+
+              build:             pynie.pbc and pynie$(EXE) executable
+                                 This is the default.
+
+              test:              Run the test suite.
+
+              clean:             Basic cleaning up.
+
+              help:              Print this help message.        
+        """
+
+setup(name='Pynie',
+      version='0.1',
+      description='Pynie - Python on Parrot',
+      url='http://code.google.com/p/pynie/',
+      cmdclass = {
+            'build': build_pynie,
+            'clean': clean_pynie,
+            'test':  test_pynie,
+            'help':  help_pynie,
+      }
+)
+
+