# -*- 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         strasweb.fr:rudloff 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 "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
}