# -*- 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            syncthing syncthing-macos 1.0.0-2 v

checksums               rmd160  d03ca0944889cbd9cac7426cfc178cf45873734a \
                        sha256  3fb4bb66b836a3f0f33162eccfb65ae91ad0a56904b1a127a880183674160418 \
                        size    7482753

categories              net aqua
maintainers             {yan12125 @yan12125} openmaintainer

description             Frugal and native macOS Syncthing application bundle
long_description        ${description}

platforms               darwin
license                 MIT

depends_lib-append      port:syncthing

patchfiles              no-bundled-syncthing.patch

post-patch {
    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/syncthing/STApplication.m
}

use_configure           no

build {
    system -W ${build.dir} "make release"
}

destroot {
    copy ${build.dir}/Build/Products/Release/Syncthing.app ${destroot}${applications_dir}
}