# $Id: Portfile 63233 2010-01-30 11:57:15Z nox@macports.org $

PortSystem      1.0

name            libsdl_net
set my_name     SDL_net
version         1.2.7
platforms       macosx
categories      devel net
maintainers     nox openmaintainer
description     cross-platform networking library

long_description \
    This is a small sample cross-platform networking library, with a sample chat client and server \
    application. The chat client uses the GUIlib GUI framework library.

homepage        http://www.libsdl.org/projects/SDL_net/
master_sites    ${homepage}release/
distname        ${my_name}-${version}

checksums       md5 6bd4662d1423810f3140d4da21b6d912 \
                sha1 b46c7e3221621cc34fec1238f1b5f0ce8972274d \
                rmd160 5c95cf28f35ceb796188323666b92cafa60fba25

post-patch {
    # SDL_byteorder.h is deprecated and SDL_endian.h should be used directly
    # instead. This fixes building when using libsdl-devel.
    reinplace s/byteorder/endian/ ${worksrcpath}/SDLnet.c
}

depends_lib     path:lib/pkgconfig/sdl.pc:libsdl

configure.args  --disable-sdltest

post-destroot {
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} CHANGES COPYING README \
        ${destroot}${prefix}/share/doc/${name}
}

livecheck.type  regex
livecheck.url   ${homepage}
livecheck.regex ${my_name}-(\\d+(?:\\.\\d+)*)
