diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-07-27 10:54:24 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-08-01 14:28:44 +0300 |
commit | 4134332906eff7216b417342f648365e19ad384d (patch) | |
tree | 1df6bb2de43483d74c9c83418b412f8919d74072 | |
parent | 495dac7fa94328ad3a1a21ae7a1fcc2a61172828 (diff) | |
download | abuild-4134332906eff7216b417342f648365e19ad384d.tar.gz abuild-4134332906eff7216b417342f648365e19ad384d.tar.bz2 abuild-4134332906eff7216b417342f648365e19ad384d.tar.xz abuild-4134332906eff7216b417342f648365e19ad384d.zip |
abuild: fix dependency tracing for cross builds
-rw-r--r-- | abuild.in | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -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..." ( |