diff options
author | Lennart Kolmodin <kolmodin@gentoo.org> | 2007-08-17 16:16:55 +0000 |
---|---|---|
committer | Lennart Kolmodin <kolmodin@gentoo.org> | 2007-08-17 16:16:55 +0000 |
commit | fc056884432bfb6ce36d01426f7d932298077902 (patch) | |
tree | 5ba57f76c21cb4d6b6f910991a2ea57bdc57fe50 /dev-lang | |
parent | Stable on amd64 wrt bug #188716 (diff) | |
download | historical-fc056884432bfb6ce36d01426f7d932298077902.tar.gz historical-fc056884432bfb6ce36d01426f7d932298077902.tar.bz2 historical-fc056884432bfb6ce36d01426f7d932298077902.zip |
Fixes to ghc 6.6.1; remove leftover files upon uninstall, optinal bash completion, tweak mk/build.mk.
Package-Manager: portage-2.1.3.1
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/ghc/ChangeLog | 10 | ||||
-rw-r--r-- | dev-lang/ghc/Manifest | 26 | ||||
-rw-r--r-- | dev-lang/ghc/files/ghc-bash-completion | 218 | ||||
-rw-r--r-- | dev-lang/ghc/ghc-6.6.1.ebuild | 40 |
4 files changed, 272 insertions, 22 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog index 4b4d101c69db..26959d5ab8d6 100644 --- a/dev-lang/ghc/ChangeLog +++ b/dev-lang/ghc/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for dev-lang/ghc # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.132 2007/08/08 15:57:56 kolmodin Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.133 2007/08/17 16:16:55 kolmodin Exp $ + + 17 Aug 2007; Lennart Kolmodin <kolmodin@gentoo.org> + +files/ghc-bash-completion, ghc-6.6.1.ebuild: + Add optional bash completion support for ghc-pkg. + Fixes to properly remove the leftover package.conf{,.old} files upon + uninstall of this package. + Tweaking mk/build.mk regarding arches we don't yet support for this GHC + version. 08 Aug 2007; Lennart Kolmodin <kolmodin@gentoo.org> ghc-6.6.ebuild: Set SplitObjs=NO if >=gcc-4.2 is used. diff --git a/dev-lang/ghc/Manifest b/dev-lang/ghc/Manifest index 0123aaed1855..67045a5b68ac 100644 --- a/dev-lang/ghc/Manifest +++ b/dev-lang/ghc/Manifest @@ -25,6 +25,10 @@ AUX ghc-6.6-nothreadedrts.patch 665 RMD160 402c8eb78dc648e55d1d7e00c695b49abe0f2 MD5 ec4b234602e907111db61eb1193c719e files/ghc-6.6-nothreadedrts.patch 665 RMD160 402c8eb78dc648e55d1d7e00c695b49abe0f293d files/ghc-6.6-nothreadedrts.patch 665 SHA256 bdfb000a70d97bb7341dda5a2ec48bb7f688532ade830eb2d73c7fa6ef1eead1 files/ghc-6.6-nothreadedrts.patch 665 +AUX ghc-bash-completion 6496 RMD160 61574aab2f8ed4ae906df5ac291f528384b79b87 SHA1 a0d7c264cc8ff3d235511e151dc82f9e16691bac SHA256 82a862bea2c9248e06fcf74d307de07b05a55f9eb95f412762bd02e53fece822 +MD5 9b442d5ee6b22c029670c510d658200f files/ghc-bash-completion 6496 +RMD160 61574aab2f8ed4ae906df5ac291f528384b79b87 files/ghc-bash-completion 6496 +SHA256 82a862bea2c9248e06fcf74d307de07b05a55f9eb95f412762bd02e53fece822 files/ghc-bash-completion 6496 AUX ghc-updater 9142 RMD160 1b99299d864e5dd73f082ffd3e2425a76e0dea15 SHA1 a24ba32e383d11b5aa5a1b01c28334c6cce947f3 SHA256 d9eb6ad3b64042e8882da8ff507f346f2c55a1d9d4daeaa2f3d696292d9c6185 MD5 dec80d46e4510ebf0bba1771a6f63705 files/ghc-updater 9142 RMD160 1b99299d864e5dd73f082ffd3e2425a76e0dea15 files/ghc-updater 9142 @@ -53,18 +57,18 @@ EBUILD ghc-6.4.2.ebuild 10063 RMD160 432148cf3791e9ecba2708ee9f8c84571071b833 SH MD5 9bfd34d76766aca1b41cf0a10880bf4f ghc-6.4.2.ebuild 10063 RMD160 432148cf3791e9ecba2708ee9f8c84571071b833 ghc-6.4.2.ebuild 10063 SHA256 c62d1a2467ed5eb06ab71bb8dc80e256675859466aa086d4dace0df2d2f45c79 ghc-6.4.2.ebuild 10063 -EBUILD ghc-6.6.1.ebuild 11261 RMD160 69dd349e6a583a4d94c0a302b150570b6c6b787e SHA1 95449051d6bbbd3e77dd191fb54ba2249d69c3b7 SHA256 a1afb7b714b67e5216a250a9ef41835cd90874ed7e44b8ae6e1c737929369c76 -MD5 08b71607da222cc4430caec348cc376f ghc-6.6.1.ebuild 11261 -RMD160 69dd349e6a583a4d94c0a302b150570b6c6b787e ghc-6.6.1.ebuild 11261 -SHA256 a1afb7b714b67e5216a250a9ef41835cd90874ed7e44b8ae6e1c737929369c76 ghc-6.6.1.ebuild 11261 +EBUILD ghc-6.6.1.ebuild 11907 RMD160 1149e2bf6d11da159a85dd989357ffac9e7a42b8 SHA1 3f67aa51f55cb84f6289707bf2fa9097d7b5fdc0 SHA256 469ee2a90e1c1817cc3db3c02113def147a2023a64c920ab38e9add5db948da4 +MD5 de34688c6c863b2b730f455cfb0d8d72 ghc-6.6.1.ebuild 11907 +RMD160 1149e2bf6d11da159a85dd989357ffac9e7a42b8 ghc-6.6.1.ebuild 11907 +SHA256 469ee2a90e1c1817cc3db3c02113def147a2023a64c920ab38e9add5db948da4 ghc-6.6.1.ebuild 11907 EBUILD ghc-6.6.ebuild 10934 RMD160 aca00102910c46c0b2219984048080a92e493f00 SHA1 9646589507bac370616a2b8c0e9df97c46691ad7 SHA256 d5e777941a5b4e9524932514099351a411174751f232be0b75b431cae144c605 MD5 9c8637f64b9a84f53e1db2c8544d7f5d ghc-6.6.ebuild 10934 RMD160 aca00102910c46c0b2219984048080a92e493f00 ghc-6.6.ebuild 10934 SHA256 d5e777941a5b4e9524932514099351a411174751f232be0b75b431cae144c605 ghc-6.6.ebuild 10934 -MISC ChangeLog 23107 RMD160 d2655b88adaa3d7ea2e04676ad3118c22bb3d698 SHA1 acbb8516f18fdc9e53048e6d97644ca25e64ae7c SHA256 efac503421f5030253267d4bfc62dfb140441ed6f5d224c1172b024806e4cc98 -MD5 6c63b0f84fe407a3f5f338505ad124ca ChangeLog 23107 -RMD160 d2655b88adaa3d7ea2e04676ad3118c22bb3d698 ChangeLog 23107 -SHA256 efac503421f5030253267d4bfc62dfb140441ed6f5d224c1172b024806e4cc98 ChangeLog 23107 +MISC ChangeLog 23447 RMD160 dcbaa969e7da12c06b95112b1f48784f046314a7 SHA1 c2b4bd963966a12abf3b7e4f8428433a6482b68a SHA256 0a6f4abb2aed28354f83c59d053fb657fad4dc04709d7a3d217e43e5030f6448 +MD5 3ce9aacf3b0b1b74f4b199ae8f76e3e9 ChangeLog 23447 +RMD160 dcbaa969e7da12c06b95112b1f48784f046314a7 ChangeLog 23447 +SHA256 0a6f4abb2aed28354f83c59d053fb657fad4dc04709d7a3d217e43e5030f6448 ChangeLog 23447 MISC metadata.xml 223 RMD160 7783e6057effb8b8f0b79cffe8b557b32c633839 SHA1 7b962c77f2e38479a9d1621ec8d307ca9f761753 SHA256 1d00c8be162a6cb87b3de440b3e63e10b39c12d56e8fbfe592e75aed872b2508 MD5 c694674dcbef799cd4fdb6914683ebff metadata.xml 223 RMD160 7783e6057effb8b8f0b79cffe8b557b32c633839 metadata.xml 223 @@ -84,7 +88,7 @@ SHA256 ec906e0471301db674088347605e3b91f150a111bffc53f3ee65f02a16b471be files/di -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) -iD8DBQFGuec71n/CYbXjntIRAmnWAJ9sfdpKS9a7QLTdRegG2BoSkK/60QCfceiR -TODgzjlnXdcaaQaLIxONfKs= -=SESo +iD8DBQFGxcn+1n/CYbXjntIRAt4+AKCdDPiGjsLfYWajZ+5ngbRm5aF2ngCbBN+V +mI1qWvDFeUBF3XkqasEevV8= +=W9l+ -----END PGP SIGNATURE----- diff --git a/dev-lang/ghc/files/ghc-bash-completion b/dev-lang/ghc/files/ghc-bash-completion new file mode 100644 index 000000000000..0ee2149cd81b --- /dev/null +++ b/dev-lang/ghc/files/ghc-bash-completion @@ -0,0 +1,218 @@ +# ghc-pkg command line completion for bash +# +# Copyright 2006-2007 Lennart Kolmodin <kolmodin@dtek.chalmers.se> + +_ghc-pkg-get-ghc-pkg() +{ + echo ghc-pkg +} + +_ghc-pkg-pkg-fields() +{ + # usage: _ghc-pkg-pkg-fields pkg-id + # + # list all fields of the pkg-id + + # same fields for all packages but different in different versions of + # ghc-pkg? this can probably be done better/faster + + if [[ -z "$1" ]]; then + echo "usage: _ghc-pkg-pkg-fields pkg-id" + return 1 + fi + + local fields + + fields="$( $(_ghc-pkg-get-ghc-pkg) describe $1 )" + + #if [[ fields != *"cannot find package"* ]]; then + echo "$fields" | grep ".*:.*" | sed "s/^\(.*\):.*\$/\1/" + #fi +} + +_ghc-pkg-pkg-ids() +{ + # usage: _ghc-pkg-pkg-ids + # + # simply lists all package ids known by ghc-pkg. + $(_ghc-pkg-get-ghc-pkg) list --simple-output +} + +_ghc-pkg-pkgs() +{ + # usage: _ghc-pkg-pkgs [include-pkgs] [include-ids] + # + # with optional parameter include-pkgs it will list all packages known + # to ghc-pkg. + # with optional parameter include-ids it will list all package-ids known + # to ghc-pkg. + local pkgs + local result + pkgs=( $( _ghc-pkg-pkg-ids ) ) + result=( ) + + local withPkgs="no" withIds="no" + while [[ -n "$1" ]]; do + case "$1" in + include-pkgs) + withPkgs="yes" ;; + include-ids) + withIds="yes" ;; + *) + echo "unknown parameter '$1' to _ghc-pkg-pkgs" + return 1 ;; + esac + shift + done + + # user must supply either include-pkgs, include-ids or both + if [[ $withPkgs != "yes" && $withIds != "yes" ]]; then + echo "usage: _ghc-pkg-pkgs [include-pkgs] [include-ids]" + return 1 + fi + + # find all packages if the user requested them + if [[ $withPkgs == "yes" ]]; then + # O(n^2) algorithm to exclude duplicates + for p in ${pkgs[*]}; do + p="${p//-[0-9.]*/}" + for existing in ${result[*]}; do + if [[ "$existing" == "$p" ]]; then + continue 2 + fi + done + result=( "${result[@]}" "${p}" ) + done + fi + + # include all pkg-ids if requested + if [[ $withIds == "yes" ]]; then + result=( "${result[@]}" "${pkgs[@]}" ) + fi + + # we are finished, echo the result + echo "${result[*]}" + + # happy ending + return 0 +} + +_ghc-pkg() +{ + local cur + cur=${COMP_WORDS[COMP_CWORD]} + + COMPREPLY=() + + local actions flags + actions='register update unregister expose hide list latest describe field' + dbflags="--user \ + --global \ + -f --package-conf= \ + --global-conf=" + registerflags="--force \ + -g --auto-ghci-libs \ + -D --define-name=" + listflags="--simple-output" + flags="$dbflags \ + $registerflags \ + $listflags \ + -? --help \ + -V --version" + + # if it's the users first word; complete it and return + if (($COMP_CWORD == 1)); then + COMPREPLY=( $( compgen -W "$actions $flags" -- $cur ) ) + return 0 + fi + + # now we know we have at least one word written + + local action="unknown" \ + prev numwords \ + cword act + prev=${COMP_WORDS[COMP_CWORD-1]} + numwords=${#COMP_WORDS[@]} + + # find the action with O(n*m) algorithm + # where n = ${#COMP_WORDS[*]} + # m = number of actions + for cword in ${COMP_WORDS[*]}; do + for act in $actions; do + if [[ "$cword" == "$act" ]]; then + action=$cword + fi + done + done + + case $action in + register|update) + # we want to complete both flags and paths, how? + # we do it by checking if the user has started to write a flag + # or a path, and then decide what to complete. + # that is, to complete a flag, the user must start to write a '-' + if [[ "$cur" == -* ]]; then + # (we assume) it's the start of a flag + # set COMPREPLY to flags relevant to these actions + COMPREPLY=( $( compgen -W "$dbflags $registerflags" -- $cur ) ) + fi + ;; + unregister|expose|hide|list|describe) + # all these actions can be completed with exactly one argument, + # a pkg-id. + COMPREPLY=( $( compgen -W "$dbflags" -- $cur ) ) + + # add special flags for some actions + if [[ "$action" == "list" ]]; then + COMPREPLY+=( $( compgen -W "$listflags" -- $cur ) ) + fi + + COMPREPLY+=( $( compgen -W "$( _ghc-pkg-pkgs include-ids )" -- $cur ) ) + ;; + latest) + # complete only packages, not package ids + COMPREPLY=( $( compgen -W "$( _ghc-pkg-pkgs include-pkgs )" -- $cur ) ) + ;; + field) + # we should always complete on the flags... + COMPREPLY=( $( compgen -W "$dbflags" -- $cur ) ) + + # then, we should either complete the package name or the field + # lets find out which one + + # find the number of words in COMP_WORDS before COMP_CWORD that + # isn't flags. it should be 2 or 3 for us to complete it, + # exactly 2 if we should complete the package name + # exactly 3 if we should complete the field name + # otherwise, don't do any additional completion except the + # flags + + # count the number of non flags up till the current word + local numnonflags=0 lastword i + for (( i=0 ; $i < $COMP_CWORD ; i++ )); do + if [[ ${COMP_WORDS[$i]} != -* ]]; then + lastword=${COMP_WORDS[$i]} + numnonflags=$(( ++numnonflags )) + fi + done + + case $numnonflags in + 2) + # complete on pkg-ids + COMPREPLY+=( $( compgen -W "$( _ghc-pkg-pkgs include-ids )" -- $cur ) ) ;; + 3) + # complete on fields + COMPREPLY+=( $( compgen -W "$( _ghc-pkg-pkg-fields $lastword )" -- $cur ) ) ;; + esac + ;; + *) + # unknown action, not yet given by the user + # return all possible completions + COMPREPLY=( $( compgen -W "$actions $flags" -- $cur ) ) + ;; + esac +} + +complete -F _ghc-pkg -o default ghc-pkg + +# vim: set ft=sh tw=80 sw=4 et : diff --git a/dev-lang/ghc/ghc-6.6.1.ebuild b/dev-lang/ghc/ghc-6.6.1.ebuild index e91299ac76ec..c8f880f99f73 100644 --- a/dev-lang/ghc/ghc-6.6.1.ebuild +++ b/dev-lang/ghc/ghc-6.6.1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.6.1.ebuild,v 1.7 2007/07/28 13:36:16 kolmodin Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.6.1.ebuild,v 1.8 2007/08/17 16:16:55 kolmodin Exp $ # Brief explanation of the bootstrap logic: # @@ -28,7 +28,7 @@ # re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between # gcc-3.x and 4.x with no problems. -inherit base eutils flag-o-matic toolchain-funcs ghc-package versionator +inherit base bash-completion eutils flag-o-matic toolchain-funcs ghc-package versionator DESCRIPTION="The Glasgow Haskell Compiler" HOMEPAGE="http://www.haskell.org/ghc/" @@ -72,7 +72,11 @@ DEPEND="${RDEPEND} # In the ghcbootstrap case we rely on the developer having # >=ghc-5.04.3 on their $PATH already -PDEPEND=">=dev-haskell/cabal-1.1.6.2" +PDEPEND=">=dev-haskell/cabal-1.1.6.2 + >=dev-haskell/filepath-1.0 + >=dev-haskell/regex-base-0.72 + >=dev-haskell/regex-posix-0.71 + >=dev-haskell/regex-compat-0.71" append-ghc-cflags() { local flag compile assemble link @@ -139,6 +143,12 @@ pkg_setup() { die "Could not find a ghc to bootstrap with." fi + set_config +} + +set_config() { + # make this a separate function and call it several times as portage doesn't + # remember the variables properly between the fuctions. use binary && GHC_PREFIX="/opt/ghc" || GHC_PREFIX="/usr" } @@ -232,11 +242,13 @@ src_compile() { echo "SRC_HC_OPTS+=-fno-warn-deprecations" >> mk/build.mk # GHC build system knows to build unregisterised on alpha and hppa, - # but we have to tell it to build unregisterised on some other arches - if use ppc64 || use sparc; then + # but we have to tell it to build unregisterised on some arches + if use alpha || use hppa || use ppc64; then echo "GhcUnregisterised=YES" >> mk/build.mk - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk echo "GhcWithInterpreter=NO" >> mk/build.mk + fi + if use alpha || use hppa || use ppc64 || use sparc; then + echo "GhcWithNativeCodeGen=NO" >> mk/build.mk echo "SplitObjs=NO" >> mk/build.mk echo "GhcRTSWays := debug" >> mk/build.mk echo "GhcNotThreaded=YES" >> mk/build.mk @@ -272,6 +284,11 @@ src_install() { || die "could not remove docs (P vs PF revision mismatch?)" fi + # TODO: this will not be necessary after version 6.6.1 since the .tbz2 + # packages will have been regenerated with package.conf.shipped files. + cp -p "${D}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"{,.shipped} \ + || die "failed to copy package.conf" + doenvd "${FILESDIR}/10ghc" else local insttarget="install" @@ -302,6 +319,8 @@ src_install() { dosbin ${FILESDIR}/ghc-updater + dobashcompletion "${FILESDIR}/ghc-bash-completion" + cp -p "${D}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"{,.shipped} \ || die "failed to copy package.conf" fi @@ -309,9 +328,6 @@ src_install() { pkg_postinst() { ghc-reregister - elog "If you have dev-lang/ghc-bin installed, you might" - elog "want to unmerge it. It is no longer needed." - elog if use binary; then elog "The envirenment has been set to use the binary distribution of" @@ -330,15 +346,19 @@ pkg_postinst() { ewarn " /usr/sbin/ghc-updater" fi ewarn "to re-merge all ghc-based Haskell libraries." + + bash-completion_pkg_postinst } pkg_prerm() { # Overwrite the (potentially) modified package.conf with a copy of the # original one, so that it will be removed during uninstall. + set_config # load GHC_PREFIX + PKG="${ROOT}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf" cp -p "${PKG}"{.shipped,} - [ -f ${PKG}.old ] && rm "${PKG}.old" + [[ -f ${PKG}.old ]] && rm "${PKG}.old" } |