# -*- 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
PortGroup           github 1.0

github.setup        denoland deno 2.5.5 v
github.tarball_from releases
revision            0

homepage            https://deno.land

description         Deno is a simple, modern and secure runtime for \
                    JavaScript and TypeScript that uses V8 and is built in \
                    Rust.

long_description    Deno is a secure runtime for JavaScript and TypeScript. \
                    It is secure by default, performs no file, network, or \
                    environment access, unless explicitly enabled, and \
                    supports TypeScript out of the box. Deno has built-in \
                    utilities like a dependency inspector (deno info) and a \
                    code formatter (deno fmt), with a set of reviewed \
                    (audited) standard modules that are guaranteed to work \
                    with Deno.

categories          devel
installs_libs       no
license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer
supported_archs     arm64 x86_64

# https://trac.macports.org/ticket/73050
# building from source is too complicated, legacysupport doesn't help
platforms           {darwin >= 16}

checksums           ${name}-x86_64-apple-darwin.zip \
                    rmd160  6e42176e76c1c52ecdbcfcffc83e9980d4b66750 \
                    sha256  e4bfeb8d5c3cd39ccd0943be4b8b9d190132bd28ed09b25eb6c1356f0142dec6 \
                    size    43267305 \
                    ${name}-aarch64-apple-darwin.zip \
                    rmd160  ade6b6d44c0c7cc7d3af7a7ec9d21de5c946d879 \
                    sha256  8c7cb0ab4eca5359ae89894a70c63e995c0750f9ed31fedd8553d8d2872b6543 \
                    size    40635765

if {${build_arch} eq "arm64"} {
    set release_arch aarch64
} else {
    set release_arch x86_64
}

distname            ${name}-${release_arch}-apple-darwin
dist_subdir         ${name}/${version}
extract.mkdir       yes

installs_libs       no
use_configure       no
use_zip             yes

# No build process as we are currently using the pre-built binary for now.
#
# To build from source, we'll need the 3rd-party and typescript repos as
# submodules, and we'll also need V8 (requiring Python2):
#
# - https://deno.land/manual/contributing/building_from_source
build               {}

destroot {
    xinstall -m 0755 ${worksrcpath}/deno ${destroot}${prefix}/bin/
}
