SUMMARY="Standards-compliant compiler for Haskell 98"
DESCRIPTION="nhc98 is a small, easy to install, standards-compliant compiler \
for Haskell 98, the :lazy functional programming language. It is very \
portable, and aims to produce small executables that run in small amounts of \
memory. It produces medium-fast code, and compilation is itself quite fast. \
It also comes with extensive tool support for automatic compilation, foreign \
language interfacing, heap and time profiling, tracing, and debugging. (Some \
of its advanced kinds of heap profiles are not found in any other Haskell \
compiler.)"
HOMEPAGE="https://www.haskell.org/nhc98/"
COPYRIGHT="1991-1998 Niklas Röjemo
1991-1997 Thomas Hallgren
1991-2007 David Wakeling
1996-2007 Jan Sparud, Colin Runciman, Phil Hassall, Olaf Chitil, and \
Thomas Nordin, their respective institutions, or funding bodies
1996-2010 Malcolm Wallace
2000 Andy Gill
1999 MicroStart Inc
Lennart Augustsson
Sigbjorn Finne
University of Glasgow
"
LICENSE="nhc98"
REVISION="1"
SOURCE_URI="http://www.haskell.org/nhc98/nhc98src-$portVersion.tar.gz"
CHECKSUM_SHA256="14c5c16c336d0bb15e6e3d1baad8a2bca93c0538a129fb18df1d47d1f4eb6f3a"
PATCHES="nhc98-$portVersion.patchset"

ARCHITECTURES="!all x86_gcc2 ?x86"

PROVIDES="
	nhc98$secondaryArchSuffix = $portVersion
	cmd:cabal_parse
	cmd:cpphs
	cmd:greencard_nhc98
	cmd:harch
	cmd:hi
	cmd:hmake
	cmd:hmake_config
	cmd:hood
	cmd:hp2graph
	cmd:nhc98
	cmd:nhc98_pkg
	cmd:runhs
	cmd:tprofprel
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:diff
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:xargs
	"

BUILD()
{
	# Not an autotools configure
	./configure --prefix=$prefix --incdir=$includeDir --mandir=$manDir --docdir=$docDir \
		--ccoption= --ldoption= --endian=-DLOW_BYTE_FIRST
	make # jobArgs is ignored, will do a parallel build anyways
}

INSTALL()
{
	make install
}
