openbsd-ports/lang/ghc/Makefile
kili a2d22041b4 Update to 6.12.2.
Many thanks to Darrin Chandler and dcoppa@ for testing, reporting about
broken stuff, missing dependencies here and in ports depending on ghc.

Notes and rants:

- Bootstrapping is done using precompiled binaries, since .hc
  bootstrapping still doesn't work. I really hate this.

  THIS MEANS THAT GHC IS NOW AND WILL STAY LEGACY-ONLY (i386 and amd64)

  At least until someone fixes it. I tried for more than two year
  (well, only in my spare time and during my vacations) and failed.

- libgmp is currently disabled, because I didn't yet hack the GHC build
  system to use the system libgmp instead of the patched one included
  in GHC.

- The haddock ncluded in the ghc distfile is replaced by the version
  of haddock found in devel/haddock. Haddock itself is @commented
  in the ghc PLIST. Unfortunately, this needs an ugly hack that
  introduces an otherwise useless pseudo flavor `no_deps' in
  devel/haddock.

- CLDouble has been removed from GHC some time ago, because it was
  an alias for double (AFAIK there's now support for long double
  in GHC). As this isn't a really big problem, it currently breaks
  c2hs, which I'll mark broken temporarily before committing the
  ghc update.

- The external codeset defaults to latin1 (suggested by Simon Marlow)
  and can be overridden by setting the HS_ENCODING to any codeset
  supported by libiconv.

- ghc.port.mk still needs some love, especially for letting a port add
  additional parameters to certain invocations of ${MODGHC_SETUP_PROG}.
2010-04-22 21:49:37 +00:00

139 lines
3.8 KiB
Makefile

# $OpenBSD: Makefile,v 1.30 2010/04/22 21:49:37 kili Exp $
COMMENT-main = compiler for the functional language Haskell
COMMENT-doc = documentation for GHC
DISTNAME = ghc-${MODGHC_VER}
PKGNAME-main = ghc-${MODGHC_VER}
PKGNAME-doc = ghc-doc-${MODGHC_VER}
CATEGORIES = lang devel
HOMEPAGE = http://www.haskell.org/ghc/
# Version of the precompiled binaries
BIN_VER = 6.12.1.20100318
# Pull in lang/ghc to get MODGHC_VER and ONLY_FOR_ARCHS, which is maintained
# in ghc.port.mk. lang/python needed for regress.
MODULES = lang/ghc lang/python converters/libiconv
MULTI_PACKAGES = -main -doc
PSEUDO_FLAVORS = native_bootstrap
FLAVOR ?=
# BSD w/o advertising clause.
# Distfile is bundled with ofther stuff like libffi, libgmp, mingw
# binaries, with BSD, GPLv2 and Perl artistic license.
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
PKG_ARCH-doc = *
BUILD_DEPENDS = ::textproc/docbook \
::textproc/docbook-xsl \
::textproc/libxslt
LIB_DEPENDS-doc =
RUN_DEPENDS-doc =
RUN_DEPENDS-main =
WANTLIB-main = c m ncurses pthread util
MASTER_SITES = ${HOMEPAGE}dist/${MODGHC_VER}/ \
${HOMEPAGE}dist/stable/dist/
MASTER_SITES0 = http://openbsd.dead-parrot.de/distfiles/
DIST_SUBDIR = ghc-${MODGHC_VER}
VMEM_WARNING = Yes
.if ${FLAVOR:L:Mnative_bootstrap}
BUILD_DEPENDS += :ghc->=6.10:lang/ghc
.else
BINDISTFILE = ${BINDISTFILE-${MACHINE_ARCH}}
.endif
DISTFILES = ghc-${MODGHC_VER}-src.tar.bz2 \
testsuite-${MODGHC_VER}.tar.bz2 \
${BINDISTFILE}
.for m in amd64 i386
BINDISTFILE-$m = ghc-${BIN_VER}-$m-unknown-openbsd.tar.bz2:0
SUPDISTFILES += ${BINDISTFILE-$m}
.endfor
USE_GMAKE = Yes
CONFIGURE_STYLE = gnu autoconf
AUTOCONF_VERSION = 2.61
CONFIGURE_ARGS += --with-iconv-includes=${LOCALBASE}/include \
--with-iconv-libraries=${LOCALBASE}/lib
MAKE_FLAGS += StripLibraries=YES \
INSTALL_BIN_OPTS=-s \
HSCOLOUR_SRCS=NO \
INTEGER_LIBRARY=integer-simple
.if ${FLAVOR:L:Mnative_bootstrap}
BUILD_DEPENDS += ::devel/haddock
.else
BUILD_DEPENDS += ::devel/haddock,no_deps:patch
.endif
REGRESS_DEPENDS = ::print/ghostscript/gnu
post-extract:
.if !${FLAVOR:L:Mnative_bootstrap}
# - Install a precompiled binary.
# - Replace utils/haddock by the version from the ports tree, move
# the alex- and happy-generated files into the src dir and rename the
# corresponding sources so cabal won't try to re-run alex or happy.
cd ${WRKDIR}/ghc-${BIN_VER} && \
./configure --prefix=${WRKDIR} && \
${MAKE_PROGRAM} install
mv ${WRKSRC}/utils/haddock{,-ghcdist}
mv ${WRKDIR}/devel/haddock/haddock-* ${WRKSRC}/utils/haddock
. for f in ghc.mk doc/ghc.mk haddock.wrapper
cp -p ${WRKSRC}/utils/haddock{-ghcdist,}/$f
. endfor
cd ${WRKSRC}/utils/haddock/src && \
find . -name \*.[xy] -print | \
sed 's@\(.*\)\.[xy]@mv & &.source \&\& mv ../dist/build/haddock/haddock-tmp/\1.hs \1.hs@' | \
sh
.endif
post-patch:
${SUBST_CMD} ${WRKSRC}/docs/index.html
post-install:
cd ${PREFIX}/lib/ghc && \
GHC_PKG="./ghc-pkg --global-conf ./package.conf.d" && \
exec > register.sh && \
chmod 755 register.sh && \
echo '#!/bin/sh' && \
echo 'exec > /dev/null 2>&1' && \
echo 'p="$${0%/*}/ghc-pkg --global-conf $${0%/*}/package.conf.d"' && \
for p in $$($$GHC_PKG list --simple); do \
echo \$$p register --force - \<\< \'EOF\' && \
$$GHC_PKG describe $$p && \
echo EOF; \
done && \
exec > unregister.sh && \
chmod 755 unregister.sh && \
echo '#!/bin/sh' && \
echo 'exec > /dev/null 2>&1' && \
echo 'p="$${0%/*}/ghc-pkg --global-conf $${0%/*}/package.conf.d"' && \
for p in $$($$GHC_PKG list --simple); do \
echo \$$p unregister --force $$p; \
done && \
rm package.conf.d/* && \
$$GHC_PKG recache
do-regress:
ulimit -c 0 && \
cd ${WRKSRC}/testsuite/tests/ghc-regress && \
exec ${SETENV} ${MAKE_ENV} HS_ENCODING=utf-8 \
${MAKE_PROGRAM} ${MAKE_FLAGS} \
PYTHON="${MODPY_BIN}"
.include <bsd.port.mk>