# -*- 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        Parallels docker-machine-parallels 2.0.1 v
revision            1
github.tarball_from archive

# stealth update; remove for next version
dist_subdir         ${name}/${version}_1

platforms           {darwin >= 17}
categories          devel
license             Apache-2
maintainers         {danchr @danchr} openmaintainer
description         Parallels driver for Docker Machine
long_description    A plugin for Docker Machine allowing to create \
                    Docker hosts locally on Parallels Desktop for Mac

checksums           rmd160  b020e17f6d5dabec0031663bdcb9338da1ad006f \
                    sha256  af52903482bff0f13200cc5aca39037cd8625cc663120e1e4d3be13aeda2720d \
                    size    17425

# Fix go build args; ultimately port should be simplified via pg golang
patchfiles-append   patch-makefile.diff

depends_build-append \
                    port:go

depends_lib-append \
                    port:docker-machine

set port_src_path_author \
                    src/github.com/${github.author}
set port_src_path_project \
                    ${port_src_path_author}/${github.project}

build.target        build
build.env           GOPATH=${workpath}/go
build.dir           ${workpath}/go/${port_src_path_project}

# what kind of tool does this?
configure {
    file mkdir ${workpath}/go/${port_src_path_author}
    ln -sf ${worksrcpath} ${workpath}/go/${port_src_path_project}
    file mkdir ${worksrcpath}/${port_src_path_author}
    ln -sf ${worksrcpath} ${worksrcpath}/${port_src_path_project}
}

destroot {
    xinstall -d ${destroot}${prefix}/bin
    xinstall -m 755 {*}[glob ${worksrcpath}/bin/docker-machine-driver-parallels] ${destroot}${prefix}/bin/
}
