Commit 99330c4f authored by Chaoting Liu's avatar Chaoting Liu

ghc: edit provide replace list, add back helper script

parent 6cbce67b
# $Id: PKGBUILD 168343 2012-10-09 04:08:52Z tdziedzic $
# Maintainer: Thomas Dziedzic <gostrc@gmail.com>
# Maintainer: Vesa Kaihlavirta <vesa@archlinux.org>
# Special note for devs looking to upgrade this package:
# ghc places a unique hash for each library when it is built.
# Libraries depend on versions specified by those hashes.
......@@ -8,7 +6,7 @@
pkgname=ghc
pkgver=8.2.1
pkgrel=1
pkgrel=2
pkgdesc='The Glasgow Haskell Compiler'
arch=('i686' 'x86_64')
url='http://www.haskell.org/ghc/'
......@@ -20,53 +18,57 @@ install='ghc.install'
options=('staticlibs')
# missing rtl?
# missing integer-gmp2
provides=('haskell-array=0.5.1.0'
'haskell-base=4.8.0.0'
'haskell-bin-package-db=0.0.0.0'
'haskell-binary=0.7.3.0'
'haskell-bytestring=0.10.6.0'
'haskell-containers=0.5.6.2'
'haskell-deepseq=1.4.1.1'
'haskell-directory=1.2.2.0'
'haskell-filepath=1.4.0.0'
'haskell-ghc-prim=0.4.0.0'
'haskell-haskeline=0.7.2.1'
'haskell-hoopl=3.10.0.2'
'haskell-hpc=0.6.0.2'
'haskell-integer-gmp=0.5.1.0'
'haskell-pretty=1.1.2.0'
'haskell-process=1.2.3.0'
'haskell-template-haskell=2.10.0.0'
'haskell-terminfo=0.4.0.1'
'haskell-time=1.5.0.1'
'haskell-transformers=0.4.2.0'
'haskell-unix=2.7.1.0'
'haskell-xhtml=3000.2.1'
'haskell-cabal=1.22.2.0'
provides=('haskell-array=0.5.2.0'
'haskell-base=4.10.0.0'
'haskell-binary=0.8.5.1'
'haskell-bytestring=0.10.8.2'
'haskell-containers=0.5.10.2'
'haskell-deepseq=1.4.3.0'
'haskell-directory=1.3.0.2'
'haskell-filepath=1.4.1.2'
'haskell-ghc-boot-th=8.2.1'
'haskell-ghc-boot=8.2.1'
'haskell-ghc-compact=0.1.0.0'
'haskell-ghc-prim=0.5.1.0'
'haskell-haskeline=0.7.4.0'
'haskell-hoopl=3.10.2.2'
'haskell-hpc=0.6.0.3'
'haskell-integer-gmp=1.0.1.0'
'haskell-pretty=1.1.3.3'
'haskell-process=1.6.1.0'
'haskell-template-haskell=2.12.0.0'
'haskell-terminfo=0.4.1.0'
'haskell-time=1.8.0.2'
'haskell-transformers=0.5.2.0'
'haskell-unix=2.7.2.2'
'haskell-xhtml=3000.2.2'
'haskell-cabal=2.0.0.2'
)
replaces=('haskell-array<0.5.1.0'
'haskell-base<4.8.0.0'
'haskell-bin-package-db<0.0.0.0'
'haskell-binary<0.7.3.0'
'haskell-bytestring<0.10.6.0'
'haskell-containers<0.5.6.2'
'haskell-deepseq<1.4.1.1'
'haskell-directory<1.2.2.0'
'haskell-filepath<1.4.0.0'
'haskell-ghc-prim<0.4.0.0'
'haskell-haskeline<0.7.2.1'
'haskell-hoopl<3.10.0.2'
'haskell-hpc<0.6.0.2'
'haskell-integer-gmp<0.5.1.0'
'haskell-pretty<1.1.2.0'
'haskell-process<1.2.3.0'
'haskell-template-haskell<2.10.0.0'
'haskell-terminfo<0.4.0.1'
'haskell-time<1.5.0.1'
'haskell-transformers<0.4.2.0'
'haskell-unix<2.7.1.0'
'haskell-xhtml<3000.2.1'
'haskell-cabal<1.22.2.0'
replaces=('haskell-array<0.5.2.0'
'haskell-base<4.10.0.0'
'haskell-binary<0.8.5.1'
'haskell-bytestring<0.10.8.2'
'haskell-containers<0.5.10.2'
'haskell-deepseq<1.4.3.0'
'haskell-directory<1.3.0.2'
'haskell-filepath<1.4.1.2'
'haskell-ghc-boot-th<8.2.1'
'haskell-ghc-boot<8.2.1'
'haskell-ghc-compact<0.1.0.0'
'haskell-ghc-prim<0.5.1.0'
'haskell-haskeline<0.7.4.0'
'haskell-hoopl<3.10.2.2'
'haskell-hpc<0.6.0.3'
'haskell-integer-gmp<1.0.1.0'
'haskell-pretty<1.1.3.3'
'haskell-process<1.6.1.0'
'haskell-template-haskell<2.12.0.0'
'haskell-terminfo<0.4.1.0'
'haskell-time<1.8.0.2'
'haskell-transformers<0.5.2.0'
'haskell-unix<2.7.2.2'
'haskell-xhtml<3000.2.2'
'haskell-cabal<2.0.0.2'
)
source=("http://www.haskell.org/ghc/dist/${pkgver}/ghc-${pkgver}-src.tar.xz"
......
#!/bin/bash
. PKGBUILD
if [[ ! -d src/ghc-${pkgver}/libraries ]]; then
echo "error: no directory src/ghc-${pkgver}/libraries: You must extract the source tarball under src/"
exit 1
fi
declare -A exclude
# no Win32 cause we're not building on windows
exclude['Win32']=1
# no integer-simple because we use integer-gmp
exclude['integer-simple']=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
done
cd src/ghc-${pkgver}/libraries
# $1 is the name of the variable
# $2 is the string for the test, either '=' or '<'
print_var() {
printf "$1=("
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 "
done
# also add cabal
version=$(awk 'tolower($0) ~ /^version:/ { print $2 }' Cabal/Cabal/Cabal.cabal)
printf "'haskell-cabal$2$version'\n "
echo -e '\b)'
}
print_var 'provides' '='
print_var 'replaces' '<'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment