Updated Blender for version 2.74

Blender è arrivato alla versione 2.74. Ho deciso questa volta di compilare la versione sorgente anzichè usare il compilato distribuito da blender.org e utilizzato da slackbuilds.org.

Slackbuilds.org offre tutti i pacchetti che servono, queste le dipendenze usate:

  • cudatoolkit per usare cycles con la GPU
  • opencolorio (che richiede python3 che è anche obbligatorio per Blender)
  • openimageio (che richiede opencv il quale in presenza di CUDA lo usa nella compilazione)
  • opencollada (facoltativo)
  • lapack(facoltativo)
  • numby3 (facoltativo)
  • jemalloc (facoltativo)

Opencollada è stato aggiunto da poco su slackbuilds ed è stato questo a spingermi a provare a compilare l’intero pacchetto. Non sto trovando nessun limite degno di nota la momento. Per questa volta lo script lo allego al post perchè non ho ancora deciso come pubblicarlo sul repository git.

PRGNAM="blender"
VERSION="2.74"
HOMEPAGE="http://blender.org"
DOWNLOAD="http://download.blender.org/source/blender-2.74.tar.gz"
MD5SUM="488151953d69d63bedd8ed59f92daf3b"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="cudatoolkit,boost,ffmpeg,opencolorio,openimageio,opencollada,lapack,numby3,jemalloc"
MAINTAINER="Giorgio Peron"
EMAIL="giorgio.peron@gmail.com"
#!/bin/sh

# Slackware build script for Blender

# Copyright 2015 Giorgio Peron Campodarsego, PD, Italy giorgio.peron@gmail.com
# Ryan P.C. McQuen | Everett, WA | ryan.q@linux.com

# Copyright 2008-2013  Robby Workman  Northport, AL, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Thanks to Giorgio Peron <giorgio.peron@gmail.com> for some build tips

PRGNAM=blender
VERSION=${VERSION:-2.74}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

case "$( uname -m )" in
  i?86) ARCH=i686 ;;
  arm*) ARCH=arm ;;
     *) ARCH=$( uname -m ) ;;
esac

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

rm -rf $PKG
rm -rf $TMP/build_linux_full
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .

# TODO try to build the CUDA kernel
export LD_LIBRARY_PATH=/usr/lib$LIBDIRSUFFIX:/usr/lib$LIBDIRSUFFIX/opencollada
make full
#make icons
cd ../build_linux_full/bin

# Move the docs to our standard location first
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv GPL-license.txt copyright.txt Python-license.txt readme.html LICENSE-*.txt \
   $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# Now move everything else
mkdir -p $PKG/opt/blender
mv * $PKG/opt/blender
rm -rf $PKG/opt/$PRGNAM/$VERSION/python

# Add profile scripts to append to PATH
mkdir -p $PKG/etc/profile.d
cp $CWD/profile.d/* $PKG/etc/profile.d/
chmod 0755 $PKG/etc/profile.d/*

mkdir -p $PKG/usr/share/icons/hicolor/scalable/apps
ln -s $PKG/opt/blender/blender.svg \
      $PKG/usr/share/icons/hicolor/scalable/apps/

# Add a desktop menu entry
mkdir -p $PKG/usr/share/applications
ln -s $PKG/opt/blender/blender.desktop \
      $PKG/usr/share/applications/blender.desktop

# Compress man pages
mkdir -p $PKG/usr/man
mv $PKG/opt/blender/blender.1 $PKG/usr/man
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -c n -l y $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.