# -*- 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 68172 2010-05-28 12:20:20Z raphael@macports.org $

PortSystem          1.0

name                xforms
version             1.0.93sp1
categories          x11
maintainers         raphael openmaintainer
description         A graphical user interface toolkit for X based on the X11 \
                    Xlib library
long_description    XForms is a graphical user interface toolkit for X based on \
                    the X11 Xlib library. It's written in C and allows to easily \
                    write GUIs for programs. For that it comes with a lot of \
                    widgets (buttons, menus, input fields, scrollbars, you name \
                    it) as well as fdesign, a tool that lets you create a GUI \
                    using a GUI. In addition, the library is extensible and new \
                    objects can easily be created and added to the library.
homepage            http://xforms-toolkit.org/
license             LGPL-2.1
platforms           darwin
master_sites        savannah
livecheck.url       http://download.savannah.gnu.org/releases-noredirect/${name}/
livecheck.regex     "${name}-((\[0-9\\.\]+)(sp\[0-9\]+)?)\\${extract.suffix}"

distfiles-append    ${name}.html${extract.suffix} \
                    ${name}.pdf
dist_subdir         ${name}/${version}_${revision}

checksums           ${distname}${extract.suffix} \
                        md5     68ed76216be9b09032e22736d95c8b3c \
                        sha1    a2c52f44ef4b20fc9002615f978eb49c79f63cd2 \
                        rmd160  cb094dbeb96b5adaa105e8f53ddbe5e452a0978e \
                    ${name}.html${extract.suffix} \
                        md5     d89e634753ad349b281b072c84182aa6 \
                        sha1    7faa22e809dfec207931237bebd1572ff0a488c1 \
                        rmd160  1c2054aeead5031bff8fcdd5f38715247d0b62e7 \
                    ${name}.pdf \
                        md5     0080f2d50d76b8245bd63ee1d821b147 \
                        sha1    187e653fbae01f4652e2aa35a8f4806b4ae5abbc \
                        rmd160  e49a6f0d8485f72ef2ab93dba7e6f23b3132b9d9

depends_lib         port:xorg-libsm \
	            port:xorg-libXau \
                    port:xorg-libXdmcp \
                    port:xorg-libX11 \
                    port:xpm \
                    port:gettext \
                    port:libiconv \
                    port:mesa \
	            port:jpeg
depends_build       port:automake \
                    port:autoconf

extract.only-delete ${name}.pdf

patchfiles          patch-lib_Makefile.am.diff \
                    patch-gl_Makefile.am.diff \
                    patch-image_Makefile.am.diff

pre-configure {     system "cd ${worksrcpath} && ./autogen.sh"
}
configure.args      --enable-demos

post-destroot {     set docdir ${destroot}${prefix}/share/doc/${name}
                    xinstall -d ${docdir}
                    xinstall -m 644 -W ${worksrcpath} \
                        COPYING.LIB \
                        ChangeLog \
                        Copyright \
                        NEWS \
                        README \
                        ${docdir}
                    copy ${workpath}/${name}.html ${docdir}
                    copy ${prefix}/var/macports/distfiles/${dist_subdir}/${name}.pdf ${docdir}
                    system "cd ${worksrcpath}/demos && make mostlyclean"
                    xinstall -d ${destroot}${prefix}/share/${name}
                    copy ${worksrcpath}/demos \
                        ${destroot}${prefix}/share/${name}/
}

# not trivial to autoreconf
universal_variant no
