Index: lang/ghc/Makefile =================================================================== --- lang/ghc/Makefile +++ lang/ghc/Makefile @@ -3,10 +3,9 @@ PORTNAME= ghc PORTVERSION= ${GHC_VERSION} -PORTREVISION= 3 CATEGORIES= lang haskell MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \ - LOCAL/pgj/:boot + http://arrowd.name/:boot DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source MAINTAINER= haskell@FreeBSD.org @@ -17,13 +16,13 @@ ONLY_FOR_ARCHS= i386 amd64 -GHC_VERSION= 8.0.2 -HSCOLOUR_VERSION= 1.24.1 +GHC_VERSION= 8.4.1 +HSCOLOUR_VERSION= 1.24.4 DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION} EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION} -CONFLICTS= ghc-7.4.* ghc-7.6.* ghc-7.8.* ghc-7.10.* +CONFLICTS= ghc-7.4.* ghc-7.6.* ghc-7.8.* ghc-7.10.* ghc-8.0.* LIB_DEPENDS+= libgmp.so:math/gmp @@ -38,8 +37,7 @@ # This is better fixed in files/build.mk.in GNU_CONFIGURE= yes -CONFIGURE_ARGS= --with-ld=${LD} \ - --with-gmp-includes=${LOCALBASE}/include \ +CONFIGURE_ARGS= --with-gmp-includes=${LOCALBASE}/include \ --with-gmp-libraries=${LOCALBASE}/lib \ --with-iconv-includes=${LOCALBASE}/include \ --with-iconv-libraries=${LOCALBASE}/lib @@ -90,14 +88,16 @@ .include .if empty(PORT_OPTIONS:MBOOT) -BOOT_GHC_VERSION= 7.10.2 +BOOT_GHC_VERSION= 8.4.1 DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot .endif # MBOOT -CONFIGURE_ARGS+= -with-gcc=${CC} -.if empty(PORT_OPTIONS:MBOOT) -CONFIGURE_ARGS_BOOT+= --with-gcc=${CC} +.if ${OSVERSION} < 1200000 +USE_GCC= yes +.else +LD= ld.bfd .endif +CONFIGURE_ENV+= CC=${CC} LD=${LD} DOCSDIR= ${PREFIX}/share/doc/${DISTNAME} GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} @@ -115,7 +115,7 @@ SLAVE_CMD= ${SETENV} PATH=${BOOT_DIR}/bin:${PATH} -CONFIGURE_ARGS_BOOT+= --prefix=${BOOT_DIR} --with-ld=${LD} +CONFIGURE_ARGS_BOOT+= --prefix=${BOOT_DIR} CONFIGURE_ARGS+= --with-ghc=${BOOT_GHC} .else # MBOOT SLAVE_CMD= # empty @@ -189,13 +189,19 @@ s|%%AR%%|${AR}|; \ s|%%LD%%|${LD}|' \ ${WRKSRC}/libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs +.if empty(PORT_OPTIONS:MBOOT) + @${REINPLACE_CMD} -e '/^mandir/d' ${BOOT_DIR}/mk/build.mk + @${REINPLACE_CMD} -e '/^infodir/d' ${BOOT_DIR}/mk/build.mk + @${REINPLACE_CMD} -e '/^docdir/d' ${BOOT_DIR}/mk/build.mk + @${REINPLACE_CMD} -e '/^htmldir/d' ${BOOT_DIR}/mk/build.mk +.endif pre-configure: apply-slist # Copy the subbed build.mk to the proper position ${CP} ${WRKDIR}/build.mk ${WRKSRC}/mk/build.mk @${MKDIR} ${TMPDIR} -.if empty(PORT_OPTIONS:MBOOTH) && ${OPSYS} == FreeBSD && \ +.if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && \ ${OSVERSION} >= 1200031 ${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \ @@ -230,14 +236,14 @@ ${SLAVE_CMD} ./Setup install) .endif -_EXECUTABLES= ${STAGEDIR}${PREFIX}/bin/hp2ps \ - ${GHC_LIBDIR}/bin/unlit \ +_EXECUTABLES= ${GHC_LIBDIR}/bin/unlit \ ${GHC_LIBDIR}/bin/hpc \ ${GHC_LIBDIR}/bin/ghc-iserv \ ${GHC_LIBDIR}/bin/ghc-pkg \ ${GHC_LIBDIR}/bin/hsc2hs \ ${GHC_LIBDIR}/bin/runghc \ - ${GHC_LIBDIR}/bin/ghc + ${GHC_LIBDIR}/bin/ghc \ + ${GHC_LIBDIR}/bin/hp2ps .if ${PORT_OPTIONS:MPROFILE} _EXECUTABLES+= ${GHC_LIBDIR}/bin/ghc-iserv-prof @@ -254,7 +260,7 @@ .if ${PORT_OPTIONS:MDOCS} ${LN} -sf haddock-ghc-${GHC_VERSION} ${STAGEDIR}${PREFIX}/bin/haddock .endif - (for f in ${_EXECUTABLES} $$(${FIND} ${GHC_LIBDIR} -name '*.so'); do \ + (for f in ${_EXECUTABLES} $$(${FIND} ${GHC_LIBDIR} -name '*.so*'); do \ ${STRIP_CMD} $$f; done) .include @@ -262,12 +268,6 @@ # Create a bootstrap compiler tar ball: run this in an interactive poudriere jail .PHONY: create-bootstrap create-bootstrap: - @${ECHO} "TODO: https://github.com/freebsd-haskell/ports/wiki/Updating-the-Bootstrap-Compiler" - cd ${WRKSCR} \ - && ${CP} ${WRKDIR}/build.boot.mk mk \ - && setenv ${CONFIGURE_ENV} ./configure --with-iconv-includes=${LOCALBASE}/include \ - --with-iconv-libraries=${LOCALBASE}/lib \ - --with-gcc=${CC} \ - --with-ld=${LD} \ - && make binary-dist TAR_COMP=xz \\ - && mv ghc-${GHC_VERSION}-boot-${GHC_ARCH}-unknown-freebsd.tar.xz /tmp/ghc-${GHC_VERSION}-${ARCH}-freebsd${FREEBSD_MAJOR_VERSION}-boot.tar.xz + cd ${WRKSRC} \ + && gmake binary-dist TAR_COMP=xz \ + && mv ${WRKSRC}/ghc-${GHC_VERSION}-${ARCH}-portbld-freebsd.tar.xz /tmp/ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz Index: lang/ghc/distinfo =================================================================== --- lang/ghc/distinfo +++ lang/ghc/distinfo @@ -1,9 +1,7 @@ -TIMESTAMP = 1499672924 -SHA256 (ghc-8.0.2-src.tar.xz) = 11625453e1d0686b3fa6739988f70ecac836cadc30b9f0c8b49ef9091d6118b1 -SIZE (ghc-8.0.2-src.tar.xz) = 10687760 -SHA256 (ghc-7.10.2-boot-i386-freebsd.tar.xz) = 5cadd55316fe6c1bf275d0f44f10b46342096922a15ecb9fb78c80fc293f901a -SIZE (ghc-7.10.2-boot-i386-freebsd.tar.xz) = 39858716 -SHA256 (ghc-7.10.2-boot-amd64-freebsd.tar.xz) = 4af0ee0795537baa11a96fba23477f8390ccb5f45910cda119d0a16bdebaedc8 -SIZE (ghc-7.10.2-boot-amd64-freebsd.tar.xz) = 49833224 -SHA256 (hscolour-1.24.1.tar.gz) = e46fe3de8ed6f96e2216b94b7608d01919bc86b15dd8d0ec7e71c0e7e5bf79c8 -SIZE (hscolour-1.24.1.tar.gz) = 28717 +TIMESTAMP = 1521746766 +SHA256 (ghc-8.4.1-src.tar.xz) = 39ae2f25192408f355693e5a3c8b6ff613ddb7c4da998fdf26210143a61839d2 +SIZE (ghc-8.4.1-src.tar.xz) = 11301528 +SHA256 (ghc-8.4.1-boot-amd64-freebsd.tar.xz) = 886e1eac8bc5d9dab62cb1dd7f579314cf0c1c40ee719ec1a497639ec6e61e19 +SIZE (ghc-8.4.1-boot-amd64-freebsd.tar.xz) = 72473540 +SHA256 (hscolour-1.24.4.tar.gz) = 243332b082294117f37b2c2c68079fa61af68b36223b3fc07594f245e0e5321d +SIZE (hscolour-1.24.4.tar.gz) = 28729 Index: lang/ghc/files/patch-compiler_main_SysTools.hs =================================================================== --- lang/ghc/files/patch-compiler_main_SysTools.hs +++ /dev/null @@ -1,12 +0,0 @@ ---- compiler/main/SysTools.hs.orig 2017-08-12 09:25:57 UTC -+++ compiler/main/SysTools.hs -@@ -907,6 +907,9 @@ getCompilerInfo' dflags = do - -- Regular clang - | any ("clang version" `isInfixOf`) stde = - return Clang -+ -- FreeBSD clang -+ | any ("FreeBSD clang version" `isInfixOf`) stde = -+ return Clang - -- XCode 5.1 clang - | any ("Apple LLVM version 5.1" `isPrefixOf`) stde = - return AppleClang51 Index: lang/ghc/files/patch-configure.ac =================================================================== --- lang/ghc/files/patch-configure.ac +++ lang/ghc/files/patch-configure.ac @@ -1,6 +1,6 @@ ---- configure.ac.orig 2017-01-04 14:17:17 UTC +--- configure.ac.orig 2018-03-06 16:48:53 UTC +++ configure.ac -@@ -418,6 +418,9 @@ AC_SUBST([SplitObjsBroken]) +@@ -447,6 +447,9 @@ XCODE_VERSION() dnl ** Building a cross compiler? dnl -------------------------------------------------------------- CrossCompiling=NO @@ -10,15 +10,30 @@ # If 'host' and 'target' differ, then this means we are building a cross-compiler. if test "$TargetPlatform" != "$HostPlatform" ; then CrossCompiling=YES -@@ -1057,6 +1060,11 @@ if test "$ac_cv_sizeof_void_p" -eq 8 ; then - use_large_address_space=yes - elif test "$ghc_host_os" = "openbsd" ; then - # as of OpenBSD 5.8 (2015), OpenBSD does not support mmap with MAP_NORESERVE. -+ # The flag MAP_NORESERVE is supported for source compatibility reasons, -+ # but is completely ignored by OS mmap -+ use_large_address_space=no -+ elif test "$ghc_host_os" = "freebsd" ; then -+ # FreeBSD does not support mmap with MAP_NORESERVE,r emoved in r273250. +@@ -798,14 +801,6 @@ AC_PATH_PROGS(PatchCmd,gpatch patch, pat + + dnl ** check for dtrace (currently only implemented for Mac OS X) + HaveDtrace=NO +-AC_PATH_PROG(DtraceCmd,dtrace) +-if test -n "$DtraceCmd"; then +- if test "x$TargetOS_CPP-$TargetVendor_CPP" = "xdarwin-apple" \ +- -o "x$TargetOS_CPP-$TargetVendor_CPP" = "xfreebsd-portbld" \ +- -o "x$TargetOS_CPP-$TargetVendor_CPP" = "xsolaris2-unknown"; then +- HaveDtrace=YES +- fi +-fi + AC_SUBST(HaveDtrace) + + AC_PATH_PROG(HSCOLOUR,HsColour) +@@ -1163,6 +1158,11 @@ if test "$ac_cv_sizeof_void_p" -eq 8 ; t # The flag MAP_NORESERVE is supported for source compatibility reasons, # but is completely ignored by OS mmap use_large_address_space=no ++ elif test "$ghc_host_os" = "freebsd" ; then ++ # FreeBSD does not support mmap with MAP_NORESERVE,r emoved in r273250. ++ # The flag MAP_NORESERVE is supported for source compatibility reasons, ++ # but is completely ignored by OS mmap ++ use_large_address_space=no + else + AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[], + [ Index: lang/ghc/files/patch-ghc.mk =================================================================== --- lang/ghc/files/patch-ghc.mk +++ lang/ghc/files/patch-ghc.mk @@ -8,14 +8,14 @@ else $(error Make has restarted itself $(MAKE_RESTARTS) times; is there a makefile bug? See http://ghc.haskell.org/trac/ghc/wiki/Building/Troubleshooting#Makehasrestarteditself3timesisthereamakefilebug for details) endif -@@ -465,10 +466,7 @@ PACKAGES_STAGE1 += ghc-boot +@@ -459,10 +460,7 @@ PACKAGES_STAGE1 += ghc-boot-th + PACKAGES_STAGE1 += ghc-boot PACKAGES_STAGE1 += template-haskell - PACKAGES_STAGE1 += hoopl - PACKAGES_STAGE1 += transformers + PACKAGES_STAGE1 += ghc-compact - -ifeq "$(HADDOCK_DOCS)" "YES" PACKAGES_STAGE1 += xhtml -endif - ifeq "$(Windows_Target)" "NO" - ifneq "$(TargetOS_CPP)" "ios" + ifeq "$(WITH_TERMINFO)" "YES" + PACKAGES_STAGE1 += terminfo Index: lang/ghc/files/patch-includes_rts_storage_ClosureMacros.h =================================================================== --- lang/ghc/files/patch-includes_rts_storage_ClosureMacros.h +++ /dev/null @@ -1,22 +0,0 @@ ---- includes/rts/storage/ClosureMacros.h.orig 2018-01-03 13:27:55 UTC -+++ includes/rts/storage/ClosureMacros.h -@@ -499,8 +499,17 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard ( - - -------------------------------------------------------------------------- */ - --#define ZERO_SLOP_FOR_LDV_PROF (defined(PROFILING)) --#define ZERO_SLOP_FOR_SANITY_CHECK (defined(DEBUG) && !defined(THREADED_RTS)) -+#if defined(PROFILING) -+#define ZERO_SLOP_FOR_LDV_PROF 1 -+#else -+#define ZERO_SLOP_FOR_LDV_PROF 0 -+#endif -+ -+#if defined(DEBUG) && !defined(THREADED_RTS) -+#define ZERO_SLOP_FOR_SANITY_CHECK 1 -+#else -+#define ZERO_SLOP_FOR_SANITY_CHECK 0 -+#endif - - #if ZERO_SLOP_FOR_LDV_PROF || ZERO_SLOP_FOR_SANITY_CHECK - #define OVERWRITING_CLOSURE(c) overwritingClosure(c) Index: lang/ghc/files/patch-libraries_Cabal_Cabal_Distribution_Simple_GHC.hs =================================================================== --- lang/ghc/files/patch-libraries_Cabal_Cabal_Distribution_Simple_GHC.hs +++ /dev/null @@ -1,11 +0,0 @@ ---- libraries/Cabal/Cabal/Distribution/Simple/GHC.hs.orig 2017-01-03 15:59:20 UTC -+++ libraries/Cabal/Cabal/Distribution/Simple/GHC.hs -@@ -996,7 +996,7 @@ getRPaths lbi clbi | supportRPaths hostOS = do - supportRPaths Linux   = True - supportRPaths Windows = False - supportRPaths OSX   = True -- supportRPaths FreeBSD   = False -+ supportRPaths FreeBSD   = True - supportRPaths OpenBSD   = False - supportRPaths NetBSD   = False - supportRPaths DragonFly = False Index: lang/ghc/files/patch-libraries__Cabal__Cabal__Distribution__Simple__Program__Builtin.hs =================================================================== --- lang/ghc/files/patch-libraries__Cabal__Cabal__Distribution__Simple__Program__Builtin.hs +++ lang/ghc/files/patch-libraries__Cabal__Cabal__Distribution__Simple__Program__Builtin.hs @@ -1,15 +1,15 @@ ---- libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs.orig 2017-01-03 15:59:20 UTC +--- libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs.orig 2017-11-28 16:40:34 UTC +++ libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs -@@ -54,6 +54,8 @@ import Distribution.Compat.Exception +@@ -59,6 +59,8 @@ import Distribution.Compat.Exception import Distribution.Verbosity import Distribution.Version +import System.FilePath (takeDirectory) + - import Data.Char - ( isDigit ) import qualified Data.Map as Map -@@ -251,11 +253,13 @@ alexProgram = (simpleProgram "alex") { + + -- ------------------------------------------------------------ +@@ -265,11 +267,13 @@ alexProgram = (simpleProgram "alex") { gccProgram :: Program gccProgram = (simpleProgram "gcc") { @@ -26,7 +26,7 @@ stripProgram :: Program stripProgram = (simpleProgram "strip") { -@@ -311,7 +315,9 @@ greencardProgram :: Program +@@ -337,7 +341,9 @@ greencardProgram :: Program greencardProgram = simpleProgram "greencard" ldProgram :: Program Index: lang/ghc/files/patch-rts_Linker.c =================================================================== --- lang/ghc/files/patch-rts_Linker.c +++ /dev/null @@ -1,11 +0,0 @@ ---- rts/Linker.c.orig 2017-08-12 09:22:13 UTC -+++ rts/Linker.c -@@ -797,7 +797,7 @@ initLinker_ (int retain_cafs) - # endif /* RTLD_DEFAULT */ - - compileResult = regcomp(&re_invalid, -- "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short)", -+ "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)", - REG_EXTENDED); - if (compileResult != 0) { - barf("Compiling re_invalid failed");