# -*- 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
# $Id$

PortSystem              1.0

name                    nxcomp
version                 3.5.0.32
revision                0
checksums               rmd160  586897c72b64afd26ad78648efef70320784e49e \
                        sha256  b5ab9f0ae35cdf6c3e26484d2a2ca55cd0225b6d8693f5544a096b19585bc50a

categories              net
platforms               darwin
license                 GPL-2

maintainers             ionic openmaintainer

description             nxcomp is the X compression library by NX
long_description        nxcomp is a library compressing X commands to be passed over network \
                        for use with the X2Go suite.

homepage                http://wiki.x2go.org/doku.php/wiki:libs:nx-libs
master_sites            http://code.x2go.org/releases/source/nx-libs/
distname                nx-libs-${version}-lite

universal_variant       yes
supported_archs         ppc i386 x86_64

use_autoreconf          yes

configure.cxxflags-append \
                        -I${prefix}/include

if {${name} eq ${subport}} {
    depends_lib-append  port:libpng \
                        path:lib/libjpeg.dylib:jpeg \
                        port:zlib \
                        port:xorg-xproto

    worksrcdir          nx-libs-${version}/nxcomp

    if {${os.major} < 10} {
        patchfiles          patch-nxcomp_cp-compat-for-10.5-.diff
    }

    livecheck.url       [lindex ${master_sites} 0]
    livecheck.regex     nx-libs-(\[0-9\]+(\\.\[0-9\]+)+(-\[0-9\]+)?)-lite
} else {
    livecheck.type      none
}

subport nxproxy {
    description         nxproxy is a compressing proxy for X
    long_description    nxproxy is a library compressing X commands to be passed over network \
                        for use with the X2Go suite.

    depends_lib-append  port:nxcomp

    worksrcdir          nx-libs-${version}/nxproxy

    patchfiles          patch-nxproxy_configure.in.diff \
                        patch-nxproxy_Makefile.in.diff

    configure.ldflags-append \
                        -L${prefix}/lib/nx
}