# -*- 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

PortSystem          1.0

name                web-ext
version             5.4.1
revision            0
checksums           rmd160  10d3b7eac6061c70d887961b211795388f545d2b \
                    sha256  09a0d33b3b2216e1d6de202e3cdfcd36ffabbe9436434bea0628678c6bdeaec3 \
                    size    76394

categories          devel
maintainers         nomaintainer
license             MPL-2
description         A command line tool to help build, run, and test web extensions

long_description    {*}${description}

homepage            https://github.com/mozilla/web-ext
master_sites        https://registry.npmjs.org/${name}/-

extract.suffix      .tgz

platforms           darwin

depends_lib-append  path:bin/node:nodejs14

depends_build-append \
                    path:bin/npm:npm6

worksrcdir          package

use_configure       no

build               {}

destroot {
    xinstall -m 755 -d "${destroot}${prefix}/lib/node_modules"
    file copy "${worksrcpath}" "${destroot}${prefix}/lib/node_modules/${name}"
    system -W "${destroot}${prefix}/lib/node_modules/${name}" "npm install --production"
    ln -s ${prefix}/lib/node_modules/.bin/${name} ${destroot}${prefix}/bin/${name}
}

livecheck.type      regex
livecheck.url       https://registry.npmjs.org/${name}
livecheck.regex     {"latest":"(.*?)"}
