abuild: fix dependency tracing for cross builds

This commit is contained in:
Timo Teräs 2016-07-27 10:54:24 +00:00
parent 495dac7fa9
commit 4134332906
1 changed files with 15 additions and 8 deletions

View File

@ -1026,7 +1026,14 @@ subpkg_provides_pc() {
trace_apk_deps() { trace_apk_deps() {
local name="$1" local name="$1"
local dir="$2" local dir="$2"
local parch="$3"
local i= found= autodeps= deppkgs= missing= local i= found= autodeps= deppkgs= missing=
local apkroot=
case "$parch" in
$CBUILD_ARCH) ;;
$CARCH | $CTARGET_ARCH) apkroot="--root $CBUILDROOT" ;;
esac
msg "Tracing dependencies..." msg "Tracing dependencies..."
# add pkgconfig if usr/lib/pkgconfig is found # add pkgconfig if usr/lib/pkgconfig is found
@ -1049,8 +1056,8 @@ trace_apk_deps() {
if subpkg_provides_prefixed_so "$i"; then if subpkg_provides_prefixed_so "$i"; then
autodeps="$autodeps so:$sonameprefix$i" autodeps="$autodeps so:$sonameprefix$i"
elif subpkg_provides_so "$i" || cross_compiling \ elif subpkg_provides_so "$i" \
|| $APK info --quiet --installed "so:$i"; then || $APK $apkroot info --quiet --installed "so:$i"; then
autodeps="$autodeps so:$i" autodeps="$autodeps so:$i"
else else
missing="$missing $i" missing="$missing $i"
@ -1061,7 +1068,7 @@ trace_apk_deps() {
if [ -f "$dir"/.rpaths ]; then if [ -f "$dir"/.rpaths ]; then
local so_files=$(find_so_files "$dir"/.rpaths $missing) \ local so_files=$(find_so_files "$dir"/.rpaths $missing) \
|| return 1 || return 1
deppkgs=$($APK info --quiet --who-owns $so_files) || return 1 deppkgs=$($APK $apkroot info --quiet --who-owns $so_files) || return 1
fi fi
for found in $deppkgs; do for found in $deppkgs; do
@ -1079,9 +1086,9 @@ trace_apk_deps() {
# pkg-config depends # pkg-config depends
for i in $(sort -u "$dir"/.needs-pc 2>/dev/null); do for i in $(sort -u "$dir"/.needs-pc 2>/dev/null); do
if subpkg_provides_pc "$i" || cross_compiling \ if subpkg_provides_pc "$i" \
|| $APK info --quiet --installed "pc:$i"; then || $APK $apkroot info --quiet --installed "pc:$i"; then
local provider=$(apk search --quiet "pc:$i") local provider=$(apk $apkroot search --quiet "pc:$i")
if list_has "$provider" $depends_dev; then if list_has "$provider" $depends_dev; then
warning "$provider should be removed from depends_dev" warning "$provider should be removed from depends_dev"
fi fi
@ -1090,7 +1097,7 @@ trace_apk_deps() {
warning "Could not find any provider for pc:$i" warning "Could not find any provider for pc:$i"
local pcfile=/usr/lib/pkgconfig/"${i%%[<>=]*}".pc local pcfile=/usr/lib/pkgconfig/"${i%%[<>=]*}".pc
if [ -e "$pcfile" ]; then if [ -e "$pcfile" ]; then
local owner=$($APK info --quiet --who-owns $pcfile) local owner=$($APK $apkroot info --quiet --who-owns $pcfile)
warning "${owner:-package providing $pcfile} needs to be rebuilt" warning "${owner:-package providing $pcfile} needs to be rebuilt"
fi fi
fi fi
@ -1310,7 +1317,7 @@ create_apks() {
local subpkgname=$name local subpkgname=$name
local subpkgarch=$(pkginfo_val arch $file) local subpkgarch=$(pkginfo_val arch $file)
trace_apk_deps "$name" "$dir" || return 1 trace_apk_deps "$name" "$dir" "$subpkgarch" || return 1
msg "Package size: ${size}" msg "Package size: ${size}"
msg "Compressing data..." msg "Compressing data..."
( (