[114719] trunk/dports/java/javacc

mww at macports.org mww at macports.org
Sat Dec 14 01:03:38 PST 2013


Revision: 114719
          https://trac.macports.org/changeset/114719
Author:   mww at macports.org
Date:     2013-12-14 01:03:38 -0800 (Sat, 14 Dec 2013)
Log Message:
-----------
javacc: version 6.0

Modified Paths:
--------------
    trunk/dports/java/javacc/Portfile

Added Paths:
-----------
    trunk/dports/java/javacc/files/
    trunk/dports/java/javacc/files/javacc
    trunk/dports/java/javacc/files/jjdoc
    trunk/dports/java/javacc/files/jjrun
    trunk/dports/java/javacc/files/jjtree

Modified: trunk/dports/java/javacc/Portfile
===================================================================
--- trunk/dports/java/javacc/Portfile	2013-12-14 08:42:55 UTC (rev 114718)
+++ trunk/dports/java/javacc/Portfile	2013-12-14 09:03:38 UTC (rev 114719)
@@ -3,8 +3,7 @@
 PortSystem 1.0
 
 name                javacc
-version             5.0
-revision            2
+version             6.0
 categories          java lang devel
 platforms           darwin
 maintainers         mww
@@ -20,17 +19,22 @@
 
 homepage            http://javacc.java.net/
 master_sites        http://java.net/projects/javacc/downloads/download/
-checksums           md5     ec3738abfa889c94a82f56453633d6bc \
-                    sha1    ac9f7833bdd427d05c8364406ff82ee7cab4f86f \
-                    rmd160  b7d6b5794619fb66a342935ab0644d231c39fb42
-dist_subdir         ${name}/${version}
+checksums           rmd160  bac11ae2993642b254e4b90303e15de3599295eb \
+                    sha256  4147023112d0a959756e9cfab93c33b5d940b58692a39a6785897e4be85e16a6
 
+use_zip             yes
+
+post-extract {
+    # these wrappers are missing in the v6.0 zip-file
+    file copy ${filespath}/javacc ${filespath}/jjdoc ${filespath}/jjrun ${filespath}/jjtree \
+        ${worksrcpath}/bin
+}
+
 configure {
-    reinplace "s|`dirname \$0`/lib|${prefix}/share/java|g" \
-        ${worksrcpath}/bin/javacc ${worksrcpath}/bin/jjtree \
-        ${worksrcpath}/bin/jjdoc
+    reinplace "s|@JAR@|${prefix}/share/java/javacc.jar|g" \
+        ${worksrcpath}/bin/javacc ${worksrcpath}/bin/jjdoc ${worksrcpath}/bin/jjtree
 }
-
+    
 build {}
 
 destroot {
@@ -39,7 +43,7 @@
     file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
     xinstall -m 644 ${worksrcpath}/bin/lib/javacc.jar \
         ${destroot}${prefix}/share/java/
-    xinstall -m 755 -W ${worksrcpath}/bin javacc jjdoc jjtree \
+    xinstall -m 755 -W ${worksrcpath}/bin javacc jjdoc jjtree jjrun \
         ${destroot}${prefix}/bin
     xinstall -m 644 -W ${worksrcpath} LICENSE \
         ${destroot}${prefix}/share/doc/${name}
@@ -47,4 +51,5 @@
 
 livecheck.type      regex
 livecheck.url       ${homepage}
-livecheck.regex     javacc-(\[0-9\.\]+).tar.gz
+livecheck.regex     javacc-(\[0-9\.\]+).zip
+

Added: trunk/dports/java/javacc/files/javacc
===================================================================
--- trunk/dports/java/javacc/files/javacc	                        (rev 0)
+++ trunk/dports/java/javacc/files/javacc	2013-12-14 09:03:38 UTC (rev 114719)
@@ -0,0 +1,9 @@
+#!/bin/sh
+JAR="@JAR@"
+
+case "`uname`" in
+     CYGWIN*) JAR="`cygpath --windows -- "$JAR"`" ;;
+esac
+
+java -classpath "$JAR" javacc "$@"
+

Added: trunk/dports/java/javacc/files/jjdoc
===================================================================
--- trunk/dports/java/javacc/files/jjdoc	                        (rev 0)
+++ trunk/dports/java/javacc/files/jjdoc	2013-12-14 09:03:38 UTC (rev 114719)
@@ -0,0 +1,9 @@
+#!/bin/sh
+JAR="@JAR@"
+
+case "`uname`" in
+     CYGWIN*) JAR="`cygpath --windows -- "$JAR"`" ;;
+esac
+
+java -classpath "$JAR" jjdoc "$@"
+

Added: trunk/dports/java/javacc/files/jjrun
===================================================================
--- trunk/dports/java/javacc/files/jjrun	                        (rev 0)
+++ trunk/dports/java/javacc/files/jjrun	2013-12-14 09:03:38 UTC (rev 114719)
@@ -0,0 +1,179 @@
+#!/bin/sh
+####################################################################
+#
+#   Copyright (C) 2006   Andrew Tomazos <andrew at tomazos.com>
+#
+#	This program is free software; you can redistribute it and/or
+#	modify it under the terms of the GNU General Public License
+#	as published by the Free Software Foundation; either version 2
+#	of the License, or (at your option) any later version.
+#
+####################################################################
+#
+#	jjrun 1.0d1
+#
+#	- Build and execute a JavaCC .jj file in one command
+#
+#	- Requires javacc, java, make and sh
+#
+#	- TODO: If you use something other than SimpleCharStream you
+#	  will need to modify the OBJECTS variable below
+#
+#	- TODO: Only tested on GNU/Linux
+#
+####################################################################
+
+# $PROGFILE: This programs file path
+PROGFILE=$0
+
+# $VERSION: This programs version
+VERSION=1.0d1
+
+# $PROGNAME: This programs name
+PROGNAME=`basename $0`
+
+# If project not specified output usage and exit
+if [ ! $1 ]
+then
+	echo "USAGE: $PROGNAME <jjfile>"
+	exit 1
+fi
+
+# $PROJECT: The jj file to run
+PROJECT=`basename $1 .jj`
+
+# $MAKEFILE: An automatically generated makefile
+MAKEFILE=$PROJECT.mk
+
+# $FORCE: forces the regeneration of the makefile
+FORCE=$2
+
+
+# If the specified project does not exist than exit
+if [ ! -f $PROJECT.jj ]
+then
+	echo ERROR: $PROGNAME: File not found $PROJECT.jj
+	exit 1
+fi
+
+# If forcing makefile regeneration than delete the makefile
+if [ $FORCE ]
+then
+	rm $MAKEFILE
+fi
+
+# If the makefile does not exist than generate it
+if [ ! -f $MAKEFILE ]
+then
+	echo $PROGNAME: Generating $MAKEFILE...
+
+#### START jjrun_makefile_header_here_doc
+cat > $MAKEFILE <<jjrun_makefile_header_here_doc
+# Automatically generated makefile for $PROJECT by $PROGNAME $VERSION
+
+#   Copyright (C) 2006   Andrew Tomazos <andrew at tomazos.com>
+#
+#	This program is free software; you can redistribute it and/or
+#	modify it under the terms of the GNU General Public License
+#	as published by the Free Software Foundation; either version 2
+#	of the License, or (at your option) any later version.
+
+# ${PROJECT}: Name of the project
+PROJECT=$PROJECT
+
+# ${MAKEFILE}: Filename of this makefile
+MAKEFILE=$MAKEFILE
+
+# ${PROGFILE}: Filepath of $PROGNAME
+PROGFILE=$PROGFILE
+
+jjrun_makefile_header_here_doc
+#### END jjrun_makefile_header_here_doc
+
+#### START jjrun_makefile_main_here_doc
+cat >> $MAKEFILE <<'jjrun_makefile_main_here_doc'
+
+# ${JJ}: The original .jj file
+JJ=${PROJECT}.jj
+
+# ${AUTOGENS}: The automatically generated classed of javacc
+AUTOGENS=					\
+	${PROJECT}				\
+	${PROJECT}Constants		\
+	${PROJECT}TokenManager
+
+# ${BOILERS}: The boilerplate classes generated by javacc
+BOILERS=					\
+	SimpleCharStream		\
+	ParseException			\
+	Token					\
+	TokenMgrError
+
+# ${OBJECTS}: The names of the classes output by javacc
+OBJECTS=${AUTOGENS} ${BOILERS} 
+
+# ${BOILERSOURCES}: The boilerplater sources files output by javacc
+BOILERSOURCES=$(addsuffix .java, ${BOILERS})
+
+# ${SOURCES}: The source files output by javacc
+SOURCES=$(addsuffix .java, ${OBJECTS})
+
+# ${CLASSES}: The class files compiled with javac from the output of javacc
+CLASSES=$(addsuffix .class, ${OBJECTS})
+
+# ${MANIFEST}: filename of the manifest for the final jar file
+MANIFEST=${PROJECT}.mf
+
+# ${JAR}: filename of the final jar file
+JAR=${PROJECT}.jar
+
+# make build rule to make JAR
+build: ${JAR}
+
+# make ${JAR}: build the jar file 
+${JAR}: ${SOURCES} ${MANIFEST}
+	@echo ${MAKEFILE}: Building ${JAR}...
+	javac ${SOURCES}
+	jar cvfm ${JAR} ${MANIFEST} ${CLASSES}
+	rm ${CLASSES}
+
+# make clean: remove all generated jar files
+clean:
+	@echo ${MAKEFILE}: Cleaning ${PROJECT}...
+	@-rm ${JAR} ${SOURCES} ${MANIFEST}
+
+# make ${SOURCES}: compile the jj file into java sources
+${SOURCES}: ${JJ}
+	@echo ${MAKEFILE}: Compiling ${JJ}...
+	@javacc ${JJ}
+	touch -c ${BOILERSOURCES}
+
+# make ${MANIFEST}: rule to make
+${MANIFEST}:
+	@echo ${MAKEFILE}: Creating manifest...
+	@echo Manifest-Version: 1.0 > ${MANIFEST}
+	@echo Main-Class: ${PROJECT} >> ${MANIFEST}
+
+${MAKEFILE}: ${PROGFILE}
+	@echo ${MAKEFILE}: Regenerating ${MAKEFILE}
+	@${PROGFILE} ${PROJECT} FORCE
+
+jjrun_makefile_main_here_doc
+# END jjrun_makefile_main_here_doc
+
+fi
+
+# If this was a forced regeneration than stop here
+if [ $FORCE ]
+then
+	exit 0
+fi
+
+# Execute the makefile to rebuild the jar file if necessary
+echo $PROGNAME: Executing $MAKEFILE...
+make -f $MAKEFILE
+
+# Execute the jar file
+echo $PROGNAME: Executing $PROJECT.jar...
+java -jar $PROJECT.jar
+

Added: trunk/dports/java/javacc/files/jjtree
===================================================================
--- trunk/dports/java/javacc/files/jjtree	                        (rev 0)
+++ trunk/dports/java/javacc/files/jjtree	2013-12-14 09:03:38 UTC (rev 114719)
@@ -0,0 +1,9 @@
+#!/bin/sh
+JAR="@JAR@"
+
+case "`uname`" in
+     CYGWIN*) JAR="`cygpath --windows -- "$JAR"`" ;;
+esac
+
+java -classpath "$JAR" jjtree "$@"
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20131214/ba99b431/attachment.html>


More information about the macports-changes mailing list