Skip to content

Instantly share code, notes, and snippets.

@cosmo0920
Created June 24, 2012 13:12
Show Gist options
  • Save cosmo0920/2983206 to your computer and use it in GitHub Desktop.
Save cosmo0920/2983206 to your computer and use it in GitHub Desktop.
USE=binaryが通らなかったのでパッチを書いてみた
--- /home/cosmo/Gentoo/var/lib/layman/haskell/dev-lang/ghc/ghc-7.4.1-r1.ebuild 2012-06-24 21:15:42.299455127 +0900
+++ /home/cosmo/overlay/cosmo-betalab/dev-lang/ghc/ghc-7.4.1-r1.ebuild 2012-06-25 05:46:08.615946259 +0900
@@ -209,13 +209,22 @@
cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
# Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
+ if [ -d "${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"];
+ then
+ 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/$(get_libdir)/${P}/package.conf.d/"*
-
+ else
+ 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/$(get_libdir)64/${P}/package.conf.d/"*
+ fi
# this one we will use to regenerate cache
# so it shoult point to current tree location
relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
@@ -531,8 +540,12 @@
fi
# path to the package.cache
- PKGCACHE="${ED}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
-
+ if [ -f "${ED}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"];
+ then
+ PKGCACHE="${ED}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
+ else
+ PKGCACHE="${ED}/usr/$(get_libdir)64/${P}/package.conf.d/package.cache"
+ fi
# copy the package.conf, including timestamp, save it so we later can put it
# back before uninstalling, or when upgrading.
cp -p "${PKGCACHE}"{,.shipped} \
@@ -550,7 +563,12 @@
ghc-reregister
# path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
+ if [ -f "${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"];
+ then
+ PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
+ else
+ PKGCACHE="${EROOT}/usr/$(get_libdir)64/${P}/package.conf.d/package.cache"
+ fi
# give the cache a new timestamp, it must be as recent as
# the package.conf.d directory.
@@ -591,7 +609,14 @@
# Overwrite the modified package.cache with a copy of the
# original one, so that it will be removed during uninstall.
- PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
+ if [ -f "${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"];
+ then
+ PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
+ else
+ PKGCACHE="${EROOT}/usr/$(get_libdir)64/${P}/package.conf.d/package.cache"
+ fi
+
+
rm -rf "${PKGCACHE}"
cp -p "${PKGCACHE}"{.shipped,}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment