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

checksums               rmd160  736a4411152f7276fdfeb3771d608c28594a7f7a \
                        sha256  d1903915325e6828bd40e5128fade94ca449077a746df1c0652b1a6916f3bcd1 \
                        size    13223697

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}
}
