Index: glibc/files/eblits/common.eblit =================================================================== --- glibc.orig/files/eblits/common.eblit +++ glibc/files/eblits/common.eblit @@ -2,24 +2,32 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v 1.29 2012/12/28 19:00:51 vapier Exp $ -alt_prefix() { +alt_arch_prefix() { is_crosscompile && echo /usr/${CTARGET} } +alt_prefix() { + is_crosscompile && echo "${EPREFIX}/usr/${CTARGET}" +} + +alt_eprefix() { + is_crosscompile || echo "${EPREFIX}" +} + # We need to be able to set alternative headers for # compiling for non-native platform # Will also become useful for testing kernel-headers without screwing up # the whole system. # note: intentionally undocumented. alt_headers() { - echo ${ALT_HEADERS:=$(alt_prefix)/usr/include} + echo ${ALT_HEADERS:=$(alt_arch_prefix)/usr/include} } alt_build_headers() { if [[ -z ${ALT_BUILD_HEADERS} ]] ; then ALT_BUILD_HEADERS=$(alt_headers) if tc-is-cross-compiler ; then ALT_BUILD_HEADERS=${ROOT}$(alt_headers) - if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then + if [[ ! -e ${EPREFIX}/${ALT_BUILD_HEADERS}/linux/version.h ]] ; then local header_path=$(echo '#include ' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h') ALT_BUILD_HEADERS=${header_path%/linux/version.h} fi @@ -29,10 +37,10 @@ alt_build_headers() { } alt_libdir() { - echo $(alt_prefix)/$(get_libdir) + echo $(alt_arch_prefix)/$(get_libdir) } alt_usrlibdir() { - echo $(alt_prefix)/usr/$(get_libdir) + echo $(alt_arch_prefix)/usr/$(get_libdir) } setup_target_flags() { @@ -259,8 +267,9 @@ setup_env() { # silly users unset LD_RUN_PATH - multilib_env ${CTARGET_OPT:-${CTARGET}} if is_crosscompile || tc-is-cross-compiler ; then + multilib_env ${CTARGET_OPT:-${CTARGET}} + if ! use multilib ; then MULTILIB_ABIS=${DEFAULT_ABI} else Index: glibc/files/eblits/pkg_preinst.eblit =================================================================== --- glibc.orig/files/eblits/pkg_preinst.eblit +++ glibc/files/eblits/pkg_preinst.eblit @@ -15,7 +15,7 @@ glibc_sanity_check() { # lead to unsafe code execution if the generated prefix is # within a world-writable directory. # (e.g. /var/tmp/portage:${HOSTNAME}) - pushd "${D}"/$(get_libdir) >/dev/null + pushd "${ED}"/$(get_libdir) >/dev/null local x striptest for x in date env ls true uname ; do @@ -35,17 +35,17 @@ eblit-glibc-pkg_preinst() { just_headers && return # prepare /etc/ld.so.conf.d/ for files - mkdir -p "${ROOT}"/etc/ld.so.conf.d + mkdir -p "${EROOT}"/etc/ld.so.conf.d # Default /etc/hosts.conf:multi to on for systems with small dbs. - if [[ $(wc -l < "${ROOT}"/etc/hosts) -lt 1000 ]] ; then - sed -i '/^multi off/s:off:on:' "${D}"/etc/host.conf + if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then + sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf elog "Defaulting /etc/host.conf:multi to on" fi [[ ${ROOT} != "/" ]] && return 0 [[ -d ${D}/$(get_libdir) ]] || return 0 - glibc_sanity_check + use prefix || glibc_sanity_check # Make sure devpts is mounted correctly for use w/out setuid pt_chown. if in_iuse suid && ! use suid ; then Index: glibc/files/eblits/pkg_setup.eblit =================================================================== --- glibc.orig/files/eblits/pkg_setup.eblit +++ glibc/files/eblits/pkg_setup.eblit @@ -98,18 +98,18 @@ eblit-glibc-pkg_setup() { # Make sure host system is up to date #394453 if has_version ' "${D}"$(alt_usrlibdir)/nptl/${l} + "${ED}"$(alt_usrlibdir)/${l} > "${ED}"$(alt_usrlibdir)/nptl/${l} fi # then grab the static lib ... src_lib=${src_lib/%.so/.a} [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a} - cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}" + cp -a ${src_lib} "${ED}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}" src_lib=${src_lib/%.a/_nonshared.a} if [[ -e ${src_lib} ]] ; then - cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}" + cp -a ${src_lib} "${ED}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}" fi done # use the nptl linker instead of the linuxthreads one as the linuxthreads # one may lack TLS support and that can be really bad for business - cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp" + cp -a elf/ld.so "${ED}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp" fi # We'll take care of the cache ourselves - rm -f "${D}"/etc/ld.so.cache + rm -f "${ED}"/etc/ld.so.cache # Everything past this point just needs to be done once ... is_final_abi || return 0 @@ -92,8 +92,8 @@ toolchain-glibc_src_install() { sparc32 /lib/ld-linux.so.2 sparc64 /lib64/ld-linux.so.2 ) - if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${D}/$(alt_prefix)/lib ]] ; then - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib + if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${D}$(alt_eprefix)/$(alt_prefix)/lib ]] ; then + dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_arch_prefix)/lib fi for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do ldso_abi=${ldso_abi_list[i]} @@ -122,12 +122,12 @@ toolchain-glibc_src_install() { # gcc likes to use relative paths to get to its multilibs like # /usr/lib/../lib64/. So while we don't install any files into # /usr/lib/, we do need it to exist. - cd "${D}"$(alt_libdir)/.. + cd "${ED}"$(alt_libdir)/.. [[ -e lib ]] || mkdir lib - cd "${D}"$(alt_usrlibdir)/.. + cd "${ED}"$(alt_usrlibdir)/.. [[ -e lib ]] || mkdir lib - dosym usr/include $(alt_prefix)/sys-include + dosym usr/include $(alt_arch_prefix)/sys-include return 0 fi @@ -137,7 +137,7 @@ toolchain-glibc_src_install() { -e "/^#/d" \ -e "/SUPPORTED-LOCALES=/d" \ -e "s: \\\\::g" -e "s:/: :g" \ - "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \ + "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \ || die "generating /usr/share/i18n/SUPPORTED failed" cd "${WORKDIR}"/extra/locale dosbin locale-gen || die @@ -150,7 +150,7 @@ toolchain-glibc_src_install() { local a keepdir /usr/$(get_libdir)/locale for a in $(get_install_abis) ; do - if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then + if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale fi done @@ -166,13 +166,13 @@ toolchain-glibc_src_install() { doinitd "${WORKDIR}"/extra/etc/nscd || die local nscd_args=( - -e "s:@PIDFILE@:$(strings "${D}"/usr/sbin/nscd | grep nscd.pid):" + -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):" ) version_is_at_least 2.16 || nscd_args+=( -e 's: --foreground : :' ) - sed -i "${nscd_args[@]}" "${D}"/etc/init.d/nscd + sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd else # Do this since extra/etc/*.conf above might have nscd.conf. - rm -f "${D}"/etc/nscd.conf + rm -f "${ED}"/etc/nscd.conf fi echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc @@ -184,7 +184,7 @@ toolchain-glibc_src_install() { # Prevent overwriting of the /etc/localtime symlink. We'll handle the # creation of the "factory" symlink in pkg_postinst(). - rm -f "${D}"/etc/localtime + rm -f "${ED}"/etc/localtime } toolchain-glibc_headers_install() { @@ -216,7 +216,7 @@ src_strip() { # if user has stripping enabled and does not have split debug turned on, # then leave the debugging sections in libpthread. if ! has nostrip ${FEATURES} && ! has splitdebug ${FEATURES} ; then - ${STRIP:-${CTARGET}-strip} --strip-debug "${D}"/*/libpthread-*.so + ${STRIP:-${CTARGET}-strip} --strip-debug "${ED}"/*/libpthread-*.so fi } Index: glibc/files/eblits/src_unpack.eblit =================================================================== --- glibc.orig/files/eblits/src_unpack.eblit +++ glibc/files/eblits/src_unpack.eblit @@ -17,7 +17,7 @@ eend_KV() { get_kheader_version() { printf '#include \nLINUX_VERSION_CODE\n' | \ - $(tc-getCPP ${CTARGET}) -I "$(alt_build_headers)" | \ + $(tc-getCPP ${CTARGET}) -I "${EPREFIX}/$(alt_build_headers)" | \ tail -n 1 } @@ -110,6 +110,9 @@ toolchain-glibc_src_unpack() { done fi + epatch "${FILESDIR}"/2.17/locale-gen_prefix.patch + eprefixify "${WORKDIR}"/extra/locale/locale-gen + # XXX: We should do the branchupdate, before extracting the manpages and # infopages else it does not help much (mtimes change if there is a change # to them with branchupdate) Index: glibc/glibc-2.17.ebuild =================================================================== --- glibc.orig/glibc-2.17.ebuild +++ glibc/glibc-2.17.ebuild @@ -1,14 +1,15 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.17.ebuild,v 1.13 2013/04/28 04:00:36 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.17.ebuild,v 1.9 2013/03/28 05:03:58 vapier Exp $ inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib unpacker multiprocessing +inherit prefix DESCRIPTION="GNU libc6 (also called glibc2) C library" HOMEPAGE="http://www.gnu.org/software/libc/libc.html" LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +KEYWORDS="~alpha ~amd64 ~arm -hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux" RESTRICT="strip" # strip ourself #46186 EMULTILIB_PKG="true"