--- /usr/portage/eclass/eutils.eclass 2013-09-14 13:01:16.000000000 -0600 +++ eutils.eclass 2013-09-19 12:45:15.353758086 -0600 @@ -52,6 +52,13 @@ fi } +# Define EPREFIX and friends if needed +if ! use prefix ; then + EPREFIX= + ED="${D}" + EROOT="${ROOT}" +fi + else ebeep() { @@ -955,11 +962,11 @@ # @DESCRIPTION: # Validate desktop entries using desktop-file-utils validate_desktop_entries() { - if [[ -x /usr/bin/desktop-file-validate ]] ; then + if [[ -x "${EPREFIX}"/usr/bin/desktop-file-validate ]] ; then einfo "Checking desktop entry validity" local directories="" for d in /usr/share/applications $@ ; do - [[ -d ${D}${d} ]] && directories="${directories} ${D}${d}" + [[ -d ${ED}${d} ]] && directories="${directories} ${ED}${d}" done if [[ -n ${directories} ]] ; then for FILE in $(find ${directories} -name "*\.desktop" \ @@ -967,7 +974,7 @@ do local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \ sed -e "s|error: ||" -e "s|${FILE}:|--|g" ) - [[ -n $temp ]] && elog ${temp/--/${FILE/${D}/}:} + [[ -n $temp ]] && elog ${temp/--/${FILE/${ED}/}:} done fi echo "" @@ -1236,13 +1243,19 @@ # let portage worry about it has preserve-libs ${FEATURES} && return 0 + # cannot preserve-libs on aix yet. + [[ ${CHOST} == *-aix* ]] && { + einfo "Not preserving libs on AIX (yet), not implemented." + return 0 + } + local lib dir for lib in "$@" ; do - [[ -e ${ROOT}/${lib} ]] || continue + [[ -e ${EROOT}/${lib} ]] || continue dir=${lib%/*} dodir ${dir} || die "dodir ${dir} failed" - cp "${ROOT}"/${lib} "${D}"/${lib} || die "cp ${lib} failed" - touch "${D}"/${lib} + cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed" + touch "${ED}"/${lib} done } @@ -1261,7 +1274,7 @@ local lib notice=0 for lib in "$@" ; do - [[ -e ${ROOT}/${lib} ]] || continue + [[ -e ${EROOT}/${lib} ]] || continue if [[ ${notice} -eq 0 ]] ; then notice=1 ewarn "Old versions of installed libraries were detected on your system." @@ -1320,8 +1333,8 @@ [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package" shift - local USEFILE=${ROOT}/var/db/pkg/${PKG}/USE - local IUSEFILE=${ROOT}/var/db/pkg/${PKG}/IUSE + local USEFILE="${EROOT}"/var/db/pkg/${PKG}/USE + local IUSEFILE="${EROOT}"/var/db/pkg/${PKG}/IUSE # if the IUSE file doesn't exist, the read will error out, we need to handle # this gracefully @@ -1410,15 +1423,21 @@ if [[ -n ${libdir} ]] ; then cat <<-EOF if [ "\${LD_LIBRARY_PATH+set}" = "set" ] ; then - export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}" + export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${EPREFIX}${libdir}" + else + export LD_LIBRARY_PATH="${EPREFIX}${libdir}" + fi + # ultra-dirty, just do the same for Darwin + if [ "\${DYLD_LIBRARY_PATH+set}" = "set" ] ; then + export DYLD_LIBRARY_PATH="\${DYLD_LIBRARY_PATH}:${EPERFIX}${libdir}" else - export LD_LIBRARY_PATH="${libdir}" + export DYLD_LIBRARY_PATH="${EPREFIX}${libdir}" fi EOF fi # We don't want to quote ${bin} so that people can pass complex # things as ${bin} ... "./someprog --args" - printf 'exec %s "$@"\n' "${bin}" + printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}\/}" ) > "${tmpwrapper}" chmod go+rx "${tmpwrapper}" @@ -1638,7 +1657,7 @@ einfo "Removing unnecessary ${f#${D%/}} (${reason})" queue+=( "${f}" ) fi - done < <(find "${D}" -xtype f -name '*.la' -print0) + done < <(find "${ED}" -xtype f -name '*.la' -print0) if [[ ${queue[@]} ]]; then rm -f "${queue[@]}"