mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 21:16:57 +02:00
SDK prefix: implement suggestions from code review
- remove explicit "-multilib" from prefix keywordsas it is set in profile - split heredoc for generating emerge wrapper so we don't need to escape - add sys-apps/bubblewrap and virtual/tmpfiles to package update automation list - use prefix build fix for libgpg-error from upstream Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This commit is contained in:
parent
ba4342d2b7
commit
17512925e7
@ -378,6 +378,7 @@ sec-policy/selinux-unconfined
|
|||||||
|
|
||||||
sys-apps/acl
|
sys-apps/acl
|
||||||
sys-apps/attr
|
sys-apps/attr
|
||||||
|
sys-apps/bubblewrap
|
||||||
sys-apps/checkpolicy
|
sys-apps/checkpolicy
|
||||||
sys-apps/config-site
|
sys-apps/config-site
|
||||||
sys-apps/coreutils
|
sys-apps/coreutils
|
||||||
@ -508,6 +509,7 @@ virtual/perl-IO
|
|||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
virtual/service-manager
|
virtual/service-manager
|
||||||
virtual/ssh
|
virtual/ssh
|
||||||
|
virtual/tmpfiles
|
||||||
|
|
||||||
x11-base/xorg-proto
|
x11-base/xorg-proto
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ function set_prefix_vars() {
|
|||||||
;;
|
;;
|
||||||
arm64-usr)
|
arm64-usr)
|
||||||
PREFIX_CHOST="aarch64-cros-linux-gnu"
|
PREFIX_CHOST="aarch64-cros-linux-gnu"
|
||||||
PREFIX_KEYWORDS="arm64 -~arm64 -multilib"
|
PREFIX_KEYWORDS="arm64 -~arm64"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -168,47 +168,50 @@ STAGINGROOT=${STAGINGROOT@Q}
|
|||||||
FINALROOT=${FINALROOT@Q}
|
FINALROOT=${FINALROOT@Q}
|
||||||
CB_ROOT=${CB_ROOT@Q}
|
CB_ROOT=${CB_ROOT@Q}
|
||||||
|
|
||||||
if [ "\${1}" = "--help" ] ; then
|
EOF
|
||||||
echo "\$0 : emerge prefix wrapper for prefix '\${PREFIXNAME}'"
|
|
||||||
|
sudo_append "${filename}" <<'EOF'
|
||||||
|
if [ "${1}" = "--help" ] ; then
|
||||||
|
echo "$0 : emerge prefix wrapper for prefix '${PREFIXNAME}'"
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " \$0 [--install|--stage] <emerge-opts>"
|
echo " $0 [--install|--stage] <emerge-opts>"
|
||||||
echo " Builds packages in prefix' staging and installs w/ runtime dependencies"
|
echo " Builds packages in prefix' staging and installs w/ runtime dependencies"
|
||||||
echo " to prefix' final root."
|
echo " to prefix' final root."
|
||||||
echo " --stage Build binpkg in staging but don't install."
|
echo " --stage Build binpkg in staging but don't install."
|
||||||
echo " --install Skip build, just install. Binpkg must exist in staging."
|
echo " --install Skip build, just install. Binpkg must exist in staging."
|
||||||
echo
|
echo
|
||||||
echo " Prefix configuration:"
|
echo " Prefix configuration:"
|
||||||
echo " PREFIXNAME=\${PREFIXNAME@Q}"
|
echo " PREFIXNAME=${PREFIXNAME@Q}"
|
||||||
echo " EPREFIX=\${EPREFIX@Q}"
|
echo " EPREFIX=${EPREFIX@Q}"
|
||||||
echo " STAGINGROOT=\${STAGINGROOT@Q}"
|
echo " STAGINGROOT=${STAGINGROOT@Q}"
|
||||||
echo " FINALROOT=\${FINALROOT@Q}"
|
echo " FINALROOT=${FINALROOT@Q}"
|
||||||
echo " CB_ROOT=\${CB_ROOT@Q}"
|
echo " CB_ROOT=${CB_ROOT@Q}"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
skip_build="false"
|
skip_build="false"
|
||||||
skip_install="false"
|
skip_install="false"
|
||||||
|
|
||||||
case "\${1}" in
|
case "${1}" in
|
||||||
--install) skip_build="true"; shift;;
|
--install) skip_build="true"; shift;;
|
||||||
--stage) skip_install="true"; shift;;
|
--stage) skip_install="true"; shift;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "\${skip_build}" = "true" ] ; then
|
if [ "${skip_build}" = "true" ] ; then
|
||||||
echo "Skipping build into staging as requested."
|
echo "Skipping build into staging as requested."
|
||||||
echo "NOTE that install into final will fail if binpkgs are missing."
|
echo "NOTE that install into final will fail if binpkgs are missing."
|
||||||
else
|
else
|
||||||
echo "Building in staging..."
|
echo "Building in staging..."
|
||||||
sudo -E EPREFIX="\${EPREFIX}" "\${CB_ROOT}/bin/cb-emerge" "\${STAGINGROOT}" "\$@"
|
sudo -E EPREFIX="${EPREFIX}" "${CB_ROOT}/bin/cb-emerge" "${STAGINGROOT}" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "\${skip_install}" = "true" ] ; then
|
if [ "${skip_install}" = "true" ] ; then
|
||||||
echo "Skipping install into final as requested."
|
echo "Skipping install into final as requested."
|
||||||
else
|
else
|
||||||
echo "Installing..."
|
echo "Installing..."
|
||||||
sudo -E EPREFIX="\${EPREFIX}" \\
|
sudo -E EPREFIX="${EPREFIX}" \
|
||||||
ROOT="\${FINALROOT}" \\
|
ROOT="${FINALROOT}" \
|
||||||
PORTAGE_CONFIGROOT="\${FINALROOT}\${EPREFIX}" emerge "\$@"
|
PORTAGE_CONFIGROOT="${FINALROOT}${EPREFIX}" emerge "$@"
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -55,16 +55,9 @@ src_prepare() {
|
|||||||
# only necessary for as long as we run eautoreconf, configure.ac
|
# only necessary for as long as we run eautoreconf, configure.ac
|
||||||
# uses ./autogen.sh to generate PACKAGE_VERSION, but autogen.sh is
|
# uses ./autogen.sh to generate PACKAGE_VERSION, but autogen.sh is
|
||||||
# not a pure /bin/sh script, so it fails on some hosts
|
# not a pure /bin/sh script, so it fails on some hosts
|
||||||
# Flatcar / t-lo 2023-09-19: Use build root for hprefixify to
|
# Flatcar / t-lo 2023-09-27: pull in upstream fix https://github.com/gentoo/gentoo/pull/33010
|
||||||
# prevent issues with prefix and cross-compiling, which causes
|
# for prefix builds.
|
||||||
# VERSION to be emptied when eautoreconf runs. This, in turn, will break
|
sed -i -e "1s:.*:#\!${BASH}:" autogen.sh || die
|
||||||
# compilation with:
|
|
||||||
# usage: mkhe:ader host_triplet template.h config.h version version_number
|
|
||||||
if tc-is-cross-compiler ; then
|
|
||||||
hprefixify -e "s#${EPREFIX}#${BROOT}#" -w 1 autogen.sh
|
|
||||||
else
|
|
||||||
hprefixify -w 1 autogen.sh
|
|
||||||
fi
|
|
||||||
eautoreconf
|
eautoreconf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user