Commit baa55447 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

abuild: install dependencies from other repos

parent 9a398eac
......@@ -36,6 +36,10 @@ export SOURCE_DATE_EPOCH
umask 022
shell_escape() {
echo \'${1/\'/\'\\\'\'}\'
}
# run optional log command for remote logging
logcmd() {
${ABUILD_LOG_CMD:-true} "$@"
......@@ -2003,6 +2007,19 @@ get_missing_deps() {
done
}
apk_add_makedeps() {
local prefix=$1
shift
local repo_args="--repository $(shell_escape "$REPODEST/$repo")"
[ -s "$repo_template" ] && repo_args=$(while read r; do
echo --repository "$(shell_escape "$REPODEST/${r##*/}")"
done) < "$repo_template"
eval $SUDO_APK add $apk_opt_wait $repo_args \
--virtual .${prefix}depends-$pkgname "\$@" || return
}
# build and install dependencies
builddeps() {
local pkg= i= BUILD_BASE=
......@@ -2103,7 +2120,6 @@ rootbld() {
mkusers
BUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX)
local aportsgit=${APORTSDIR:-${startdir}}
mkdir -p "$BUILD_ROOT/proc" "$BUILD_ROOT/etc/apk/keys" \
"$BUILD_ROOT/$HOME/.abuild" "$BUILD_ROOT/$aportsgit" \
......@@ -2125,7 +2141,6 @@ rootbld() {
buildhost=${gitref/./-}
fi
local repo_template=$aportsgit/$repo/.rootbld-repositories
[ -s "$repo_template" ] || die "rootbld: $repo_template does not exist"
(
for key in $(git config --list --name-only); do
......@@ -2283,14 +2298,12 @@ deps() {
local _quiet="$1"
[ -z "$_quiet" ] && msg "Installing for build:$builddeps"
$SUDO_APK add $_quiet $apk_opt_wait --repository "$REPODEST/$repo" \
--virtual .makedepends-$pkgname \
$builddeps \
|| return 1
apk_add_makedeps make $_quiet $builddeps || return 1
if [ -n "$CBUILDROOT" ]; then
[ -z "$_quiet" ] && msg "Installing for host:$hostdeps"
$SUDO_APK add $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --repository "$REPODEST/$repo" $apk_opt_wait \
--no-scripts --virtual .hostdepends-$pkgname $hostdeps || return 1
apk_add_makedeps host $_quiet --no-scripts \
--root "$CBUILDROOT" --arch "$CTARGET_ARCH" $hostdeps \
|| return 1
fi
}
......@@ -2477,6 +2490,9 @@ pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
repo=${startdir%/*}
repo=${repo##*/}
aportsgit=${APORTSDIR:-${startdir}}
repo_template=$aportsgit/$repo/.rootbld-repositories
SRCDEST=${SRCDEST:-$startdir}
BUILD_ROOT=
......
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