2014-04-09 14:40:27 +00:00
|
|
|
# vim: set ts=4 sw=4 et:
|
2014-03-22 11:31:42 +00:00
|
|
|
#
|
2014-09-05 09:10:07 +00:00
|
|
|
setup_pkg_depends() {
|
2015-04-30 06:26:12 +00:00
|
|
|
local pkg="$1" j _pkgdepname _pkgdep _rpkgname _depname _depver _replacement
|
2014-09-05 09:10:07 +00:00
|
|
|
|
|
|
|
if [ -n "$pkg" ]; then
|
|
|
|
# subpkg
|
|
|
|
if declare -f ${pkg}_package >/dev/null; then
|
|
|
|
${pkg}_package
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
for j in ${depends}; do
|
|
|
|
_rpkgname="${j%\?*}"
|
|
|
|
_depname="${j#*\?}"
|
|
|
|
_pkgdepname="$($XBPS_UHELPER_CMD getpkgdepname ${_depname} 2>/dev/null)"
|
|
|
|
if [ -z "${_pkgdepname}" ]; then
|
|
|
|
_pkgdepname="$($XBPS_UHELPER_CMD getpkgname ${_depname} 2>/dev/null)"
|
|
|
|
fi
|
2014-09-06 10:37:09 +00:00
|
|
|
if [ -s ${XBPS_DISTDIR}/etc/virtual ]; then
|
|
|
|
_replacement=$(egrep "^${_pkgdepname:-${_depname}}[[:blank:]]" ${XBPS_DISTDIR}/etc/virtual|cut -d ' ' -f2)
|
|
|
|
if [ -n "${_replacement}" ]; then
|
|
|
|
_depname="${_depname/${_pkgdepname:-${_depname}}/${_replacement}}"
|
|
|
|
fi
|
|
|
|
elif [ -s ${XBPS_DISTDIR}/etc/defaults.virtual ]; then
|
|
|
|
_replacement=$(egrep "^${_pkgdepname:-${_depname}}[[:blank:]]" ${XBPS_DISTDIR}/etc/defaults.virtual|cut -d ' ' -f2)
|
|
|
|
if [ -n "${_replacement}" ]; then
|
|
|
|
_depname="${_depname/${_pkgdepname:-${_depname}}/${_replacement}}"
|
|
|
|
fi
|
|
|
|
fi
|
2014-09-05 09:10:07 +00:00
|
|
|
if [ -z "${_pkgdepname}" ]; then
|
|
|
|
_pkgdep="${_depname}>=0"
|
|
|
|
else
|
|
|
|
_pkgdep="${_depname}"
|
|
|
|
fi
|
2015-03-27 09:50:40 +00:00
|
|
|
|
2014-09-05 09:10:07 +00:00
|
|
|
if [ "${_rpkgname}" = "virtual" ]; then
|
|
|
|
run_depends+=" virtual?${_pkgdep}"
|
|
|
|
else
|
|
|
|
run_depends+=" ${_pkgdep}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
for j in ${hostmakedepends}; do
|
|
|
|
_depname="${j%\?*}"
|
2014-09-06 10:37:09 +00:00
|
|
|
if [ -s ${XBPS_DISTDIR}/etc/virtual ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
_replacement=$(egrep "^${_depname}[[:blank:]]" ${XBPS_DISTDIR}/etc/virtual|cut -d ' ' -f2)
|
2014-09-06 10:37:09 +00:00
|
|
|
if [ -n "${_replacement}" ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
_depname="${_depname/${_depname}/${_replacement}}"
|
2014-09-06 10:37:09 +00:00
|
|
|
fi
|
|
|
|
elif [ -s ${XBPS_DISTDIR}/etc/defaults.virtual ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
_replacement=$(egrep "^${_depname}[[:blank:]]" ${XBPS_DISTDIR}/etc/defaults.virtual|cut -d ' ' -f2)
|
2014-09-06 10:37:09 +00:00
|
|
|
if [ -n "${_replacement}" ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
_depname="${_depname/${_depname}/${_replacement}}"
|
2014-09-06 10:37:09 +00:00
|
|
|
fi
|
|
|
|
fi
|
2015-04-30 06:26:12 +00:00
|
|
|
_depver=$(srcpkg_get_version ${_depname}) || exit $?
|
|
|
|
host_build_depends+=" ${_depname}-${_depver}"
|
2014-09-05 09:10:07 +00:00
|
|
|
done
|
|
|
|
for j in ${makedepends}; do
|
|
|
|
_depname="${j%\?*}"
|
2014-09-06 10:37:09 +00:00
|
|
|
if [ -s ${XBPS_DISTDIR}/etc/virtual ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
_replacement=$(egrep "^${_depname}[[:blank:]]" ${XBPS_DISTDIR}/etc/virtual|cut -d ' ' -f2)
|
2014-09-06 10:37:09 +00:00
|
|
|
if [ -n "${_replacement}" ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
_depname="${_depname/${_depname}/${_replacement}}"
|
2014-09-06 10:37:09 +00:00
|
|
|
fi
|
|
|
|
elif [ -s ${XBPS_DISTDIR}/etc/defaults.virtual ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
_replacement=$(egrep "^${_depname}[[:blank:]]" ${XBPS_DISTDIR}/etc/defaults.virtual|cut -d ' ' -f2)
|
2014-09-06 10:37:09 +00:00
|
|
|
if [ -n "${_replacement}" ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
_depname="${_depname/${_depname}/${_replacement}}"
|
2014-09-06 10:37:09 +00:00
|
|
|
fi
|
|
|
|
fi
|
2015-04-30 06:26:12 +00:00
|
|
|
_depver=$(srcpkg_get_version ${_depname}) || exit $?
|
|
|
|
build_depends+=" ${_depname}-${_depver}"
|
2014-09-05 09:10:07 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-03-22 11:31:42 +00:00
|
|
|
# Install a required package dependency, like:
|
|
|
|
#
|
|
|
|
# xbps-install -Ay <pkgname>
|
|
|
|
#
|
|
|
|
# Returns 0 if package already installed or installed successfully.
|
|
|
|
# Any other error number otherwise.
|
|
|
|
#
|
|
|
|
install_pkg_from_repos() {
|
2014-04-09 14:40:27 +00:00
|
|
|
local pkg="$1" cross="$2" rval= tmplogf=
|
|
|
|
|
2015-03-28 03:49:18 +00:00
|
|
|
mkdir -p $XBPS_STATEDIR
|
2015-03-03 09:45:34 +00:00
|
|
|
tmplogf=${XBPS_STATEDIR}/xbps_${XBPS_TARGET_MACHINE}_bdep_${pkg}.log
|
|
|
|
|
2014-04-09 14:40:27 +00:00
|
|
|
if [ -n "$cross" ]; then
|
2015-06-07 15:02:20 +00:00
|
|
|
$XBPS_INSTALL_XCMD -Ayd "$pkg" >$tmplogf 2>&1
|
2014-04-09 14:40:27 +00:00
|
|
|
else
|
2015-06-07 15:02:20 +00:00
|
|
|
$XBPS_INSTALL_CMD -Ayd "$pkg" >$tmplogf 2>&1
|
2014-04-09 14:40:27 +00:00
|
|
|
fi
|
|
|
|
rval=$?
|
|
|
|
if [ $rval -ne 0 -a $rval -ne 17 ]; then
|
|
|
|
# xbps-install can return:
|
|
|
|
#
|
2014-07-02 09:09:41 +00:00
|
|
|
# SUCCESS (0): package installed successfully.
|
|
|
|
# ENOENT (2): package missing in repositories.
|
|
|
|
# ENXIO (6): package depends on invalid dependencies.
|
2015-10-29 07:48:38 +00:00
|
|
|
# EAGAIN (11): package conflicts.
|
2014-07-02 09:09:41 +00:00
|
|
|
# EEXIST (17): package already installed.
|
|
|
|
# ENODEV (19): package depends on missing dependencies.
|
|
|
|
# ENOTSUP (95): no repositories registered.
|
2014-04-09 14:40:27 +00:00
|
|
|
#
|
|
|
|
[ -z "$XBPS_KEEP_ALL" ] && remove_pkg_autodeps
|
|
|
|
msg_red "$pkgver: failed to install '$1' dependency! (error $rval)\n"
|
2015-03-03 09:45:34 +00:00
|
|
|
cat $tmplogf
|
2014-04-09 14:40:27 +00:00
|
|
|
msg_error "Please see above for the real error, exiting...\n"
|
|
|
|
fi
|
|
|
|
[ $rval -eq 17 ] && rval=0
|
|
|
|
return $rval
|
2014-03-22 11:31:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns 0 if pkgpattern in $1 is matched against current installed
|
|
|
|
# package, 1 if no match and 2 if not installed.
|
|
|
|
#
|
|
|
|
check_pkgdep_matched() {
|
2014-09-21 09:44:45 +00:00
|
|
|
local pkg="$1" checkver="$2" cross="$3" uhelper= pkgn= iver=
|
2014-04-09 14:40:27 +00:00
|
|
|
|
|
|
|
[ "$build_style" = "meta" ] && return 2
|
|
|
|
[ -z "$pkg" ] && return 255
|
|
|
|
|
2015-03-27 09:50:40 +00:00
|
|
|
pkgn="$($XBPS_UHELPER_CMD getpkgdepname ${pkg} 2>/dev/null)"
|
2014-04-09 14:40:27 +00:00
|
|
|
if [ -z "$pkgn" ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
pkgn="$($XBPS_UHELPER_CMD getpkgname ${pkg} 2>/dev/null)"
|
2014-04-09 14:40:27 +00:00
|
|
|
fi
|
|
|
|
[ -z "$pkgn" ] && return 255
|
|
|
|
|
|
|
|
if [ -n "$cross" ]; then
|
|
|
|
uhelper="$XBPS_UHELPER_XCMD"
|
|
|
|
else
|
|
|
|
uhelper="$XBPS_UHELPER_CMD"
|
|
|
|
fi
|
|
|
|
|
2014-09-21 09:44:45 +00:00
|
|
|
iver="$($uhelper $checkver $pkgn)"
|
2014-04-09 14:40:27 +00:00
|
|
|
if [ $? -eq 0 -a -n "$iver" ]; then
|
|
|
|
$XBPS_UHELPER_CMD pkgmatch "${pkgn}-${iver}" "${pkg}"
|
|
|
|
[ $? -eq 1 ] && return 0
|
|
|
|
else
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 1
|
2014-03-22 11:31:42 +00:00
|
|
|
}
|
|
|
|
|
2014-04-10 09:58:06 +00:00
|
|
|
#
|
|
|
|
# Returns 0 if pkgpattern in $1 is installed and greater than current
|
|
|
|
# installed package, otherwise 1.
|
|
|
|
#
|
|
|
|
check_installed_pkg() {
|
|
|
|
local pkg="$1" cross="$2" uhelper= pkgn= iver=
|
|
|
|
|
|
|
|
[ -z "$pkg" ] && return 2
|
|
|
|
|
|
|
|
pkgn="$($XBPS_UHELPER_CMD getpkgname ${pkg})"
|
|
|
|
[ -z "$pkgn" ] && return 2
|
|
|
|
|
|
|
|
if [ -n "$cross" ]; then
|
|
|
|
uhelper="$XBPS_UHELPER_XCMD"
|
|
|
|
else
|
|
|
|
uhelper="$XBPS_UHELPER_CMD"
|
|
|
|
fi
|
|
|
|
|
|
|
|
iver="$($uhelper version $pkgn)"
|
|
|
|
if [ $? -eq 0 -a -n "$iver" ]; then
|
|
|
|
$XBPS_CMPVER_CMD "${pkgn}-${iver}" "${pkg}"
|
|
|
|
[ $? -eq 0 -o $? -eq 1 ] && return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2015-03-27 09:50:40 +00:00
|
|
|
srcpkg_get_version() {
|
|
|
|
local pkg="$1"
|
|
|
|
# Run this in a sub-shell to avoid polluting our env.
|
|
|
|
(
|
|
|
|
unset XBPS_BINPKG_EXISTS
|
2015-04-30 06:26:12 +00:00
|
|
|
setup_pkg $pkg || exit $?
|
2015-03-27 09:50:40 +00:00
|
|
|
echo "${version}_${revision}"
|
2015-04-30 07:09:03 +00:00
|
|
|
) || msg_error "$pkgver: failed to transform dependency $pkg\n"
|
2015-03-27 09:50:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
srcpkg_get_pkgver() {
|
|
|
|
local pkg="$1"
|
|
|
|
# Run this in a sub-shell to avoid polluting our env.
|
|
|
|
(
|
|
|
|
unset XBPS_BINPKG_EXISTS
|
2015-04-30 06:26:12 +00:00
|
|
|
setup_pkg $pkg || exit $?
|
2015-03-27 09:50:40 +00:00
|
|
|
echo "${sourcepkg}-${version}_${revision}"
|
2015-04-30 07:09:03 +00:00
|
|
|
) || msg_error "$pkgver: failed to transform dependency $pkg\n"
|
2015-03-27 09:50:40 +00:00
|
|
|
}
|
|
|
|
|
2014-03-22 11:31:42 +00:00
|
|
|
#
|
|
|
|
# Installs all dependencies required by a package.
|
|
|
|
#
|
|
|
|
install_pkg_deps() {
|
2015-03-23 11:42:35 +00:00
|
|
|
local pkg="$1" targetpkg="$2" target="$3" cross="$4" cross_prepare="$5"
|
2015-03-27 09:50:40 +00:00
|
|
|
local rval _realpkg curpkgdepname pkgn iver
|
|
|
|
local i j found rundep repo
|
2014-04-09 14:40:27 +00:00
|
|
|
|
2015-03-27 09:50:40 +00:00
|
|
|
local -a host_binpkg_deps binpkg_deps host_missing_deps missing_deps missing_rdeps
|
2014-04-09 14:40:27 +00:00
|
|
|
|
|
|
|
[ -z "$pkgname" ] && return 2
|
|
|
|
|
|
|
|
setup_pkg_depends
|
|
|
|
|
2015-03-14 06:50:05 +00:00
|
|
|
if [ "$pkg" != "$targetpkg" ]; then
|
|
|
|
msg_normal "$pkgver: building (dependency of $targetpkg) ...\n"
|
|
|
|
else
|
|
|
|
msg_normal "$pkgver: building ...\n"
|
|
|
|
fi
|
|
|
|
|
2014-07-30 15:58:17 +00:00
|
|
|
if [ -z "$build_depends" -a -z "$host_build_depends" -a -z "$run_depends" ]; then
|
2014-04-09 14:40:27 +00:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Host build dependencies.
|
|
|
|
#
|
|
|
|
for i in ${host_build_depends}; do
|
2015-03-27 09:50:40 +00:00
|
|
|
check_pkgdep_matched "$i" version
|
2014-04-09 14:40:27 +00:00
|
|
|
local rval=$?
|
|
|
|
if [ $rval -eq 0 ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
echo " [host] ${i}: installed."
|
|
|
|
continue
|
2014-04-09 14:40:27 +00:00
|
|
|
elif [ $rval -eq 1 ]; then
|
2015-03-28 02:22:07 +00:00
|
|
|
_realpkg="$($XBPS_UHELPER_CMD getpkgname $i 2>/dev/null)"
|
|
|
|
iver=$($XBPS_UHELPER_CMD version ${_realpkg})
|
|
|
|
if [ $? -eq 0 -a -n "$iver" ]; then
|
|
|
|
echo " [host] ${i}: installed $iver (virtualpkg)."
|
|
|
|
continue
|
|
|
|
else
|
|
|
|
echo " [host] ${i}: unresolved build dependency!"
|
|
|
|
return 1
|
|
|
|
fi
|
2014-04-09 14:40:27 +00:00
|
|
|
else
|
2015-03-27 09:50:40 +00:00
|
|
|
repo=$($XBPS_QUERY_CMD -R -prepository ${i} 2>/dev/null)
|
|
|
|
if [ -n "${repo}" ]; then
|
|
|
|
echo " [host] ${i}: found ($repo)"
|
|
|
|
host_binpkg_deps+=("${i}")
|
|
|
|
continue
|
2014-04-09 14:40:27 +00:00
|
|
|
else
|
2015-03-27 09:50:40 +00:00
|
|
|
echo " [host] ${i}: not found."
|
2014-04-09 14:40:27 +00:00
|
|
|
fi
|
|
|
|
fi
|
2015-03-27 09:50:40 +00:00
|
|
|
host_missing_deps+=("${i}")
|
2014-04-09 14:40:27 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Target build dependencies.
|
|
|
|
#
|
2015-03-27 09:50:40 +00:00
|
|
|
for i in ${build_depends}; do
|
|
|
|
_realpkg="$($XBPS_UHELPER_CMD getpkgname $i 2>/dev/null)"
|
|
|
|
# Check if dependency is a subpkg, if it is, ignore it.
|
|
|
|
unset found
|
|
|
|
for j in ${subpackages}; do
|
|
|
|
[ "$j" = "${_realpkg}" ] && found=1 && break
|
|
|
|
done
|
|
|
|
[ -n "$found" ] && continue
|
|
|
|
check_pkgdep_matched "${i}" version $cross
|
|
|
|
local rval=$?
|
|
|
|
if [ $rval -eq 0 ]; then
|
2015-03-28 02:22:07 +00:00
|
|
|
echo " [target] ${i}: installed."
|
2014-09-21 09:44:45 +00:00
|
|
|
continue
|
2015-03-27 09:50:40 +00:00
|
|
|
elif [ $rval -eq 1 ]; then
|
2015-03-28 02:22:07 +00:00
|
|
|
iver=$($XBPS_UHELPER_XCMD version ${_realpkg})
|
|
|
|
if [ $? -eq 0 -a -n "$iver" ]; then
|
|
|
|
echo " [target] ${i}: installed $iver (virtualpkg)."
|
|
|
|
continue
|
|
|
|
else
|
|
|
|
echo " [target] ${i}: unresolved build dependency!"
|
|
|
|
return 1
|
|
|
|
fi
|
2015-03-27 09:50:40 +00:00
|
|
|
else
|
|
|
|
repo=$($XBPS_QUERY_XCMD -R -prepository ${i} 2>/dev/null)
|
|
|
|
if [ -n "${repo}" ]; then
|
2015-03-28 02:22:07 +00:00
|
|
|
echo " [target] ${i}: found ($repo)"
|
2015-03-27 09:50:40 +00:00
|
|
|
binpkg_deps+=("${i}")
|
|
|
|
continue
|
|
|
|
else
|
2015-03-28 02:22:07 +00:00
|
|
|
echo " [target] ${i}: not found."
|
2015-03-27 09:50:40 +00:00
|
|
|
fi
|
2014-09-21 09:44:45 +00:00
|
|
|
fi
|
2015-03-27 09:50:40 +00:00
|
|
|
missing_deps+=("${i}")
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Target run time dependencies
|
|
|
|
#
|
|
|
|
for i in ${run_depends}; do
|
2014-04-09 14:40:27 +00:00
|
|
|
_realpkg="${i%\?*}"
|
2014-08-17 17:21:25 +00:00
|
|
|
if [ "${_realpkg}" = "virtual" ]; then
|
|
|
|
# ignore virtual dependencies
|
2015-03-27 09:50:40 +00:00
|
|
|
echo " [runtime] ${i#*\?}: virtual dependency."
|
2014-08-17 17:21:25 +00:00
|
|
|
continue
|
|
|
|
fi
|
2014-04-09 14:40:27 +00:00
|
|
|
pkgn=$($XBPS_UHELPER_CMD getpkgdepname "${_realpkg}")
|
|
|
|
if [ -z "$pkgn" ]; then
|
|
|
|
pkgn=$($XBPS_UHELPER_CMD getpkgname "${_realpkg}")
|
|
|
|
if [ -z "$pkgn" ]; then
|
2015-03-27 09:50:40 +00:00
|
|
|
msg_error "$pkgver: invalid runtime dependency: ${_realpkg}\n"
|
2014-04-09 14:40:27 +00:00
|
|
|
fi
|
|
|
|
fi
|
2014-07-30 15:58:17 +00:00
|
|
|
# Check if dependency is a subpkg, if it is, ignore it.
|
|
|
|
unset found
|
|
|
|
for j in ${subpackages}; do
|
2015-03-27 09:50:40 +00:00
|
|
|
[ "$j" = "${pkgn}" ] && found=1 && break
|
2014-07-30 15:58:17 +00:00
|
|
|
done
|
|
|
|
[ -n "$found" ] && continue
|
2015-03-27 09:50:40 +00:00
|
|
|
_props=$($XBPS_QUERY_XCMD -R -ppkgver,repository ${_realpkg} 2>/dev/null)
|
|
|
|
if [ -n "${_props}" ]; then
|
|
|
|
set -- ${_props}
|
|
|
|
$XBPS_UHELPER_CMD pkgmatch ${1} "${_realpkg}"
|
|
|
|
if [ $? -eq 1 ]; then
|
|
|
|
echo " [runtime] ${_realpkg}: found ($2)"
|
2014-04-09 14:40:27 +00:00
|
|
|
shift 2
|
2015-03-27 09:50:40 +00:00
|
|
|
continue
|
2014-04-09 14:40:27 +00:00
|
|
|
else
|
2015-03-27 09:50:40 +00:00
|
|
|
echo " [runtime] ${_realpkg}: not found."
|
2014-04-09 14:40:27 +00:00
|
|
|
fi
|
2015-03-27 09:50:40 +00:00
|
|
|
shift 2
|
|
|
|
else
|
|
|
|
echo " [runtime] ${_realpkg}: not found."
|
2014-04-09 14:40:27 +00:00
|
|
|
fi
|
2015-03-27 09:50:40 +00:00
|
|
|
missing_rdeps+=("${_realpkg}")
|
2014-04-09 14:40:27 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Host missing dependencies, build from srcpkgs.
|
|
|
|
for i in ${host_missing_deps[@]}; do
|
2015-03-14 06:50:05 +00:00
|
|
|
# packages not found in repos, install from source.
|
|
|
|
(
|
2015-03-27 09:50:40 +00:00
|
|
|
curpkgdepname=$($XBPS_UHELPER_CMD getpkgname "$i" 2>/dev/null)
|
2014-04-09 14:40:27 +00:00
|
|
|
setup_pkg $curpkgdepname
|
2015-05-23 06:54:14 +00:00
|
|
|
exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 \
|
|
|
|
$XBPS_LIBEXECDIR/build.sh $sourcepkg $pkg $target || exit $?
|
2015-03-19 09:08:02 +00:00
|
|
|
) || exit $?
|
2015-03-14 06:50:05 +00:00
|
|
|
host_binpkg_deps+=("$i")
|
2014-04-09 14:40:27 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Target missing dependencies, build from srcpkgs.
|
|
|
|
for i in ${missing_deps[@]}; do
|
|
|
|
# packages not found in repos, install from source.
|
2015-03-14 06:50:05 +00:00
|
|
|
(
|
2015-03-27 09:50:40 +00:00
|
|
|
curpkgdepname=$($XBPS_UHELPER_CMD getpkgname "$i" 2>/dev/null)
|
2014-04-09 14:40:27 +00:00
|
|
|
setup_pkg $curpkgdepname $cross
|
2015-05-02 01:40:52 +00:00
|
|
|
exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 \
|
|
|
|
$XBPS_LIBEXECDIR/build.sh $sourcepkg $pkg $target $cross $cross_prepare || exit $?
|
2015-03-19 09:08:02 +00:00
|
|
|
) || exit $?
|
2015-03-14 06:50:05 +00:00
|
|
|
binpkg_deps+=("$i")
|
2014-04-09 14:40:27 +00:00
|
|
|
done
|
|
|
|
|
2015-03-27 09:50:40 +00:00
|
|
|
# Target runtime missing dependencies, build from srcpkgs.
|
|
|
|
for i in ${missing_rdeps[@]}; do
|
|
|
|
# packages not found in repos, install from source.
|
|
|
|
(
|
|
|
|
curpkgdepname=$($XBPS_UHELPER_CMD getpkgdepname "$i" 2>/dev/null)
|
|
|
|
if [ -z "$curpkgdepname" ]; then
|
|
|
|
curpkgdepname=$($XBPS_UHELPER_CMD getpkgname "$i" 2>/dev/null)
|
|
|
|
if [ -z "$curpkgdepname" ]; then
|
|
|
|
curpkgdepname="$i"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
setup_pkg $curpkgdepname $cross
|
2015-05-02 01:40:52 +00:00
|
|
|
exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 \
|
|
|
|
$XBPS_LIBEXECDIR/build.sh $sourcepkg $pkg $target $cross $cross_prepare || exit $?
|
2015-03-27 09:50:40 +00:00
|
|
|
) || exit $?
|
|
|
|
done
|
|
|
|
|
2015-03-14 06:50:05 +00:00
|
|
|
if [ "$pkg" != "$targetpkg" ]; then
|
|
|
|
msg_normal "$pkg: building (dependency of $targetpkg) ...\n"
|
2014-04-09 14:40:27 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
for i in ${host_binpkg_deps[@]}; do
|
|
|
|
msg_normal "$pkgver: installing host dependency '$i' ...\n"
|
|
|
|
install_pkg_from_repos "${i}"
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in ${binpkg_deps[@]}; do
|
|
|
|
msg_normal "$pkgver: installing target dependency '$i' ...\n"
|
|
|
|
install_pkg_from_repos "$i" $cross
|
|
|
|
done
|
2014-03-22 11:31:42 +00:00
|
|
|
}
|