Skip to content

Commit

Permalink
build: support parallel build jobs for debs
Browse files Browse the repository at this point in the history
Add support for parallel build jobs. Do this by setting parallel=X in
DEB_BUILD_OPTIONS instead of passing -j to dpkg-buildpackage as the
latter also updates MAKEFLAGS by itself which some package might not be
too happy with.
  • Loading branch information
sjoerdsimons authored and mlschroe committed Nov 14, 2014
1 parent 778a520 commit 701e243
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions build-recipe-dsc
Expand Up @@ -70,15 +70,15 @@ recipe_prepare_dsc() {
}

recipe_build_dsc() {
DSC_BUILD_OPTIONS=
if test -n "$BUILD_JOBS" ; then
DSC_BUILD_OPTIONS="parallel=${BUILD_JOBS}"
fi
# Checks to see if a build script should be used
# this allows the build environment to be manipulated
# and alternate build commands can be used
# Debian policy requires to build with single CPU by default
# if test -n "$BUILD_JOBS" ; then
# DSC_BUILD_JOBS="-j$BUILD_JOBS"
# fi
DSC_BUILD_CMD="$(queryconfig --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" substitute dsc:build_cmd)"
test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc $DSC_BUILD_JOBS"
test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc"
if test -e $BUILD_ROOT/$TOPDIR/SOURCES/build.script ; then
echo "Sourcing build.script to build - it should normally run 'dpkg-buildpackage -us -uc'"
DSC_BUILD_CMD="source $TOPDIR/SOURCES/build.script"
Expand All @@ -88,7 +88,7 @@ recipe_build_dsc() {
if test -n "$RUN_SHELL"; then
chroot $BUILD_ROOT su -
else
chroot $BUILD_ROOT su -c "cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
chroot $BUILD_ROOT su -c "export DEB_BUILD_OPTIONS=${DSC_BUILD_OPTIONS} ; cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false"; then
DEB_CHANGESFILE=${RECIPEFILE%.dsc}_"$(chroot $BUILD_ROOT su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes
chroot $BUILD_ROOT su -c "which lintian > /dev/null && cd $TOPDIR && echo Running lintian && (set -x && lintian -i $DEB_SOURCEDIR/$DEB_DSCFILE)" - $BUILD_USER < /dev/null
Expand Down

0 comments on commit 701e243

Please sign in to comment.