# -*- 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
PortGroup           openssl 1.0
PortGroup           qmake 1.0

openssl.branch      1.0

github.setup        nark Deriv 005f17573854dd034f7077a50967f655cfd8b3ef
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version             2014.04.22
revision            0

categories          www
license             GPL-2
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer

description         Cross-platform client for Wired 2.0 
long_description    Deriv is full graphical and cross-platform client for the Wired 2.0 protocol. \
                    It is built against libwired and Qt frameworks.

checksums           rmd160  078cb86639dc28c8f7cd050a1f0dfc7fb6193c18 \
                    sha256  061f6322986bd6b3861e07abc76cb648d2b6d80f072f90b0657a69a1e847a89c \
                    size    1792221

depends_build-append \
                    path:bin/cmake:cmake

depends_lib-append  port:libiconv \
                    port:libwired \
                    port:libxml2 \
                    port:ncurses \
                    port:qt4-mac \
                    port:qtkeychain-qt4 \
                    port:sqlite3 \
                    port:zlib

compiler.blacklist-append *gcc-4.* {clang < 421}

# Trash the pre-built lib.
post-extract {
    delete ${worksrcpath}/libwired
    delete ${worksrcpath}/qtkeychain
    delete ${worksrcpath}/qtkeychain-build
}

post-patch {
    reinplace "s,@PREFIX@,${prefix},g" ${worksrcpath}/Deriv.pro
}

# Build against Macports libwired:
patchfiles-append   patch-fix-linking.diff

pre-configure {
    system -W ${worksrcpath} "${qt_lrelease_cmd} ${name}.pro"
}

destroot {
    move ${worksrcpath}/${name}.app ${destroot}${applications_dir}/${name}.app
}
