summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2016-05-31 22:35:32 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2016-05-31 22:37:16 +0100
commit2db4176c329e5e99e68f47dcb058c55d434bb64e (patch)
tree8a268a63179d05ab2d6dece7fc640483aecee27f /eclass/ghc-package.eclass
parentdev-python/pyudev: Version bump to 0.20.0 (diff)
downloadgentoo-2db4176c329e5e99e68f47dcb058c55d434bb64e.tar.gz
gentoo-2db4176c329e5e99e68f47dcb058c55d434bb64e.tar.bz2
gentoo-2db4176c329e5e99e68f47dcb058c55d434bb64e.zip
haskell-cabal.eclass: add basic support for ROOT!=/, bug #534194
Reported-by: Dennis Schridde Bug: https://bugs.gentoo.org/534194 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass/ghc-package.eclass')
-rw-r--r--eclass/ghc-package.eclass12
1 files changed, 11 insertions, 1 deletions
diff --git a/eclass/ghc-package.eclass b/eclass/ghc-package.eclass
index 5466c0b5b20d..ccc6d6ffd84b 100644
--- a/eclass/ghc-package.eclass
+++ b/eclass/ghc-package.eclass
@@ -62,6 +62,16 @@ ghc-getghcpkgbin() {
fi
}
+# @FUNCTION: ghc-host-prefix
+# @DESCRIPTION:
+# Returns root of installed ghc.
+# Some helpers (like best_version) require reference
+# host system as they are tied to compiler bing executed.
+ghc-host-root() {
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+ echo "${EPREFIX}/"
+}
+
# @FUNCTION: ghc-version
# @DESCRIPTION:
# returns upstream version of ghc
@@ -85,7 +95,7 @@ ghc-pm-version() {
local pm_ghc_p
if [[ -z "${_GHC_PM_VERSION_CACHE}" ]]; then
- pm_ghc_p=$(best_version dev-lang/ghc)
+ pm_ghc_p=$(ROOT=$(ghc-host-root) best_version dev-lang/ghc)
_GHC_PM_VERSION_CACHE="PM:${pm_ghc_p#dev-lang/ghc-}"
fi
echo "${_GHC_PM_VERSION_CACHE}"