# $Id: Portfile 64763 2010-03-15 16:31:33Z nox@macports.org $

PortSystem      1.0

name            fltk
version         1.1.10
revision        1
categories      aqua devel
platforms       macosx
maintainers     alakazam openmaintainer
description     Fast Light Tool Kit

long_description \
    FLTK (pronounced fulltick) \
    is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), \
    Microsoft Windows, and Mac OS X. \
    FLTK provides modern GUI functionality without the bloat \
    and supports 3D graphics via OpenGL and \
    its built-in GLUT emulation. \
    \
    FLTK is designed to be small and modular enough to be \
    statically linked, but works fine as a shared library. \
    FLTK also includes an excellent UI builder called FLUID \
    that can be used to create applications in minutes.

homepage        http://www.fltk.org/
master_sites    http://ftp.easysw.com/pub/fltk/${version}/
worksrcdir      ${name}-${version}
distname        ${worksrcdir}-source
use_bzip2       yes

checksums       md5     a1765594bc427ff892e36089fe1fa672 \
                sha1    0d2b34fede91fa78eeaefb893dd70282f73908a8 \
                rmd160  f8fc4371811efcc0d6fc73edd0525d8ff87a4faa

depends_lib     port:jpeg \
                port:libpng \
                port:zlib

universal_variant no

post-patch {
    reinplace "s|/Applications|${applications_dir}/${name}|g" \
        ${worksrcpath}/fluid/Makefile \
        ${worksrcpath}/test/Makefile
}

configure.args  --enable-threads \
                --mandir=${prefix}/share/man

# Force 32-bit (#21054)
if {${build_arch} == "x86_64"} {
    configure.build_arch i386
    configure.args-append   --with-archflags="-arch i386"
} elseif {${build_arch} == "ppc64"} {
    configure.build_arch ppc
    configure.args-append   --with-archflags="-arch ppc"
}

use_parallel_build  yes

destroot.target install \
                install-desktop

livecheck.type  regexm
livecheck.url   ${homepage}
livecheck.regex "Stable Release.*?\n.*?VERSION=(\\d+(\\.\\d+)*)'"
