# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem      1.0
PortGroup       github 1.0
PortGroup       openssl 1.0
PortGroup       qmake 1.0

github.setup    abdularis LAN-Share b1db903d092d6610fd90dfa0b412d555ba9550ce
version         1.2.1
name            [string tolower ${github.project}]
revision        0
categories      net
maintainers     {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license         GPL-3

description     Cross platform LAN File transfer application built with Qt C++ framework
long_description \
                {*}${description}

checksums       rmd160  e2e53f4e5a1203f3004b7170e08770fe96dd2663 \
                sha256  1a9cfc1f5136766b9926d256203f17c4facabbc9ce5d966550463dede5adacc0 \
                size    216983
github.tarball_from archive

patch.pre_args-replace  -p0 -p1

patchfiles      qt4-compatibility.patch
# devicebroadcaster.cpp:69:37: error: 'numeric_limits' is not a member of 'std'
patchfiles-append \
                patch-includes.diff
# Fix runtime warnings:
patchfiles-append \
                qt4-slot-fixes.patch
# Fix runtime crash:
platform powerpc {
    patchfiles-append \
                ppc32-qjson-fix.patch
}

depends_lib-append \
                port:qjson4

compiler.cxx_standard \
                2011

configure.args-append \
                ${worksrcpath}/src/LANShare.pro

# Hack around a bug in qmake:
# g++-mp-14: error: unrecognized command-line option '-Xarch_ppc64'
if {${os.platform} eq "darwin" && ${configure.build_arch} eq "ppc64"} {
    post-configure {
        reinplace "s|-Xarch_ppc64||g" ${worksrcpath}/Makefile
    }
}

destroot {
    copy ${worksrcpath}/LANShare.app ${destroot}${applications_dir}/
}
