xbps-src: support building bootstrap pkgs in chroot with -D.

The base_chroot var has been renamed to bootstrap, to avoid conflicts
with the base-chroot pkg. So now you can rebuild any bootstrap package
if the masterdir is ready (base-chroot already) installed and
installation is only to destdir.
This commit is contained in:
Juan RP 2011-07-06 08:16:56 +02:00
parent 8156eeb03e
commit 5355f32aca
33 changed files with 60 additions and 39 deletions

View file

@ -10,7 +10,7 @@ long_desc="
replaces="xbps-base-chroot>=0"
noarch=yes
base_chroot=yes
bootstrap=yes
Add_dependency full xbps-triggers
Add_dependency full base-files

View file

@ -9,7 +9,7 @@ long_desc="
installed by any other package and are required on any GNU/Linux system."
noarch=yes
base_chroot=yes
bootstrap=yes
do_install()
{

View file

@ -12,7 +12,7 @@ long_desc="
replaces="xbps-base-files>=0"
noarch=yes
base_chroot=yes
bootstrap=yes
conf_files="
/etc/profile

View file

@ -34,7 +34,7 @@ long_desc="
to sixty-four. In addition, most sh scripts can be run by Bash without
modification."
base_chroot=yes
bootstrap=yes
register_shell="/bin/bash"
Add_dependency run glibc

View file

@ -22,7 +22,7 @@ long_desc="
stripping out symbols (like debugging information) from object files,
and other tools."
base_chroot=yes
bootstrap=yes
subpackages="$pkgname-devel"
Add_dependency run glibc
Add_dependency run zlib

View file

@ -16,7 +16,7 @@ long_desc="
very much like their GNU counterparts. BusyBox provides a fairly complete
environment for any small or embedded system."
base_chroot=yes
bootstrap=yes
replaces="busybox-initramfs>=0"
Add_dependency run glibc

View file

@ -22,7 +22,7 @@ long_desc="
The archive file format of bzip2 (.bz2) is incompatible with that of its
predecessor, bzip (.bz)."
base_chroot=yes
bootstrap=yes
subpackages="bzip2-devel"
Add_dependency run glibc

View file

@ -6,7 +6,7 @@
unset run_depends build_depends revision
revision=2
base_chroot=yes
bootstrap=yes
pkgname=chroot-grep
wrksrc=grep-${version}
configure_args="--disable-perl-regexp --disable-nls ac_cv_path_GREP=grep"

View file

@ -13,7 +13,7 @@ long_desc="
parametrized polyhedron or parametrized polyhedra union is reached. CLooG is
designed to avoid control overhead and to produce a very efficient code."
base_chroot=yes
bootstrap=yes
subpackages="$pkgname-devel"
Add_dependency run glibc
Add_dependency run gmp

View file

@ -13,7 +13,7 @@ long_desc="
faster. Cmp has been moved into this package from the GNU textutils package.
These programs are usually used for creating patch files."
base_chroot=yes
bootstrap=yes
Add_dependency run glibc
post_install()

View file

@ -14,7 +14,7 @@ long_desc="
around getuid, chown, chmod, mknod, stat, and so on, thereby creating a fake
root environment."
base_chroot=yes
bootstrap=yes
Add_dependency run glibc
post_install()

View file

@ -10,7 +10,7 @@ long_desc="
File attempts to classify files depending on their contents and prints
a description if a match is found."
base_chroot=yes
bootstrap=yes
subpackages="file-devel"
Add_dependency run glibc

View file

@ -17,7 +17,8 @@ long_desc="
for ObjectiveC++ install gcc-objc++, for Go install gcc-go,
for Fortran install gcc-fortran."
base_chroot=yes
bootstrap=yes
subpackages="libgcc libgo libssp libssp-devel libstdc++ libstdc++-devel libgomp"
subpackages="${subpackages} libquadmath libquadmath-devel libgo-devel libgomp-devel"
subpackages="${subpackages} libmudflap libmudflap-devel libobjc libobjc-devel"
@ -44,6 +45,8 @@ Add_dependency build mpc-devel
Add_dependency build binutils-devel
Add_dependency build cloog-ppl-devel
Add_dependency build libelf-devel
Add_dependency build binutils
do_build()
{

View file

@ -18,7 +18,7 @@ long_desc="
# Don't check for deps here
ignore_vdeps_dir="/usr/lib/gconv"
base_chroot=yes
bootstrap=yes
conf_files="/etc/rpc /etc/ld.so.conf /etc/nsswitch.conf"
subpackages="glibc-devel glibc-locales nscd"

View file

@ -28,7 +28,7 @@ long_desc="
The advantage for GNU MP increases with the operand sizes for certain
operations, since GNU MP in many cases has asymptotically faster algorithms."
base_chroot=yes
bootstrap=yes
subpackages="gmp-devel"
Add_dependency build m4
Add_dependency run libgcc

View file

@ -12,7 +12,7 @@ long_desc="
and freedom from patented algorithms. The GNU Project uses it as the
standard compression program for its system."
base_chroot=yes
bootstrap=yes
Add_dependency run glibc
post_build()

View file

@ -7,7 +7,7 @@ short_desc="The Linux kernel headers for development"
long_desc="
This package provides the linux kernel headers for use in userspace."
base_chroot=yes
bootstrap=yes
nostrip=yes
do_build()

View file

@ -14,6 +14,6 @@ long_desc="
Eli (a state of the art compiler generation system), and Elk (the Extension
Language Kit - an implementation of the Scheme programming language.)"
base_chroot=yes
bootstrap=yes
subpackages="$pkgname-devel"
Add_dependency run glibc

View file

@ -15,5 +15,5 @@ long_desc="
shell commands, doing arithmetic, etc. Autoconf needs GNU m4 for
generating configure scripts, but not for running them."
base_chroot=yes
bootstrap=yes
Add_dependency run glibc

View file

@ -12,5 +12,5 @@ long_desc="
program need to be recompiled and issues the commands to
recompile them, when necessary."
base_chroot=yes
bootstrap=yes
Add_dependency run glibc

View file

@ -12,7 +12,7 @@ long_desc="
high precision and correct rounding of the result. It is built upon and
follows the same principles as Mpfr."
base_chroot=yes
bootstrap=yes
subpackages="mpc-devel"
Add_dependency run glibc
Add_dependency run gmp

View file

@ -15,7 +15,7 @@ long_desc="
see more on the credit page. MPFR is based on the GMP multiple-precision
library."
base_chroot=yes
bootstrap=yes
subpackages="$pkgname-devel"
Add_dependency run glibc
Add_dependency run gmp

View file

@ -17,7 +17,7 @@ long_desc="
ecompiler infocmp, clear, tput, tset, and a termcap conversion tool captoinfo.
Full manual pages are provided for the library and tools."
base_chroot=yes
bootstrap=yes
subpackages="ncurses-base ncurses-devel ncurses-libs ncurses-term"
Add_dependency run glibc
Add_dependency run ncurses-libs

View file

@ -13,5 +13,5 @@ long_desc="
This is the GPL version from the Free Software Foundation."
base_chroot=yes
bootstrap=yes
Add_dependency run glibc

View file

@ -22,7 +22,7 @@ long_desc="
exact-arithmetic version of the simplex algorithm."
disable_parallel_build=yes
base_chroot=yes
bootstrap=yes
subpackages="ppl-devel"
Add_dependency run libgcc

View file

@ -13,7 +13,7 @@ long_desc="
of these. Note that as of the current version of GNU tar (1.12), gtar
does not create "correct" ustar archives."
base_chroot=yes
bootstrap=yes
Add_dependency run glibc
Add_dependency run bzip2
Add_dependency full gzip

View file

@ -11,7 +11,7 @@ long_desc="
noarch=yes
noextract=yes
base_chroot=yes
bootstrap=yes
do_install()
{

View file

@ -18,7 +18,7 @@ long_desc="
is thread safe. The data format used by the library is described
by RFCs (Request for Comments) 1950 to 1952."
base_chroot=yes
bootstrap=yes
subpackages="zlib-devel"
Add_dependency run glibc

View file

@ -101,7 +101,7 @@ autoremove_pkg_dependencies()
# If XBPS_PREFER_BINPKG_DEPS is set, we should remove those
# package dependencies installed by the target package, do it.
#
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$base_chroot" ]; then
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
msg_normal "'$pkgname': removing automatically installed dependencies ...\n"
# Autoremove installed binary packages.
${cmd} -y reconfigure all && ${cmd} -Rpyf autoremove 2>&1 >/dev/null
@ -188,7 +188,7 @@ install_pkg_deps()
[ $? -eq 0 ] && continue
prev_pkg="$j"
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$base_chroot" ]; then
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
install_pkg_from_repos ${j}
if [ $? -eq 255 ]; then
# xbps-bin returned unexpected error
@ -214,7 +214,7 @@ install_pkg_deps()
fi
done
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$base_chroot" ]; then
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
install_pkg_from_repos ${curpkg}
if [ $? -eq 255 ]; then
# xbps-bin returned unexpected error
@ -279,7 +279,7 @@ install_dependencies_pkg()
[ -z "$notinstalled_deps" ] && return 0
# Install direct build dependencies from binary packages.
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$base_chroot" ]; then
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
msg_normal "'$pkg': installing dependencies from repositories ...\n"
for i in ${notinstalled_deps}; do
if [ -z "$pkglist" ]; then

View file

@ -45,7 +45,7 @@ _umount()
return $?
}
[ -n "$base_chroot" ] && return 0
[ -n "$bootstrap" ] && return 0
if [ "${chroot_cmd}" = "chroot" ]; then
if [ "$(id -u)" -ne 0 ]; then
@ -316,6 +316,8 @@ xbps_chroot_handler()
else
[ -n "$KEEP_WRKSRC" ] && arg="-C"
[ -n "$KEEP_AUTODEPS" ] && arg="$arg -K"
[ -n "$DESTDIR_ONLY_INSTALL" ] && arg="$arg -D"
action="$arg $action"
env in_chroot=1 IN_CHROOT=1 LANG=C _ORIGINPKG="$pkg" \
${chroot_cmd} $XBPS_MASTERDIR sh -c \

View file

@ -50,7 +50,7 @@ install_pkg()
check_installed_pkg "$pkg"
if [ $? -eq 1 -o $? -eq 0 ]; then
instver="$($XBPS_PKGDB_CMD version $pkgname)"
if [ -n "$instver" ]; then
if [ -n "$instver" -a -z "$DESTDIR_ONLY_INSTALL" ]; then
echo "=> $pkgname-$instver already installed."
return 0
fi
@ -130,6 +130,7 @@ install_pkg()
if [ -d "$wrksrc" -a -z "$KEEP_WRKSRC" ]; then
remove_tmpl_wrksrc $wrksrc
fi
return 0
fi
# Stow package into masterdir.
@ -200,7 +201,6 @@ remove_pkg()
[ -z $pkgname ] && msg_error "unexistent package, aborting.\n"
ver=$($XBPS_PKGDB_CMD version $pkgname)
stow_pkg_handler unstow || return $?
for subpkg in ${subpackages}; do
if [ -d "$XBPS_DESTDIR/${subpkg}-${ver%_*}" ]; then
@ -223,6 +223,8 @@ remove_pkg()
[ -f $XBPS_POST_INSTALL_DONE ] && rm -f $XBPS_POST_INSTALL_DONE
[ -f $XBPS_INSTALL_DONE ] && rm -f $XBPS_INSTALL_DONE
stow_pkg_handler unstow || return $?
[ -n "$found" ] && return 0
return 1

View file

@ -90,7 +90,7 @@ reset_tmpl_vars()
local TMPL_VARS="pkgname distfiles configure_args \
make_build_args make_install_args build_style \
short_desc maintainer long_desc checksum wrksrc \
make_cmd base_chroot register_shell keep_empty_dirs \
make_cmd bootstrap register_shell keep_empty_dirs \
make_build_target configure_script noextract nofetch \
pre_configure pre_build pre_install build_depends \
post_configure post_build post_install nostrip \
@ -285,6 +285,10 @@ set_tmpl_common_vars()
. $XBPS_SHUTILSDIR/install_files.sh
if [ -n "$IGNORE_BOOTSTRAP_PKGS" ]; then
unset bootstrap
fi
FILESDIR=$XBPS_SRCPKGDIR/$pkgname/files
PATCHESDIR=$XBPS_SRCPKGDIR/$pkgname/patches
DESTDIR=${XBPS_DESTDIR}/${pkgname}-${version}

View file

@ -315,6 +315,16 @@ else
fi
export PATH="$MYPATH"
#
# If masterdir is ready (base-chroot installed and chroot set up) and
# XBPS_PREFER_BINPKG_DEPS enabled, force ignoring rules to handle
# bootstrap packages.
#
if [ -n "$DESTDIR_ONLY_INSTALL" -a -n "$XBPS_PREFER_BINPKG_DEPS" \
-a -f "$XBPS_MASTERDIR/.xbps_perms_done" ]; then
export IGNORE_BOOTSTRAP_PKGS=1
fi
#
# Main switch.
#
@ -332,7 +342,7 @@ build|configure)
_pkgname=$(basename_cwd)
fi
if [ -z "$base_chroot" -a -z "$IN_CHROOT" ]; then
if [ -z "$bootstrap" -a -z "$IN_CHROOT" ]; then
. $XBPS_SHUTILSDIR/chroot.sh
xbps_chroot_handler $target ${_pkgname}
else
@ -416,7 +426,7 @@ install)
fi
setup_tmpl ${_pkgname}
_ORIGINPKG="${_pkgname}"
if [ -z "$IN_CHROOT" -a -z "$base_chroot" ]; then
if [ -z "$IN_CHROOT" -a -z "$bootstrap" ]; then
. $XBPS_SHUTILSDIR/chroot.sh
xbps_chroot_handler $target ${_ORIGINPKG}
else
@ -448,7 +458,7 @@ remove)
_pkgname=$(basename_cwd)
fi
setup_tmpl ${_pkgname}
if [ -z "$IN_CHROOT" -a -z "$base_chroot" ]; then
if [ -z "$IN_CHROOT" -a -z "$bootstrap" ]; then
. $XBPS_SHUTILSDIR/chroot.sh
xbps_chroot_handler $target ${_pkgname}
else