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

PortSystem 1.0

name		hs-type-level
set canonicalname	type-level
version		0.2.1
categories	devel haskell
maintainers	gwright
platforms	darwin

description	Type level programming library for GHC
long_description	\
		This library permits performing computations on		\
		the type-level. Type-level functions are implemented	\
		using functional dependencies of multi parameter type	\
		classes. To date, Booleans and Numerals (Naturals and	\
		Positives) are supported.

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

checksums	md5     0c0700cfe465b917c8b572b238a80fb4		\
		sha1    ffdabc12b918c0a4fd62a1e5bac7159b041b3fa4	\
		rmd160  f674ffb8085bfd9ecbd673de3ee8a8d79c13c844

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" }

