summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2013-07-19 10:21:35 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2013-07-19 10:21:35 +0000
commit5ae5d812486841c669cfd833e4983a612531f478 (patch)
tree73398407481dcdcaa96cee12cf586e936b016d50 /dev-lang
parentsci-biology/mafft: Keyword for ~-linux (diff)
downloadgentoo-2-5ae5d812486841c669cfd833e4983a612531f478.tar.gz
gentoo-2-5ae5d812486841c669cfd833e4983a612531f478.tar.bz2
gentoo-2-5ae5d812486841c669cfd833e4983a612531f478.zip
Fix building on systems where libdir differs from the one we have built GHC (it case of bug #476998 it was an amd64-linux). Thanks to tamiko and Christoph Junghans.
(Portage version: 2.2.0_alpha182_p1/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/ghc/ChangeLog7
-rw-r--r--dev-lang/ghc/ghc-7.6.3.ebuild39
2 files changed, 38 insertions, 8 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog
index 32a2a4a8199b..1885244b56c0 100644
--- a/dev-lang/ghc/ChangeLog
+++ b/dev-lang/ghc/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-lang/ghc
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.243 2013/06/01 14:16:25 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.244 2013/07/19 10:21:35 slyfox Exp $
+
+ 19 Jul 2013; Sergei Trofimovich <slyfox@gentoo.org> ghc-7.6.3.ebuild:
+ Fix building on systems where libdir differs from the one we have built GHC
+ (it case of bug #476998 it was an amd64-linux). Thanks to tamiko and Christoph
+ Junghans.
*ghc-7.6.3 (01 Jun 2013)
diff --git a/dev-lang/ghc/ghc-7.6.3.ebuild b/dev-lang/ghc/ghc-7.6.3.ebuild
index 7dfc47445cc8..0b3196b4c33b 100644
--- a/dev-lang/ghc/ghc-7.6.3.ebuild
+++ b/dev-lang/ghc/ghc-7.6.3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.6.3.ebuild,v 1.1 2013/06/01 14:16:25 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.6.3.ebuild,v 1.2 2013/07/19 10:21:35 slyfox Exp $
# Brief explanation of the bootstrap logic:
#
@@ -50,10 +50,10 @@ HOMEPAGE="http://www.haskell.org/ghc/"
arch_binaries=""
# sorted!
-#arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )"
+arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )"
#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )"
arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64.tbz2 )"
+arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64.tbz2 )"
#arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )"
#arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )"
#arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )"
@@ -65,13 +65,13 @@ arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc
# 0 - yet
yet_binary() {
case "${ARCH}" in
- #alpha) return 0 ;;
+ alpha) return 0 ;;
#arm)
# ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
# return 0
#;;
amd64) return 0 ;;
- #ia64) return 0 ;;
+ ia64) return 0 ;;
#ppc) return 0 ;;
#ppc64) return 0 ;;
#sparc) return 0 ;;
@@ -233,20 +233,44 @@ relocate_path() {
relocate_ghc() {
local to=$1
+ # libdir for prebuilt binary and for current system may mismatch
+ # It does for prefix installation for example: bug #476998
+ local bin_ghc_prefix=${WORKDIR}/usr
+ local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
+ local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
+
# backup original script to use it later after relocation
local gp_back="${T}/ghc-pkg-${PV}-orig"
cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
+ if [[ ${bin_libdir} != $(get_libdir) ]]; then
+ einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
+ # moving the dir itself is not strictly needed
+ # but then USE=binary would result in installing
+ # in '${bin_libdir}'
+ mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
+
+ relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
+ "${WORKDIR}/usr/bin/ghc-${PV}" \
+ "${WORKDIR}/usr/bin/ghci-${PV}" \
+ "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
+ "${WORKDIR}/usr/bin/hsc2hs" \
+ "${WORKDIR}/usr/bin/runghc-${PV}" \
+ "$gp_back" \
+ "${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"*
+ fi
+
# Relocate from /usr to ${EPREFIX}/usr
relocate_path "/usr" "${to}/usr" \
"${WORKDIR}/usr/bin/ghc-${PV}" \
"${WORKDIR}/usr/bin/ghci-${PV}" \
"${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
"${WORKDIR}/usr/bin/hsc2hs" \
+ "${WORKDIR}/usr/bin/runghc-${PV}" \
"${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"*
# this one we will use to regenerate cache
- # so it shoult point to current tree location
+ # so it should point to current tree location
relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
if use prefix; then
@@ -257,8 +281,9 @@ relocate_ghc() {
"${WORKDIR}/usr/bin/ghc-${PV}" \
"${WORKDIR}/usr/bin/ghci-${PV}" \
"${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
- "$gp_back" \
"${WORKDIR}/usr/bin/hsc2hs" \
+ "${WORKDIR}/usr/bin/runghc-${PV}" \
+ "$gp_back" \
|| die "Adding LD_LIBRARY_PATH for wrappers failed"
fi