# -*- 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        artempyanykh marksman 2024-12-18
github.tarball_from releases
revision            0

platforms           darwin
supported_archs     x86_64 arm64
categories          devel
license             MIT
maintainers         {judaew @judaew} openmaintainer

description         Write Markdown with code assist and intelligence in the \
                    comfort of your favourite editor
long_description    \
    Marksman is a program that integrates with your editor to assist you in \
    writing and maintaining your Markdown documents. Using LSP protocol it \
    provides completion, goto definition, find references, rename refactoring, \
    diagnostics, and more. In addition to regular Markdown, it also supports \
    wiki-link-style references that enable Zettelkasten-like1, 2 note taking.

distfiles           marksman-macos
checksums           rmd160  7cb2d1d760ffa10a0c36e41bd255f625b11cc508 \
                    sha256  ff006163615312703431584b7f32af4eb6ae2537e907ed2ca93c50d489cb8373 \
                    size    41041472

if {${os.major} < 10 && ${os.platform} eq "darwin"} {
    known_fail yes

    # https://github.com/macports/macports-ports/commit/e273bb134e991080544b1372ffb3f540e6aef418
    pre-fetch {
        ui_error "${name} ${version} requires macOS 10.5 or newer."
        return -code error "incompatible macOS version"
    }
}

extract.mkdir       yes

extract {
    copy ${distpath}/marksman-macos ${worksrcpath}/marksman-macos
}

use_configure       no
build {}

destroot {
    xinstall -m 0755 ${worksrcpath}/marksman-macos \
        ${destroot}${prefix}/bin/marksman
}
