[Midnightbsd-cvs] mports [20662] trunk/devel: add py-ply

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Nov 6 20:03:22 EST 2015


Revision: 20662
          http://svnweb.midnightbsd.org/mports/?rev=20662
Author:   laffer1
Date:     2015-11-06 20:03:21 -0500 (Fri, 06 Nov 2015)
Log Message:
-----------
add py-ply

Modified Paths:
--------------
    trunk/devel/Makefile

Added Paths:
-----------
    trunk/devel/py-ply/
    trunk/devel/py-ply/Makefile
    trunk/devel/py-ply/distinfo
    trunk/devel/py-ply/files/
    trunk/devel/py-ply/files/patch-CHANGES
    trunk/devel/py-ply/files/patch-ply_lex.py
    trunk/devel/py-ply/files/patch-ply_yacc.py
    trunk/devel/py-ply/pkg-descr
    trunk/devel/py-ply/pkg-plist

Modified: trunk/devel/Makefile
===================================================================
--- trunk/devel/Makefile	2015-11-07 00:32:29 UTC (rev 20661)
+++ trunk/devel/Makefile	2015-11-07 01:03:21 UTC (rev 20662)
@@ -423,6 +423,7 @@
 SUBDIR += py-notify
 SUBDIR += py-orbit
 SUBDIR += py-parsing
+SUBDIR += py-ply
 SUBDIR += py-pytz
 SUBDIR += py-setuptools
 SUBDIR += py-setuptools27

Added: trunk/devel/py-ply/Makefile
===================================================================
--- trunk/devel/py-ply/Makefile	                        (rev 0)
+++ trunk/devel/py-ply/Makefile	2015-11-07 01:03:21 UTC (rev 20662)
@@ -0,0 +1,36 @@
+# $MidnightBSD$
+
+PORTNAME=	ply
+PORTVERSION=	3.6
+CATEGORIES=	devel python
+MASTER_SITES=	http://www.dabeaz.com/ply/
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Python Lex-Yacc
+
+LICENSE=	bsd3
+
+USES=		python
+USE_PYTHON=	autoplist concurrent distutils
+
+PORTDOCS=	ply.html internal.html
+
+OPTIONS_DEFINE=	DOCS EXAMPLES
+
+post-extract:
+	@${FIND} ${WRKSRC}/example -name "*.pyc" -type f -delete
+	@${FIND} ${WRKSRC}/example -name "__pycache__" -type d -delete
+
+pre-configure:
+	@${REINPLACE_CMD} -e 's|from setuptools import setup|from distutils.core import setup|' \
+		${WRKSRC}/setup.py
+
+post-install:
+	@${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/doc/ply.html ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/doc/internal.html ${DOCSDIR}
+	@${MKDIR} ${EXAMPLESDIR}
+	${CP} -R ${WRKSRC}/example/ ${EXAMPLESDIR}
+
+.include <bsd.port.mk>


Property changes on: trunk/devel/py-ply/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/py-ply/distinfo
===================================================================
--- trunk/devel/py-ply/distinfo	                        (rev 0)
+++ trunk/devel/py-ply/distinfo	2015-11-07 01:03:21 UTC (rev 20662)
@@ -0,0 +1,2 @@
+SHA256 (ply-3.6.tar.gz) = 61367b9eb2f4b819f69ea116750305270f1df8859992c9e356d6a851f25a4b47
+SIZE (ply-3.6.tar.gz) = 281690


Property changes on: trunk/devel/py-ply/distinfo
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/py-ply/files/patch-CHANGES
===================================================================
--- trunk/devel/py-ply/files/patch-CHANGES	                        (rev 0)
+++ trunk/devel/py-ply/files/patch-CHANGES	2015-11-07 01:03:21 UTC (rev 20662)
@@ -0,0 +1,12 @@
+--- CHANGES.orig	2015-04-25 14:15:57 UTC
++++ CHANGES
+@@ -1,3 +1,9 @@
++Version 3.7
++---------------------
++05/07/15: beazley
++          Fixed regression in handling of table modules if specified as module
++          objects.   See https://github.com/dabeaz/ply/issues/63
++
+ Version 3.6
+ ---------------------
+ 04/25/15: beazley


Property changes on: trunk/devel/py-ply/files/patch-CHANGES
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/py-ply/files/patch-ply_lex.py
===================================================================
--- trunk/devel/py-ply/files/patch-ply_lex.py	                        (rev 0)
+++ trunk/devel/py-ply/files/patch-ply_lex.py	2015-11-07 01:03:21 UTC (rev 20662)
@@ -0,0 +1,82 @@
+--- ply/lex.py.orig	2015-04-26 21:17:41 UTC
++++ ply/lex.py
+@@ -171,7 +171,10 @@ class Lexer:
+     # ------------------------------------------------------------
+     # writetab() - Write lexer information to a table file
+     # ------------------------------------------------------------
+-    def writetab(self, basetabmodule, outputdir=''):
++    def writetab(self, lextab, outputdir=''):
++        if isinstance(lextab, types.ModuleType):
++            raise IOError("Won't overwrite existing lextab module")
++        basetabmodule = lextab.split('.')[-1]
+         filename = os.path.join(outputdir, basetabmodule) + '.py'
+         with open(filename, 'w') as tf:
+             tf.write('# %s.py. This file automatically created by PLY (version %s). Don\'t edit!\n' % (basetabmodule, __version__))
+@@ -856,6 +859,10 @@ class LexerReflect(object):
+ # -----------------------------------------------------------------------------
+ def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab',
+         reflags=0, nowarn=False, outputdir=None, debuglog=None, errorlog=None):
++
++    if lextab is None:
++        lextab = 'lextab'
++
+     global lexer
+ 
+     ldict = None
+@@ -885,29 +892,13 @@ def lex(module=None, object=None, debug=
+     else:
+         ldict = get_caller_module_dict(2)
+ 
+-    if outputdir is None:
+-        # If no output directory is set, the location of the output files
+-        # is determined according to the following rules:
+-        #     - If lextab specifies a package, files go into that package directory
+-        #     - Otherwise, files go in the same directory as the specifying module
+-        if '.' not in lextab:
+-            srcfile = ldict['__file__']
+-        else:
+-            parts = lextab.split('.')
+-            pkgname = '.'.join(parts[:-1])
+-            exec('import %s' % pkgname)
+-            srcfile = getattr(sys.modules[pkgname], '__file__', '')
+-        outputdir = os.path.dirname(srcfile)
+-
+     # Determine if the module is package of a package or not.
+     # If so, fix the tabmodule setting so that tables load correctly
+     pkg = ldict.get('__package__')
+-    if pkg:
++    if pkg and isinstance(lextab, str):
+         if '.' not in lextab:
+             lextab = pkg + '.' + lextab
+ 
+-    baselextab = lextab.split('.')[-1]
+-
+     # Collect parser information from the dictionary
+     linfo = LexerReflect(ldict, log=errorlog, reflags=reflags)
+     linfo.get_all()
+@@ -1029,8 +1020,24 @@ def lex(module=None, object=None, debug=
+ 
+     # If in optimize mode, we write the lextab
+     if lextab and optimize:
++        if outputdir is None:
++            # If no output directory is set, the location of the output files
++            # is determined according to the following rules:
++            #     - If lextab specifies a package, files go into that package directory
++            #     - Otherwise, files go in the same directory as the specifying module
++            if isinstance(lextab, types.ModuleType):
++                srcfile = lextab.__file__
++            else:
++                if '.' not in lextab:
++                    srcfile = ldict['__file__']
++                else:
++                    parts = lextab.split('.')
++                    pkgname = '.'.join(parts[:-1])
++                    exec('import %s' % pkgname)
++                    srcfile = getattr(sys.modules[pkgname], '__file__', '')
++            outputdir = os.path.dirname(srcfile)
+         try:
+-            lexobj.writetab(baselextab, outputdir)
++            lexobj.writetab(lextab, outputdir)
+         except IOError as e:
+             errorlog.warning("Couldn't write lextab module %r. %s" % (lextab, e))
+ 


Property changes on: trunk/devel/py-ply/files/patch-ply_lex.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/py-ply/files/patch-ply_yacc.py
===================================================================
--- trunk/devel/py-ply/files/patch-ply_yacc.py	                        (rev 0)
+++ trunk/devel/py-ply/files/patch-ply_yacc.py	2015-11-07 01:03:21 UTC (rev 20662)
@@ -0,0 +1,79 @@
+--- ply/yacc.py.orig	2015-04-26 21:19:12 UTC
++++ ply/yacc.py
+@@ -2692,7 +2692,11 @@ class LRGeneratedTable(LRTable):
+     # This function writes the LR parsing tables to a file
+     # -----------------------------------------------------------------------------
+ 
+-    def write_table(self, basemodulename, outputdir='', signature=''):
++    def write_table(self, tabmodule, outputdir='', signature=''):
++        if isinstance(tabmodule, types.ModuleType):
++            raise IOError("Won't overwrite existing tabmodule")
++
++        basemodulename = tabmodule.split('.')[-1]
+         filename = os.path.join(outputdir, basemodulename) + '.py'
+         try:
+             f = open(filename, 'w')
+@@ -2705,7 +2709,7 @@ _tabversion = %r
+ _lr_method = %r
+ 
+ _lr_signature = %r
+-    ''' % (filename, __tabversion__, self.lr_method, signature))
++    ''' % (os.path.basename(filename), __tabversion__, self.lr_method, signature))
+ 
+             # Change smaller to 0 to go back to original tables
+             smaller = 1
+@@ -3179,6 +3183,9 @@ def yacc(method='LALR', debug=yaccdebug,
+          check_recursion=True, optimize=False, write_tables=True, debugfile=debug_file,
+          outputdir=None, debuglog=None, errorlog=None, picklefile=None):
+ 
++    if tabmodule is None:
++        tabmodule = tab_module
++
+     # Reference to the parsing method of the last built parser
+     global parse
+ 
+@@ -3204,22 +3211,26 @@ def yacc(method='LALR', debug=yaccdebug,
+         # is determined according to the following rules:
+         #     - If tabmodule specifies a package, files go into that package directory
+         #     - Otherwise, files go in the same directory as the specifying module
+-        if '.' not in tabmodule:
+-            srcfile = pdict['__file__']
++        if isinstance(tabmodule, types.ModuleType):
++            srcfile = tabmodule.__file__
+         else:
+-            parts = tabmodule.split('.')
+-            pkgname = '.'.join(parts[:-1])
+-            exec('import %s' % pkgname)
+-            srcfile = getattr(sys.modules[pkgname], '__file__', '')
++            if '.' not in tabmodule:
++                srcfile = pdict['__file__']
++            else:
++                parts = tabmodule.split('.')
++                pkgname = '.'.join(parts[:-1])
++                exec('import %s' % pkgname)
++                srcfile = getattr(sys.modules[pkgname], '__file__', '')
+         outputdir = os.path.dirname(srcfile)
+ 
+     # Determine if the module is package of a package or not.
+     # If so, fix the tabmodule setting so that tables load correctly
+     pkg = pdict.get('__package__')
+-    if pkg and '.' not in tabmodule:
+-        tabmodule = pkg + '.' + tabmodule
++    if pkg and isinstance(tabmodule, str):
++        if '.' not in tabmodule:
++            tabmodule = pkg + '.' + tabmodule
++
+ 
+-    basetabmodule = tabmodule.split('.')[-1]
+ 
+     # Set start symbol if it's specified directly using an argument
+     if start is not None:
+@@ -3432,7 +3443,7 @@ def yacc(method='LALR', debug=yaccdebug,
+     # Write the table file if requested
+     if write_tables:
+         try:
+-            lr.write_table(basetabmodule, outputdir, signature)
++            lr.write_table(tabmodule, outputdir, signature)
+         except IOError as e:
+             errorlog.warning("Couldn't create %r. %s" % (tabmodule, e))
+ 


Property changes on: trunk/devel/py-ply/files/patch-ply_yacc.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/py-ply/pkg-descr
===================================================================
--- trunk/devel/py-ply/pkg-descr	                        (rev 0)
+++ trunk/devel/py-ply/pkg-descr	2015-11-07 01:03:21 UTC (rev 20662)
@@ -0,0 +1,9 @@
+PLY is a Python-only implementation of the popular compiler construction
+tools lex and yacc. The implementation borrows ideas from a number of
+previous efforts; most notably John Aycock's SPARK toolkit. However, the
+overall flavor of the implementation is more closely modeled after the C
+version of lex and yacc. The other significant feature of PLY is that it
+provides extensive input validation and error reporting--much more so than
+other Python parsing tools.
+
+WWW: http://www.dabeaz.com/ply/


Property changes on: trunk/devel/py-ply/pkg-descr
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/py-ply/pkg-plist
===================================================================
--- trunk/devel/py-ply/pkg-plist	                        (rev 0)
+++ trunk/devel/py-ply/pkg-plist	2015-11-07 01:03:21 UTC (rev 20662)
@@ -0,0 +1,47 @@
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ansic/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ansic/clex.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ansic/cparse.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calc/calc.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calc/parser.out
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calc/parsetab.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calceof/calc.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calcdebug/calc.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/classcalc/calc.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/classcalc/calc_Calc_parsetab.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/closurecalc/calc.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hedit/hedit.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/newclasscalc/calc.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/newclasscalc/calc_Calc_parsetab.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/optcalc/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/optcalc/calc.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/optcalc/lextab.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/optcalc/parser.out
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/optcalc/parsetab.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/unicalc/calc.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yply/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yply/ylex.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yply/yparse.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yply/yply.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/sqrt2.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/basiclex.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/basiclog.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/basinterp.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/basparse.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/dim.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/func.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/gcd.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/gosub.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/hello.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/linear.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/maxsin.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/powers.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/rand.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/sales.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/sears.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/sqrt1.bas
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/BASIC/basic.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/GardenSnake/GardenSnake.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/GardenSnake/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/cleanup.sh


Property changes on: trunk/devel/py-ply/pkg-plist
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list