summaryrefslogtreecommitdiff
path: root/sys-libs/glibc/glibc-9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/glibc/glibc-9999.ebuild')
-rw-r--r--sys-libs/glibc/glibc-9999.ebuild136
1 files changed, 56 insertions, 80 deletions
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index 38cec1fa3414..2375fd18f6a9 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc
# Please read & adapt the page as necessary if obsolete.
@@ -23,6 +23,19 @@ EMULTILIB_PKG="true"
PATCH_VER=1
PATCH_DEV=dilfridge
+# gcc mulitilib bootstrap files version
+GCC_BOOTSTRAP_VER=20201208
+
+# systemd integration version
+GLIBC_SYSTEMD_VER=20210729
+
+# Minimum kernel version that glibc requires
+MIN_KERN_VER="3.2.0"
+
+# Minimum pax-utils version needed (which contains any new syscall changes for
+# its seccomp filter!). Please double check this!
+MIN_PAX_UTILS_VER="1.3.3"
+
if [[ ${PV} == 9999* ]]; then
inherit git-r3
else
@@ -31,26 +44,11 @@ else
SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
fi
-RELEASE_VER=${PV}
-
-GCC_BOOTSTRAP_VER=20201208
-
-LOCALE_GEN_VER=2.23
-
-GLIBC_SYSTEMD_VER=20210729
-
-SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${LOCALE_GEN_VER}.tar.gz"
SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )"
IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd perl profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla"
-# Minimum kernel version that glibc requires
-MIN_KERN_VER="3.2.0"
-# Minimum pax-utils version needed (which contains any new syscall changes for
-# its seccomp filter!). Please double check this!
-MIN_PAX_UTILS_VER="1.3.3"
-
# Here's how the cross-compile logic breaks down ...
# CTARGET - machine that will target the binaries
# CHOST - machine that will host the binaries
@@ -99,19 +97,25 @@ fi
# Lastly, let's avoid some openssh nastiness, bug 708224, as
# convenience to our users.
-# gzip, grep, awk are needed by locale-gen, bug 740750
+# gzip, grep, awk are needed by locale-gen, bug 740750; depending on the
+# compile-locales useflag either in src_install or in pkg_postinst.
+IDEPEND="
+ !compile-locales? ( sys-apps/locale-gen )
+"
BDEPEND="
${PYTHON_DEPS}
>=app-misc/pax-utils-${MIN_PAX_UTILS_VER}
sys-devel/bison
- doc? ( sys-apps/texinfo )
- !compile-locales? (
- app-arch/gzip
- sys-apps/grep
- app-alternatives/awk
+ compile-locales? ( sys-apps/locale-gen )
+ doc? (
+ dev-lang/perl
+ sys-apps/texinfo
+ )
+ test? (
+ dev-lang/perl
+ >=net-dns/libidn2-2.3.0
)
- test? ( dev-lang/perl )
"
COMMON_DEPEND="
gd? ( media-libs/gd:2= )
@@ -119,26 +123,16 @@ COMMON_DEPEND="
audit? ( sys-process/audit )
caps? ( sys-libs/libcap )
) )
- perl? ( dev-lang/perl )
- test? ( dev-lang/perl )
suid? ( caps? ( sys-libs/libcap ) )
selinux? ( sys-libs/libselinux )
systemtap? ( dev-util/systemtap )
"
DEPEND="${COMMON_DEPEND}
- compile-locales? (
- app-arch/gzip
- sys-apps/grep
- app-alternatives/awk
- )
- test? ( >=net-dns/libidn2-2.3.0 )
"
RDEPEND="${COMMON_DEPEND}
- app-arch/gzip
- sys-apps/grep
- app-alternatives/awk
- sys-apps/gentoo-functions
+ sys-apps/locale-gen
!<app-misc/pax-utils-${MIN_PAX_UTILS_VER}
+ perl? ( dev-lang/perl )
"
RESTRICT="!test? ( test )"
@@ -670,7 +664,7 @@ foreach_abi() {
glibc_banner() {
local b="Gentoo ${PVR}"
- [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" p${PATCH_VER}"
+ [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" (patchset ${PATCH_VER})"
echo "${b}"
}
@@ -766,13 +760,6 @@ sanity_prechecks() {
fi
fi
- # Users have had a chance to phase themselves, time to give em the boot
- if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
- eerror "You still haven't deleted ${EROOT}/etc/locales.build."
- eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
- die "Lazy upgrader detected"
- fi
-
if [[ ${CTARGET} == i386-* ]] ; then
eerror "i386 CHOSTs are no longer supported."
eerror "Chances are you don't actually want/need i386."
@@ -879,6 +866,8 @@ pkg_pretend() {
upgrade_warning
}
+# pkg_setup
+
pkg_setup() {
# see bug 682570
[[ -z ${BOOTSTRAP_RAP} ]] && python-any-r1_pkg_setup
@@ -907,23 +896,24 @@ src_unpack() {
unpack ${P}.tar.xz
cd "${WORKDIR}" || die
- unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz
+ unpack glibc-${PV}-patches-${PATCH_VER}.tar.xz
fi
cd "${WORKDIR}" || die
- unpack locale-gen-${LOCALE_GEN_VER}.tar.gz
use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz
}
+# src_prepare
+
src_prepare() {
local patchsetname
if ! use vanilla ; then
if [[ ${PV} == 9999* ]] ; then
patchsetname="from git master"
else
- patchsetname="${RELEASE_VER}-${PATCH_VER}"
+ patchsetname="${PV}-${PATCH_VER}"
fi
- einfo "Applying Gentoo Glibc Patchset ${patchsetname}"
+ einfo "Applying Gentoo Glibc patchset ${patchsetname}"
eapply "${WORKDIR}"/patches
einfo "Done."
fi
@@ -932,21 +922,17 @@ src_prepare() {
gnuconfig_update
- cd "${WORKDIR}"
+ cd "${WORKDIR}" || die
find . -name configure -exec touch {} +
- # move the external locale-gen to its old place
- mkdir extra || die
- mv locale-gen-${LOCALE_GEN_VER} extra/locale || die
-
- eprefixify extra/locale/locale-gen
-
# Fix permissions on some of the scripts.
chmod u+x "${S}"/scripts/*.sh
- cd "${S}"
+ cd "${S}" || die
}
+# src_configure
+
glibc_do_configure() {
dump_build_environment
@@ -962,7 +948,7 @@ glibc_do_configure() {
# https://sourceware.org/PR22634#c0
case $(tc-arch ${CTARGET}) in
# Keep whitelist of targets where autodetection mostly works.
- amd64|x86|sparc|ppc|ppc64|arm|arm64|s390) ;;
+ amd64|x86|sparc|ppc|ppc64|arm|arm64|s390|riscv|loong) ;;
# Blacklist everywhere else
*) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;;
esac
@@ -1031,7 +1017,7 @@ glibc_do_configure() {
# execute Perl during configure if we're cross-compiling a prefix, but
# it will just disable mtrace in that case.
# Note: mtrace is needed by the test suite.
- ac_cv_path_PERL="$(usex perl "${EPREFIX}"/usr/bin/perl $(usex test "${EPREFIX}"/usr/bin/perl no))"
+ ac_cv_path_PERL="$(usex perl "${EPREFIX}"/usr/bin/perl $(usex test "${EPREFIX}"/usr/bin/perl $(usex doc "${EPREFIX}"/usr/bin/perl no)))"
# locale data is arch-independent
# https://bugs.gentoo.org/753740
@@ -1040,6 +1026,7 @@ glibc_do_configure() {
# -march= option tricks build system to infer too
# high ISA level: https://sourceware.org/PR27318
libc_cv_include_x86_isa_level=no
+
# Explicit override of https://sourceware.org/PR27991
# exposes a bug in glibc's configure:
# https://sourceware.org/PR27991
@@ -1219,6 +1206,8 @@ src_configure() {
foreach_abi do_src_configure
}
+# src_compile
+
do_src_compile() {
emake -C "$(builddir nptl)"
}
@@ -1231,6 +1220,8 @@ src_compile() {
foreach_abi do_src_compile
}
+# src_test
+
glibc_src_test() {
cd "$(builddir nptl)"
@@ -1250,26 +1241,16 @@ glibc_src_test() {
SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=16 emake ${myxfailparams} check
}
-do_src_test() {
- local ret=0
-
- glibc_src_test
- : $(( ret |= $? ))
-
- return ${ret}
-}
-
src_test() {
if just_headers ; then
return
fi
- # Give tests more time to complete.
- export TIMEOUTFACTOR=5
-
- foreach_abi do_src_test || die "tests failed"
+ foreach_abi glibc_src_test || die "tests failed"
}
+# src_install
+
run_locale_gen() {
# if the host locales.gen contains no entries, we'll install everything
local root="$1"
@@ -1317,7 +1298,8 @@ glibc_do_src_install() {
# Avoid stripping binaries not targeted by ${CHOST}. Or else
# ${CHOST}-strip would break binaries build for ${CTARGET}.
is_crosscompile && dostrip -x /
- # gdb thread introspection relies on local libpthreas symbols. stripping breaks it
+
+ # gdb thread introspection relies on local libpthreads symbols. stripping breaks it
# See Note [Disable automatic stripping]
dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so
@@ -1435,6 +1417,8 @@ glibc_do_src_install() {
#################################################################
# EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
+ #################################################################
+
# Make sure we install some symlink hacks so that when we build
# a 2nd stage cross-compiler, gcc finds the target system
# headers correctly. See gcc/doc/gccinstall.info
@@ -1458,15 +1442,8 @@ glibc_do_src_install() {
-e "s: \\\\::g" -e "s:/: :g" \
"${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
|| die "generating /usr/share/i18n/SUPPORTED failed"
- cd "${WORKDIR}"/extra/locale
- dosbin locale-gen
- doman *.[0-8]
- insinto /etc
- doins locale.gen
-
- keepdir /usr/lib/locale
- cd "${S}"
+ cd "${S}" || die
# Install misc network config files
insinto /etc
@@ -1511,7 +1488,6 @@ 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 --inplace-glibc "${ED}/"
- sed -e 's:COMPILED_LOCALES="":COMPILED_LOCALES="1":' -i "${ED}"/usr/sbin/locale-gen || die
fi
}