# $Id: Portfile,v 1.4 2005/09/25 13:05:29 mww Exp $

PortSystem 1.0
name				plotutils
version				2.4.1
revision			2
categories			graphics
maintainers			darwinports@opendarwin.org
description			GNU plotting utilities
long_description \
	GNU plotting utilities package, including GNU libplot: a thread-safe \
	function library for exporting two-dimensional vector graphics files, \
	and for displaying animated vector graphics under the X Window System.

platforms			darwin

homepage			http://www.gnu.org/software/plotutils/
master_sites		gnu opendarwin::lt

checksums			${name}-${portversion}${extract.suffix} \
						md5 8da2cc2ed5a837cad0753c7843ef18ee

depends_lib			lib:libpng:libpng lib:libz:zlib

patchfiles			patch-libplot_g_write.c patch-libplot_n_write.c \
					patch-libplot_i_rle.c patch-libplot_z_write.c

configure.args		--without-x --enable-libplotter \
					--mandir=${prefix}/share/man --infodir=${prefix}/share/info

configure.env       CPPFLAGS="-I${prefix}/include" LDFLAGS="-L${prefix}/lib"

variant x11 {
	depends_lib-append		lib:libX11:XFree86
	configure.args-delete	--without-x
	configure.args-append	--with-x
}

variant darwin {
	distfiles-append	ltconfig13:lt ltmain13:lt
	checksums-append	ltconfig13 md5 ea53f42a550c9f9e653758a8ed91574e \
						ltmain13 md5 e094ae92724c4015dbab97de151c2525
	extract.only		${distname}${extract.suffix}
	post-patch {
		xinstall -m 644 ${distpath}/ltconfig13 ${worksrcpath}/ltconfig
		xinstall -m 644 ${distpath}/ltmain13 ${worksrcpath}/ltmain.sh
	}
}

