diff options
Diffstat (limited to 'sys-libs/glibc/glibc-9999.ebuild')
-rw-r--r-- | sys-libs/glibc/glibc-9999.ebuild | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 0b6964c6a3b4..e1955052ee36 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -1,17 +1,16 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=7 PYTHON_COMPAT=( python3_{5,6,7} ) -inherit python-any-r1 prefix eutils eapi7-ver toolchain-funcs flag-o-matic gnuconfig usr-ldscript \ +inherit python-any-r1 prefix eutils toolchain-funcs flag-o-matic gnuconfig usr-ldscript \ multilib systemd multiprocessing DESCRIPTION="GNU libc C library" HOMEPAGE="https://www.gnu.org/software/libc/" LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE" -RESTRICT="strip" # Strip ourself #46186 SLOT="2.2" EMULTILIB_PKG="true" @@ -65,6 +64,16 @@ fi # We need a new-enough binutils/gcc to match upstream baseline. # Also we need to make sure our binutils/gcc supports TLS, # and that gcc already contains the hardened patches. +BDEPEND=" + ${PYTHON_DEPS} + >=app-misc/pax-utils-0.1.10 + sys-devel/bison + !<sys-apps/sandbox-1.6 + !<sys-apps/portage-2.1.2 + !<sys-devel/bison-2.7 + !<sys-devel/make-4 + doc? ( sys-apps/texinfo ) +" COMMON_DEPEND=" nscd? ( selinux? ( audit? ( sys-process/audit ) @@ -75,14 +84,6 @@ COMMON_DEPEND=" systemtap? ( dev-util/systemtap ) " DEPEND="${COMMON_DEPEND} - ${PYTHON_DEPS} - >=app-misc/pax-utils-0.1.10 - sys-devel/bison - !<sys-apps/sandbox-1.6 - !<sys-apps/portage-2.1.2 - !<sys-devel/bison-2.7 - !<sys-devel/make-4 - doc? ( sys-apps/texinfo ) test? ( >=net-dns/libidn2-2.0.5 ) " RDEPEND="${COMMON_DEPEND} @@ -92,17 +93,17 @@ RDEPEND="${COMMON_DEPEND} " if [[ ${CATEGORY} == cross-* ]] ; then - DEPEND+=" !headers-only? ( + BDEPEND+=" !headers-only? ( >=${CATEGORY}/binutils-2.24 >=${CATEGORY}/gcc-6 )" [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers" else - DEPEND+=" + BDEPEND+=" >=sys-devel/binutils-2.24 >=sys-devel/gcc-6 - virtual/os-headers " + DEPEND+=" virtual/os-headers " RDEPEND+=" >=net-dns/libidn2-2.0.5 vanilla? ( !sys-libs/timezone-data ) @@ -522,7 +523,7 @@ check_devpts() { [[ ${MERGE_TYPE} == "buildonly" ]] && return # Only sanity check when installing the native glibc. - [[ ${ROOT} != "/" ]] && return + [[ -n ${ROOT} ]] && return # If they're opting in to the old suid code, then no need to check. use suid && return @@ -610,7 +611,7 @@ sanity_prechecks() { # Prevent native builds from downgrading if [[ ${MERGE_TYPE} != "buildonly" ]] && \ - [[ ${ROOT} == "/" ]] && \ + [[ -z ${ROOT} ]] && \ [[ ${CBUILD} == ${CHOST} ]] && \ [[ ${CHOST} == ${CTARGET} ]] ; then @@ -1102,7 +1103,7 @@ src_configure() { } do_src_compile() { - emake -C "$(builddir nptl)" || die "make nptl for ${ABI} failed" + emake -C "$(builddir nptl)" } src_compile() { @@ -1141,21 +1142,33 @@ src_test() { run_locale_gen() { # if the host locales.gen contains no entries, we'll install everything local root="$1" + local inplace="" + + if [[ "${root}" == "--inplace-glibc" ]] ; then + inplace="--inplace-glibc" + root="$2" + fi + local locale_list="${root}/etc/locale.gen" + + pushd "${ED}"/$(get_libdir) >/dev/null + if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then - ewarn "Generating all locales; edit /etc/locale.gen to save time/space" + [[ -z ${inplace} ]] && ewarn "Generating all locales; edit /etc/locale.gen to save time/space" locale_list="${root}/usr/share/i18n/SUPPORTED" fi - locale-gen --jobs $(makeopts_jobs) --config "${locale_list}" \ + locale-gen ${inplace} --jobs $(makeopts_jobs) --config "${locale_list}" \ --destdir "${root}" + + popd >/dev/null } glibc_do_src_install() { local builddir=$(builddir nptl) cd "${builddir}" - emake install_root="${D}$(build_eprefix)$(alt_prefix)" install || die + emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support # which come without headers etc. Only needed for binary packages since the @@ -1168,13 +1181,18 @@ glibc_do_src_install() { # '#define VERSION "2.26.90"' -> '2.26.90' local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h) - if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then + # gdb is lame and requires some debugging information to remain in + # libpthread. libthread_db makes no sense stripped as it is only used when debugging. + dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so + dostrip -x $(alt_libdir)/libthread_db-1.0.so + + if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then # Move versioned .a file out of libdir to evade portage QA checks # instead of using gen_usr_ldscript(). We fix ldscript as: # "GROUP ( /usr/lib64/libm-<pv>.a ..." -> "GROUP ( /usr/lib64/glibc-<pv>/libm-<pv>.a ..." - sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"$(alt_usrlibdir)/libm.a || die + sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"/$(alt_usrlibdir)/libm.a || die dodir $(alt_usrlibdir)/${P} - mv "${ED}"$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die + mv "${ED}"/$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"/$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die fi # We'll take care of the cache ourselves @@ -1332,14 +1350,15 @@ glibc_do_src_install() { # Generate all locales if this is a native build as locale generation if use compile-locales && ! is_crosscompile ; then - run_locale_gen "${ED}" + run_locale_gen --inplace-glibc "${ED}/" + sed -e 's:COMPILED_LOCALES="":COMPILED_LOCALES="1":' -i "${ED}"/usr/sbin/locale-gen || die fi } glibc_headers_install() { local builddir=$(builddir "headers") cd "${builddir}" - emake install_root="${D}$(build_eprefix)$(alt_prefix)" install-headers + emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install-headers insinto $(alt_headers)/gnu doins "${S}"/include/gnu/stubs.h @@ -1350,23 +1369,6 @@ glibc_headers_install() { dosym usr/include $(alt_prefix)/sys-include } -src_strip() { - # gdb is lame and requires some debugging information to remain in - # libpthread, so we need to strip it by hand. libthread_db makes no - # sense stripped as it is only used when debugging. - local pthread=$(has splitdebug ${FEATURES} && echo "libthread_db" || echo "lib{pthread,thread_db}") - env \ - -uRESTRICT \ - CHOST=${CTARGET} \ - STRIP_MASK="/*/{,tls/}${pthread}*" \ - prepallstrip - # 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 "${ED}"$(alt_prefix)/*/libpthread-*.so - fi -} - src_install() { if just_headers ; then export ABI=default @@ -1380,8 +1382,6 @@ src_install() { elog "Not installing static glibc libraries" find "${ED}" -name "*.a" -and -not -name "*_nonshared.a" -delete fi - - src_strip } # Simple test to make sure our new glibc isn't completely broken. @@ -1434,7 +1434,7 @@ pkg_preinst() { einfo "Defaulting /etc/host.conf:multi to on" fi - [[ ${ROOT} != "/" ]] && return 0 + [[ -n ${ROOT} ]] && return 0 [[ -d ${ED}/$(get_libdir) ]] || return 0 [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check } @@ -1445,15 +1445,15 @@ pkg_postinst() { if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then # Generate fastloading iconv module configuration file. - "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}" + "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}/" fi - if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then + if ! is_crosscompile && [[ -z ${ROOT} ]] ; then # Reload init ... if in a chroot or a diff init package, ignore # errors from this step #253697 /sbin/telinit U 2>/dev/null - use compile-locales || run_locale_gen "${EROOT}" + use compile-locales || run_locale_gen "${EROOT}/" fi # Check for sanity of /etc/nsswitch.conf, take 2 |