# $Id: Portfile,v 1.5 2005/07/06 16:18:02 ssen Exp $

PortSystem 1.0
name		XFree86_44
version		4.4.0
categories	x11
revision	3
maintainers	darwinports@opendarwin.org
description	X11R6 windowing system
homepage        http://www.xfree86.org/
long_description The XFree86 project's X window system implementation

platforms	darwin freebsd
prefix		${x11prefix}
master_sites	opendarwin	xfree:${version}/source/

distfiles	XFree86-4.4.0-src-1.tgz \
		XFree86-4.4.0-src-2.tgz \
		XFree86-4.4.0-src-3.tgz \
		XFree86-4.4.0-src-4.tgz \
		XFree86-4.4.0-src-5.tgz
checksums	XFree86-4.4.0-src-1.tgz md5 97cea3d9e1197dde32ca34e3b6086469 \
		XFree86-4.4.0-src-2.tgz md5 b9b6c74a03e314569e01d5fd4ff59523 \
		XFree86-4.4.0-src-3.tgz md5 703404f48d3a15f58389a879d47c769d \
		XFree86-4.4.0-src-4.tgz md5 5d1792f5c154c7462c6aef39c7853b3b \
		XFree86-4.4.0-src-5.tgz md5 5c37f028efc6d54a9c725e333f9cc8ae

# Although these only affect Darwin, the patches can be
# applied on any platform
patchfiles	patch-darwin.cf patch-xfIOKit.c.diff

depends_build	bin:perl:perl5.8
configure	{}
worksrcdir	xc
build.target	World
destroot.target	install install.man

variant puredarwin {
	post-patch	{
		set hostfd [open "${worksrcpath}/config/cf/host.def" w+]
		puts $hostfd "#define DarwinQuartzSupport NO"
		puts $hostfd "#define BuildGlxExt YES"
		puts $hostfd "#define BuildGLXLibrary YES"
		puts $hostfd "#define GlxBuiltInXMesa YES"
		close $hostfd
	}
}

# If getting the development version, check out of CVS instead
variant devel {
	fetch.type cvs
	cvs.root :pserver:anoncvs@anoncvs.xfree86.org:/cvs
	cvs.module xc
	cvs.password	anoncvs
}
