summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Villavicencio <the_paya@gentoo.org>2010-03-16 02:25:33 +0000
committerJavier Villavicencio <the_paya@gentoo.org>2010-03-16 02:25:33 +0000
commita876f2fa61d3ac86eb4b4a6f607bdb21bccc784a (patch)
tree30facf0e4bd36a1296ecba22004a8e853c27fcbd
parentRemove stray bracket from gnu mirrors. (diff)
downloadgentoo-2-a876f2fa61d3ac86eb4b4a6f607bdb21bccc784a.tar.gz
gentoo-2-a876f2fa61d3ac86eb4b4a6f607bdb21bccc784a.tar.bz2
gentoo-2-a876f2fa61d3ac86eb4b4a6f607bdb21bccc784a.zip
Another hack on fbsd/profile.bashrc to patch known install-sh versions that are likely to fail during a parallel make install.
-rw-r--r--profiles/default/bsd/ChangeLog7
-rw-r--r--profiles/default/bsd/fbsd/profile.bashrc62
2 files changed, 66 insertions, 3 deletions
diff --git a/profiles/default/bsd/ChangeLog b/profiles/default/bsd/ChangeLog
index 9a96b049bb43..a712bfc62d90 100644
--- a/profiles/default/bsd/ChangeLog
+++ b/profiles/default/bsd/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for profile directory
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/profiles/default/bsd/ChangeLog,v 1.30 2010/03/11 10:29:22 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/profiles/default/bsd/ChangeLog,v 1.31 2010/03/16 02:25:31 the_paya Exp $
+
+ 16 Mar 2010; Javier Villavicencio <the_paya@gentoo.org>
+ fbsd/profile.bashrc:
+ Another hack on profile.bashrc to patch well known install-sh versions
+ that are likely to fail during a parallel make install.
11 Mar 2010; Alexis Ballier <aballier@gentoo.org>
+fbsd/amd64/8.0/make.defaults, +fbsd/amd64/8.0/parent,
diff --git a/profiles/default/bsd/fbsd/profile.bashrc b/profiles/default/bsd/fbsd/profile.bashrc
index 11ebca7ba10e..a22e22aae70d 100644
--- a/profiles/default/bsd/fbsd/profile.bashrc
+++ b/profiles/default/bsd/fbsd/profile.bashrc
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/profiles/default/bsd/fbsd/profile.bashrc,v 1.4 2009/03/11 14:43:09 drizzt Exp $
+# $Header: /var/cvsroot/gentoo-x86/profiles/default/bsd/fbsd/profile.bashrc,v 1.5 2010/03/16 02:25:33 the_paya Exp $
alias make=gmake
alias patch=gpatch
@@ -12,9 +12,67 @@ alias awk=gawk
# See bugs 169678, 195148 and 256129.
# Also the discussion on
# http://archives.gentoo.org/gentoo-dev/msg_8cb1805411f37b4eb168a3e680e531f3.xml
-post_src_install()
+bsd-post_src_install()
{
if [ "${PN}" != "libiconv" -a -e "${D}"/usr/lib*/charset.alias ] ; then
rm -f "${D}"/usr/lib*/charset.alias
fi
}
+
+# These are because of
+# http://archives.gentoo.org/gentoo-dev/msg_529a0806ed2cf841a467940a57e2d588.xml
+# The profile-* ones are meant to be used in etc/portage/profile.bashrc by user
+# until there is the registration mechanism.
+profile-post_src_install() { bsd-post_src_install ; }
+ post_src_install() { bsd-post_src_install ; }
+
+
+# Another hack to fix old versions of install-sh (automake) where a non-gnu
+# mkdir is not considered thread-safe (make install errors with -j > 1)
+bsd-patch_install-sh() {
+ # Do nothing if we don't have patch installed:
+ if [[ -z $(type -P gpatch) ]]; then
+ return 0
+ fi
+ local EPDIR="${ECLASSDIR}/ELT-patches/install-sh"
+ local EPATCHES="${EPDIR}/1.5.6 ${EPDIR}/1.5.4 ${EPDIR}/1.5"
+ local ret=0
+ for file in $(find . -name "install-sh" -print); do
+ if [[ -n $(egrep "scriptversion=2005|scriptversion=2004" ${file}) ]]; then
+ einfo "Automatically patching parallel-make unfriendly install-sh."
+ # Stolen from libtool.eclass
+ for mypatch in ${EPATCHES}; do
+ if gpatch -p0 --dry-run "${file}" "${mypatch}" &> "${T}/patch_install-sh.log"; then
+ gpatch -p0 -g0 --no-backup-if-mismatch "${file}" "${mypatch}" \
+ &> "${T}/patch_install-sh.log"
+ ret=$?
+ break
+ else
+ ret=1
+ fi
+ done
+ if [[ ret -eq 0 ]]; then
+ einfo "Patch applied successfully on \"${file}\"."
+ else
+ ewarn "Unable to apply install-sh patch. "
+ ewarn "If you experience errors during install phase, try with MAKEOPTS=\"-j1\""
+ fi
+ fi
+ done
+}
+
+# It should be run after everything has been unpacked/patched, some developers
+# do patch this little bastard from time to time.
+# So do it after unpack() for EAPI=0|1 and after prepare() for everything else.
+if [[ -n $EAPI ]] ; then
+ case "$EAPI" in
+ 0|1)
+ profile-post_src_unpack() { bsd-patch_install-sh ; }
+ post_src_unpack() { bsd-patch_install-sh ; }
+ ;;
+ *)
+ profile_post_src_prepare() { bsd-patch_install-sh ; }
+ post_src_prepare() { bsd-patch_install-sh ; }
+ ;;
+ esac
+fi