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}.
This commit is contained in:
kili 2010-04-22 21:49:37 +00:00
parent 0886815cde
commit a2d22041b4
33 changed files with 5350 additions and 4190 deletions

View File

@ -1,170 +1,138 @@
# $OpenBSD: Makefile,v 1.29 2008/10/02 19:50:52 kili Exp $
#
# Ancient versions based on Simon Marlow's port script for FreeBSD:
# $FreeBSD: ports/lang/ghc/Makefile,v 1.13 2002/08/22 12:53:38 obraun Exp $
# And on NetBSD's 5.04.3 .hc boot script
# $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
COMMENT-main = compiler for the functional language Haskell
COMMENT-doc = documentation for GHC
DISTNAME= ghc-${MODGHC_VER}
PKGNAME-main= ghc-${MODGHC_VER}p2
PKGNAME-doc= ghc-doc-${MODGHC_VER}p0
CATEGORIES= lang
HOMEPAGE= http://www.haskell.org/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
MODULES = lang/ghc lang/python converters/libiconv
MULTI_PACKAGES= -doc -main
MULTI_PACKAGES = -main -doc
PSEUDO_FLAVORS= native_bootstrap
FLAVOR?=
PSEUDO_FLAVORS = native_bootstrap
FLAVOR ?=
# BSD w/o advertising clause
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
# 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/libxslt
LIB_DEPENDS-main= gmp::devel/gmp
RUN_DEPENDS-doc=
RUN_DEPENDS-main=
WANTLIB-main= c m ncurses pthread readline
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}/
MASTER_SITES0= ${HOMEPAGE}docs/${MODGHC_VER}/
MASTER_SITES1= http://openbsd.dead-parrot.de/distfiles/
MASTER_SITES = ${HOMEPAGE}dist/${MODGHC_VER}/ \
${HOMEPAGE}dist/stable/dist/
MASTER_SITES0 = http://openbsd.dead-parrot.de/distfiles/
DIST_SUBDIR= ghc-${MODGHC_VER}
DOC_FILES= Cabal users_guide libraries
DOC_DIR= ${PREFIX}/share/doc/ghc
DIST_SUBDIR = ghc-${MODGHC_VER}
VMEM_WARNING = Yes
.if ${FLAVOR:L:Mnative_bootstrap}
# In theory, even older versions should work, but the only version
# tested with is 6.2.2.
BUILD_DEPENDS+= :ghc->=6.2.2:lang/ghc
BUILD_DEPENDS += :ghc->=6.10:lang/ghc
.else
HCFILES= ${HCFILES-${MACHINE_ARCH}}
CONFIGURE_ARGS= --enable-hc-boot
BINDISTFILE = ${BINDISTFILE-${MACHINE_ARCH}}
.endif
DISTFILES= ghc-${MODGHC_VER}-src.tar.bz2 \
ghc-${MODGHC_VER}-src-extralibs.tar.bz2 \
ghc-testsuite-6.6.1.tar.gz \
${DOC_FILES:C/(.+)/\1.html.tar.gz:0/g} \
${HCFILES}
# HC file bundles for non-native bootstrapping. To build a registerised
# bundle, run make with ALL_TARGET="stage1 hc-file-bundle" and the
# following configuration settings for GHC (in ${WRKSRC}/mk/build.mk;
# variable settings MAKE_FLAGS may work, too):
#
# GhcBootLibs=YES
# GhcLibHcOpts=-O
# GhcWithInterpreter=NO
# SRC_HC_OPTS=-O -H32 -fasm -keep-hc-files
# SplitObjs=NO
#
# The version and configuration of GHC used to build the bundle must
# match those of the GHC you want to bootstrap from the bundle. Don't
# even try to create a bundle from ghc-6.2.2 and then build ghc-6.6.1
# with it. (same for registerised vs. unregisterised builds).
#
# The general solution for porting this to other architectures will
# be to boot via unregisterised .hc files generated on an architecture
# already running GHC. For more information, see:
# http://hackage.haskell.org/trac/ghc/wiki/Building/Porting
DISTFILES = ghc-${MODGHC_VER}-src.tar.bz2 \
testsuite-${MODGHC_VER}.tar.bz2 \
${BINDISTFILE}
.for m in amd64 i386
HCFILES-$m= ghc-${MODGHC_VER}-$m-unknown-openbsd-hc.tar.bz2:1
SUPDISTFILES+= ${HCFILES-$m}
BINDISTFILE-$m = ghc-${BIN_VER}-$m-unknown-openbsd.tar.bz2:0
SUPDISTFILES += ${BINDISTFILE-$m}
.endfor
SUBST_VARS= MODGHC_VER
USE_GMAKE = Yes
USE_GMAKE= Yes
CONFIGURE_STYLE = gnu autoconf
AUTOCONF_VERSION = 2.61
CONFIGURE_ARGS += --with-iconv-includes=${LOCALBASE}/include \
--with-iconv-libraries=${LOCALBASE}/lib
CONFIGURE_STYLE= gnu dest autoconf
AUTOCONF_VERSION= 2.57
CONFIGURE_ARGS+= --with-gmp-includes=${LOCALBASE}/include \
--with-gmp-libraries=${LOCALBASE}/lib
MAKE_FLAGS += StripLibraries=YES \
INSTALL_BIN_OPTS=-s \
HSCOLOUR_SRCS=NO \
INTEGER_LIBRARY=integer-simple
FAKE_FLAGS+= stage=2
post-extract:
@mv ${WRKDIR}/testsuite ${WRKSRC}
.if !${FLAVOR:L:Mnative_bootstrap}
# Bootstrap stage 1 from HC files, then wipe out all .o and .a files and
# resume a "normal" 2-stage build using the compiler just bootstrapped.
# No idea yet what's going wrong with GhcPatchLevel during configure
# (seeo mk/config.mk.in), so explicitely pass UseStage1=YES, to fix the
# build of compat/cbit/unicode.c
MAKE_FLAGS+= BootingFromHc=NO \
UseStage1=YES \
SplitObjs=NO \
GHC=${WRKBUILD}/compiler/ghc-inplace \
HC=${WRKBUILD}/compiler/ghc-inplace \
HAPPY=${WRKSRC}/distrib/fake-happy
BOOT_FLAGS= GhcBootLibs=YES GhcWithInterpreter=NO \
SplitObjs=NO
BOOT_DIRS= utils/mkdependC utils/unlit utils/mkdirhier \
driver/mangler driver/split includes rts libraries \
compat utils compiler
# Override to get profiling libraries and several additional
# utilities installed.
FAKE_FLAGS+= BootingFromHc=NO
do-build:
# Bootstrap an initial ghc from HC files.
.for dir in ${BOOT_DIRS}
cd ${WRKBUILD}/${dir} && \
env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${BOOT_FLAGS} boot all
.endfor
# Cleanup objects and libraries
find ${WRKBUILD} -name '*.[ao]' | xargs rm -f
# Rebuild includes, RTS, and a minimal subset of libraries.
.for dir in includes rts libraries
cd ${WRKBUILD}/${dir} && \
env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} boot all \
GhcBootLibs=YES
.endfor
# Rebuild compat and utils. Build the mini-drivers for ghc
# and ghci right now, else they'll be built during the fake
# stage, which will put the wrong paths into them.
.for dir in compat utils driver/ghc driver/ghci
cd ${WRKBUILD}/${dir} && \
env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} clean boot all
.endfor
cd ${WRKBUILD}/libraries && \
env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} boot all
cd ${WRKBUILD} && \
env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} stage2
.if ${FLAVOR:L:Mnative_bootstrap}
BUILD_DEPENDS += ::devel/haddock
.else
BUILD_DEPENDS += ::devel/haddock,no_deps:patch
.endif
# Create scripts for the Cabal package registry that will be used for
# @exec and @unexec. And generate a man page.
post-build:
cd ${WRKBUILD} && sh ${FILESDIR}/mkregunreg.sh ${PREFIX}
cd ${WRKBUILD}/docs/man && \
env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ghc.1
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:
rm ${PREFIX}/lib/ghc/package.conf
${INSTALL_SCRIPT} ${WRKBUILD}/{un,}register.sh ${PREFIX}/lib/ghc
${INSTALL_DATA_DIR} ${DOC_DIR}
cd ${WRKDIR} && umask 022 && pax -rw ${DOC_FILES} ${DOC_DIR}
${INSTALL_MAN_DIR} ${PREFIX}/man/man1
${INSTALL_MAN} ${WRKBUILD}/docs/man/ghc.1 ${PREFIX}/man/man1
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 && \
${MAKE_ENV} ${MAKE_PROGRAM} stage=2 ${MAKE_FLAGS} \
exec ${SETENV} ${MAKE_ENV} HS_ENCODING=utf-8 \
${MAKE_PROGRAM} ${MAKE_FLAGS} \
PYTHON="${MODPY_BIN}"
.include <bsd.port.mk>

View File

@ -1,40 +1,20 @@
MD5 (ghc-6.6.1/Cabal.html.tar.gz) = TNx7DePyZUmYlabM5YQLdA==
MD5 (ghc-6.6.1/ghc-6.6.1-amd64-unknown-openbsd-hc.tar.bz2) = EL3dUlKz5IXqroLqsZr1QQ==
MD5 (ghc-6.6.1/ghc-6.6.1-i386-unknown-openbsd-hc.tar.bz2) = vziNKlzZ8V4y+pcRWz/R/w==
MD5 (ghc-6.6.1/ghc-6.6.1-src-extralibs.tar.bz2) = Q6JrgWCLIGwFatwwMvfaKg==
MD5 (ghc-6.6.1/ghc-6.6.1-src.tar.bz2) = up9K7C/eX/HhVIrmm3iusA==
MD5 (ghc-6.6.1/ghc-testsuite-6.6.1.tar.gz) = Z4r9jlfLRMpsUBJhY9NDeA==
MD5 (ghc-6.6.1/libraries.html.tar.gz) = VTwiHzL/YnAsjoggqOvYWg==
MD5 (ghc-6.6.1/users_guide.html.tar.gz) = 0kxVV02uyWdrg75UKEombg==
RMD160 (ghc-6.6.1/Cabal.html.tar.gz) = TB/zUFMpmDqAWiKPvEdbxRyYibs=
RMD160 (ghc-6.6.1/ghc-6.6.1-amd64-unknown-openbsd-hc.tar.bz2) = VGizOlhdmQ/2/vBlNoILPM0KkmA=
RMD160 (ghc-6.6.1/ghc-6.6.1-i386-unknown-openbsd-hc.tar.bz2) = MQCkMcHaxGPkE4sAuKBcLY5lhBQ=
RMD160 (ghc-6.6.1/ghc-6.6.1-src-extralibs.tar.bz2) = HBjIXZeMSzNpEy4kfII6qpDqhTA=
RMD160 (ghc-6.6.1/ghc-6.6.1-src.tar.bz2) = a4KnRVlCX+X+H6G2eoNDNFe64K0=
RMD160 (ghc-6.6.1/ghc-testsuite-6.6.1.tar.gz) = 0RTxQrOhKQfH2pd5MlpZ36JtkiU=
RMD160 (ghc-6.6.1/libraries.html.tar.gz) = eZGxVHaQGvG3BfKiA7ovA7L3pHc=
RMD160 (ghc-6.6.1/users_guide.html.tar.gz) = Q9tPeKoWW4bL4M3MLDuhGaNM2V0=
SHA1 (ghc-6.6.1/Cabal.html.tar.gz) = scaZtQ8Vgnal+3BrWNIrCdxy5Zs=
SHA1 (ghc-6.6.1/ghc-6.6.1-amd64-unknown-openbsd-hc.tar.bz2) = z74qCcZjRUd2UZoaMFgJiijVO8c=
SHA1 (ghc-6.6.1/ghc-6.6.1-i386-unknown-openbsd-hc.tar.bz2) = o3B5NP1uZpmz/Jgv5jbS4QrW9ZI=
SHA1 (ghc-6.6.1/ghc-6.6.1-src-extralibs.tar.bz2) = E5j2w1GR1SQQouBms4JjXf8NjW0=
SHA1 (ghc-6.6.1/ghc-6.6.1-src.tar.bz2) = zBhGtK1gficHITcc5AQ7GgF80Q4=
SHA1 (ghc-6.6.1/ghc-testsuite-6.6.1.tar.gz) = VzVspsu2UI8ha3NiAivkVmIM4Po=
SHA1 (ghc-6.6.1/libraries.html.tar.gz) = COC8nth+5zLNj6EjmJYC6P0mog0=
SHA1 (ghc-6.6.1/users_guide.html.tar.gz) = mQPNZroLlaY+SLvkZys8adggV0o=
SHA256 (ghc-6.6.1/Cabal.html.tar.gz) = UtCVCKHOMqkRgLUT1dzX0axu9WzupT+SQdWy0ayrZdk=
SHA256 (ghc-6.6.1/ghc-6.6.1-amd64-unknown-openbsd-hc.tar.bz2) = 8KZ17HgLPOr/UDDAmBujUh1SCIyE199kSFa1otz3lbI=
SHA256 (ghc-6.6.1/ghc-6.6.1-i386-unknown-openbsd-hc.tar.bz2) = 1HGmr9VX0fp8B0Iu7NNrGvf9vI/cBaWYGoykqlKCHaM=
SHA256 (ghc-6.6.1/ghc-6.6.1-src-extralibs.tar.bz2) = 0WKoL8OI/dSMMnsJu213jyMT0S1SgvOxIKwIpdTniQI=
SHA256 (ghc-6.6.1/ghc-6.6.1-src.tar.bz2) = SJEmzustu2qF742H1nkuYeG8DViC5LM6dyVBDXlhMsY=
SHA256 (ghc-6.6.1/ghc-testsuite-6.6.1.tar.gz) = nkWMzdkst6tRC7iIN3xXnxfx28Tc6cwIYyW8C3t87CU=
SHA256 (ghc-6.6.1/libraries.html.tar.gz) = DiY2YrBIiI6pIIvdkaurnhTBKpA98WMaEjN2oxtxoF8=
SHA256 (ghc-6.6.1/users_guide.html.tar.gz) = nrZeMcdyx++fNK+nbJgL+Jk97Om3X5rBU/mK5pmv1Fw=
SIZE (ghc-6.6.1/Cabal.html.tar.gz) = 18657
SIZE (ghc-6.6.1/ghc-6.6.1-amd64-unknown-openbsd-hc.tar.bz2) = 6506515
SIZE (ghc-6.6.1/ghc-6.6.1-i386-unknown-openbsd-hc.tar.bz2) = 6565940
SIZE (ghc-6.6.1/ghc-6.6.1-src-extralibs.tar.bz2) = 1928527
SIZE (ghc-6.6.1/ghc-6.6.1-src.tar.bz2) = 4339970
SIZE (ghc-6.6.1/ghc-testsuite-6.6.1.tar.gz) = 1178216
SIZE (ghc-6.6.1/libraries.html.tar.gz) = 1457817
SIZE (ghc-6.6.1/users_guide.html.tar.gz) = 246027
MD5 (ghc-6.12.2/ghc-6.12.1.20100318-amd64-unknown-openbsd.tar.bz2) = T2ElMVtDgljwt9u5Vvlt4w==
MD5 (ghc-6.12.2/ghc-6.12.1.20100318-i386-unknown-openbsd.tar.bz2) = jr9r36dvIqbZrdbitpjlGA==
MD5 (ghc-6.12.2/ghc-6.12.2-src.tar.bz2) = t6s9PC1YU0yz8xoA4sEsZw==
MD5 (ghc-6.12.2/testsuite-6.12.2.tar.bz2) = B+e98PB0KInOv0fluXe/bA==
RMD160 (ghc-6.12.2/ghc-6.12.1.20100318-amd64-unknown-openbsd.tar.bz2) = eB//0ECkFwcEgd16Ozn36ChzX44=
RMD160 (ghc-6.12.2/ghc-6.12.1.20100318-i386-unknown-openbsd.tar.bz2) = DHLZlgkpdqB/TfQkNWCbqwQCQIU=
RMD160 (ghc-6.12.2/ghc-6.12.2-src.tar.bz2) = rRFAIkIPuzE9xW8cUoXRzvTIjy8=
RMD160 (ghc-6.12.2/testsuite-6.12.2.tar.bz2) = MP1O2HUc9rt3P+M3YUrWUirHgTY=
SHA1 (ghc-6.12.2/ghc-6.12.1.20100318-amd64-unknown-openbsd.tar.bz2) = DaTaiRRQe9HoKs8Z4nW+g0skvto=
SHA1 (ghc-6.12.2/ghc-6.12.1.20100318-i386-unknown-openbsd.tar.bz2) = LuOj2mwTMHDo8O35AGGEF9Sb55M=
SHA1 (ghc-6.12.2/ghc-6.12.2-src.tar.bz2) = QhlncpvquKUFG4t8IWJAv8uHnIQ=
SHA1 (ghc-6.12.2/testsuite-6.12.2.tar.bz2) = XvmFkMaYVtqZE4KIdIOcwKQtEXc=
SHA256 (ghc-6.12.2/ghc-6.12.1.20100318-amd64-unknown-openbsd.tar.bz2) = COWgyhw/i49D908ZxbXT7yF66h/j7w2gYNaxC09lDng=
SHA256 (ghc-6.12.2/ghc-6.12.1.20100318-i386-unknown-openbsd.tar.bz2) = 0KJibgVxXxKTPnol6oYiMYN/A1MpY64bDZNhtxYEl9I=
SHA256 (ghc-6.12.2/ghc-6.12.2-src.tar.bz2) = fx458LPdrKNbVc1DDKBY0cRnhEWnF3ORyctjQrfEGjA=
SHA256 (ghc-6.12.2/testsuite-6.12.2.tar.bz2) = D8/hgg7V+N7Akxk0NyJIy4lkbNOEiUCW1TtpvMMc410=
SIZE (ghc-6.12.2/ghc-6.12.1.20100318-amd64-unknown-openbsd.tar.bz2) = 45975278
SIZE (ghc-6.12.2/ghc-6.12.1.20100318-i386-unknown-openbsd.tar.bz2) = 46498184
SIZE (ghc-6.12.2/ghc-6.12.2-src.tar.bz2) = 34158695
SIZE (ghc-6.12.2/testsuite-6.12.2.tar.bz2) = 2612422

View File

@ -1,55 +0,0 @@
# $OpenBSD: mkregunreg.sh,v 1.1 2007/07/21 17:14:57 kili Exp $
#
# Create register and unregister scripts for updating the Cabal
# package registry.
# This script must be called from the ghc build directory.
prefix="$1"
pkg_conf="$prefix/lib/ghc/package.conf"
ghc_pkg="$prefix/bin/ghc-pkg"
umask 022
my_ghc_pkg() {
./utils/ghc-pkg/ghc-pkg.bin --global-conf ./driver/package.conf "$@"
}
for p in $(my_ghc_pkg list --simple-output); do
echo $p $p
set -- $(my_ghc_pkg field $p depends)
shift
for d; do
echo $p $d
done
done > deps
exec > register.sh
cat <<- 'EOF'
#! /bin/sh
exec > /dev/null
EOF
tsort -r deps |
while read p; do
echo "$ghc_pkg register - << 'EOF'"
my_ghc_pkg describe $p
echo EOF
done
echo rm -f $pkg_conf.old
exec > unregister.sh
cat <<- 'EOF'
#! /bin/sh
exec > /dev/null
EOF
tsort deps |
sed "s!^!$ghc_pkg unregister !"
cat <<- EOF
rm -f $pkg_conf.old
# If no packages are left, just remove the registry.
if echo '[]' | cmp -s - $pkg_conf; then
rm -f $pkg_conf
fi
EOF

View File

@ -1,11 +1,13 @@
# $OpenBSD: ghc.port.mk,v 1.6 2007/07/21 17:14:57 kili Exp $
# $OpenBSD: ghc.port.mk,v 1.7 2010/04/22 21:49:37 kili Exp $
# Module for Glasgow Haskell Compiler
# Not yet ported to other architectures
# See comments in lang/ghc/Makefile for more information
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS = i386 amd64
MODGHC_VER= 6.6.1
MODGHC_VER = 6.12.2
SUBST_VARS += MODGHC_VER
MODGHC_BIN = ${LOCALBASE}/bin/ghc
# The following is for depending ports only. GHC itself just needs
# MODGHC_VER and ONLY_FOR_ARCHS. This is a little bit ugly, but
@ -15,11 +17,88 @@ MODGHC_VER= 6.6.1
# i.e. RUN_DEPENDS = :ghc-${MODGHC_VERSION}:lang/ghc, and not
# just ::lang/ghc.
.if ${PKGPATH} != "lang/ghc"
BUILD_DEPENDS+= ::lang/ghc
BUILD_DEPENDS += ::lang/ghc
# Only add runtime when it is actually needed (by default yes)
MODGHC_RUNTIME?=Yes
. if ${MODGHC_RUNTIME:L} == "yes"
RUN_DEPENDS+= :ghc-${MODGHC_VER}:lang/ghc
# Set to "cabal" to get the typical Cabal targets defined. Add "haddock"
# to generate API documentation using Haddock. Add "register" to create
# and include register/unregister scripts (you'll still have to add the
# necessary tags to your PLIST by hand).
# Add "nort" if the port doesn't depend on the GHC runtime. This will
# also turn off the default "hs-" prefix for PKGNAME.
# Finally, set it to or add "hackage" if the distfiles are avialable on
# hackage.org.
MODGHC_BUILD ?=
. if !${MODGHC_BUILD:L:Mnort}
PKGNAME ?= hs-${DISTNAME}
RUN_DEPENDS += :ghc-${MODGHC_VER}:lang/ghc
. endif
. if ${MODGHC_BUILD:L:Mhackage}
MODGHC_HACKAGE_NAME = ${DISTNAME:C,-[0-9.]*$,,}
MODGHC_HACKAGE_VERSION = ${DISTNAME:C,.*-([0-9.]*)$,\1,}
HOMEPAGE ?= http://hackage.haskell.org/package/${MODGHC_HACKAGE_NAME}
MASTER_SITES = http://hackage.haskell.org/packages/archive/${MODGHC_HACKAGE_NAME}/${MODGHC_HACKAGE_VERSION}/
SUBST_VARS += DISTNAME MODGHC_HACKAGE_VERSION
. endif
. if ${MODGHC_BUILD:L:Mcabal}
MODGHC_SETUP_SCRIPT ?= Setup.lhs Setup.hs
MODGHC_SETUP_PROG ?= ${WRKSRC}/Setup
MODGHC_SETUP_CONF_ARGS ?= configure -g -O --prefix=${PREFIX}
MODGHC_SETUP_CONF_ENV ?= HOME=${PORTHOME} PATH=${PATH}
. if ${MODGHC_BUILD:L:Mhaddock}
BUILD_DEPENDS += ::devel/haddock
. endif
# Little hack to let ports still add CONFIGURE_STYLE = autoconf and go
# without a do-configure: target (some Haskell ports are built with
# Cabal but use autohell for the documentation):
MODCABAL_configure = \
cd ${WRKSRC} && \
for s in ${MODGHC_SETUP_SCRIPT}; do \
test -f "$$s" && \
${MODGHC_BIN} --make \
-o ${MODGHC_SETUP_PROG} "$$s" && \
break; \
done && \
cd ${WRKBUILD} && exec ${SETENV} ${MODGHC_SETUP_CONF_ENV} \
${MODGHC_SETUP_PROG} ${MODGHC_SETUP_CONF_ARGS}
CONFIGURE_STYLE += CABAL
. if !target(do-build)
do-build:
@cd ${WRKBUILD} && exec ${SETENV} ${MODGHC_SETUP_CONF_ENV} \
${MODGHC_SETUP_PROG} build
. if ${MODGHC_BUILD:L:Mhaddock}
@cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \
${MODGHC_SETUP_PROG} haddock
. endif
. if ${MODGHC_BUILD:L:Mregister}
@cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \
${MODGHC_SETUP_PROG} register --gen-script
@cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \
${MODGHC_SETUP_PROG} unregister --gen-script
. endif
. endif
. if !target(do-install)
do-install:
@cd ${WRKBUILD} && exec ${SETENV} ${MODGHC_SETUP_CONF_ENV} \
${MODGHC_SETUP_PROG} copy --destdir=${DESTDIR}
. if ${MODGHC_BUILD:L:Mregister}
@${INSTALL_SCRIPT} ${WRKBUILD}/register.sh ${PREFIX}/lib/${DISTNAME}
@${INSTALL_SCRIPT} ${WRKBUILD}/unregister.sh ${PREFIX}/lib/${DISTNAME}
. endif
. endif
. if !target(do-regress)
do-regress:
@cd ${WRKBUILD} && exec ${SETENV} ${MODGHC_SETUP_CONF_ENV} \
${MODGHC_SETUP_PROG} test
. endif
. endif
.endif

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-aclocal_m4,v 1.1 2008/10/02 19:50:52 kili Exp $
--- aclocal.m4.orig Wed Apr 25 19:10:41 2007
+++ aclocal.m4 Tue Sep 30 15:45:58 2008
@@ -571,7 +571,7 @@ AC_DEFUN([FPTOOLS_CHECK_PERL_VERSION],
if grep "v5.8" conftest.out >/dev/null 2>&1; then
:
else
- if grep "version 6" conftest.out >/dev/null 2>&1; then
+ if grep "v5.10" conftest.out >/dev/null 2>&1; then
:
else
AC_MSG_ERROR([your version of perl probably won't work, try upgrading it.])

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-compat_compat_mk,v 1.1 2007/07/21 17:14:57 kili Exp $
When bootstrapping from HC-files, libghccompat needs some symbols
from libHSbase, which is pulled in during linkage anyway, but
unfortunately before libghccompat.
--- compat/compat.mk.orig Wed Apr 25 19:10:39 2007
+++ compat/compat.mk Sun May 6 12:50:19 2007
@@ -21,7 +21,7 @@ endif
# And similarly for when booting from .hc files:
HC_BOOT_LD_OPTS += -L$(GHC_COMPAT_DIR)
-HC_BOOT_LIBS += -lghccompat
+HC_BOOT_LIBS += -lghccompat -lHSbase
ifeq "$(Windows)" "YES"
# not very nice, but required for -lghccompat on Windows

View File

@ -1,24 +0,0 @@
$OpenBSD: patch-compiler_Makefile,v 1.1 2007/07/21 17:14:57 kili Exp $
When bootstrapping from HC-files, don't try to build with interpreter.
Don't set DESTDIR.
--- compiler/Makefile.orig Wed Apr 25 19:10:41 2007
+++ compiler/Makefile Tue May 8 14:08:32 2007
@@ -408,7 +408,7 @@ endif
# enabled when we are bootstrapping with the same version of GHC, and
# the interpreter is supported on this platform.
-ifeq "$(GhcWithInterpreter) $(bootstrapped)" "YES YES"
+ifeq "$(GhcWithInterpreter) $(bootstrapped) $(BootingFromHc)" "YES YES NO"
# Yes, include the interepreter, readline, and Template Haskell extensions
SRC_HC_OPTS += -DGHCI -DBREAKPOINT -package template-haskell
@@ -774,7 +774,6 @@ CLEAN_FILES += $(odir)/ghc-inplace
# but put it together with the libraries.
# Also don't want any interface files installed
-DESTDIR = $(INSTALL_LIBRARY_DIR_GHC)
ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
INSTALL_LIBEXECS += $(GHC_PROG)

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-configure_ac,v 1.1 2010/04/22 21:49:37 kili Exp $
--- configure.ac.orig Wed Mar 31 20:10:08 2010
+++ configure.ac Fri Apr 2 09:45:09 2010
@@ -321,7 +321,7 @@ esac
checkArch() {
case $1 in
- alpha|arm|hppa|hppa1_1|i386|ia64|m68k|mips|mipseb|mipsel|powerpc|powerpc64|rs6000|s390|sparc|sparc64|vax|x86_64)
+ alpha|amd64|arm|hppa|hppa1_1|i386|ia64|m68k|mips|mipseb|mipsel|powerpc|powerpc64|rs6000|s390|sparc|sparc64|vax|x86_64)
;;
*)
echo "Unknown arch $1"

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-docs_index_html,v 1.1 2010/04/22 21:49:37 kili Exp $
--- docs/index.html.orig Tue Apr 13 20:10:04 2010
+++ docs/index.html Sat Apr 17 18:32:34 2010
@@ -39,7 +39,7 @@
<LI>
<P>
- <B><A HREF="libraries/ghc/index.html">GHC API</A></B>
+ <B><A HREF="libraries/ghc-${MODGHC_VER}/index.html">GHC API</A></B>
</P>
<P>
Documentation for the GHC API.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-ghc_mk,v 1.1 2010/04/22 21:49:37 kili Exp $
I don't see the point in not installing libraries that are required
by the build (and by several external haskell libraries we have or
will have in the ports tree).
--- ghc.mk.orig Wed Mar 31 20:10:09 2010
+++ ghc.mk Fri Apr 2 09:47:24 2010
@@ -841,7 +841,7 @@ INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe
endif
-INSTALLED_PACKAGES = $(filter-out haskeline mtl terminfo utf8-string,$(PACKAGES))
+INSTALLED_PACKAGES = $(PACKAGES)
HIDDEN_PACKAGES = ghc-binary
define set_INSTALL_DISTDIR

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-libraries_Cabal_Distribution_PreProcess_hs,v 1.1 2007/07/22 22:37:25 kili Exp $
Pass more complete LDFLAGS to the hsc2hs preprocessor. Inspired by
development revision of Cabal, but much less intrusive, and I think
their approach is wrong, because it passes -R options via --lflags
to hsc2hs, which in turn passes it to ghc and then bails out.
--- libraries/Cabal/Distribution/PreProcess.hs.orig Wed Apr 25 19:23:22 2007
+++ libraries/Cabal/Distribution/PreProcess.hs Sun Jul 22 19:59:12 2007
@@ -237,6 +237,7 @@ ppHsc2hs bi lbi
++ [opt | opt@('-':c:_) <- ccOptions bi, c == 'D' || c == 'I']
++ ["--cflag=" ++ opt | opt@('-':'U':_) <- ccOptions bi]
++ ["--lflag=-L" ++ dir | dir <- extraLibDirs bi]
+ ++ ["--lflag=" ++ opt | opt@('-':'L':_) <- ldOptions bi]
++ ["--lflag=-l" ++ lib | lib <- extraLibs bi])
ppC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor

View File

@ -1,37 +1,12 @@
$OpenBSD: patch-libraries_Cabal_Distribution_Simple_Register_hs,v 1.1 2007/07/21 17:14:58 kili Exp $
Be more quiet, I don't want to see all that blurb from ghc-pkg.
Instead of a huge echo, just use a here-document.
--- libraries/Cabal/Distribution/Simple/Register.hs.orig Wed Apr 25 19:23:22 2007
+++ libraries/Cabal/Distribution/Simple/Register.hs Sun Jul 15 14:53:40 2007
@@ -342,7 +342,7 @@ rawSystemEmit scriptName True verbosity path args = do
#if mingw32_HOST_OS || mingw32_TARGET_OS
writeFile scriptName ("@" ++ path ++ concatMap (' ':) args)
#else
- writeFile scriptName ("#!/bin/sh\n\n"
+ writeFile scriptName ("#!/bin/sh\nexec > /dev/null\n"
++ (path ++ concatMap (' ':) args)
++ "\n")
p <- getPermissions scriptName
@@ -360,17 +360,12 @@ rawSystemPipe scriptName verbose pipeFrom path args =
#if mingw32_HOST_OS || mingw32_TARGET_OS
writeFile scriptName ("@" ++ path ++ concatMap (' ':) args)
#else
- writeFile scriptName ("#!/bin/sh\n\n"
- ++ "echo '" ++ escapeForShell pipeFrom
- ++ "' | "
- ++ (path ++ concatMap (' ':) args)
- ++ "\n")
+ writeFile scriptName ("#!/bin/sh\nexec > /dev/null\n"
+ ++ (path ++ concatMap (' ':) args) ++ " << 'EOF'\n"
+ ++ pipeFrom ++ "\nEOF\n")
p <- getPermissions scriptName
setPermissions scriptName p{executable=True}
#endif
- where escapeForShell [] = []
- escapeForShell (c@'\'':cs) = c : c : escapeForShell cs
- escapeForShell (c :cs) = c : escapeForShell cs
-- ------------------------------------------------------------
-- * Testing
$OpenBSD: patch-libraries_Cabal_Distribution_Simple_Register_hs,v 1.2 2010/04/22 21:49:37 kili Exp $
--- libraries/Cabal/Distribution/Simple/Register.hs.orig Wed Mar 31 20:10:21 2010
+++ libraries/Cabal/Distribution/Simple/Register.hs Fri Apr 2 09:45:09 2010
@@ -404,7 +404,7 @@ unregister pkg lbi regFlags = do
case compilerFlavor (compiler lbi) of
GHC ->
let Just ghcPkg = lookupProgram ghcPkgProgram (withPrograms lbi)
- invocation = HcPkg.unregisterInvocation ghcPkg Verbosity.normal
+ invocation = HcPkg.unregisterInvocation ghcPkg Verbosity.silent
packageDb pkgid
in if genScript
then writeFileAtomic unregScriptFileName

View File

@ -0,0 +1,45 @@
$OpenBSD: patch-libraries_base_GHC_IO_Encoding_Iconv_hs,v 1.1 2010/04/22 21:49:37 kili Exp $
This is needed for our version of GNU libiconv-1.13.
--- libraries/base/GHC/IO/Encoding/Iconv.hs.orig Tue Apr 13 20:10:08 2010
+++ libraries/base/GHC/IO/Encoding/Iconv.hs Mon Apr 19 13:26:59 2010
@@ -71,31 +71,31 @@ latin1 = unsafePerformIO (mkTextEncoding "Latin1")
{-# NOINLINE utf8 #-}
utf8 :: TextEncoding
-utf8 = unsafePerformIO (mkTextEncoding "UTF8")
+utf8 = unsafePerformIO (mkTextEncoding "UTF-8")
{-# NOINLINE utf16 #-}
utf16 :: TextEncoding
-utf16 = unsafePerformIO (mkTextEncoding "UTF16")
+utf16 = unsafePerformIO (mkTextEncoding "UTF-16")
{-# NOINLINE utf16le #-}
utf16le :: TextEncoding
-utf16le = unsafePerformIO (mkTextEncoding "UTF16LE")
+utf16le = unsafePerformIO (mkTextEncoding "UTF-16LE")
{-# NOINLINE utf16be #-}
utf16be :: TextEncoding
-utf16be = unsafePerformIO (mkTextEncoding "UTF16BE")
+utf16be = unsafePerformIO (mkTextEncoding "UTF-16BE")
{-# NOINLINE utf32 #-}
utf32 :: TextEncoding
-utf32 = unsafePerformIO (mkTextEncoding "UTF32")
+utf32 = unsafePerformIO (mkTextEncoding "UTF-32")
{-# NOINLINE utf32le #-}
utf32le :: TextEncoding
-utf32le = unsafePerformIO (mkTextEncoding "UTF32LE")
+utf32le = unsafePerformIO (mkTextEncoding "UTF-32LE")
{-# NOINLINE utf32be #-}
utf32be :: TextEncoding
-utf32be = unsafePerformIO (mkTextEncoding "UTF32BE")
+utf32be = unsafePerformIO (mkTextEncoding "UTF-32BE")
{-# NOINLINE localeEncoding #-}
localeEncoding :: TextEncoding

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-libraries_base_GHC_IO_Encoding_hs,v 1.1 2010/04/22 21:49:37 kili Exp $
--- libraries/base/GHC/IO/Encoding.hs.orig Tue Apr 20 20:10:11 2010
+++ libraries/base/GHC/IO/Encoding.hs Thu Apr 22 19:11:45 2010
@@ -94,7 +94,9 @@ utf32le = UTF32.utf32le
utf32be :: TextEncoding
utf32be = UTF32.utf32be
--- | The Unicode encoding of the current locale
+-- | The Unicode encoding of the current locale. On OpenBSD this is set
+-- to the value of the environment variable 'HS_ENCODING' or to 'latin1'
+-- if that variable isn't set.
localeEncoding :: TextEncoding
#if !defined(mingw32_HOST_OS)
localeEncoding = Iconv.localeEncoding

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-libraries_base_System_IO_hs,v 1.1 2010/04/22 21:49:37 kili Exp $
--- libraries/base/System/IO.hs.orig Tue Apr 20 20:10:11 2010
+++ libraries/base/System/IO.hs Thu Apr 22 19:08:46 2010
@@ -173,7 +173,9 @@ module System.IO (
-- on your system, which is also available as 'localeEncoding'.
-- (GHC note: on Windows, we currently do not support double-byte
-- encodings; if the console\'s code page is unsupported, then
- -- 'localeEncoding' will be 'latin1'.)
+ -- 'localeEncoding' will be 'latin1'. On OpenBSD, the default
+ -- encoding is always 'latin1' but can be overridden with the
+ -- environment variable `HS_ENCODING')
--
-- Encoding and decoding errors are always detected and reported,
-- except during lazy I/O ('hGetContents', 'getContents', and

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-libraries_base_System_Posix_Internals_hs,v 1.1 2010/04/22 21:49:37 kili Exp $
Kids, please don't blindly fix stupid compiler warnings without
looking at what you are changing. (In this case, the comment right
above the chunk was there for a reason, I guess; go read it)
Only this part for now, but there may be more.
--- libraries/base/System/Posix/Internals.hs.orig Tue Apr 13 20:10:09 2010
+++ libraries/base/System/Posix/Internals.hs Thu Apr 15 13:18:27 2010
@@ -327,8 +327,8 @@ setNonBlockingFD fd set = do
let flags' | set = flags .|. o_NONBLOCK
| otherwise = flags .&. complement o_NONBLOCK
unless (flags == flags') $ do
- throwErrnoIfMinus1Retry_ "fcntl_write" $
- c_fcntl_write fd const_f_setfl (fromIntegral flags')
+ _ <- c_fcntl_write fd const_f_setfl (fromIntegral flags')
+ return ()
#else
-- bogus defns for win32

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-libraries_base_cbits_PrelIOUtils_c,v 1.1 2010/04/22 21:49:37 kili Exp $
We have very limited locale support so used latin1 as default codeset
which can be overridden by the environment variable `HS_ENCODING'.
--- libraries/base/cbits/PrelIOUtils.c.orig Tue Apr 13 20:10:09 2010
+++ libraries/base/cbits/PrelIOUtils.c Mon Apr 19 23:12:08 2010
@@ -26,10 +26,13 @@ void debugBelch2(const char*s, char *t)
// Use a C wrapper for this because we avoid hsc2hs in base
#if HAVE_LANGINFO_H
-#include <langinfo.h>
+#include <stdlib.h>
+#include <string.h>
char *localeEncoding (void)
{
- return nl_langinfo(CODESET);
+ char *l;
+ l = getenv("HS_ENCODING");
+ return l != NULL ? l : "latin1";
}
#endif

View File

@ -0,0 +1,7 @@
$OpenBSD: patch-libraries_unix_tests_queryfdoption01_stdin,v 1.1 2010/04/22 21:49:37 kili Exp $
--- libraries/unix/tests/queryfdoption01.stdin.orig Sun Apr 18 16:36:09 2010
+++ libraries/unix/tests/queryfdoption01.stdin Sun Apr 18 16:36:09 2010
@@ -0,0 +1,3 @@
+You can't fcntl(fd, F_SETFL, O_NONBLOCK) /dev/null on (Open)BSD,
+so just supply this dummy file instead of running this test on
+/dev/null.

View File

@ -1,39 +0,0 @@
$OpenBSD: patch-mk_bootstrap_mk,v 1.5 2007/07/21 17:14:58 kili Exp $
Don't use -fno-unit-at-a-time on amd64 when bootstrapping from HC files.
Pull in our system libgmp.
libreadline needs libncurses.
--- mk/bootstrap.mk.orig Wed Apr 25 19:10:40 2007
+++ mk/bootstrap.mk Sat Jun 2 14:01:38 2007
@@ -22,7 +22,7 @@ PLATFORM_HC_BOOT_CC_OPTS += -fno-defer-pop -fomit-fram
endif
ifeq "$(x86_64_TARGET_ARCH)" "1"
-PLATFORM_HC_BOOT_CC_OPTS += -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-unit-at-a-time -fno-builtin
+PLATFORM_HC_BOOT_CC_OPTS += -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-builtin
endif
ifeq "$(hppa_TARGET_ARCH)" "1"
@@ -83,9 +83,11 @@ endif
ifeq "$(HaveLibGmp)" "NO"
DASH_L_GHC_RTS_GMP_DIR=-L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL)/gmp
+else
+DASH_L_GHC_RTS_GMP_DIR=-L$(GMP_LIB_DIRS)
endif
-HC_BOOT_LD_OPTS = \
+HC_BOOT_LD_OPTS += \
-L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL) \
$(DASH_L_GHC_RTS_GMP_DIR) \
-L$(FPTOOLS_TOP_ABS)/libraries/base \
@@ -142,7 +144,7 @@ HC_BOOT_LD_OPTS += \
HC_BOOT_LIBS =
ifeq "$(GhcWithInterpreter)" "YES"
-HC_BOOT_LIBS += -lHSreadline -lreadline -lHStemplate-haskell -lHSunix -lHSunix_cbits
+HC_BOOT_LIBS += -lHSreadline -lreadline -lcurses -lHStemplate-haskell -lHSunix -lHSunix_cbits
endif
HC_BOOT_LIBS += -lHSCabal -lHShaskell98 -lHSregex-compat -lHSregex-posix -lHSregex-base -lHSbase -lHSbase_cbits -lHSparsec -lHSrts -lgmp -lm $(EXTRA_HC_BOOT_LIBS)

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-mk_config_mk_in,v 1.1 2007/07/21 17:14:58 kili Exp $
--- mk/config.mk.in.orig Wed Apr 25 19:10:41 2007
+++ mk/config.mk.in Wed Jun 20 18:48:41 2007
@@ -513,11 +513,11 @@ libdir = $(prefix)
else
#
-# Unix: override libdir and datadir to put ghc-specific stuff in
-# a subdirectory with the version number included.
+# Unix: put everything into a ghc subdirectory, but don't fiddle with
+# version numbers, please. Datadir is only used for haddock defaults.
#
-libdir = $(libdir0)/ghc-$(ProjectVersion)
-datadir = $(datadir0)/ghc-$(ProjectVersion)
+libdir = $(libdir0)/ghc
+datadir = $(datadir0)/doc/ghc
endif # Windows

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-mk_install_mk_in,v 1.1 2010/04/22 21:49:37 kili Exp $
--- mk/install.mk.in.orig Wed Mar 31 20:10:10 2010
+++ mk/install.mk.in Fri Apr 2 09:45:09 2010
@@ -105,7 +105,7 @@ else
# to be in the same place (and things like ghc-pkg need to agree on
# where package.conf is, so we just set it globally).
#
-ghclibdir = $(libdir)/ghc-$(ProjectVersion)
+ghclibdir = $(libdir)/ghc
ghcdocdir = $(datarootdir)/doc/ghc
endif

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-mk_package_mk,v 1.5 2007/07/21 17:14:58 kili Exp $
No html subdirectories so we don't confuse haddock for ports depending
on this. See also patch-mk_config_mk_in, which changes datadir (and
this influences PKG_DATADIR).
--- mk/package.mk.orig Wed Apr 25 19:10:41 2007
+++ mk/package.mk Wed Jun 20 18:59:27 2007
@@ -45,7 +45,7 @@ DATA_DIR_INSTALLED = $(PKG_DATADIR)
DATA_DIR_INPLACE = $(FPTOOLS_TOP_ABS)/libraries/$(PACKAGE)
HTML_DIR_INPLACE = $(FPTOOLS_TOP_ABS)/libraries/$(PACKAGE)/html
-HTML_DIR_INSTALLED = $(PKG_DATADIR)/html/libraries/$(PACKAGE)
+HTML_DIR_INSTALLED = $(PKG_DATADIR)/libraries/$(PACKAGE)
HADDOCK_IFACE_INPLACE = $(HTML_DIR_INPLACE)/$(PACKAGE).haddock
HADDOCK_IFACE_INSTALLED = $(HTML_DIR_INSTALLED)/$(PACKAGE).haddock
@@ -371,7 +371,7 @@ CLEAN_FILES += $(PACKAGE).haddock
%.raw-hs : %.hs
$(HC) $(HC_OPTS) -D__HADDOCK__ -E $< -o $@
-HTML_INSTALL_DIR = $(datadir)/html/libraries/$(PACKAGE)
+HTML_INSTALL_DIR = $(datadir)/libraries/$(PACKAGE)
# NOT the same as HTML_DIR_INSTALLED when BIN_DIST is on
install-docs :: $(HTML_DOC)

View File

@ -1,51 +0,0 @@
$OpenBSD: patch-rts_Adjustor_c,v 1.1 2007/07/21 17:14:58 kili Exp $
--- rts/Adjustor.c.orig Wed Apr 25 19:10:41 2007
+++ rts/Adjustor.c Thu May 31 22:08:54 2007
@@ -85,12 +85,8 @@ static void GNUC3_ATTRIBUTE(used) obscure_ccall_wrapp
}
extern void obscure_ccall_ret_code(void);
-#if defined(openbsd_HOST_OS)
-static unsigned char *obscure_ccall_ret_code_dyn;
#endif
-#endif
-
#if defined(x86_64_HOST_ARCH)
static void GNUC3_ATTRIBUTE(used) obscure_ccall_wrapper(void)
{
@@ -324,11 +320,7 @@ createAdjustor(int cconv, StgStablePtr hptr,
adj_code[0x0a] = (unsigned char)0x68; /* pushl obscure_ccall_ret_code */
*((StgFunPtr*)(adj_code + 0x0b)) =
-#if !defined(openbsd_HOST_OS)
(StgFunPtr)obscure_ccall_ret_code;
-#else
- (StgFunPtr)obscure_ccall_ret_code_dyn;
-#endif
adj_code[0x0f] = (unsigned char)0xff; /* jmp *%eax */
adj_code[0x10] = (unsigned char)0xe0;
@@ -1100,22 +1092,4 @@ if ( *(unsigned char*)ptr != 0xe8 ) {
*((unsigned char*)ptr) = '\0';
freeExec(ptr);
-}
-
-
-/*
- * Function: initAdjustor()
- *
- * Perform initialisation of adjustor thunk layer (if needed.)
- */
-void
-initAdjustor(void)
-{
-#if defined(i386_HOST_ARCH) && defined(openbsd_HOST_OS)
- obscure_ccall_ret_code_dyn = allocateExec(4);
- obscure_ccall_ret_code_dyn[0] = ((unsigned char *)obscure_ccall_ret_code)[0];
- obscure_ccall_ret_code_dyn[1] = ((unsigned char *)obscure_ccall_ret_code)[1];
- obscure_ccall_ret_code_dyn[2] = ((unsigned char *)obscure_ccall_ret_code)[2];
- obscure_ccall_ret_code_dyn[3] = ((unsigned char *)obscure_ccall_ret_code)[3];
-#endif
}

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-rts_Linker_c,v 1.2 2007/09/16 20:05:12 kili Exp $
We don't have MAP_ANONYMOUS (which is the same as MAP_ANON on Linux,
but the latter has been deprecated). We also don't have that MAP_32BIT
Linux provides for amd64, so just zap that flag to 0. In addition
EM_X86_64 is called EM_AMD64 on OpenBSD, so just replace it to
reenable GHCi (noted by dons).
--- rts/Linker.c.orig Wed Apr 25 19:10:41 2007
+++ rts/Linker.c Sun Sep 16 12:27:02 2007
@@ -73,6 +73,11 @@
#endif
+#ifdef openbsd_HOST_OS
+# define MAP_ANONYMOUS MAP_ANON
+# define MAP_32BIT 0
+#endif
+
#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
# define OBJFORMAT_ELF
#elif defined(cygwin32_HOST_OS) || defined (mingw32_HOST_OS)
@@ -2923,8 +2928,8 @@ ocVerifyImage_ELF ( ObjectCode* oc )
case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break;
#endif
case EM_PPC: IF_DEBUG(linker,debugBelch( "powerpc32" )); break;
-#ifdef EM_X86_64
- case EM_X86_64: IF_DEBUG(linker,debugBelch( "x86_64" )); break;
+#ifdef EM_AMD64
+ case EM_AMD64: IF_DEBUG(linker,debugBelch( "x86_64" )); break;
#endif
default: IF_DEBUG(linker,debugBelch( "unknown" ));
errorBelch("%s: unknown architecture", oc->fileName);

View File

@ -1,18 +0,0 @@
$OpenBSD: patch-rts_Makefile,v 1.1 2007/07/21 17:14:58 kili Exp $
--- rts/Makefile.orig Wed Apr 25 19:10:41 2007
+++ rts/Makefile Thu May 3 14:10:53 2007
@@ -192,10 +192,11 @@ SRC_MKDEPENDC_OPTS += -DPROFILING -DTHREADED_RTS -DDEB
# -----------------------------------------------------------------------------
# The auto-generated apply code
-# We want a slightly different version for the unregisterised way, so we make
-# AutoApply on a per-way basis (eg. AutoApply_p.cmm).
+# The original AutoApply$(_way).cmm trick breaks hc bundle generation.
+# For the OpenBSD port, we won't do both ways (registered and
+# unregistered) in one shot, so just keep this simple and unbreak the build.
-AUTO_APPLY_CMM = AutoApply$(_way).cmm
+AUTO_APPLY_CMM = AutoApply.cmm
ifneq "$(BootingFromHc)" "YES"
$(AUTO_APPLY_CMM): $(GHC_GENAPPLY)

View File

@ -1,13 +0,0 @@
$OpenBSD: patch-rts_RtsStartup_c,v 1.1 2007/07/21 17:14:58 kili Exp $
--- rts/RtsStartup.c.orig Wed Apr 25 19:10:41 2007
+++ rts/RtsStartup.c Thu May 31 22:09:15 2007
@@ -180,9 +180,6 @@ hs_init(int *argc, char **argv[])
synchroniseSystem(); // calls initParallelSystem etc
#endif /* PAR */
- /* Perform initialisation of adjustor thunk layer. */
- initAdjustor();
-
/* initialise scheduler data structures (needs to be done before
* initStorage()).
*/

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-testsuite_driver_testlib_py,v 1.1 2010/04/22 21:49:37 kili Exp $
--- testsuite/driver/testlib.py.orig Thu Apr 15 15:23:09 2010
+++ testsuite/driver/testlib.py Fri Apr 16 16:02:57 2010
@@ -1224,6 +1224,12 @@ def compare_outputs( kind, normaliser, extra_normalise
actual_raw = read_no_crs(actual_file)
actual_str = normaliser(actual_raw)
+ # Strip OpenBSDs linker warnings about strcpy(3) & friends.
+ if config.os == 'openbsd':
+ actual_str = re.sub('.*: In function .*:\n: warning: .* is .* misused, please use .*\n',
+ '', actual_str)
+
+
if extra_normaliser(expected_str) != extra_normaliser(actual_str):
print 'Actual ' + kind + ' output differs from expected:'
@@ -1238,13 +1244,13 @@ def compare_outputs( kind, normaliser, extra_normalise
# Ignore whitespace when diffing. We should only get to this
# point if there are non-whitespace differences
- r = os.system( 'diff -uw ' + expected_normalised_file + \
+ r = os.system( 'diff -auw ' + expected_normalised_file + \
' ' + actual_normalised_file )
# If for some reason there were no non-whitespace differences,
# then do a full diff
if r == 0:
- r = os.system( 'diff -u ' + expected_normalised_file + \
+ r = os.system( 'diff -au ' + expected_normalised_file + \
' ' + actual_normalised_file )
if config.accept:

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-testsuite_tests_ghc-regress_codeGen_should_run_all_T,v 1.1 2010/04/22 21:49:37 kili Exp $
With 8k of stack, this test fails for WAY=normal.
--- testsuite/tests/ghc-regress/codeGen/should_run/all.T.orig Thu Apr 15 15:23:20 2010
+++ testsuite/tests/ghc-regress/codeGen/should_run/all.T Sun Apr 18 18:23:34 2010
@@ -77,5 +77,5 @@ test('1861', extra_run_opts('0'), compile_and_run, [''
test('2838', normal, compile_and_run, [''])
test('3207', normal, compile_and_run, [''])
test('3561', normal, compile_and_run, [''])
-test('3677', extra_run_opts('+RTS -K8k -RTS'), compile_and_run, [''])
+test('3677', extra_run_opts('+RTS -K10k -RTS'), compile_and_run, [''])

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-testsuite_timeout_Makefile,v 1.1 2010/04/22 21:49:37 kili Exp $
--- testsuite/timeout/Makefile.orig Thu Apr 15 15:26:22 2010
+++ testsuite/timeout/Makefile Fri Apr 16 16:02:57 2010
@@ -27,7 +27,9 @@ $(TIMEOUT_PROGRAM): timeout.py
rm -rf install-inplace
mkdir install-inplace
mkdir install-inplace/bin
- cp $< $@
+ cp $< $@.py
+ echo '#!/bin/sh' > $@
+ echo exec ${PYTHON} \$$0.py \"\$$@\" >> $@
chmod +x $@
else
# The python timeout program doesn't work on mingw, so we still use the

View File

@ -3,22 +3,18 @@ interactive environment for the functional language Haskell. Highlights:
* GHC supports the entire Haskell 98 language plus a wide variety of
extensions.
* GHC works on several platforms including Windows and most varieties of
Unix, and several different processor architectures. There are detailed
instructions for porting GHC to a new platform.
* GHC has extensive optimisation capabilities, including inter-module
optimisation.
* GHC compiles Haskell code either by using an intermediate C compiler
(GCC), or by generating native code on some platforms. The interactive
environment compiles Haskell to bytecode, and supports execution of
mixed bytecode/compiled programs.
* GHC works on several platforms including Windows and a few varieties of
Unix, and a few different processor architectures. There are detailed
instructions for porting GHC to a new platform. Which doesn't work.
* GHC has extensive optimisation capabilities, including inter-module
optimisation.
* GHC compiles Haskell code either by using an intermediate C compiler
(GCC), or by generating native code on most currently supported
platforms. The interactive environment compiles Haskell to
bytecode, and supports execution of mixed bytecode/compiled
programs.
* Profiling is supported, both by time/allocation and various kinds of
heap profiling.
* GHC comes with a wide range of libraries.
The following flavors are available:
- native_bootstrap (PSEUDO_FLAVOR):
Use an already installed ghc for bootstrapping (default is
to boot from .hc files). If there's no preinstalled GHC, this
may lead to GHC being built twice!
heap profiling.
* GHC comes with a minimal range of libraries, but a wide range of
additional libraries are available as separate packages, including
the full set of the Haskell Platform.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff