extra/ghc to 7.8.2-3

This commit is contained in:
Kevin Mihelich 2014-05-04 15:03:37 +00:00
parent 4de66c3a34
commit 2706cd5c57
4 changed files with 101 additions and 152 deletions

View file

@ -1,4 +1,4 @@
# $Id: PKGBUILD 168343 2012-10-09 04:08:52Z tdziedzic $
# $Id$
# Maintainer: Thomas Dziedzic <gostrc@gmail.com>
# Maintainer: Vesa Kaihlavirta <vesa@archlinux.org>
# Special note for devs looking to upgrade this package:
@ -9,90 +9,85 @@
# use the following command to print out packages that need to get rebuilt
# grep -r ghc /var/abs/ | awk -F '/' '{ print $5; }' | sort -u
# ALARM: David Flemström <david.flemstrom@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org
# David Flemström <david.flemstrom@gmail.com>
# - Add patch for vfp flags (add-vfp-flags.patch)
# - Change build.mk to use the LLVM backend with the right
# optimization passes
# - build.mk: BuildFlavor change from perf to perf-llvm
# - Add LLVM as a dependency
# - Correct gcc path after bulding with distcc
# - Uncommented !makeflags option
# - Use debian package for the initial build
buildarch=1
pkgname=ghc
pkgver=7.6.3
pkgrel=1
pkgver=7.8.2
pkgrel=3
pkgdesc='The Glasgow Haskell Compiler'
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
arch=('i686' 'x86_64')
url='http://www.haskell.org/ghc/'
license=('custom')
# libffi might be needed in the future: http://hackage.haskell.org/trac/ghc/ticket/4496
depends=('llvm' 'perl' 'gmp>=5.0' 'gcc') # 'libffi')
depends=('perl' 'gmp' 'gcc' 'libffi' 'llvm')
makedepends=('ghc' 'perl' 'libxslt' 'docbook-xsl')
checkdepends=('python2')
install='ghc.install'
# keep this otherwise a lot of tests will show as unexpected failures... need to investigate why using -jn for n > 1 does this...
options=('!makeflags')
# missing rtl?
provides=('haskell-array=0.4.0.1'
'haskell-base=4.6.0.1'
'haskell-binary=0.5.1.1'
options=('staticlibs' '!makeflags')
provides=('haskell-array=0.5.0.0'
'haskell-base=4.7.0.0'
'haskell-binary=0.7.1.0'
'haskell-bin-package-db=0.0.0.0'
'haskell-bytestring=0.10.0.2'
'haskell-containers=0.5.0.0'
'haskell-deepseq=1.3.0.1'
'haskell-directory=1.2.0.1'
'haskell-filepath=1.3.0.1'
'haskell-ghc-prim=0.3.0.0'
'haskell-haskell2010=1.1.1.0'
'haskell-haskell98=2.0.0.2'
'haskell-hoopl=3.9.0.0'
'haskell-hpc=0.6.0.0'
'haskell-integer-gmp=0.5.0.0'
'haskell-old-locale=1.0.0.5'
'haskell-old-time=1.1.0.1'
'haskell-pretty=1.1.1.0'
'haskell-process=1.1.0.2'
'haskell-template-haskell=2.8.0.0'
'haskell-time=1.4.0.1'
'haskell-unix=2.6.0.1'
'haskell-cabal=1.16.0'
)
replaces=('haskell-array<0.4.0.1'
'haskell-base<4.6.0.1'
'haskell-binary<0.5.1.1'
'haskell-bytestring=0.10.4.0'
'haskell-containers=0.5.5.1'
'haskell-deepseq=1.3.0.2'
'haskell-directory=1.2.1.0'
'haskell-filepath=1.3.0.2'
'haskell-ghc-prim=0.3.1.0'
'haskell-haskell2010=1.1.2.0'
'haskell-haskell98=2.0.0.3'
'haskell-hoopl=3.10.0.1'
'haskell-hpc=0.6.0.1'
'haskell-integer-gmp=0.5.1.0'
'haskell-old-locale=1.0.0.6'
'haskell-old-time=1.1.0.2'
'haskell-pretty=1.1.1.1'
'haskell-process=1.2.0.0'
'haskell-template-haskell=2.9.0.0'
'haskell-time=1.4.2'
'haskell-transformers=0.3.0.0'
'haskell-unix=2.7.0.1'
'haskell-cabal=1.18.1.3'
)
replaces=('haskell-array<0.5.0.0'
'haskell-base<4.7.0.0'
'haskell-binary<0.7.1.0'
'haskell-bin-package-db<0.0.0.0'
'haskell-bytestring<0.10.0.2'
'haskell-containers<0.5.0.0'
'haskell-deepseq<1.3.0.1'
'haskell-directory<1.2.0.1'
'haskell-filepath<1.3.0.1'
'haskell-ghc-prim<0.3.0.0'
'haskell-haskell2010<1.1.1.0'
'haskell-haskell98<2.0.0.2'
'haskell-hoopl<3.9.0.0'
'haskell-hpc<0.6.0.0'
'haskell-integer-gmp<0.5.0.0'
'haskell-old-locale<1.0.0.5'
'haskell-old-time<1.1.0.1'
'haskell-pretty<1.1.1.0'
'haskell-process<1.1.0.2'
'haskell-template-haskell<2.8.0.0'
'haskell-time<1.4.0.1'
'haskell-unix<2.6.0.1'
'haskell-cabal<1.16.0'
)
source=("http://www.haskell.org/ghc/dist/${pkgver}/ghc-${pkgver}-src.tar.bz2"
"http://www.haskell.org/ghc/dist/${pkgver}/ghc-${pkgver}-testsuite.tar.bz2"
'haskell-bytestring<0.10.4.0'
'haskell-containers<0.5.5.1'
'haskell-deepseq<1.3.0.2'
'haskell-directory<1.2.1.0'
'haskell-filepath<1.3.0.2'
'haskell-ghc-prim<0.3.1.0'
'haskell-haskell2010<1.1.2.0'
'haskell-haskell98<2.0.0.3'
'haskell-hoopl<3.10.0.1'
'haskell-hpc<0.6.0.1'
'haskell-integer-gmp<0.5.1.0'
'haskell-old-locale<1.0.0.6'
'haskell-old-time<1.1.0.2'
'haskell-pretty<1.1.1.1'
'haskell-process<1.2.0.0'
'haskell-template-haskell<2.9.0.0'
'haskell-time<1.4.2'
'haskell-transformers'
'haskell-unix<2.7.0.1'
'haskell-cabal<1.18.1.3'
)
source=("http://www.haskell.org/ghc/dist/${pkgver}/ghc-${pkgver}-src.tar.xz"
"http://www.haskell.org/ghc/dist/${pkgver}/ghc-${pkgver}-testsuite.tar.xz"
'build.mk'
'ghc'
'add-vfp-flags.patch')
md5sums=('986d1f90ca30d60f7b2820d75c6b8ea7'
'66aa6177a31cc4b9d7eeb55cb1514918'
md5sums=('97578e0c27574a99e0d5071a7f35d136'
'ac54f7fa453010149a573740705ecbfb'
'cb89e280f907c60791d08613f05ec049'
'de3d0a2ae5330459481b33584f15a1cd')
'c1d46d86752c50dd85e7143b029fa07f'
'1eb0ed10fa9676c2e23a587c40166e0e')
build() {
cd ghc-${pkgver}
@ -103,8 +98,11 @@ build() {
# have to 're-boot' because the patch changes configure stuff
./boot
./configure \
--prefix=/usr
--prefix=/usr \
--with-system-libffi \
--with-ffi-includes=/usr/lib/libffi-3.0.13/include
make
}
@ -116,7 +114,6 @@ check() {
cd ghc-${pkgver}
# python2 rename
sed -e 's/PYTHON = python/&2/' -i testsuite/mk/boilerplate.mk
sed -e 's_#!/usr/bin/env python_&2_' -i testsuite/timeout/calibrate testsuite/timeout/timeout.py
# upstream known failures on both i686 and x86_64:
@ -153,48 +150,10 @@ package() {
sed -r 's|("C compiler command", ")[^"]+|\1/usr/bin/gcc|' \
-i "${pkgdir}/usr/lib/ghc-${pkgver}/settings"
# provide non vanilla bash completion since ghc currently doesn't ship with any:
# https://ghc.haskell.org/trac/ghc/ticket/9006
install -d ${pkgdir}/usr/share/bash-completion/completions
install -m644 ${srcdir}/ghc \
${pkgdir}/usr/share/bash-completion/completions
}
# Chicken and egg fix
if ! pacman -Ssq ^ghc$ > /dev/null; then
makedepends=("${makedepends[@]:1}" "ncurses")
if [ "${CARCH}" = "armv7h" ]; then
source+=("http://ftp.uk.debian.org/debian/pool/main/g/ghc/ghc_7.6.2-1_armhf.deb")
md5sums+=('5d7190b3cc48771019b47376d1e69a1c')
elif [ "${CARCH}" = "armv6h" ]; then
source+=("http://distribution-us.hexxeh.net/raspbian/archive/raspbian/pool/main/g/ghc/ghc_7.4.1-4+rpi1_armhf.deb")
md5sums+=('79c70db16e69b5617a3761e735db0f42')
else
source+=("http://ftp.uk.debian.org/debian/pool/main/g/ghc/ghc_7.6.2-1_armel.deb")
md5sums+=('69894b056a12a608bd4d454ffbe30d9c')
fi
eval "$(echo "_build()"; declare -f build | tail -n +2)"
build() {
if [ "${CARCH}" = "armv7h" ]; then
ar x "ghc_7.6.2-1_armhf.deb"
elif [ "${CARCH}" = "armv6h" ]; then
ar x "ghc_7.4.1-4+rpi1_armhf.deb"
else
ar x "ghc_7.6.2-1_armel.deb"
fi
rm -rf usr var
tar -zxf data.tar.gz
sed "s|\"/|\"${srcdir}/|" -i usr/lib/ghc/bin/ghc{,-pkg}
sed "s| /usr| ${srcdir}/usr|" -i var/lib/ghc/package.conf.d/*
#sed "s/-3.0//" -i usr/lib/ghc/settings # correct LLVM commands
#Ugly fixes
ln -s `which opt` ${srcdir}/usr/lib/ghc/bin/opt-3.0
ln -s `which llc` ${srcdir}/usr/lib/ghc/bin/llc-3.0
ln -s /usr/lib/libffi.so.6 usr/lib/libffi.so.5
ln -s /usr/lib/libncurses.so.5 usr/lib/libtinfo.so.5
ln -fs ../../../var/lib/ghc/package.conf.d usr/lib/ghc/package.conf.d
export PATH="${PATH}:${srcdir}/usr/lib/ghc/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${srcdir}/usr/lib"
ghc-pkg recache
_build
}
fi

View file

@ -1,15 +1,8 @@
diff --git a/aclocal.m4 b/aclocal.m4
index 127f528..a2db986 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -344,12 +344,12 @@
[AC_DEFINE(arm_HOST_ARCH_PRE_ARMv7, 1, [ARM pre v7])
changequote(, )dnl
ARM_ISA=ARMv6
- ARM_ISA_EXT="[]"
+ ARM_ISA_EXT="[VFPv2]"
changequote([, ])dnl
],
diff -urN a/aclocal.m4 b/aclocal.m4
--- a/aclocal.m4 2014-04-07 12:26:08.000000000 -0600
+++ b/aclocal.m4 2014-05-04 08:43:23.399271800 -0600
@@ -408,7 +408,7 @@
)],
[changequote(, )dnl
ARM_ISA=ARMv7
- ARM_ISA_EXT="[VFPv3,NEON]"
@ -17,25 +10,3 @@ index 127f528..a2db986 100644
changequote([, ])dnl
])
])
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index b128c1f..c71546c 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1453,14 +1453,17 @@ runPhase LlvmLlc input_fn dflags
else if (elem VFPv3D16 ext)
then ["-mattr=+v7,+vfp3,+d16"]
else []
+ ArchARM ARMv6 ext _ -> if (elem VFPv2 ext)
+ then ["-mattr=+v6,+vfp2"]
+ else ["-mattr=+v6"]
_ -> []
-- On Ubuntu/Debian with ARM hard float ABI, LLVM's llc still
-- compiles into soft-float ABI. We need to explicitly set abi
-- to hard
abiOpts = case platformArch (targetPlatform dflags) of
- ArchARM ARMv7 _ HARD -> ["-float-abi=hard"]
- ArchARM ARMv7 _ _ -> []
- _ -> []
+ ArchARM _ _ HARD -> ["-float-abi=hard"]
+ ArchARM _ _ _ -> []
+ _ -> []

10
extra/ghc/ghc Normal file
View file

@ -0,0 +1,10 @@
_ghc()
{
local envs=`ghc --show-options`
# get the word currently being completed
local cur=${COMP_WORDS[$COMP_CWORD]}
# the resulting completions should be put into this array
COMPREPLY=( $( compgen -W "$envs" -- $cur ) )
}
complete -F _ghc -o default ghc

View file

@ -12,6 +12,11 @@ declare -A exclude
exclude['Win32']=1
# no integer-simple because we use integer-gmp
exclude['integer-simple']=1
# the rest are installed as dependencies of ghc and some shouldn't even be installed!
# https://ghc.haskell.org/trac/ghc/ticket/8919
exclude['haskeline']=1
exclude['terminfo']=1
exclude['xhtml']=1
# extract excluded libraries from ghc.mk
for exclude_pkg in $(sed 's/PKGS_THAT_ARE_INTREE_ONLY := //p' -n src/ghc-${pkgver}/ghc.mk); do
exclude[${exclude_pkg}]=1
@ -26,13 +31,17 @@ print_var() {
for pkg in $(ls ./*/*.cabal | awk -F '/' '{ print $2 }'); do
[[ ${exclude[${pkg}]} ]] && continue
version=$(awk 'tolower($0) ~ /^version:/ {print $2 }' $pkg/$pkg.cabal)
printf "'haskell-$pkg$2$version'\n "
printf "'haskell-$pkg"
[[ -n "$2" ]] && printf "$2$version"
printf "'\n "
done
# also add cabal
version=$(awk 'tolower($0) ~ /^version:/ { print $2 }' Cabal/Cabal/Cabal.cabal)
printf "'haskell-cabal$2$version'\n "
printf "'haskell-cabal"
[[ -n "$2" ]] && printf "$2$version"
printf "'\n "
echo -e '\b)'
}
print_var 'provides' '='
print_var 'replaces' '<'
print_var 'replaces'