Skip to content

Commit

Permalink
Use ccache for builds
Browse files Browse the repository at this point in the history
Addresses #9, 'Add ccache'
  • Loading branch information
zultron committed Apr 10, 2015
1 parent 43db34f commit 5496887
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions scripts/base-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ TCL_VER=8.6

# Build script name
DBUILD=$(basename $0)

# ccache directory
CCACHE_DIR=$CONFIG_DIR/ccache
8 changes: 8 additions & 0 deletions scripts/debian-binary-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ debug " Sourcing debian-binary-package.sh"
#
# These routines handle building the package.

ccache_setup() {
if ! test -d $CCACHE_DIR; then
debug " Creating ccache directory $CCACHE_DIR"
run_user mkdir -p $CCACHE_DIR
fi
}

binary_package_build() {
msg "Building binary package '$PACKAGE'"
source_package_init
ccache_setup
sbuild_build_package
}

8 changes: 5 additions & 3 deletions scripts/sbuild.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
# PATH
# Type: STRING
# PATH to set when running dpkg-buildpackage.
#$path =
#'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games';
$path = '/usr/lib/ccache:/usr/sbin:/usr/bin:/sbin:/bin';



Expand Down Expand Up @@ -380,7 +379,10 @@ $purge_session = 'successful';
# };
#$build_environment = {};
$build_environment = {
'CCACHE_DIR' => '/srv/ccache'
# CCACHE config
'CCACHE_DIR' => '@CCACHE_DIR@',
'CCACHE_UMASK' => '002',
'CCACHE_COMPRESS' => '1'
};

# CORE_DEPENDS
Expand Down
4 changes: 3 additions & 1 deletion scripts/sbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ sbuild_install_sbuild_conf() {
-e "s/@MAINTAINER@/$MAINTAINER/" \
-e "s/@EMAIL@/$EMAIL/" \
-e "s/@PACKAGE_NEW_VERSION_SUFFIX@/$PACKAGE_NEW_VERSION_SUFFIX/" \
-e "s,@CCACHE_DIR@,$CCACHE_DIR," \
-e "s/@/\\\\@/g"
debug " Contents of /etc/sbuild/sbuild.conf:"
run_debug grep -v -e '^$' -e '^#' /etc/sbuild/sbuild.conf
run_debug grep -v -e '^$' -e '^ *#' /etc/sbuild/sbuild.conf

debug " Installing fstab into /etc/schroot/sbuild/fstab"
run cp $SCRIPTS_DIR/sbuild-fstab /etc/schroot/sbuild/fstab
Expand Down Expand Up @@ -193,6 +194,7 @@ sbuild_chroot_setup() {
run sbuild-createchroot $SBUILD_VERBOSE \
--components=$COMPONENTS \
--arch=$SBUILD_CHROOT_ARCH \
--include=ccache \
$SCHROOT_EXCLUDE_ARG \
$BUILD_SCHROOT_SETUP_ONLY \
$CODENAME $CHROOT_DIR $MIRROR
Expand Down

0 comments on commit 5496887

Please sign in to comment.