sys-apps/glibc-(2.32|2.33): add Flatcar changes

2.33
- unmask amd64 and arm64
- remove tmpfiles from ebuild inherit so we don't run into a circular
  dep with systemd
- take care of nscd.conf via tmpfiles, add files/nscd-conf.tmpfiles.
- Don't run sanity checks in pkg_pretend to prevent gcc checks when
  only the binary package is installed.
- comment out 'dostrip -x' to force the OS image binaries to be stripped
- remove everything glibc wants to put under /etc since we use
  baselayout to provide that

2.32
sys-libs/glibc-2.32,targets/sdk: backport to EAPI6, add Flatcar changes

Backport the glibc recipe to EAPI6 to work around BDEPEND emerge
issue, add flatcar specific changes to the build recipe.
Move PYTHON_DEPS to DEPEND so things can build.

Don't run sanity checks in pkg_pretend
(similar change as in glibc-2.29) to prevent
gcc checks when only the binary package is installed.

Also, force the "crypt" use flag for all builds so libcrypt is built.
(Upstream gentoo does the same)

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
This commit is contained in:
Thilo Fromm 2021-06-28 15:55:05 +02:00
parent 3baf9c2c44
commit 33e49eaeec
3 changed files with 60 additions and 20 deletions

View File

@ -0,0 +1,2 @@
L /etc/nscd.conf - - - - ../usr/share/baselayout/nscd.conf
d /var/db/nscd - - - - -

View File

@ -1,11 +1,11 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=6
PYTHON_COMPAT=( python3_{6,7,8,9} )
PYTHON_COMPAT=( python3_{6,7} )
inherit python-any-r1 prefix eutils toolchain-funcs flag-o-matic gnuconfig \
inherit python-any-r1 prefix eutils eapi7-ver toolchain-funcs flag-o-matic gnuconfig \
multilib systemd multiprocessing
DESCRIPTION="GNU libc C library"
@ -22,7 +22,7 @@ PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
inherit git-r3
else
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 ~sparc x86"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86"
SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
SRC_URI+=" riscv? ( https://dev.gentoo.org/~dilfridge/distfiles/backport-rv32.txz )"
@ -93,7 +93,6 @@ fi
# gzip, grep, awk are needed by locale-gen, bug 740750
BDEPEND="
${PYTHON_DEPS}
>=app-misc/pax-utils-0.1.10
sys-devel/bison
doc? ( sys-apps/texinfo )
@ -115,6 +114,7 @@ COMMON_DEPEND="
!<net-misc/openssh-8.1_p1-r2
"
DEPEND="${COMMON_DEPEND}
${PYTHON_DEPS}
compile-locales? (
app-arch/gzip
sys-apps/grep
@ -724,12 +724,12 @@ sanity_prechecks() {
# the phases
#
# pkg_pretend
# Flatcar: Skip sanity checks at pretend time because we don't ship a compiler
# in the OS image. This test fails when installing the glibc binpkg and no
# compiler is present.
pkg_pretend() {
# All the checks...
einfo "Checking general environment sanity."
sanity_prechecks
einfo "Flatcar: Skipping sanity_prechecks for binpkg installation. src_unpack will take care of compile-time prechecks."
# sanity_prechecks
}
pkg_setup() {
@ -1228,12 +1228,13 @@ 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)
# Flatcar: dostrip not available in EAPI6
# Avoid stripping binaries not targeted by ${CHOST}. Or else
# ${CHOST}-strip would break binaries build for ${CTARGET}.
is_crosscompile && dostrip -x /
# is_crosscompile && dostrip -x /
# gdb thread introspection relies on local libpthreas symbols. stripping breaks it
# See Note [Disable automatic stripping]
dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so
# dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so
if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
# Move versioned .a file out of libdir to evade portage QA checks
@ -1405,6 +1406,23 @@ glibc_do_src_install() {
run_locale_gen --inplace-glibc "${ED}/"
sed -e 's:COMPILED_LOCALES="":COMPILED_LOCALES="1":' -i "${ED}"/usr/sbin/locale-gen || die
fi
## Flatcar Container Linux: Add some local changes:
# - Config files are installed by baselayout, not glibc.
# - Install nscd/systemd stuff in /usr.
# Use tmpfiles to put nscd.conf in /etc and create directories.
insinto /usr/share/baselayout
if ! in_iuse nscd || use nscd ; then
doins "${S}"/nscd/nscd.conf || die
systemd_newtmpfilesd "${FILESDIR}"/nscd-conf.tmpfiles nscd-conf.conf || die
fi
# Clean out any default configs.
rm -rf "${ED}"/etc
# Restore this one for the SDK.
test ! -e "${T}"/00glibc || doenvd "${T}"/00glibc
}
glibc_headers_install() {

View File

@ -3,11 +3,11 @@
EAPI=7
PYTHON_COMPAT=( python3_{7,8,9,10} )
PYTHON_COMPAT=( python3_{6,7} )
TMPFILES_OPTIONAL=1
inherit python-any-r1 prefix toolchain-funcs flag-o-matic gnuconfig \
multilib systemd multiprocessing tmpfiles
multilib systemd multiprocessing
DESCRIPTION="GNU libc C library"
HOMEPAGE="https://www.gnu.org/software/libc/"
@ -23,7 +23,7 @@ PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
inherit git-r3
else
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
fi
@ -715,10 +715,12 @@ sanity_prechecks() {
# pkg_pretend
# Flatcar: Skip sanity checks at pretend time because we don't ship a compiler
# in the OS image. This test fails when installing the glibc binpkg and no
# compiler is present.
pkg_pretend() {
# All the checks...
einfo "Checking general environment sanity."
sanity_prechecks
einfo "Flatcar: Skipping sanity_prechecks for binpkg installation. src_unpack will take care of compile-time prechecks."
# sanity_prechecks
}
pkg_setup() {
@ -1216,12 +1218,13 @@ 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)
# Flatcar: override this and strip everything to keep image size at bay
# Avoid stripping binaries not targeted by ${CHOST}. Or else
# ${CHOST}-strip would break binaries build for ${CTARGET}.
is_crosscompile && dostrip -x /
# is_crosscompile && dostrip -x /
# gdb thread introspection relies on local libpthreas symbols. stripping breaks it
# See Note [Disable automatic stripping]
dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so
# dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so
if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
# Move versioned .a file out of libdir to evade portage QA checks
@ -1398,6 +1401,23 @@ glibc_do_src_install() {
run_locale_gen --inplace-glibc "${ED}/"
sed -e 's:COMPILED_LOCALES="":COMPILED_LOCALES="1":' -i "${ED}"/usr/sbin/locale-gen || die
fi
## Flatcar Container Linux: Add some local changes:
# - Config files are installed by baselayout, not glibc.
# - Install nscd/systemd stuff in /usr.
# Use tmpfiles to put nscd.conf in /etc and create directories.
insinto /usr/share/baselayout
if ! in_iuse nscd || use nscd ; then
doins "${S}"/nscd/nscd.conf || die
systemd_newtmpfilesd "${FILESDIR}"/nscd-conf.tmpfiles nscd-conf.conf || die
fi
# Clean out any default configs.
rm -rf "${ED}"/etc
# Restore this one for the SDK.
test ! -e "${T}"/00glibc || doenvd "${T}"/00glibc
}
glibc_headers_install() {