1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

lang/ghc: Update to 9.2.2

This commit is contained in:
Gleb Popov 2022-03-10 21:49:37 +03:00
parent be5f5db250
commit 8709d6be0b
8 changed files with 2409 additions and 2511 deletions

View File

@ -2,14 +2,10 @@
PORTNAME= ghc
PORTVERSION= ${GHC_VERSION}
PORTREVISION= 2
CATEGORIES= lang haskell
MASTER_SITES= https://www.haskell.org/ghc/dist/${PORTVERSION}/:source \
LOCAL/arrowd/:boot \
https://hackage.haskell.org/package/hscolour-${HSCOLOUR_VERSION}/:docs
DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source \
hscolour-${HSCOLOUR_VERSION}.tar.gz:docs
EXTRACT_ONLY= ${_DISTFILES:C/hscolour.*$//g}
LOCAL/arrowd/:boot
DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source
MAINTAINER= haskell@FreeBSD.org
COMMENT= Compiler for the functional language Haskell
@ -21,16 +17,15 @@ ONLY_FOR_ARCHS= amd64 i386 aarch64 armv6 armv7
USES= autoreconf compiler:c11 gmake iconv:patch,translit \
localbase:ldflags ncurses perl5 tar:xz
USE_LOCALE= en_US.UTF-8
USE_PERL5= build
GNU_CONFIGURE= yes
CONFIGURE_ENV= PATH=${SLAVES_PREFIX}/bin:${PATH}
MAKE_ENV= PATH=${SLAVES_PREFIX}/bin:${PATH}
CONFIGURE_ARGS= --docdir=${DOCSDIR}
NO_CCACHE= yes
SUB_FILES= build.mk
SUB_LIST= GHC_VERSION=${GHC_VERSION} \
NCURSESINC="${NCURSESBASE}/include" NCURSESLIB="${NCURSESLIB}" \
SUB_LIST= NCURSESINC="${NCURSESBASE}/include" NCURSESLIB="${NCURSESLIB}" \
CFLAGS="${CFLAGS}"
OPTIONS_DEFINE= DYNAMIC GMP PROFILE DOCS
@ -43,7 +38,7 @@ OPTIONS_GROUP_BOOTSTRAP=BOOT
BOOT_DESC= Use installed GHC for bootstrapping
DOCS_DESC= Install HTML documentation
DYNAMIC_DESC= Add support for dynamic linking
GMP_DESC= Use GNU Multi-precision Library for big integers support
GMP_DESC= Use GNU Multi-precision Library from Ports
PROFILE_DESC= Add support for performance profiling
DOCS_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx
@ -60,10 +55,6 @@ DYNAMIC_PLIST_SUB_OFF= NODYNAMIC=""
GMP_CONFIGURE_WITH= gmp-includes=${LOCALBASE}/include \
gmp-libraries=${LOCALBASE}/lib
GMP_LIB_DEPENDS= libgmp.so:math/gmp
GMP_SUB_LIST= INTEGER_LIBRARY="integer-gmp"
GMP_SUB_LIST_OFF= INTEGER_LIBRARY="integer-simple"
GMP_PLIST_SUB= GMP="" SIMPLE="@comment "
GMP_PLIST_SUB_OFF= GMP="@comment " SIMPLE=""
# Append substitutions for build.mk
BOOT_SUB_LIST= HSC2HS=${LOCALBASE}/bin/hsc2hs
@ -72,16 +63,30 @@ BOOT_SUB_LIST_OFF= HSC2HS=${BOOT_HSC2HS}
PROFILE_SUB_LIST= WITH_PROFILE="YES"
PROFILE_SUB_LIST_OFF= WITH_PROFILE="NO"
GHC_VERSION= 9.2.1
CABAL_VERSION= 3.6.0.0
HSCOLOUR_VERSION= 1.24.4
LLVM_VERSION= 10
GHC_VERSION= 9.2.2
LLVM_VERSION= 12
BOOT_GHC_VERSION= 8.10.7
# LLVM version that bootstrap compiler uses
BOOT_LLVM_VERSION= 10
OPTIONS_SUB= yes
PLIST_SUB= GHC_VERSION=${GHC_VERSION} CABAL_VERSION=${CABAL_VERSION}
BASE_PACKAGES= Cabal:3.6.3.0 array:0.5.4.0 base:4.16.1.0 binary:0.8.9.0 \
bytestring:0.11.3.0 containers:0.6.5.1 deepseq:1.4.6.1 \
directory:1.3.6.2 exceptions:0.10.4 filepath:1.4.2.2 \
ghc:${GHC_VERSION} ghc-bignum:1.2 ghc-boot:${GHC_VERSION} \
ghc-boot-th:${GHC_VERSION} ghc-compact:0.1.0.0 \
ghc-heap:${GHC_VERSION} ghc-prim:0.8.0 \
ghci:${GHC_VERSION} haskeline:0.8.2 hpc:0.6.1.0 \
integer-gmp:1.1 libiserv:${GHC_VERSION} mtl:2.2.2 \
parsec:3.1.15.0 pretty:1.3.3.6 process:1.6.13.2 \
stm:2.5.0.2 template-haskell:2.18.0.0 terminfo:0.4.1.5 \
text:1.2.5.0 time:1.11.1.1 transformers:0.5.6.2 \
unix:2.7.2.2 xhtml:3000.2.2.1
.for pkg in ${BASE_PACKAGES}
PLIST_SUB+= ${pkg:C/\:.*//:tu}_VERSION=${pkg:C/^[^\:]*(\:|\$)//}
.endfor
PORTDOCS= *
@ -94,9 +99,6 @@ CONFIGURE_TARGET= ${GHC_ARCH}-portbld-${OPSYS:tl}
BUILD_DEPENDS+= ${LOCALBASE}/lib/compat/libncursesw.so.8:misc/compat12x
.endif
DOCSDIR= ${PREFIX}/share/doc/${DISTNAME}
DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION}
EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION}
GHC_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/}
GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION}
GHC_LIBDIR_REL= lib/ghc-${GHC_VERSION}
@ -140,20 +142,13 @@ BUILD_DEPENDS+= llc${BOOT_LLVM_VERSION}:devel/llvm${BOOT_LLVM_VERSION}
.if empty(PORT_OPTIONS:MBOOT)
BOOT_DIR= ${WRKDIR}/ghc-${BOOT_GHC_VERSION}-boot
BOOT_GHC= ${BOOT_DIR}/bin/ghc-${BOOT_GHC_VERSION}
BOOT_GHC-PKG= ${BOOT_DIR}/bin/ghc-pkg-${BOOT_GHC_VERSION}
BOOT_HSC2HS= ${BOOT_DIR}/bin/hsc2hs
SLAVE_ENV= ${SETENV} PATH=${BOOT_DIR}/bin:${PATH}
CONFIGURE_ARGS+= GHC=${BOOT_GHC}
CONFIGURE_ENV+= GHC=${BOOT_GHC}
.else # MBOOT
SLAVE_ENV= # empty
CONFIGURE_ARGS+= GHC=${LOCALBASE}/bin/ghc
CONFIGURE_ENV+= GHC=${LOCALBASE}/bin/ghc
.endif # MBOOT
SLAVES_PREFIX= ${WRKDIR}/slaves_prefix
SLAVES_WRKDIRPREFIX= ${WRKDIR}/slaves_wrkdirprefix
# TODO: remove this after rerolling all bootstraps
post-patch:
.if empty(PORT_OPTIONS:MBOOT)
@${REINPLACE_CMD} -e '/^mandir/d' ${BOOT_DIR}/mk/build.mk
@ -168,33 +163,25 @@ pre-configure:
# If we are using bootstrap compiler, configure and install it into ${BOOT_DIR}
.if empty(PORT_OPTIONS:MBOOT)
cd ${BOOT_DIR} && ${CONFIGURE_ENV} ${CONFIGURE_ENV_BOOTSTRAP} ${CONFIGURE_CMD} --prefix=${BOOT_DIR}
cd ${BOOT_DIR} && ${CONFIGURE_ENV} ${CONFIGURE_CMD} --prefix=${BOOT_DIR}
cd ${BOOT_DIR} && PACKAGES='' ${MAKE_CMD} install
.endif
# If DOCS are set, install HsColour in-place
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${SLAVES_PREFIX}
${MKDIR} ${SLAVES_WRKDIRPREFIX}
cd ${SLAVES_WRKDIRPREFIX} && \
${TAR} xvf ${DISTDIR}/hscolour-${HSCOLOUR_VERSION}.tar.gz && \
cd hscolour-${HSCOLOUR_VERSION} && \
${SLAVE_ENV} ghc --make -o Setup Setup.hs -package Cabal && \
${SLAVE_ENV} ./Setup configure --ghc --prefix=${SLAVES_PREFIX} --with-gcc=${CC} --with-ld=${LD} && \
${SLAVE_ENV} ./Setup build && \
${SLAVE_ENV} ./Setup install
.endif
post-install:
(for f in ${_EXECUTABLES} $$(${FIND} ${GHC_LIBDIR} -name '*.so*'); do \
${STRIP_CMD} $$f; done)
${RM} -r ${STAGEDIR}${DOCSDIR}/html/haddock/.build-html
${FIND} ${STAGEDIR}${DOCSDIR}/html -name .buildinfo -delete
${RM} ${STAGEDIR}${PREFIX}/bin/haddock
.if exists(${BOOT_DIR}/bin/runhaskell)
RUNHASKELL?= ${BOOT_DIR}/bin/runhaskell
.else
RUNHASKELL?= ${LOCALBASE}/bin/runhaskell
.endif
.PHONY: fixup-plist
fixup-plist:
${BOOT_DIR}/bin/runhaskell ${PATCHDIR}/fixup-plist.hs ${.CURDIR}/pkg-plist
${RUNHASKELL} ${PATCHDIR}/fixup-plist.hs ${.CURDIR}/pkg-plist
# Create a bootstrap compiler tar ball: run this in an interactive poudriere jail
# Set all OPTIONS to OFF when generating bootstraps
@ -216,12 +203,6 @@ create-bootstrap:
# Set DYNAMIC, GMP and PROFILE to ON, and DOCS to OFF when generating Stack bindist
.PHONY: create-stack-bindist
create-stack-bindist:
${REINPLACE_CMD} -e '/^mandir/d' \
-e '/^infodir/d' \
-e '/^docdir/d' \
-e '/^htmldir/d' \
${WRKSRC}/mk/build.mk
cd ${WRKSRC} \
&& ${GMAKE} binary-dist TAR_COMP=xz \
&& ${MV} ${WRKSRC}/ghc-${GHC_VERSION}-${GHC_ARCH}-portbld-freebsd.tar.xz /tmp/

View File

@ -1,6 +1,6 @@
TIMESTAMP = 1635527375
SHA256 (ghc-9.2.1-src.tar.xz) = f444012f97a136d9940f77cdff03fda48f9475e2ed0fec966c4d35c4df55f746
SIZE (ghc-9.2.1-src.tar.xz) = 23338772
TIMESTAMP = 1646895563
SHA256 (ghc-9.2.2-src.tar.xz) = 902463a4cc6ee479af9358b9f8b2ee3237b03e934a1ea65b6d1fcf3e0d749ea6
SIZE (ghc-9.2.2-src.tar.xz) = 23461244
SHA256 (ghc-8.10.7-boot-amd64-freebsd.tar.xz) = 5adfeceee2c3aa1208da174390cbb8e8c1d0a333b7c4a3a676a63f93beaf3126
SIZE (ghc-8.10.7-boot-amd64-freebsd.tar.xz) = 70607916
SHA256 (ghc-8.10.7-boot-i386-freebsd.tar.xz) = d841a6abf2b97e34feb9c71a85520a78dd667bfb6d6a7f401fa8a92b558928dc
@ -15,5 +15,3 @@ SHA256 (ghc-8.10.7-boot-armv7-freebsd.tar.xz) = 15708f4f4324d7e87ddbd6548a6ca72d
SIZE (ghc-8.10.7-boot-armv7-freebsd.tar.xz) = 127945844
SHA256 (ghc-8.10.7-boot-armv6-freebsd.tar.xz) = 84010e11f92e0a9fe106b80cbaf027ba342da055c3ad6d89eab0a389c0523e1b
SIZE (ghc-8.10.7-boot-armv6-freebsd.tar.xz) = 129190568
SHA256 (hscolour-1.24.4.tar.gz) = 243332b082294117f37b2c2c68079fa61af68b36223b3fc07594f245e0e5321d
SIZE (hscolour-1.24.4.tar.gz) = 28729

View File

@ -1,15 +1,8 @@
docdir = %%PREFIX%%/share/doc/ghc-%%GHC_VERSION%%
htmldir = %%PREFIX%%/share/doc/ghc-%%GHC_VERSION%%
mandir = %%PREFIX%%/man
infodir = %%PREFIX%%/info
DYNAMIC_GHC_PROGRAMS = %%WITH_DYNAMIC%%
BUILD_PROF_LIBS = %%WITH_PROFILE%%
HADDOCK_DOCS = YES
HSCOLOUR_SRCS = %%WITH_DOCS%%
INTEGER_LIBRARY = %%INTEGER_LIBRARY%%
# disable xelatex: PR 231438
BUILD_SPHINX_PDF = NO
BSD_PATH_TO_HSC2HS = %%HSC2HS%%
SRC_HC_OPTS += -I%%NCURSESINC%% -L%%NCURSESLIB%% -I%%LOCALBASE%%/include -L%%LOCALBASE%%/lib
SRC_CC_OPTS += %%CFLAGS%%
EXTRA_HSC2HS_OPTS += -I%%LOCALBASE%%/include --lflag=-L%%LOCALBASE%%/lib

View File

@ -26,7 +26,5 @@ processLine1 l
processLine2 l
| "%%GMP%%" `isPrefixOf` l ||
"%%SIMPLE%%" `isPrefixOf` l = l
| "/integer-gmp-" `isInfixOf` l = "%%GMP%%" ++ l
| "/integer-simple-" `isInfixOf` l = "%%SIMPLE%%" ++ l
| "/libCffi" `isInfixOf` l = "%%NODYNAMIC%%" ++ l
| otherwise = l

View File

@ -0,0 +1,11 @@
--- m4/fp_cc_supports_target.m4.orig 2022-03-05 07:25:06 UTC
+++ m4/fp_cc_supports_target.m4
@@ -12,7 +12,7 @@ AC_DEFUN([FP_CC_SUPPORTS_TARGET],
AC_REQUIRE([FPTOOLS_SET_PLATFORM_VARS])
AC_MSG_CHECKING([whether $1 CC supports --target])
echo 'int main() { return 0; }' > conftest.c
- if $CC --target=$LlvmTarget -Werror conftest.c >& /dev/null ; then
+ if $CC --target=$LlvmTarget -Werror conftest.c 2>&1 /dev/null ; then
CONF_CC_SUPPORTS_TARGET=YES
AC_MSG_RESULT([yes])
else

View File

@ -1,87 +0,0 @@
diff --git a/rts/Linker.c b/rts/Linker.c
index 72533ae52af48184fb76171fb93a73c04d025f2f..09cf5fa0593743f9b9f44603e2290cea9132ed89 100644
--- rts/Linker.c
+++ rts/Linker.c
@@ -78,6 +78,33 @@
#if defined(dragonfly_HOST_OS)
#include <sys/tls.h>
#endif
+
+/*
+ * Note [iconv and FreeBSD]
+ * ~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * On FreeBSD libc.so provides an implementation of the iconv_* family of
+ * functions. However, due to their implementation, these symbols cannot be
+ * resolved via dlsym(); rather, they can only be resolved using the
+ * explicitly-versioned dlvsym().
+ *
+ * This is problematic for the RTS linker since we may be asked to load
+ * an object that depends upon iconv. To handle this we include a set of
+ * fallback cases for these functions, allowing us to resolve them to the
+ * symbols provided by the libc against which the RTS is linked.
+ *
+ * See #20354.
+ */
+
+#if defined(freebsd_HOST_OS)
+extern void iconvctl();
+extern void iconv_open_into();
+extern void iconv_open();
+extern void iconv_close();
+extern void iconv_canonicalize();
+extern void iconv();
+#endif
+
/*
Note [runtime-linker-support]
-----------------------------
@@ -655,6 +682,10 @@ internal_dlsym(const char *symbol) {
}
RELEASE_LOCK(&dl_mutex);
+ IF_DEBUG(linker, debugBelch("internal_dlsym: looking for symbol '%s' in special cases\n", symbol));
+# define SPECIAL_SYMBOL(sym) \
+ if (strcmp(symbol, #sym) == 0) return (void*)&sym;
+
# if defined(HAVE_SYS_STAT_H) && defined(linux_HOST_OS) && defined(__GLIBC__)
// HACK: GLIBC implements these functions with a great deal of trickery where
// they are either inlined at compile time to their corresponding
@@ -664,18 +695,28 @@ internal_dlsym(const char *symbol) {
// We borrow the approach that the LLVM JIT uses to resolve these
// symbols. See http://llvm.org/PR274 and #7072 for more info.
- IF_DEBUG(linker, debugBelch("internal_dlsym: looking for symbol '%s' in GLIBC special cases\n", symbol));
+ SPECIAL_SYMBOL(stat);
+ SPECIAL_SYMBOL(fstat);
+ SPECIAL_SYMBOL(lstat);
+ SPECIAL_SYMBOL(stat64);
+ SPECIAL_SYMBOL(fstat64);
+ SPECIAL_SYMBOL(lstat64);
+ SPECIAL_SYMBOL(atexit);
+ SPECIAL_SYMBOL(mknod);
+# endif
- if (strcmp(symbol, "stat") == 0) return (void*)&stat;
- if (strcmp(symbol, "fstat") == 0) return (void*)&fstat;
- if (strcmp(symbol, "lstat") == 0) return (void*)&lstat;
- if (strcmp(symbol, "stat64") == 0) return (void*)&stat64;
- if (strcmp(symbol, "fstat64") == 0) return (void*)&fstat64;
- if (strcmp(symbol, "lstat64") == 0) return (void*)&lstat64;
- if (strcmp(symbol, "atexit") == 0) return (void*)&atexit;
- if (strcmp(symbol, "mknod") == 0) return (void*)&mknod;
+ // See Note [iconv and FreeBSD]
+# if defined(freebsd_HOST_OS)
+ SPECIAL_SYMBOL(iconvctl);
+ SPECIAL_SYMBOL(iconv_open_into);
+ SPECIAL_SYMBOL(iconv_open);
+ SPECIAL_SYMBOL(iconv_close);
+ SPECIAL_SYMBOL(iconv_canonicalize);
+ SPECIAL_SYMBOL(iconv);
# endif
+#undef SPECIAL_SYMBOL
+
// we failed to find the symbol
return NULL;
}

View File

@ -1,11 +0,0 @@
--- rts/posix/OSThreads.c.orig 2021-10-28 20:41:34 UTC
+++ rts/posix/OSThreads.c
@@ -325,7 +325,7 @@ getNumberOfProcessors (void)
nproc = 1;
}
}
-#elif defined(freebsd_HOST_OS)
+#elif defined(freebsd_HOST_OS) && !defined(HAVE_SCHED_GETAFFINITY)
cpuset_t mask;
CPU_ZERO(&mask);
if(cpuset_getaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1, sizeof(mask), &mask) == 0) {

File diff suppressed because it is too large Load Diff