pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/lang/ghc98
Module Name: pkgsrc
Committed By: jperkin
Date: Thu Jun 20 12:49:39 UTC 2024
Modified Files:
pkgsrc/lang/ghc98: Makefile bootstrap.mk
Log Message:
ghc98: Incredibly ugly workaround to fix Darwin.
Ultimately, the problem here is that GHC goes looking for things in places it
should not be. If libiconv is installed, it ends up trying to link against the
pkgsrc libiconv, even if it is not buildlinked. The problem is that the
bootstrap kits are built with native libiconv, and so this breaks the build as
they are looking for iconv_*() vs pkgsrc libiconv which uses libiconv_*().
Unfortunately setting PREFER.iconv=native isn't enough. For some reason gtar
is being pulled in as a tool, and because of nls that ends up pulling in
gettext-lib and therefore libiconv, which still breaks the build. The native
tar works fine on Darwin, so we also need to add an exclusion to avoid gtar
being added to USE_TOOLS.
This "fix" will only really work in bulk builds. As soon as libiconv is
installed via any other dependency it's game over.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/lang/ghc98/Makefile \
pkgsrc/lang/ghc98/bootstrap.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/lang/ghc98/Makefile
diff -u pkgsrc/lang/ghc98/Makefile:1.4 pkgsrc/lang/ghc98/Makefile:1.5
--- pkgsrc/lang/ghc98/Makefile:1.4 Sat May 11 18:37:40 2024
+++ pkgsrc/lang/ghc98/Makefile Thu Jun 20 12:49:39 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2024/05/11 18:37:40 pho Exp $
+# $NetBSD: Makefile,v 1.5 2024/06/20 12:49:39 jperkin Exp $
# -----------------------------------------------------------------------------
# Package metadata
#
@@ -33,6 +33,13 @@ PKGSRC_OVERRIDE_MKPIE= yes
.include "options.mk"
+# The bootstrap kits are built with native iconv, and unfortunately ghc looks
+# in places it should not, so we have to do everything we can to avoid libiconv
+# being installed as it breaks the build due to iconv_*() vs libiconv_*().
+#
+.if ${OPSYS} == "Darwin"
+PREFER.iconv= native
+.endif
# -----------------------------------------------------------------------------
# Distfiles
Index: pkgsrc/lang/ghc98/bootstrap.mk
diff -u pkgsrc/lang/ghc98/bootstrap.mk:1.4 pkgsrc/lang/ghc98/bootstrap.mk:1.5
--- pkgsrc/lang/ghc98/bootstrap.mk:1.4 Sat May 11 18:37:40 2024
+++ pkgsrc/lang/ghc98/bootstrap.mk Thu Jun 20 12:49:39 2024
@@ -1,4 +1,4 @@
-# $NetBSD: bootstrap.mk,v 1.4 2024/05/11 18:37:40 pho Exp $
+# $NetBSD: bootstrap.mk,v 1.5 2024/06/20 12:49:39 jperkin Exp $
# -----------------------------------------------------------------------------
# Select a bindist of bootstrapping compiler on a per-platform basis. See
# ./files/BOOTSTRAP.md for details.
@@ -107,7 +107,18 @@ TOOLS_PLATFORM.cpp= /usr/lib/cpp
# Install a bootstrapping (stage-0) compiler directly into TOOLS_DIR so
# that ./configure can find it.
#
-USE_TOOLS+= xzcat xz gtar cpp patch # patch is for bootstrap.py
+USE_TOOLS+= xzcat xz cpp patch # patch is for bootstrap.py
+
+# We must avoid gtar on Darwin because it ends up pulling in libiconv (see
+# Makefile for why that breaks things). It's possible this is no longer
+# required anyway and has just been cargo-culted around since 2019.
+#
+.if ${OPSYS} == "Darwin"
+GHC_TAR= ${TAR}
+.else
+USE_TOOLS+= gtar
+GHC_TAR= ${GTAR}
+.endif
BOOT_ARCHIVE_TOP_DIR= ${BOOT_ARCHIVE:C/\.tar\..z$//}
pre-configure:
@@ -118,7 +129,7 @@ pre-configure:
${RUN}${MKDIR} ${WRKDIR}/bootkit-dist
${RUN}cd ${WRKDIR}/bootkit-dist && \
${XZCAT} ${DISTDIR}/${DIST_SUBDIR}/${BOOT_ARCHIVE} | \
- ${GTAR} -xf -
+ ${GHC_TAR} -xf -
@${PHASE_MSG} "Preparing bootstrapping compiler for ${PKGNAME}"
# <kludge>
Home |
Main Index |
Thread Index |
Old Index