# Contributor: Fyda <solinde@gmail.com>
# This script compiles the cairo-dock plugins from SVN.
# Cairo-dock can be found at:
# http://developer.berlios.de/projects/cairo-dock/
# Cairo-dock is released under the GPL.
# You'll need at least the following to build this successfully:
# libxxf86vm vte subversion autoconf automake intltool pkgconfig libtool perlxml
# ... and, of course, cairo-dock itself. ;)
# NOTE: This script sets /usr/local as the prefix (not /usr).
# It also does a `sudo make install' for each item, so you might need to
# stick around and type in the password when it brings up a prompt for that.
# USAGE:-
# Put this script in its own directory, eg. ~/cairo-dock
# make it executable, and run it with: ./cdock_plugins.sh
# You can blacklist specific plug-ins here. Separate items with a space.
_blacklist="template xfce-integration"
# Where should the files be installed to? (Don't change this unless you know
# what you're doing.)
_installprefix="/usr/local"
# Where is the SVN repo located? (You shouldn't normally have to change this.)
_svntrunk="http://svn.berlios.de/svnroot/repos/cairo-dock/trunk"
# And the directory name containing all the individual plugin subdirectories?
_svnmod="plug-ins"
### SCRIPT BEGINS BELOW ###
if [ -d $_svnmod ] ; then
cd $_svnmod
svn update || return 1
echo "Files are up to date."
else
svn checkout $_svntrunk/$_svnmod || return 1
cd $_svnmod
fi
echo "SVN checkout done."
echo "Starting make..."
# get directory listing, clean it up to remove the trailing slashes
_itemstocompile="$(echo */ | sed s/\\///g)"
# create lists of items that failed at 1) autoreconf, 2) configure, and 3) make
_failedarc=""
_failedconf=""
_failedmake=""
# and a list of successfully built items
_successfulitems=""
# apply the blacklist so we remove those plug-ins from the to-compile list
if [ ! -z "$_blacklist" ] ; then
echo "** You have blacklisted the following plug-ins:"
echo "$_blacklist"
for a in _blacklist ; do
_itemstocompile="$(echo $_itemstocompile | sed s/$a//)"
done
fi
for a in $_itemstocompile ; do
echo "Doing autoreconf for $a..."
cd $a
autoreconf -isvf
if [ $? -ne 0 ]; then
_failedarc="$_failedarc $a"
echo "WARNING: $a failed during autoreconf!"
else
echo "Doing configure for $a..."
CFLAGS="$CFLAGS -Wno-error" CXXFLAGS="$CXXFLAGS -Wno-error" ./configure --prefix=$_installprefix
if [ $? -ne 0 ]; then
_failedconf="$_failedconf $a"
echo "WARNING: $a did not pass pre-build checks! You are probably missing some build dependencies."
else
echo "Making $a..."
make
if [ $? -ne 0 ]; then
_failedmake="$_failedmake $a"
echo "WARNING: $a failed to build!"
else
echo "Doing make install for $a..."
sudo make install
if [ $? -ne 0 ]; then
echo "WARNING: Failed to install $a!"
else
_successfulitems="$_successfulitems $a"
echo "Successfully made and installed $a."
fi
fi
fi
fi
cd ..
done
if [ ! -z "$_failedarc" ]; then
echo "** The following plug-ins failed during autoreconf:"
echo "$_failedarc"
fi
if [ ! -z "$_failedconf" ]; then
echo "** The following plug-ins failed during configure (probably missing build dependencies):"
echo "$_failedconf"
fi
if [ ! -z "$_failedmake" ]; then
echo "** The following plug-ins failed to build:"
echo "$_failedmake"
fi
if [ ! -z "$_blacklist" ]; then
echo "** The following blacklisted plug-ins were not built:"
echo "$_blacklist"
fi
if [ ! -z "$_successfulitems" ]; then
echo "** The following plug-ins were successfully built:"
echo "$_successfulitems"
fi