Skip to content

Commit 3e9c4bb

Browse files
committed
scripts/bootstrap-prefix: unbreak bootstraps due to silly meson dep
gentoo-functions requires meson nowadays, which cannot be bootstrapped this early because it requires a Python that the python eclass finds so work around this by providing a dummy gentoo/functions.sh Signed-off-by: Fabian Groffen <[email protected]>
1 parent b736fab commit 3e9c4bb

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

scripts/bootstrap-prefix.sh

+32-4
Original file line numberDiff line numberDiff line change
@@ -1876,10 +1876,29 @@ bootstrap_stage2() {
18761876
# see profiles/features/prefix/standalone/profile.bashrc
18771877
export BOOTSTRAP_RAP_STAGE2=yes
18781878

1879+
# elt-patches needs gentoo-functions, but gentoo-functions these
1880+
# days needs meson to install, which requires a properly installed
1881+
# Python -- at this stage we don't have that
1882+
# so fake gentoo-functions with some dummies to make elt-patches
1883+
# and others install
1884+
if [[ ! -e "${ROOT}"/tmp/lib/gentoo/functions.sh ]] ; then
1885+
mkdir -p "${ROOT}"/tmp/lib/gentoo
1886+
cat > "${ROOT}"/tmp/lib/gentoo/functions.sh <<-EOF
1887+
#!${BASH}
1888+
1889+
ewarn() {
1890+
echo $*
1891+
}
1892+
1893+
eerror() {
1894+
echo "!!! $*"
1895+
}
1896+
EOF
1897+
fi
1898+
18791899
# Build a basic compiler and portage dependencies in $ROOT/tmp.
18801900
pkgs=(
18811901
sys-devel/gnuconfig
1882-
sys-apps/gentoo-functions
18831902
app-portage/elt-patches
18841903
sys-libs/ncurses
18851904
sys-libs/readline
@@ -2130,6 +2149,16 @@ bootstrap_stage3() {
21302149
read -r -a linker_pkgs <<< "${linker}"
21312150
read -r -a compiler_pkgs <<< "${compiler}"
21322151

2152+
# We need gentoo-functions but it meson is still a no-go, because we
2153+
# don't have a Python. Why would such simple package with a silly
2154+
# script file need meson is beyond me. So, we have no other way
2155+
# than to fake it here for the time being like in stage2.
2156+
if [[ ! -e "${ROOT}"/lib/gentoo/functions.sh ]] ; then
2157+
mkdir -p "${ROOT}"/lib/gentoo
2158+
cp "${ROOT}"/tmp/lib/gentoo/functions.sh \
2159+
"${ROOT}"/lib/gentoo/functions.sh
2160+
fi
2161+
21332162
if is-rap ; then
21342163
# We need ${ROOT}/usr/bin/perl to merge glibc.
21352164
if [[ ! -x "${ROOT}"/usr/bin/perl ]]; then
@@ -2166,7 +2195,6 @@ bootstrap_stage3() {
21662195
pkgs=(
21672196
sys-devel/gnuconfig
21682197
sys-apps/baselayout
2169-
sys-apps/gentoo-functions
21702198
app-portage/elt-patches
21712199
sys-kernel/linux-headers
21722200
sys-libs/glibc
@@ -2218,7 +2246,6 @@ bootstrap_stage3() {
22182246
else
22192247
pkgs=(
22202248
sys-devel/gnuconfig
2221-
sys-apps/gentoo-functions
22222249
app-portage/elt-patches
22232250
app-arch/xz-utils
22242251
sys-apps/sed
@@ -2283,7 +2310,7 @@ bootstrap_stage3() {
22832310
# now we have a shell right there
22842311
unset CONFIG_SHELL
22852312

2286-
# Build portage and dependencies.
2313+
# Build portage dependencies.
22872314
pkgs=(
22882315
sys-apps/coreutils
22892316
sys-apps/findutils
@@ -2306,6 +2333,7 @@ bootstrap_stage3() {
23062333
virtual/os-headers
23072334
sys-devel/gettext
23082335
sys-apps/portage
2336+
sys-apps/gentoo-functions
23092337
)
23102338

23112339
pre_emerge_pkgs "" "${pkgs[@]}" || return 1

0 commit comments

Comments
 (0)