# $Id: Portfile 50980 2009-05-14 19:41:55Z and.damore@macports.org $

PortSystem 1.0
name		hs-typenats
set shortname	typenats
version		0.2
categories	devel
maintainers	gwright
platforms	darwin

description	Type level natural numbers for haskell
long_description	\
		This library defines type level arithmetic by	\
		heavily abusing GHC's typechecker. It includes	\
		the following operations on type level		\
		naturals:					\
								\
		    * addition					\
		    * subtraction				\
		    * multiplication				\
		    * division					\
		    * remainder					\
		    * GCD					\
								\
		It also contains the following predicates:	\
								\
		    * test for zero				\
		    * test for equality				\
		    * <						\
		    * >						\
		    * <=					\
		    * >=					\

homepage	http://www.eecs.tufts.edu/~rdocki01/typenats.html
master_sites	http://www.eecs.tufts.edu/~rdocki01/projects
distname	${shortname}-${version}-source

checksums	md5 ee9f4e51b49d927e7ade1034211a14b9

depends_build	port:ghc

pre-configure	{ cd ${worksrcpath}
		  system "ghc -o Setup Setup.hs -package Cabal"
		}

configure	{ cd ${worksrcpath}
		  system "./Setup configure --ghc --prefix=${prefix} --enable-library-profiling"
		}

build		{ cd ${worksrcpath}
		  system "./Setup build -v"
		}

destroot	{ cd ${worksrcpath}
		  system "./Setup copy --copy-prefix=${destroot}${prefix}"
                  system "./Setup register   --gen-script"
                  system "./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" }

