# $Id: Portfile,v 1.7 2006/02/16 19:38:44 olegb Exp $

PortSystem 1.0
name		glib1
version		1.2.10
revision	5
categories	devel
maintainers	mij@opendarwin.org
description	Library with data structure functions and other constructs
homepage	http://www.gtk.org/
platforms	darwin freebsd

long_description General-purpose library from the GTK+ team, includes \
		 support routines for C such as lists, trees, hashes, \
		 memory allocation, and many other things.

master_sites	ftp://ftp.gtk.org/pub/gtk/v1.2/ \
		opendarwin::lt

set filename	glib-${portversion}${extract.suffix}
distfiles	${filename} ltconfig13:lt ltmain13:lt
checksums	${filename} md5 6fe30dad87c77b91b632def29dd69ef9 \
		ltconfig13 md5 ea53f42a550c9f9e653758a8ed91574e \
		ltmain13 md5 e094ae92724c4015dbab97de151c2525
extract.only	${filename}
worksrcdir	glib-${portversion}

depends_lib	lib:libintl.3:gettext
depends_build	bin:pkg-config:pkgconfig

pre-patch	{ system "cp ${distpath}/ltconfig13 ${worksrcpath}/ltconfig"
		  system "cp ${distpath}/ltmain13 ${worksrcpath}/ltmain.sh" }

patchfiles	patch-configure patch-config.guess patch-config.sub \
		patch-gmain.c patch-glib.h patch-gutils.c

configure.env	LDFLAGS="-L${prefix}/lib" CFLAGS="-I${prefix}/include"
configure.args	--disable-static --mandir=${prefix}/share/man \
		--infodir=${prefix}/share/info 

post-destroot	{ system "ln -sf libglib-1.2.0.0.10.dylib \
		    ${destroot}${prefix}/lib/libglib.1.dylib"
		  system "ln -sf libgmodule-1.2.0.0.10.dylib \
		    ${destroot}${prefix}/lib/libgmodule.1.dylib"
		  system "ln -sf libgthread-1.2.0.0.10.dylib \
		    ${destroot}${prefix}/lib/libgthread.1.dylib" }

platform darwin 6 {	depends_lib-append	lib:libdl:dlcompat }
