# $Id: Portfile 40948 2008-10-18 20:05:04Z ryandesign@macports.org $

PortSystem 1.0

name		hs-ghc-paths
set canonicalname	ghc-paths
version		0.1.0.5
categories	devel haskell
maintainers	nomaintainer
platforms	darwin
description	Locate ghc's installation directories
long_description	\
		Locate GHC's installation directories. This package is	\
		required by haddock, the Haskell documentation	    	\
		generator.

homepage	http://hackage.haskell.org/haddock/
master_sites	http://hackage.haskell.org/packages/archive/${canonicalname}/${version}
distname	${canonicalname}-${version}

checksums	md5     8fdc122e65845d2d53734f78e22c5155		\
		sha1    f9a70a8564be268e4aa88436ea18fc84a1ce303a	\
		rmd160  098804e5a48ce9381174245601b3896304464219

depends_build	port:ghc

configure       { system "cd ${worksrcpath} && runhaskell Setup configure --ghc --prefix=${prefix} --with-compiler=${prefix}/bin/ghc --enable-library-profiling"
                }

build           { system "cd ${worksrcpath} && runhaskell Setup build -v"
                }

destroot        { system "cd ${worksrcpath} && runhaskell Setup copy --copy-prefix=${destroot}${prefix}"
	          system "cd ${worksrcpath} && runhaskell Setup register   --gen-script"
		  system "cd ${worksrcpath} && runhaskell 	Setup unregister --gen-script"

                  file mkdir ${destroot}${prefix}/libexec/${name}
                  file copy ${worksrcpath}/register.sh \
                            ${destroot}${prefix}/libexec/${name}
                  file copy ${worksrcpath}/unregister.sh \
                            ${destroot}${prefix}/libexec/${name}
                }

post-activate   { system "${prefix}/libexec/${name}/register.sh" }

#pre-deactivate { system "${prefix}/libexec/${name}/unregister.sh" }

