Commit 74355b39 authored by Timo Teräs's avatar Timo Teräs

abuild: fix dependency tracing for cross builds

parent 05e2a037
......@@ -1026,7 +1026,14 @@ subpkg_provides_pc() {
trace_apk_deps() {
local name="$1"
local dir="$2"
local parch="$3"
local i= found= autodeps= deppkgs= missing=
local apkroot=
case "$parch" in
$CBUILD_ARCH) ;;
$CARCH | $CTARGET_ARCH) apkroot="--root $CBUILDROOT" ;;
esac
msg "Tracing dependencies..."
# add pkgconfig if usr/lib/pkgconfig is found
......@@ -1049,8 +1056,8 @@ trace_apk_deps() {
if subpkg_provides_prefixed_so "$i"; then
autodeps="$autodeps so:$sonameprefix$i"
elif subpkg_provides_so "$i" || cross_compiling \
|| $APK info --quiet --installed "so:$i"; then
elif subpkg_provides_so "$i" \
|| $APK $apkroot info --quiet --installed "so:$i"; then
autodeps="$autodeps so:$i"
else
missing="$missing $i"
......@@ -1061,7 +1068,7 @@ trace_apk_deps() {
if [ -f "$dir"/.rpaths ]; then
local so_files=$(find_so_files "$dir"/.rpaths $missing) \
|| return 1
deppkgs=$($APK info --quiet --who-owns $so_files) || return 1
deppkgs=$($APK $apkroot info --quiet --who-owns $so_files) || return 1
fi
for found in $deppkgs; do
......@@ -1079,9 +1086,9 @@ trace_apk_deps() {
# pkg-config depends
for i in $(sort -u "$dir"/.needs-pc 2>/dev/null); do
if subpkg_provides_pc "$i" || cross_compiling \
|| $APK info --quiet --installed "pc:$i"; then
local provider=$(apk search --quiet "pc:$i")
if subpkg_provides_pc "$i" \
|| $APK $apkroot info --quiet --installed "pc:$i"; then
local provider=$(apk $apkroot search --quiet "pc:$i")
if list_has "$provider" $depends_dev; then
warning "$provider should be removed from depends_dev"
fi
......@@ -1090,7 +1097,7 @@ trace_apk_deps() {
warning "Could not find any provider for pc:$i"
local pcfile=/usr/lib/pkgconfig/"${i%%[<>=]*}".pc
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"
fi
fi
......@@ -1310,7 +1317,7 @@ create_apks() {
local subpkgname=$name
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 "Compressing data..."
(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment