Commit 72fefe0f authored by Natanael Copa's avatar Natanael Copa

abuild: add support for sonameprefix

This is a feature to prefix all so:* provides with a tag. This was done
so that the openjdk8 so depends would only be satisfied by openjdk8
provides and not openjdk7, which might provide same so:lib*.so file.

To use it do: sonameprefix="openjdk8:"
parent a2c4d5b0
......@@ -1023,6 +1023,11 @@ find_so_files() {
return 0
}
subpkg_provides_prefixed_so() {
[ -n "$sonameprefix" ] && grep -q -w "^$sonameprefix$1" \
"$pkgbasedir"/.control.*/.provides-so 2>/dev/null
}
subpkg_provides_so() {
grep -q -w "^$1" "$pkgbasedir"/.control.*/.provides-so 2>/dev/null
}
......@@ -1053,9 +1058,11 @@ trace_apk_deps() {
[ -f "$dir"/.needs-so ] && for i in $(cat "$dir"/.needs-so); do
# first check if its provided by same apkbuild
grep -q -w "^$i" "$dir"/.provides-so 2>/dev/null && continue
grep -q -w "^$sonameprefix$i" "$dir"/.provides-so 2>/dev/null && continue
if subpkg_provides_so "$i" || cross_compiling \
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
autodeps="$autodeps so:$i"
else
......@@ -1194,7 +1201,7 @@ scan_shared_objects() {
;;
esac
list_has "$soname" $somask && continue
echo "$soname $sover"
echo "$sonameprefix$soname $sover"
# use awk to filter out dupes that has sover = 0
done | awk '{ if (so[$1] == 0) so[$1] = $2; }
END { for (i in so) print(i " " so[i]); }' \
......@@ -1212,7 +1219,7 @@ scan_shared_objects() {
| sed 's:,:\n:g' | sort -u \
| while read soname; do
# only add files that are not self provided
grep -q -w "^$soname" "$controldir"/.provides-so \
grep -q -w "^$sonameprefix$soname" "$controldir"/.provides-so \
|| list_has "$soname" $somask \
|| echo $soname
done > "$controldir"/.needs-so
......
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