# -*- 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: Portfile 115596 2014-01-06 17:12:09Z cal@macports.org $

PortSystem              1.0

name                    nxcomp
version                 3.5.0.22
checksums               rmd160  c47b608015bd7302269f383392801c56327670f4 \
                        sha256  d5c62932ef6ad9c852ac555949467571c71aa0973cc7130b5b204588957b4dac

categories              net
platforms               darwin
license                 GPL-2

maintainers             cal 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 x2go.

homepage                http://www.nomachine.com/
master_sites            http://code.x2go.org/releases/source/nx-libs/
distname                nx-libs-${version}-lite

universal_variant       yes
supported_archs         ppc i386 x86_64

depends_build           port:makedepend

use_autoreconf          yes

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

if {${name} eq ${subport}} {
    revision            1

    depends_lib-append  port:libpng \
                        port:jpeg \
                        port:zlib \
                        port:xorg-xproto

    worksrcdir          nx-libs-${version}/nxcomp

    patchfiles          patch-nxcomp__configure.in.diff \
                        patch-nxcomp__Makefile.in.diff \
                        patch-nxcomp__Types.h-dont-use-STL-internals-on-libc++.diff

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

subport nxproxy {
    revision            0
    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 x2go.

    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
}
