# $Id: Portfile,v 1.8 2005/04/11 16:58:52 gwright Exp $

PortSystem 1.0
name		hs-plugins
version		20050407
revision	1
epoch		20050407
categories	devel
maintainers	gwright@opendarwin.org
platforms	darwin

#bugs		Now builds from a snapshot to be compatible with
#		ghc-6.4.  The previous 0.9.8 release was incompatible
#		with the new library packing system introduced with
#		6.4, the Common Architecture for Builing Applications
#		and Libraries (Cabal).  Will track releases again once
#		support for ghc-6.4 is introduced.

description	A plugin library for Haskell
long_description	\
		hs-plugins was originally designed as a system		\
		for replacing all the various configuration languages	\
		in existence (particularly mutt and vim) but developed	\
		to be very suitable for plugins in general.

homepage	http://www.cse.unsw.edu.au/~dons/hs-plugins/hs-plugins.html
master_sites	ftp://ftp.cse.unsw.edu.au/pub/users/dons/hs-plugins/snapshots

checksums	md5 c53af7d0563a8473da41c940e20922f3

depends_build	bin:ghc:ghc

use_autoconf	yes

destroot.destdir	PREFIX=${destroot}/${prefix}

post-activate	{ cd ${worksrcpath}

		  # start by unregistering old versions

		  system "ghc-pkg -r printf  || true"
		  system "ghc-pkg -r eval    || true"
		  system "ghc-pkg -r plugins || true"
		  system "ghc-pkg -r hi      || true"
		  system "ghc-pkg -r altdata || true"

		  system "PREFIX=${prefix} LIBDIR=${prefix}/lib/${name} ghc-pkg -u < src/altdata/altdata.conf.in"
		  system "PREFIX=${prefix} LIBDIR=${prefix}/lib/${name} ghc-pkg -u < src/hi/hi.conf.in"
		  system "PREFIX=${prefix} LIBDIR=${prefix}/lib/${name} ghc-pkg -u < src/plugins/plugins.conf.in"
		  system "PREFIX=${prefix} LIBDIR=${prefix}/lib/${name} ghc-pkg -u < src/eval/eval.conf.in"
		  system "PREFIX=${prefix} LIBDIR=${prefix}/lib/${name} ghc-pkg -u < src/printf/printf.conf.in"

		  system "ranlib ${prefix}/lib/${name}/libHSplugins.a"
		  system "ranlib ${prefix}/lib/${name}/libHShi.a"
		  system "ranlib ${prefix}/lib/${name}/libHSaltdata.a"
		  system "ranlib ${prefix}/lib/${name}/libHSeval.a"
		  system "ranlib ${prefix}/lib/${name}/libHSprintf.a"
		}
