Import of pkgsrc-2014Q1

This commit is contained in:
2014-11-05 12:41:07 +01:00
parent 785076ae39
commit 9a8c06dafb
19365 changed files with 828089 additions and 278039 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
#
GHC_VERSION="@GHC_VERSION@"
case ${STAGE} in
DEINSTALL)
${RM} -f ${PKG_PREFIX}/lib/${PKGBASE}-${GHC_VERSION}/package.conf.d/package.cache
;;
esac
+10
View File
@@ -0,0 +1,10 @@
GHC: The Glasgow Haskell Compiler.
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler for the functional programming language Haskell 98
(http://www.haskell.org). GHC compiles Haskell to either native code
or C. It implements numerous experimental language extensions to
Haskell, including concurrency, a foreign language interface, several
type-system extensions, exceptions, and so on. GHC comes with a
generational garbage collector, a space and time profiler, and a
comprehensive set of libraries.
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
#
case ${STAGE} in
POST-INSTALL)
${PKG_PREFIX}/bin/ghc-pkg recache
;;
esac
+191
View File
@@ -0,0 +1,191 @@
# $NetBSD: Makefile,v 1.9 2014/02/08 12:42:25 obache Exp $
# -----------------------------------------------------------------------------
# Package metadata
#
DISTNAME= ghc-7.6.3-src
PKGNAME= ${DISTNAME:S/-src$//}
PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= http://www.haskell.org/ghc/dist/${PKGVERSION_NOREV}/
EXTRACT_SUFX= .tar.bz2
MAINTAINER= pho@cielonegro.org
HOMEPAGE= http://www.haskell.org/ghc/
COMMENT= Compiler for the functional language Haskell
LICENSE= modified-bsd
# GHC requires GHC to build itself. Formerly we could work around this
# bootstrapping problem by creating a special archive containing C
# sources compiled from Haskell sources, but that's no longer
# possible. So we have to prepare stripped-down binaries sufficient to
# bootstrap compilers for each platforms. If you want to build them
# yourself, follow an instruction in the ./TODO file.
ONLY_FOR_PLATFORM= \
Darwin-*-powerpc \
FreeBSD-*-i386 \
Linux-*-x86_64 \
NetBSD-*-i386 \
NetBSD-*-x86_64 \
SunOS-5.11-*
# -----------------------------------------------------------------------------
# Distfiles
#
DISTFILES= ${DEFAULT_DISTFILES}
#.if make(distinfo)
#DISTFILES+= ${PKGNAME_NOREV}-boot-i386-unknown-freebsd.tar.xz
#DISTFILES+= ${PKGNAME_NOREV}-boot-i386-unknown-netbsd.tar.xz
#DISTFILES+= ${PKGNAME_NOREV}-boot-powerpc-apple-darwin.tar.xz
#DISTFILES+= ${PKGNAME_NOREV}-boot-x86_64-unknown-linux.tar.xz
#DISTFILES+= ${PKGNAME_NOREV}-boot-x86_64-unknown-netbsd.tar.xz
#DISTFILES+= ${PKGNAME_NOREV}-boot-i386-unknown-solaris2.tar.gz
#DISTFILES+= ${PKGNAME_NOREV}-boot-x86_64-unknown-solaris2.tar.xz
#.else
#DISTFILES+= ${BOOT_ARCHIVE}
#.endif
WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
# We don't want to extract all of the DISTFILEs.
EXTRACT_ONLY= ${DEFAULT_DISTFILES}
# -----------------------------------------------------------------------------
# Tools
#
USE_TOOLS+= autoconf gmake perl:run
GNU_CONFIGURE= yes
USE_GNU_CONFIGURE_HOST= no
CONFIGURE_ARGS+= \
--with-gcc=${CC:Q} \
--with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/include \
--with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/lib \
--with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/include \
--with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/lib
CONFIGURE_ENV+= \
CONF_CC_OPTS_STAGE0=${CFLAGS:Q} \
CONF_GCC_LINKER_OPTS_STAGE0=${LDFLAGS:Q} \
CONF_LD_LINKER_OPTS_STAGE0=${LDFLAGS:Q} \
CONF_CC_OPTS_STAGE1=${CFLAGS:Q} \
CONF_GCC_LINKER_OPTS_STAGE1=${LDFLAGS:Q} \
CONF_LD_LINKER_OPTS_STAGE1=${LDFLAGS:Q} \
CONF_CC_OPTS_STAGE2=${CFLAGS:Q} \
CONF_GCC_LINKER_OPTS_STAGE2=${LDFLAGS:Q} \
CONF_LD_LINKER_OPTS_STAGE2=${LDFLAGS:Q} \
PerlCmd=${PERL5:Q}
# -----------------------------------------------------------------------------
# Build hooks
#
# We patch configure.ac in some directories.
post-patch:
@${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}"
${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf
# Define the target "pre-configure" and non-standard "bootstrap".
.include "../../lang/ghc7/bootstrap.mk"
.for i in ${DISTFILES:M*-boot-*}
SITES.${i}?= ${MASTER_SITE_LOCAL}
.endfor
# Our pre-configure phase installs a bindist of bootstrapping compiler
# directly into TOOLS_DIR so that ./configure can find it.
post-configure:
# Here we generate mk/build.mk dynamically.
${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk
# We need to tell the libraries/terminfo/configure that our ncurses is
# in a non-standard path. Without that, the resulting GHC tries to
# link programs by executing ld(1) without passing it -L${PREFIX:Q}/lib.
${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
--configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/include \
--configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/lib" >> ${WRKSRC:Q}/mk/build.mk
# The ghc compiler does normally split the generated asm files into small
# parts before sending them to gcc, to enable the linker to eliminate
# unused parts. This does however not play nice with the pkgsrc
# framework, and the result is that the build takes more than 5 times
# as long than when the files are not split. See
# http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html
# for a description of the problem.
# Disable file splitting until pkgsrc gets improved.
${RUN} ${ECHO} "SplitObjs = NO" >> ${WRKSRC:Q}/mk/build.mk
# If there is HsColour is in the PATH, GHC's build system tries to use
# it without even checking if it really works. That's not what we
# appreciate.
${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk
# Don't even think of PDF.
${RUN} ${ECHO} "BUILD_DOCBOOK_PS = NO" >> ${WRKSRC:Q}/mk/build.mk
${RUN} ${ECHO} "BUILD_DOCBOOK_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk
# -----------------------------------------------------------------------------
# Installation/removal hooks
#
# Substitutions for INSTALL and DEINSTALL that handles package.cache.
FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV}
# We don't want package.cache to be in the PLIST.
post-install:
${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache
# -----------------------------------------------------------------------------
# PLIST
#
# We can't use static PLIST because the package installs some files
# whose names are randomly generated, namely
# lib/${PKGNAME}/package.conf.d/*.conf
#
PRINT_PLIST_AWK+= /lib\/${PKGNAME_NOREV}\/package\.conf\.d/ { next; }
# If we were lucky we could just use "PLIST_TYPE = dynamic", but the
# feature has seemingly bitrotted.
.include "../../mk/bsd.prefs.mk"
.if empty(USE_DESTDIR:M[Yy][Ee][Ss])
GENERATE_PLIST+= \
cd ${PREFIX:Q} && \
${FIND} lib/${PKGNAME_NOREV}/package.conf.d -xdev -newer ${_COOKIE.extract} \! -type d -print | ${SORT} -d;
.else
GENERATE_PLIST+= \
cd ${DESTDIR:Q}${PREFIX:Q} && \
${FIND} lib/${PKGNAME_NOREV}/package.conf.d -xdev \! -type d -print | ${SORT} -d;
.endif
# -----------------------------------------------------------------------------
# Sanity checks
#
# There is an unused script which don't pass the portability test.
CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw
# GHC currently *requires* ${PREFIX}/lib to be in
# "/etc/ld-elf.so.conf". See
# http://hackage.haskell.org/trac/ghc/ticket/2933
CHECK_SHLIBS_SUPPORTED= no
# -----------------------------------------------------------------------------
# Dependencies
#
BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt
BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/gmp/buildlink3.mk"
.include "../../mk/curses.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
+5386
View File
File diff suppressed because it is too large Load Diff
+30
View File
@@ -0,0 +1,30 @@
.. -*- rst -*-
wip/ghc TODO
============
* Modify configure.ac and rules/build-package-data.mk to allow
``--with-curses-{includes,libraries}`` to be passed to the top-level
``configure``, and send a patch to the upstream.
* Add the following ``./configure`` flags to eliminate
``patch-Makefile`` and ``patch-ghc.mk``:
* ``--with-dist-archiver={bzip2,xz} [default=bzip2]``
* ``BZIP2FLAGS``
* ``XZFLAGS``
* Let ``./configure`` check for broken binutils and provide a better
fix for ``patch-rts_StgCRun.c``.
* Build more bootstrapping compilers to support more platforms.
How to build a bootstrapping compiler
-------------------------------------
You need a working compiler to build one. If you think there are no
bindists for your platform, you may need to cross-build a compiler
yourself: `Cross-compiling GHC
<http://hackage.haskell.org/trac/ghc/wiki/Building/CrossCompiling>`_
Assuming you have a working ghc in your PATH, just run ``bmake patch
&& bmake bootstrap`` and see if you are lucky enough.
+143
View File
@@ -0,0 +1,143 @@
# $NetBSD: bootstrap.mk,v 1.9 2014/02/05 06:38:05 obache Exp $
# -----------------------------------------------------------------------------
# Select a bindist of bootstrapping compiler based on a per-platform
# basis.
#
# BOOT_ARCHIVE
# This variable is set to the name of compressed archive file of a
# bootstrapping compiler for the current platform.
#
# BOOT_TARBALL
# Similar to BOOT_ARCHIVE, but "*.tar" not "*.tar.xz".
#
.include "../../mk/bsd.prefs.mk"
.if ${MACHINE_ARCH} == "i386" && ${OPSYS} == "FreeBSD"
BOOT_ARCHIVE:= ${PKGNAME}-boot-i386-unknown-freebsd.tar.xz
.elif ${MACHINE_ARCH} == "i386" && ${OPSYS} == "NetBSD"
BOOT_ARCHIVE:= ${PKGNAME}-boot-i386-unknown-netbsd.tar.xz
.elif ${MACHINE_ARCH} == "powerpc" && ${OPSYS} == "Darwin"
BOOT_ARCHIVE:= ${PKGNAME_NOREV}-boot-powerpc-apple-darwin.tar.xz
# Existence of libelf makes LeadingUnderscore being "NO", which is
# incorrect for this platform. See ${WRKSRC}/aclocal.m4
# (FP_LEADING_UNDERSCORE)
CONFLICTS+= libelf-[0-9]*
.elif ${MACHINE_ARCH} == "x86_64" && ${OPSYS} == "Linux"
BOOT_ARCHIVE:= ${PKGNAME}-boot-x86_64-unknown-linux.tar.xz
.elif ${MACHINE_ARCH} == "x86_64" && ${OPSYS} == "NetBSD"
BOOT_ARCHIVE:= ${PKGNAME}-boot-x86_64-unknown-netbsd.tar.xz
.elif !empty(MACHINE_PLATFORM:MSunOS-5.11-i386)
BOOT_ARCHIVE:= ${PKGNAME}-boot-i386-unknown-solaris2.tar.gz
.elif !empty(MACHINE_PLATFORM:MSunOS-5.11-x86_64)
BOOT_ARCHIVE:= ${PKGNAME}-boot-x86_64-unknown-solaris2.tar.xz
.else
PKG_FAIL_REASON+= "internal error: unsupported platform"
.endif
BOOT_TARBALL= ${BOOT_ARCHIVE:C/\.xz$//:C/\.gz$//}
# -----------------------------------------------------------------------------
# The "pre-configure" hook
#
# Install a bootstrapping compiler directly into TOOLS_DIR so that
# ./configure can find it.
#
USE_TOOLS+= gmake xzcat xz
pre-configure:
@${TEST} -f ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE} || \
${FAIL_MSG} "Put your trusted bootstrap archive as ${DISTDIR}/${DIST_SUBDIR}/${BOOT_ARCHIVE}"
@${PHASE_MSG} "Extracting bootstrapping compiler for ${PKGNAME}"
${RUN} ${MKDIR} ${WRKDIR:Q}/build-extract
${RUN} cd ${WRKDIR:Q}/build-extract && \
${EXTRACT_CMD_DEFAULT} ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE}
@${PHASE_MSG} "Preparing bootstrapping compiler for ${PKGNAME}"
${RUN} cd ${WRKDIR:Q}/build-extract/${PKGNAME_NOREV}-boot && \
${SH} ./configure \
--prefix=${TOOLS_DIR:Q} && \
${MAKE_PROGRAM} install
# -----------------------------------------------------------------------------
# An unusual target "bootstrap"
#
# Build a bootstrapping compiler using an already installed GHC. This
# can certainly impossible if you don't have one. It's absolutely
# important to build it with the fewest possible run-time
# dependencies, otherwise the resulting binary can easily get
# unusable.
#
.PHONY: bootstrap
#BUILDLINK_PASSTHRU_DIRS= ${PREFIX}/lib/${PKGNAME_NOREV}
bootstrap: pre-bootstrap .WAIT ${WRKDIR}/${BOOT_ARCHIVE}
@${PHASE_MSG} "Done creating" ${WRKDIR}/${BOOT_ARCHIVE}
.PHONY: pre-bootstrap
pre-bootstrap:
@${TEST} \! -f ${_COOKIE.configure} || \
(${ERROR_MSG} "You have already configured the package in a way\
that building bootstrapping compiler is impossible."; \
${FAIL_MSG} "Please run \"${MAKE} clean patch\" first.");
@${TEST} -f ${_COOKIE.patch} || \
${FAIL_MSG} "Please run \"${MAKE} patch\" first."
@${DO_NADA}
${WRKDIR}/lndir:
@${PHASE_MSG} "Building lndir(1) to duplicate the source tree."
cd ${WRKSRC:Q}/utils/lndir && \
${CC:Q} lndir.c -o ${.TARGET}
${WRKDIR}/stamp-lndir-boot: ${WRKDIR}/lndir
@${PHASE_MSG} "Duplicating the source tree for bootstrapping ${PKGNAME_NOREV}"
${MKDIR} ${WRKDIR:Q}/build-boot
cd ${WRKDIR:Q}/build-boot && \
${WRKDIR}/lndir -silent ../${PKGNAME_NOREV:Q}
${TOUCH} ${.TARGET}
${WRKDIR}/stamp-configure-boot: ${WRKDIR}/stamp-lndir-boot
@${PHASE_MSG} "Configuring bootstrapping compiler ${PKGNAME_NOREV}"
${MKDIR} ${WRKDIR:Q}/build-boot
cd ${WRKDIR:Q}/build-boot && \
${PKGSRC_SETENV} PATH=${PATH} \
CONF_CC_OPTS_STAGE0=${CFLAGS:Q} \
CONF_GCC_LINKER_OPTS_STAGE0="-L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib" \
CONF_LD_LINKER_OPTS_STAGE0="-L${PREFIX}/lib ${LINKER_RPATH_FLAG}${PREFIX}/lib" \
CONF_CC_OPTS_STAGE1=${CFLAGS:Q} \
CONF_GCC_LINKER_OPTS_STAGE1="-L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib" \
CONF_LD_LINKER_OPTS_STAGE1="-L${PREFIX}/lib ${LINKER_RPATH_FLAG}${PREFIX}/lib" \
CONF_CC_OPTS_STAGE2=${CFLAGS:Q} \
CONF_GCC_LINKER_OPTS_STAGE2="-L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib" \
CONF_LD_LINKER_OPTS_STAGE2="-L${PREFIX}/lib ${LINKER_RPATH_FLAG}${PREFIX}/lib" \
${SH} ./configure && \
${SED} -e "s,@CURSES_INCDIR@,${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.ncurses:Uinclude},g" \
-e "s,@CURSES_LIBDIR@,${BUILDLINK_PREFIX.curses:Q}/lib,g" \
${FILESDIR:Q}/bootstrap.build.mk > mk/build.mk
${TOUCH} ${.TARGET}
${WRKDIR}/stamp-build-boot: ${WRKDIR}/stamp-configure-boot
@${PHASE_MSG} "Building bootstrapping compiler ${PKGNAME_NOREV}"
${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD}
${TOUCH} ${.TARGET}
${WRKDIR}/${BOOT_TARBALL}: ${WRKDIR}/stamp-build-boot
@${PHASE_MSG} "Creating binary distribution of bootstrapping ${PKGNAME_NOREV}"
${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} binary-dist
${MV} -f ${WRKDIR:Q}/build-boot/${BOOT_TARBALL} ${.TARGET}
# This can take up half an hour. Memory usage is also very high, about 680 MiB.
${WRKDIR}/${BOOT_ARCHIVE}: ${WRKDIR}/${BOOT_TARBALL}
@${PHASE_MSG} "Compressing binary distribution of bootstrapping ${PKGNAME_NOREV}"
${XZ} --verbose -9 --extreme ${WRKDIR:Q}/${BOOT_TARBALL}
+16
View File
@@ -0,0 +1,16 @@
# $NetBSD: buildlink3.mk,v 1.3 2014/02/08 12:44:16 obache Exp $
BUILDLINK_TREE+= ghc
.if !defined(GHC_BUILDLINK3_MK)
GHC_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.ghc+= ghc>=7.6.3
BUILDLINK_PKGSRCDIR.ghc?= ../../lang/ghc7
.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/gmp/buildlink3.mk"
.include "../../mk/curses.buildlink3.mk"
.endif # GHC_BUILDLINK3_MK
BUILDLINK_TREE+= -ghc
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: distinfo,v 1.2 2013/12/16 06:23:09 obache Exp $
SHA1 (ghc-7.6.3-src.tar.bz2) = 8938e1ef08b37a4caa071fa169e79a3001d065ff
RMD160 (ghc-7.6.3-src.tar.bz2) = 82a673ed38b7cf9a59afeb01057625fc761a822b
Size (ghc-7.6.3-src.tar.bz2) = 110763823 bytes
SHA1 (patch-Makefile) = a6692a4a90b8003a8719c51d82d15f5af0ba1907
SHA1 (patch-ghc.mk) = c4210aaa3e2b4a319b0b70da375ac89fddde5cb7
SHA1 (patch-libraries_integer-gmp_configure.ac) = bc5ce3a6c39d681c413eb08b66e7287e39406fe0
SHA1 (patch-libraries_integer-simple_GHC_Integer.hs) = f079285bc489c194959b9bee2aa5c977ec77ae1e
SHA1 (patch-libraries_integer-simple_GHC_Integer_Type.hs) = b3140e169726f78f6d3b4edcd4cc119b6f767bfa
SHA1 (patch-rts_Linker.c) = 86c080636fd9b983baeb05f26a90282ffa6eec34
SHA1 (patch-rts_StgCRun.c) = dcbc883cb4826aeccac0be09647b7889c7809271
SHA1 (patch-rts_ghc.mk) = 4dd33c5ac593736a9fa0fdbdd65df90549fac771
+35
View File
@@ -0,0 +1,35 @@
# -*- makefile-gmake -*-
#
# This is a build conf for bootstrapping compilers.
#
# We don't want any docs.
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS = NO
BUILD_DOCBOOK_PDF = NO
BUILD_MAN = NO
# Enabling evil-splitter reduces bindist size, which is good. However
# it introduces a run-time dependency on perl, which is unacceptable.
SplitObjs = NO
# We only want vanilla libraries and rts. No profiling, no shared
# libraries, no debugging, no event logging.
GhcLibWays = v
GhcRTSWays =
# I'm not sure disabling GHCi significantly reduces the bindist size,
# but we don't need it anyway.
GhcWithInterpreter = NO
# We don't want in-place GMP to be statically linked as it increases
# the bindist size. Dynamic linkage is even worse.
INTEGER_LIBRARY = integer-simple
# We'd like to distinguish bootstrapping bindists from normal ones.
BIN_DIST_NAME = ghc-$(ProjectVersion)-boot
libraries/terminfo_CONFIGURE_OPTS += \
--configure-option=--with-curses-includes=@CURSES_INCDIR@ \
--configure-option=--with-curses-libraries=@CURSES_LIBDIR@
+16
View File
@@ -0,0 +1,16 @@
$NetBSD: patch-Makefile,v 1.1 2013/12/12 12:47:17 obache Exp $
Required by patches/patch-ghc.mk
--- Makefile.orig 2013-02-14 02:53:07.000000000 +0000
+++ Makefile
@@ -75,7 +75,7 @@ binary-dist: binary-dist-prep
ifeq "$(mingw32_TARGET_OS)" "1"
mv bindistprep/*.exe .
endif
- mv bindistprep/*.tar.bz2 .
+ mv bindistprep/*.tar .
binary-dist-prep:
ifeq "$(mingw32_TARGET_OS)" "1"
+23
View File
@@ -0,0 +1,23 @@
$NetBSD: patch-ghc.mk,v 1.1 2013/12/12 12:47:17 obache Exp $
We want bootstrapping bindists to be as small as possible, and bzip2
is not enough:
% du -sh ghc-*.tar*
291M ghc-7.6.2-boot-powerpc-apple-darwin.tar
60M ghc-7.6.2-boot-powerpc-apple-darwin.tar.bz2
32M ghc-7.6.2-boot-powerpc-apple-darwin.tar.xz
--- ghc.mk.orig 2013-02-14 02:24:35.000000000 +0000
+++ ghc.mk
@@ -1009,7 +1009,8 @@ unix-binary-dist-prep:
$(call removeFiles,$(BIN_DIST_PREP_TAR))
# h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
# tree then we want to include the real file, not a symlink to it
- cd bindistprep && "$(TAR_CMD)" hcf - -T ../$(BIN_DIST_LIST) | bzip2 -c > ../$(BIN_DIST_PREP_TAR_BZ2)
+ "$(MKDIRHIER)" compiler/stage2/doc # Workaround needed when building no docs.
+ cd bindistprep && "$(TAR_CMD)" hcf ../$(BIN_DIST_PREP_TAR) -T ../$(BIN_DIST_LIST)
windows-binary-dist-prep:
$(call removeTrees,bindistprep/)
@@ -0,0 +1,42 @@
$NetBSD: patch-libraries_integer-gmp_configure.ac,v 1.1 2013/12/12 12:47:17 obache Exp $
In Darwin, integer-gmp prefers GMP.framework when it happens to be
installed somewhere in the system, even though it doesn't come with
Darwin. Let it stop that. (Already fixed in the upstream.)
--- libraries/integer-gmp/configure.ac.orig 2013-01-27 13:36:41.000000000 +0000
+++ libraries/integer-gmp/configure.ac
@@ -45,18 +45,20 @@ dnl-------------------------------------
dnl * Mac OS X only: check for GMP.framework
dnl--------------------------------------------------------------------
-case $target_os in
- darwin*)
- AC_MSG_CHECKING([for GMP.framework])
- save_libs="$LIBS"
- LIBS="-framework GMP"
- AC_TRY_LINK_FUNC(__gmpz_fdiv_qr,
- [HaveFrameworkGMP=YES; GMP_FRAMEWORK=GMP; GMP_LIBS=],
- [HaveFrameworkGMP=NO])
- LIBS="$save_libs"
- AC_MSG_RESULT([$HaveFrameworkGMP])
- ;;
-esac
+if test "$HaveLibGmp" = "NO"; then
+ case $target_os in
+ darwin*)
+ AC_MSG_CHECKING([for GMP.framework])
+ save_libs="$LIBS"
+ LIBS="-framework GMP"
+ AC_TRY_LINK_FUNC(__gmpz_fdiv_qr,
+ [HaveFrameworkGMP=YES; GMP_FRAMEWORK=GMP],
+ [HaveFrameworkGMP=NO])
+ LIBS="$save_libs"
+ AC_MSG_RESULT([$HaveFrameworkGMP])
+ ;;
+ esac
+fi
AC_CHECK_HEADER([gmp.h], , [HaveFrameworkGMP=NO; HaveLibGmp=NO; GMP_LIBS=])
@@ -0,0 +1,15 @@
$NetBSD: patch-libraries_integer-simple_GHC_Integer.hs,v 1.1 2013/12/12 12:47:17 obache Exp $
Missing functions: already fixed in the upstream.
--- libraries/integer-simple/GHC/Integer.hs.orig 2013-02-13 18:50:32.000000000 +0000
+++ libraries/integer-simple/GHC/Integer.hs
@@ -27,6 +27,7 @@ module GHC.Integer (
plusInteger, minusInteger, timesInteger, negateInteger,
eqInteger, neqInteger, absInteger, signumInteger,
leInteger, gtInteger, ltInteger, geInteger, compareInteger,
+ divInteger, modInteger,
divModInteger, quotRemInteger, quotInteger, remInteger,
encodeFloatInteger, decodeFloatInteger, floatFromInteger,
encodeDoubleInteger, decodeDoubleInteger, doubleFromInteger,
@@ -0,0 +1,24 @@
$NetBSD: patch-libraries_integer-simple_GHC_Integer_Type.hs,v 1.1 2013/12/12 12:47:17 obache Exp $
Missing functions: already fixed in the upstream.
--- libraries/integer-simple/GHC/Integer/Type.hs.orig 2013-02-13 18:45:55.000000000 +0000
+++ libraries/integer-simple/GHC/Integer/Type.hs
@@ -370,6 +370,16 @@ n `divModInteger` d =
then (# q `minusInteger` oneInteger, r `plusInteger` d #)
else (# q, r #)
+{-# NOINLINE divInteger #-}
+divInteger :: Integer -> Integer -> Integer
+n `divInteger` d = quotient
+ where (# quotient, _ #) = n `divModInteger` d
+
+{-# NOINLINE modInteger #-}
+modInteger :: Integer -> Integer -> Integer
+n `modInteger` d = modulus
+ where (# _, modulus #) = n `divModInteger` d
+
{-# NOINLINE quotRemInteger #-}
quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
Naught `quotRemInteger` (!_) = (# Naught, Naught #)
+26
View File
@@ -0,0 +1,26 @@
$NetBSD: patch-rts_Linker.c,v 1.1 2013/12/12 12:47:17 obache Exp $
Support 64-bit x86 SunOS.
--- rts/Linker.c.orig 2013-04-18 21:22:46.000000000 +0000
+++ rts/Linker.c
@@ -75,7 +75,8 @@
( defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || \
defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
defined(openbsd_HOST_OS ) || defined(darwin_HOST_OS ) || \
- defined(kfreebsdgnu_HOST_OS) || defined(gnu_HOST_OS)))
+ defined(kfreebsdgnu_HOST_OS) || defined(gnu_HOST_OS) || \
+ defined(solari2_HOST_OS)))
/* Don't use mmap on powerpc_HOST_ARCH as mmap doesn't support
* reallocating but we need to allocate jump islands just after each
* object images. Otherwise relative branches to jump islands can fail
@@ -4014,6 +4015,9 @@ ocResolve_PEi386 ( ObjectCode* oc )
# define ELF_TARGET_386 /* Used inside <elf.h> */
#elif defined(x86_64_HOST_ARCH)
# define ELF_TARGET_X64_64
+# if defined(solaris2_HOST_OS)
+# define ELF_TARGET_AMD64
+# endif
# define ELF_64BIT
#endif
+31
View File
@@ -0,0 +1,31 @@
$NetBSD: patch-rts_StgCRun.c,v 1.1 2013/12/12 12:47:17 obache Exp $
We have to make the visiblity of StgRun and StgReturn to "hidden" not
to trigger a bug in old binutils which results in:
ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32
against `StgRun' can not be used when making a shared object;
recompile with -fPIC
With this workaround we can no longer override those two symbols using
LD_PRELOAD, but I think there is no reason to do so anyway.
--- rts/StgCRun.c.orig 2013-01-27 13:21:52.000000000 +0000
+++ rts/StgCRun.c
@@ -246,6 +246,7 @@ StgRunIsImplementedInAssembler(void)
* save callee-saves registers on behalf of the STG code.
*/
".globl " STG_RUN "\n"
+ ".hidden " STG_RUN "\n"
STG_RUN ":\n\t"
"subq %1, %%rsp\n\t"
"movq %%rsp, %%rax\n\t"
@@ -280,6 +281,7 @@ StgRunIsImplementedInAssembler(void)
"jmp *%%rax\n\t"
".globl " STG_RETURN "\n"
+ ".hidden " STG_RETURN "\n"
STG_RETURN ":\n\t"
"movq %%rbx, %%rax\n\t" /* Return value in R1 */
+22
View File
@@ -0,0 +1,22 @@
$NetBSD: patch-rts_ghc.mk,v 1.1 2013/12/12 12:47:17 obache Exp $
This is pkgsrc specific: dtrace(1) gets confused when we have gcc
wrappers in the PATH so we have to hide them:
gcc: installation problem, cannot exec '/usr/pkgsrc/wip/ghc/work/.gcc/bin/p
owerpc-apple-darwin9-gcc-4.0.1': No such file or directory
dtrace: failed to compile script rts/RtsProbes.d: Preprocessor failed to pr
ocess input program
--- rts/ghc.mk.orig 2013-01-27 13:21:52.000000000 +0000
+++ rts/ghc.mk
@@ -484,7 +484,7 @@ endif
DTRACEPROBES_SRC = rts/RtsProbes.d
$(DTRACEPROBES_H): $(DTRACEPROBES_SRC) includes/ghcplatform.h | $$(dir $$@)/.
- "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $<
+ env PATH="/usr/bin" "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $<
endif
# -----------------------------------------------------------------------------