# $Id$

PortSystem 1.0

name		hsshellscript
version		2.1.0
revision	1
categories	devel
license		LGPL-2.1+
maintainers	nomaintainer
platforms	darwin

description	Haskell for Unix Shell Scripting
long_description	\
		HsShell allows the use of the Haskell programming	\
		language for tasks which are usually done by shell scripts.

homepage	http://www.volker-wysk.de/hsshellscript/
master_sites	${homepage}/dist/

checksums	md5 1d85645fdf43b1496be5767272220cf1

depends_build	bin:c2hs:hs-c2hs		\
		bin:ghc:ghc

patchfiles	patch-Makefile

configure	{
		  set ghcversion [ exec ghc --version | sed "s|^.*version ||" ]
		  reinplace -locale en_US.ISO8859-1 s|/usr/local/imports|${prefix}/lib/ghc-${ghcversion}/imports| ${worksrcpath}/Makefile
		  reinplace -locale en_US.ISO8859-1 s|/usr/local|${prefix}|g ${worksrcpath}/Makefile
		}

build.target	{ }

post-destroot	{ system "ranlib ${destroot}${prefix}/lib/libhsshellscript.a" }

post-activate	{
		  set ghcversion [ exec ghc --version | sed "s|^.*version ||" ]
		  system "cd ${worksrcpath} && DEST_IMPORTS=${prefix}/lib/ghc-${ghcversion}/imports/hsshellscript \
			  DEST_LIB=${prefix}/lib \
			  ghc-pkg -i lib/hsshellscript.pkg --update-package --auto-ghci-libs"
		}