# $Id: Portfile 88374 2011-12-29 23:08:46Z jeremyhu@macports.org $

PortSystem      1.0

name            openmotif
version         2.3.3
set branch      [join [lrange [split ${version} .] 0 1] .]
set subdir      [lindex [split ${version} -] 0]
worksrcdir      ${name}-${subdir}
categories      x11
license         Restrictive
platforms       darwin
maintainers     nomaintainer
description     The Open Motif toolkit for X11

long_description \
    This is The Open Group's full version of Motif based on \
    the original OSF sources.

homepage        http://www.motifzone.net/
conflicts       lesstif
master_sites    http://ftp.ics.com/openmotif/${branch}/${subdir}/ \
                ftp://ftp.ics.com/openmotif/${branch}/${subdir}/
fetch.use_epsv  no

checksums           sha1    2a51e2f28078c4db7ff0c8517eb257001716b699 \
                    rmd160  015323e212e91ea3beaf039593de5ba75b01e4a6 \
                    sha256  c85f5545e218fa0c59a3789192132d472fc5a33e914a221a568eee4fc10cd103

depends_build \
	port:pkgconfig \
	port:xbitmaps

depends_lib \
	port:jpeg \
	port:libpng \
	port:libiconv \
	port:xorg-libsm \
	port:xorg-libXext \
	port:Xft2 \
	port:xorg-libXmu \
	port:xorg-libXp \
	port:xorg-libXt

patchfiles      patch-uintptr_t-cast.diff \
                patch-lib-XmP.h.diff \
                patch-clients-uil-UilDefI.h.diff

post-patch {
    reinplace "s|iconv_open|libiconv_open|g" ${worksrcpath}/configure
    reinplace -E "/^LDFLAGS/s|\$| @LDFLAGS@|" ${worksrcpath}/lib/Xm/Makefile.in
}

configure.args  --mandir=${prefix}/share/man	\
                --enable-xft	\
                --enable-jpeg	\
                --enable-png \
                --x-includes=${prefix}/include \
                --x-libraries=${prefix}/lib

use_parallel_build  no
build.env       LANG=C

post-destroot {
    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} BUGREPORT COPYRIGHT.MOTIF ChangeLog LICENSE \
        README RELNOTES TODO ${destroot}${docdir}
}

livecheck.type  none
