# $Id: Portfile 92542 2012-05-01 01:00:14Z jeremyhu@macports.org $

PortSystem 1.0

name		quartz-wm
version		1.3.1
categories	x11
maintainers	jeremyhu openmaintainer
description     Apple's Window Manager for X11
homepage	http://xquartz.macosforge.org
platforms	macosx
long_description quartz-wm is the XQuartz window-manager.
master_sites	${homepage}/downloads/src
license         APSL-2

checksums       sha1    cb627148636202795104a196fd7dcb2197c22fa3 \
                rmd160  bbc18e5cb4ebe6d3bb02f8209ad37e265122e7a1 \
                sha256  e91565c810865a1585a2f876427a4d4597890eb7cae0ae870e5ec17cee681fc9

use_xz          yes

depends_build   port:pkgconfig  \
                port:xorg-util-macros

depends_lib     port:xorg-libXinerama \
                port:xorg-libXrandr \
                port:xorg-libAppleWM \
                path:lib/pkgconfig/pixman-1.pc:libpixman

# http://trac.macports.org/ticket/33515
if {${os.arch} == "powerpc"} {
    # This is sub-optimal, but it will work for now
    post-patch {
        reinplace "/install_name_tool/d" ${worksrcpath}/lib/Makefile.in
    }
} elseif {${os.major} < 10} {
    depends_build port:cctools
    depends_skip_archcheck-append cctools
}

platform macosx {
    if { ![file exists /usr/include/Xplugin.h] } {
        # Xplugin.h is missing on Tiger
        configure.cppflags-append -I${filespath}/include
    }
}

configure.args --with-bundle-id-prefix=org.macports
