# -*- 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 2.0.14+1 v
github.tarball_from     archive
revision                0

checksums               rmd160  0d1e9beaa1386f507dee8070926e54fa04abeb1e \
                        sha256  ed2ed3e059eee3e54574811e2190493c6c5efc234c1eb738d462b25f84452b4b \
                        size    13230507

categories              net aqua
installs_libs           no
license                 MIT
maintainers             {gmail.com:herby.gillot @herbygillot} \
                        openmaintainer

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

depends_lib-append      port:syncthing

patchfiles-append       patch-no-bundled-syncthing.diff \
                        patch-disable-autoupdatechecks.diff

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

use_configure           no
use_xcode               yes

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

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