Auto get and build latest Blender25-svn trunk script [Ubuntu/Ubuntu-based Linuxes]

Mods: not sure which sections this belongs in, so put it here. Please move if appropriate.

I wrote a quick script that pulls down and compiles the latest Blender25 svn trunk into your home directory, leaving your other installations alone. Run the script again (daily or whenever) to again pull the latest files and compile and run blender25-svn.

I’ve tested and this works out of the box on Ubuntu 10.04 32-bit and 64-bit, and will likely work on derivatives like Mint, after doing the apt-get install of development headers (per Blender.org’s official instructions):
Install development headers:


sudo apt-get install subversion build-essential gettext \
 libxi-dev libsndfile1-dev \
 libpng12-dev libfftw3-dev \
 libopenexr-dev libopenjpeg-dev \
 libopenal-dev libalut-dev libvorbis-dev \
 libglu1-mesa-dev libsdl-dev libfreetype6-dev \
 libtiff4-dev libsamplerate0-dev libavdevice-dev \
 libavformat-dev libavutil-dev libavcodec-dev libjack-dev \
 libswscale-dev libx264-dev libmp3lame-dev python3.1-dev

The script:


#!/bin/bash
#
#before running, you'll need to
#sudo apt-get install subversion build-essential gettext \
# libxi-dev libsndfile1-dev \
# libpng12-dev libfftw3-dev \
# libopenexr-dev libopenjpeg-dev \
# libopenal-dev libalut-dev libvorbis-dev \
# libglu1-mesa-dev libsdl-dev libfreetype6-dev \
# libtiff4-dev libsamplerate0-dev libavdevice-dev \
# libavformat-dev libavutil-dev libavcodec-dev libjack-dev \
# libswscale-dev libx264-dev libmp3lame-dev python3.1-dev
#Per the blender.org Building Blender instructions
#
#
echo "####"
echo "Get and build latest Blender 2.5 trunk script"
echo "####"
echo "#Changing directory to blender25-svn"
cd ~ ;  

if [ -d "./blender25-svn" ] ; then
echo "#blender25-svn folder already exists"
else
echo "#blender25-svn folder does not exist, creating it"
mkdir blender25-svn
fi

cd blender25-svn ;
echo "#Checking out latest trunk from svn"
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/blender/; 
cd blender;
echo "BF_OPENAL_LIB = 'openal alut'" > user-config.py;
#ubuntu 10.04 puts its python headers here
echo "BF_PYTHON_INC = '/usr/include/python3.1'" >> user-config.py;
echo "BF_PYTHON_VERSION = '3.1'" >> user-config.py;
echo "WITH_BF_OPENMP = 1" >> user-config.py;

echo "#Running scons"
python scons/scons.py -j2 1>~/blender25-svn/scons_out.txt 2> ~/blender25-svn/scons_error.txt;
cd ~ ;
cd blender25-svn/install/linux2 ;
echo "#Launching blender"
echo "#If this fails, check the scons_*.txt logs in the blender25-svn dir"
./blender;

Copy the above into a new file called something like NewestBlender25.sh, and then chmod a+x NewestBlender25.sh to make it executable.
In terminal:


user@ubuntu:~$ gedit NewestBlender25.sh
---paste the script in from above and click Save----
user@ubuntu:~$ chmod a+x NewestBlender25.sh

To download and compile, simply run

./NewestBlender25.sh

in a terminal.
If the blender25-svn directory does not exist in your home directory it will be automatically created.

To uninstall, simply delete the NewestBlender25.sh script and the blender25-svn directory.

I personally add this script to my launcher bar so I can just click and go about my business (picture attached). http://i.imgur.com/AZkyA.png

To add to your Gnome launcher:
Right click on an empty space in the launcher bar
Choose “Add to Panel”
Choose “Custom Application Launcher”
Click Add
Name can be whatever you prefer - I use “Compile blender25 svn”
Click the browse button and choose your NewestBlender25.sh script, likely in your home directory

Please let me know if you have any trouble, I’ll do my best to help troubleshoot.