[78580] trunk/dports/lang

ryandesign at macports.org ryandesign at macports.org
Thu May 12 18:37:11 PDT 2011


Revision: 78580
          http://trac.macports.org/changeset/78580
Author:   ryandesign at macports.org
Date:     2011-05-12 18:37:11 -0700 (Thu, 12 May 2011)
Log Message:
-----------
jslint: new port, version 2011-05-10; see #29445

Added Paths:
-----------
    trunk/dports/lang/jslint/
    trunk/dports/lang/jslint/Portfile
    trunk/dports/lang/jslint/files/
    trunk/dports/lang/jslint/files/patch-jslint.js.diff

Added: trunk/dports/lang/jslint/Portfile
===================================================================
--- trunk/dports/lang/jslint/Portfile	                        (rev 0)
+++ trunk/dports/lang/jslint/Portfile	2011-05-13 01:37:11 UTC (rev 78580)
@@ -0,0 +1,42 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+
+name                jslint
+version             2011-05-10
+categories          lang
+maintainers         gmail.com:tael67 openmaintainer
+platforms           darwin
+supported_archs     noarch
+
+description         The JavaScript Code Quality Tool
+
+long_description    JSLint is a JavaScript program that looks for problems in \
+                    JavaScript programs. It is a code quality tool.
+
+homepage            http://www.jslint.com/
+fetch.type          git
+git.url             https://github.com/douglascrockford/JSLint.git
+git.branch          b38a8d9db9ead37fa812
+
+depends_lib         port:spidermonkey
+
+patchfiles          patch-jslint.js.diff
+
+post-patch {
+    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/jslint.js
+}
+
+configure {
+    if {[catch {exec ${prefix}/bin/js -e "new File();"} openerror]} {
+        ui_error "You need to install spidermonkey with the +fileobject variant in order to use ${name}."
+        return -code error "incompatible spidermonkey installation"
+    }
+}
+
+build {}
+
+destroot {
+    xinstall ${worksrcpath}/jslint.js ${destroot}${prefix}/bin/jslint
+}


Property changes on: trunk/dports/lang/jslint/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/lang/jslint/files/patch-jslint.js.diff
===================================================================
--- trunk/dports/lang/jslint/files/patch-jslint.js.diff	                        (rev 0)
+++ trunk/dports/lang/jslint/files/patch-jslint.js.diff	2011-05-13 01:37:11 UTC (rev 78580)
@@ -0,0 +1,45 @@
+--- jslint_old.js	2011-05-11 00:51:32.000000000 +0200
++++ jslint.js	2011-05-12 21:04:15.000000000 +0200
+@@ -1,3 +1,4 @@
++#!@PREFIX@/bin/js
+ // jslint.js
+ // 2011-05-10
+ 
+@@ -6674,4 +6675,34 @@
+ 
+     return itself;
+ 
+-}());
+\ No newline at end of file
++}());
++
++
++if(!arguments[0] || arguments[0]==="-h" || arguments[0]==="--help"){
++	print('Usage : "jslint myscript.js option[=true]"');
++}else{
++var file=new File(arguments[0]);	
++file.open("read", "text");
++var script=file.readAll();
++var i;
++var option= {};
++for (i = 1; i < arguments.length; i++) {
++	var splitoptions=arguments[i].split("=");
++	option[splitoptions[0]]=splitoptions[1]=="false"?false:true;
++}
++if(!JSLINT(script, option)){
++for (i = 0; i < JSLINT.errors.length; i++) {
++            var e = JSLINT.errors[i];
++            if (e) {
++                print('Error at line ' + (e.line + 1) + ' character ' + (e.character + 1) + ': ' + e.reason);
++                if(e.evidence){
++                print((e.evidence).replace(/^\s+/g,'').replace(/\s+$/g,''));
++                }
++                print('');
++            }
++        }
++
++}else{
++print("No error found");	
++}
++}
+\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110512/9d61c277/attachment-0001.html>


More information about the macports-changes mailing list