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

github.setup        fwcd kotlin-language-server 1.3.13
revision            0
categories          devel java

supported_archs     noarch
platforms           {darwin any}
maintainers         {amake @amake} openmaintainer
license             MIT

description         Kotlin code completion, linting and more for any editor/IDE \
                    using the Language Server Protocol

long_description    {*}${description}

checksums           rmd160  ec8741fe655aa12ba6f034ce2ce32403cdd0d3c1 \
                    sha256  4fe7d71d087b307c7869036171bd9d8c6a4284cd7c25b89098b0a24eb2d9b6d2 \
                    size    87291855

github.tarball_from releases
distname            server
dist_subdir         ${name}/${version}

java.version        11+
java.fallback       openjdk17

use_zip             yes
use_configure       no

build {}

pre-destroot {
    delete {*}[glob ${worksrcpath}/bin/*.bat]
}

destroot {
    xinstall -m 0755 -d ${destroot}${prefix}/share/java
    file copy ${worksrcpath} \
         ${destroot}${prefix}/share/java/${name}

    foreach f [glob -tails -directory ${destroot}${prefix}/share/java/${name}/bin *] {
        ln -s ../share/java/${name}/bin/${f} ${destroot}${prefix}/bin/${f}
    }
}
