Here's the script. Save it as "pyprp.sh" and run it from a terminal with "bash pyprp.sh".
It will:
- Download all dependency packages using your package manager
- Fetch libHSPlasma and pyHSPlasma, build them, and install them
- Fetch PyPRP2, build it, and install it
- Properly add PyPRP2 to your Blender addons directory
It will most likely ask for your password at least once, when it installs the dependency packages. Depending on your system configuration it may ask again when it installs PyHSPlasma and PyPRP2 to the system. My script is not asking for your password directly - it's the system tools asking when my script tries to perform certain actions.
EDIT: I forgot to mention that if you have a dual- or quad-core machine, you can change "MAKEOPTS=-j1" to "MAKEOPTS=-j2" or "MAKEOPTS=-j4", in order to take advantage of those extra cores to speed up build times.
EDIT2: Fixed a non-critical typo
- Code: Select all
#!/bin/bash
MAKEOPTS=-j1
echo "First things first, we install dependency packages. This may ask for your sudo password"
sudo apt-get install blender build-essential cmake git libdevil-dev libjpeg-dev libz-dev python3-dev
mkdir -p $HOME/.pyprp/
if [[ -d $HOME/.pyprp/libhsplasma/build ]]; then
echo "It looks like you already have libHSPlasma available. Let's check for updates!"
cd $HOME/.pyprp/libhsplasma
git pull
cd build
else
echo "It doesn't look like you have libHSPlasma. We're going to build it now"
cd $HOME/.pyprp
git clone git://github.com/H-uru/libhsplasma.git
mkdir -p libhsplasma/build/
cd libhsplasma/build/
cmake ../ -DCMAKE_BUILD_TYPE=Release -DPYTHON_3_OK=True -DPYTHON_2_OK=False -DDISABLE_TOOLS=On -DDISABLE_NET=On -DDISABLE_PYTHON=Off
fi
make $MAKEOPTS
echo "Now we're installing libHSPlasma. This may ask for your sudo password."
sudo make install
if [[ -d $HOME/.pyprp/pyprp2/build ]]; then
echo "It looks like you already have PyPRP2 available. Let's check for updates!"
cd $HOME/.pyprp/pyprp2/
git pull
cd build
else
echo "It doesn't look like you have PyPRP2. We're going to build it now"
cd $HOME/.pyprp
git clone git://github.com/H-uru/pyprp2.git
mkdir -p pyprp2/build/
cd pyprp2/build
cmake ../buildplmipmap/ -DCMAKE_BUILD_TYPE=Release
fi
make $MAKEOPTS
echo "Now we're installing PyPRP2. This may ask for your sudo password."
sudo make install
BLENDER_VERSION=`blender --version | cut -d' ' -f2 | head -n1`
BLENDER_ADDONS_DIR=$HOME/.blender/$BLENDER_VERSION/scripts/addons/
PYPRP2_DIR=$BLENDER_ADDONS_DIR/PyPRP2
if [[ ! -h $PYPRP2_DIR ]]; then
echo "PyPRP2 symlink for Blender does not exist. Creating it..."
if [[ -e $PYPRP2_DIR ]]; then
echo "Removing unknown PyPRP2 version so we can use the up-to-date one"
rm -r $PYPRP2_DIR
fi
mkdir -p $BLENDER_ADDONS_DIR
ln -s $HOME/.pyprp/pyprp2/addons/PyPRP2 $PYPRP2_DIR
fi