install more packages to increase build speed

master
Marc Wäckerlin 8 years ago
parent d1fa73a940
commit 0cc24e498b
  1. 3
      debian/control.in
  2. 54
      scripts/bootstrap-to-docker.sh

3
debian/control.in vendored

@ -6,7 +6,8 @@ Build-Depends: debhelper, subversion, pkg-config, automake, libtool, autotools-d
Package: @PACKAGE_NAME@ Package: @PACKAGE_NAME@
Section: development Section: development
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, debootstrap, coreutils
Recommends: qemu-user-static, lxc-docker, schroot
Description: @DESCRIPTION@ Description: @DESCRIPTION@
@README_DEB@ @README_DEB@

@ -16,8 +16,10 @@ tmpdir=${tmpdir:-"/var/tmp/chroots"}
test -d "${tmpdir}" || mkdir -p "${tmpdir}" test -d "${tmpdir}" || mkdir -p "${tmpdir}"
docker_user=${docker_user:-${USER}} docker_user=${docker_user:-${USER}}
if test -z "${ports[@]}"; then if test -z "${ports[@]}"; then
ports=( armhf powerpc ppc64el s390x arm64 ) #ports=( armhf powerpc ppc64el s390x arm64 )
qemus=( arm ppc ppc64 s390x armb ) #qemus=( arm ppc ppc64 s390x aarch64 )
ports=( armhf )
qemus=( arm )
fi fi
numports=${#ports[@]} numports=${#ports[@]}
if test -z "$archs"; then if test -z "$archs"; then
@ -25,12 +27,13 @@ if test -z "$archs"; then
(amd64) archs="amd64 i386";; (amd64) archs="amd64 i386";;
(*) archs=$(dpkg --print-architecture);; (*) archs=$(dpkg --print-architecture);;
esac esac
for ((i=0; i<${num}; ++i)); do for ((i=0; i<$numports; ++i)); do
if test -x /usr/bin/qemu-${qemus[$i]}-static; then if test -x /usr/bin/qemu-${qemus[$i]}-static; then
archs+=" ${ports[$i]}" archs+=" ${ports[$i]}"
fi fi
done done
fi fi
ubuntu_qt5="yakkety xenial wily vivid trusty" ubuntu_qt5="yakkety xenial wily vivid trusty"
debian_qt5="jessie sid" debian_qt5="jessie sid"
debian_qt4="" debian_qt4=""
@ -40,13 +43,11 @@ ubuntu=("${ubuntu_qt5}")
debian=("${debian_qt5}" "${debian_qt4}") debian=("${debian_qt5}" "${debian_qt4}")
distros=(${distros:-"${ubuntu[@]}" "${debian[@]}"}) distros=(${distros:-"${ubuntu[@]}" "${debian[@]}"})
packages_qt5="qtbase5-dev qtbase5-dev-tools qtbase5-dev-tools libqt5webkit5-dev libqt5svg5-dev qt5-default qttools5-dev" packages_qt5="libpoppler-qt5-dev libpodofo-dev libqt5designer5 libqt5svg5-dev libqt5webkit5-dev qt5-default qt5-qmake qtbase5-dev qtbase5-dev-tools qttools5-dev qttools5-dev-tools"
# |libqtcore4-qmake|libqt4-core packages_qt4="libqt4-core libqt4-designer libqt4-dev libqt4-webkit qt4-dev-tools qt4-qmake"
packages_qt4="qt4-qmake libqt4-dev" # |libqtcore4 |libqtwebkit-dev |libp11-kit-dev|libgnutls-dev
# |software-properties-common|python-software-properties packages_base="apt-transport-https automake autotools-dev binutils-dev debhelper default-jdk-headless doxygen dpkg-dev g++ git graphviz libboost-thread-dev libcppunit-dev liblog4cxx-dev libpcsclite-dev libpkcs11-helper1-dev libproxy-dev libssl-dev libtool libz-dev lsb-release mscgen nodejs pandoc pkg-config software-properties-common subversion subversion-tools texinfo xvfb"
packages_base="software-properties-common apt-transport-https dpkg-dev lsb-release debhelper git subversion pkg-config automake libtool autotools-dev doxygen graphviz mscgen libcppunit-dev xvfb nodejs" #package_not_in_yakkety="default-jdk-headless"
package_not_in_xenial=""
package_not_in_xenial_qt5=""
if test -z "${packages[@]}"; then if test -z "${packages[@]}"; then
packages=("${packages_base} ${packages_qt5}" "${packages_base} ${packages_qt5}" "${packages_base} ${packages_qt4}") packages=("${packages_base} ${packages_qt5}" "${packages_base} ${packages_qt5}" "${packages_base} ${packages_qt4}")
@ -85,6 +86,11 @@ error() {
for ((i=0; i<${#distros[@]}; ++i)); do for ((i=0; i<${#distros[@]}; ++i)); do
package="${packages[${index:-$i}]}" package="${packages[${index:-$i}]}"
for distro in ${distros[$i]}; do for distro in ${distros[$i]}; do
prevent=package_not_in_${distro};
instpkgs=${package}
for pkg in ${!prevent}; do
instpkgs=${instpkgs//${pkg}/}
done
if test -n "$limit" -a "$distro" != "$limit"; then if test -n "$limit" -a "$distro" != "$limit"; then
continue continue
fi fi
@ -131,6 +137,24 @@ for ((i=0; i<${#distros[@]}; ++i)); do
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot "${tmpdir}/${distro}-${arch}" dpkg --configure -a sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot "${tmpdir}/${distro}-${arch}" dpkg --configure -a
fi fi
fi fi
echo " ---- mount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2
sudo mount -t proc proc "${tmpdir}/${distro}-${arch}"/proc/
sudo mount -t sysfs sys "${tmpdir}/${distro}-${arch}"/sys/
sudo mount -o bind /dev "${tmpdir}/${distro}-${arch}"/dev/
echo " ---- preconfigure debian packages in ${tmpdir}/${distro}-${arch}" 1>&2
sudo chroot "${tmpdir}/${distro}-${arch}" debconf-set-selections <<EOF
console-setup console-setup/fontsize-fb47 select 8x16
console-setup console-setup/fontface47 select Fixed
console-setup console-setup/charmap47 select UTF-8
console-setup console-setup/store_defaults_in_debconf_db boolean true
keyboard-configuration console-setup/ask_detect boolean false
keyboard-configuration console-setup/detected note
console-setup console-setup/fontsize string 8x16
console-setup console-setup/fontsize-text47 select 8x16
console-setup console-setup/codesetcode string Uni2
keyboard-configuration console-setup/detect detect-keyboard
console-setup console-setup/codeset47 select . Combined - Latin; Slavic Cyrillic; Greek
EOF
echo " ---- prevent packages in ${tmpdir}/${distro}-${arch}" 1>&2 echo " ---- prevent packages in ${tmpdir}/${distro}-${arch}" 1>&2
for f in "dbus" "libpam-systemd*" "packagekit*" "policykit*" "colord"; do for f in "dbus" "libpam-systemd*" "packagekit*" "policykit*" "colord"; do
sudo chroot "${tmpdir}/${distro}-${arch}" <<EOF1 sudo chroot "${tmpdir}/${distro}-${arch}" <<EOF1
@ -157,8 +181,14 @@ EOF1
fi fi
sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true update sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true update
sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true -y dist-upgrade sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true -y dist-upgrade
echo " ---- install ${package} to ${tmpdir}/${distro}-${arch}" 1>&2 echo " ---- cleanup ${instpkgs} to ${tmpdir}/${distro}-${arch}" 1>&2
sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true install -y ${package} sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true autoremove --purge -y
echo " ---- install ${instpkgs} to ${tmpdir}/${distro}-${arch}" 1>&2
sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true install -y ${instpkgs}
echo " ---- unmount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2
sudo umount "${tmpdir}/${distro}-${arch}"/proc/
sudo umount "${tmpdir}/${distro}-${arch}"/sys/
sudo umount "${tmpdir}/${distro}-${arch}"/dev/
echo " ---- import ${tmpdir}/${distro}-${arch} to ${docker_user}/${type}:${distro}-${arch}" 1>&2 echo " ---- import ${tmpdir}/${distro}-${arch} to ${docker_user}/${type}:${distro}-${arch}" 1>&2
cd "${tmpdir}/${distro}-${arch}" cd "${tmpdir}/${distro}-${arch}"
sudo tar c . | docker import - "${docker_user}/${type}:${distro}-${arch}" sudo tar c . | docker import - "${docker_user}/${type}:${distro}-${arch}"

Loading…
Cancel
Save