Files
haikuports/dev-lang/ghc/ghc8.6-8.6.5.recipe
Adrien Destugues e9819ea44c ghc 8.6: add patches provided by Donn Cave.
Atempt to enable the recipe, but the previous version of ghc (2.2)
crashes during the build for me. Let's see if the buildbot does better.
2021-01-02 12:59:52 +01:00

132 lines
3.0 KiB
Bash

SUMMARY="The Glasgow Haskell Compiler"
DESCRIPTION="
The Glorious Glasgow Haskell Compilation system (GHC) is a compiler for Haskell.
Haskell is \"the\" standard lazy functional programming language.
"
HOMEPAGE="https://www.haskell.org/ghc/"
COPYRIGHT="The Glasgow Haskell Team"
LICENSE="BSD (3-clause)
GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="https://www.haskell.org/ghc/dist/$portVersion/ghc-$portVersion-src.tar.xz"
SOURCE_DIR="ghc-$portVersion"
CHECKSUM_SHA256="4d4aa1e96f4001b934ac6193ab09af5d6172f41f5a5d39d8e43393b9aafee361"
PATCHES="ghc-8.6.5.patchset"
ARCHITECTURES="!x86"
SECONDARY_ARCHITECTURES="x86"
GLOBAL_WRITABLE_FILES="
settings/ghc directory keep-old
"
PROVIDES="
ghc78$secondaryArchSuffix = $portVersion
cmd:ghc = $portVersion compat >= 8.6
cmd:ghc_$portVersion
cmd:ghc_pkg
cmd:ghc_pkg_$portVersion
cmd:ghci
cmd:ghci_$portVersion
cmd:haddock
cmd:haddock_ghc_$portVersion
cmd:hp2ps
cmd:hpc
cmd:hsc2hs
cmd:runghc
cmd:runghc_$portVersion
cmd:runhaskell
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:libiconv$secondaryArchSuffix
lib:libncursesw$secondaryArchSuffix >= 6
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
haiku_devel >= $haikuVersion
devel:libgmp$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libncursesw$secondaryArchSuffix >= 6
devel:libz$secondaryArchSuffix
docbook_xml_dtd
docbook_xsl_stylesheets
"
BUILD_PREREQUIRES="
cmd:autoconf
cmd:awk
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:ghc_8.2.2
cmd:ghc_pkg_8.2.2
cmd:git
cmd:grep
cmd:ld$secondaryArchSuffix
cmd:make
cmd:patch
cmd:perl
cmd:sed
cmd:sort
cmd:tar
cmd:xsltproc
"
BUILD()
{
# 2. Build GHC using the bootstrap compiler; we create a "dyn" only install
echo "Building GHC proper..."
cat > mk/build.mk <<-EOF
V = 0
GhcLibWays = v dyn
SRC_HC_OPTS = -O -H64m
GhcStage1HcOpts = -O -fasm
GhcStage2HcOpts = -O2 -fasm
GhcHcOpts = -Rghc-timing
GhcLibHcOpts = -O2
DYNAMIC_GHC_PROGRAMS = YES
DYNAMIC_TOO = YES
NoFibWays =
STRIP_CMD = :
EOF
# Workaround for haikuporter bug #207
mkdir -p /system/settings/ghc
cp -r /system/lib/x86/ghc-*/package.conf.d /system/settings/ghc/
export HOME=/boot/home
autoconf
# haikuporter's buildspec confuses GHC, so we omit it, and we can't
# have a gcc2 GHC, so just install directly into $prefix/bin
runConfigure --omit-buildspec --omit-dirs binDir configure --bindir=$prefix/bin GHC=/bin/ghc-8.2.2 CC=/bin/gcc-x86
make $jobArgs
}
INSTALL()
{
export HOME=/boot/home
export GHC_PACKAGE_PATH=$settingsDir/ghc/package.conf.d
ghc-pkg init $GHC_PACKAGE_PATH
unset GHC_PACKAGE_PATH
# 1. Install our new GHC
echo "Installing GHC!"
make install
# 2. Move package.conf.d to settings
sed -i -e '/^PKGCONF=/c\
PKGCONF='"$settingsDir"'/ghc/package.conf.d' $prefix/bin/ghc-pkg-$portVersion
unset GHC_PACKAGE_PATH
# move package.conf.d files to the right place...
mv $libDir/ghc-$portVersion/package.conf.d/*.conf $settingsDir/ghc/package.conf.d/
$prefix/bin/ghc-pkg recache
}