mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-15 08:56:58 +02:00
eclass/multilib-build: Sync with Gentoo
It's from Gentoo commit 1e44aed83bc6bd9f6452439f8ccefd7854a36545.
This commit is contained in:
parent
c3780924d0
commit
db7f0f5b52
@ -6,7 +6,7 @@
|
|||||||
# Michał Górny <mgorny@gentoo.org>
|
# Michał Górny <mgorny@gentoo.org>
|
||||||
# @AUTHOR:
|
# @AUTHOR:
|
||||||
# Author: Michał Górny <mgorny@gentoo.org>
|
# Author: Michał Górny <mgorny@gentoo.org>
|
||||||
# @SUPPORTED_EAPIS: 6 7 8
|
# @SUPPORTED_EAPIS: 7 8
|
||||||
# @BLURB: flags and utility functions for building multilib packages
|
# @BLURB: flags and utility functions for building multilib packages
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# The multilib-build.eclass exports USE flags and utility functions
|
# The multilib-build.eclass exports USE flags and utility functions
|
||||||
@ -21,10 +21,6 @@ if [[ -z ${_MULTILIB_BUILD_ECLASS} ]]; then
|
|||||||
_MULTILIB_BUILD_ECLASS=1
|
_MULTILIB_BUILD_ECLASS=1
|
||||||
|
|
||||||
case ${EAPI} in
|
case ${EAPI} in
|
||||||
6)
|
|
||||||
ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated EAPI ${EAPI}!"
|
|
||||||
ewarn "${CATEGORY}/${PF}: Support will be removed on 2024-10-08. Please port to newer EAPI."
|
|
||||||
;;
|
|
||||||
7|8) ;;
|
7|8) ;;
|
||||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||||
esac
|
esac
|
||||||
@ -257,8 +253,8 @@ multilib_check_headers() {
|
|||||||
_multilib_header_cksum() {
|
_multilib_header_cksum() {
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
if [[ -d ${ED%/}/usr/include ]]; then
|
if [[ -d ${ED}/usr/include ]]; then
|
||||||
find "${ED%/}"/usr/include -type f \
|
find "${ED}"/usr/include -type f \
|
||||||
-exec cksum {} + | sort -k2
|
-exec cksum {} + | sort -k2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -380,7 +376,7 @@ multilib_prepare_wrappers() {
|
|||||||
|
|
||||||
[[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
|
[[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
|
||||||
|
|
||||||
local root=${1:-${ED%/}}
|
local root=${1:-${ED}}
|
||||||
local f
|
local f
|
||||||
|
|
||||||
if [[ ${COMPLETE_MULTILIB} == yes ]]; then
|
if [[ ${COMPLETE_MULTILIB} == yes ]]; then
|
||||||
@ -448,9 +444,9 @@ multilib_prepare_wrappers() {
|
|||||||
|
|
||||||
# Some ABIs may have install less files than others.
|
# Some ABIs may have install less files than others.
|
||||||
if [[ -f ${root}/usr/include${f} ]]; then
|
if [[ -f ${root}/usr/include${f} ]]; then
|
||||||
local wrapper=${ED%/}/tmp/multilib-include${f}
|
local wrapper=${ED}/tmp/multilib-include${f}
|
||||||
|
|
||||||
if [[ ! -f ${ED%/}/tmp/multilib-include${f} ]]; then
|
if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then
|
||||||
dodir "/tmp/multilib-include${dir}"
|
dodir "/tmp/multilib-include${dir}"
|
||||||
# a generic template
|
# a generic template
|
||||||
cat > "${wrapper}" <<_EOF_ || die
|
cat > "${wrapper}" <<_EOF_ || die
|
||||||
@ -508,7 +504,7 @@ _EOF_
|
|||||||
|
|
||||||
# $CHOST shall be set by multilib_toolchain_setup
|
# $CHOST shall be set by multilib_toolchain_setup
|
||||||
dodir "/tmp/multilib-include/${CHOST}${dir}"
|
dodir "/tmp/multilib-include/${CHOST}${dir}"
|
||||||
mv "${root}/usr/include${f}" "${ED%/}/tmp/multilib-include/${CHOST}${dir}/" || die
|
mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
|
||||||
|
|
||||||
# Note: match a space afterwards to avoid collision potential.
|
# Note: match a space afterwards to avoid collision potential.
|
||||||
sed -e "/${MULTILIB_ABI_FLAG} /s&error.*&include <${CHOST}${f}>&" \
|
sed -e "/${MULTILIB_ABI_FLAG} /s&error.*&include <${CHOST}${f}>&" \
|
||||||
@ -548,11 +544,11 @@ multilib_install_wrappers() {
|
|||||||
|
|
||||||
local root=${1:-${ED}}
|
local root=${1:-${ED}}
|
||||||
|
|
||||||
if [[ -d ${ED%/}/tmp/multilib-include ]]; then
|
if [[ -d ${ED}/tmp/multilib-include ]]; then
|
||||||
multibuild_merge_root \
|
multibuild_merge_root \
|
||||||
"${ED%/}"/tmp/multilib-include "${root}"/usr/include
|
"${ED}"/tmp/multilib-include "${root}"/usr/include
|
||||||
# it can fail if something else uses /tmp
|
# it can fail if something else uses /tmp
|
||||||
rmdir "${ED%/}"/tmp &>/dev/null
|
rmdir "${ED}"/tmp &>/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user