How to build blender-svn package for paldo

From Paldo

Jump to: navigation, search

Image:Blender-svn.png Tutorial by Philip Müller

Contents

[edit] About blender

Blender is a free 3D graphics application. It can be used for modeling, UV unwrapping, texturing, rigging, water simulations, skinning, animating, rendering, particle and other simulations, non-linear editing, compositing, and creating interactive 3D applications. Blender is available for several operating systems, including Microsoft Windows, Mac OS X, Linux, IRIX, Solaris, NetBSD, FreeBSD, OpenBSD with unofficial ports for BeOS, SkyOS, AmigaOS, MorphOS and Pocket PC. Blender has a robust feature set similar in scope and depth to other high-end 3D software such as Softimage|XSI, Cinema 4D, 3ds Max, Lightwave and Maya. These features include advanced simulation tools such as rigid body, fluid, cloth and softbody dynamics, modifier based modeling tools, powerful character animation tools, a node based material and compositing system and Python for embedded scripting.

[edit] Why creating svn-tarballs?

Well, every program needs time to get stable. SVN isn't always the best thing to use as a normal user, but sometimes the SVN-versions support features the actual release don't has. Using SVN-software is a risk too. Nobody can tell you for shure it will work. It is coding in progress. So if you want to experiment with new software this tutorial is right for you. And with paldo it is easy as it can get!

[edit] Create the tarball

Open a terminal and change in any dir you like as your work-directory. Then do this cmd:

 $ svn co 

You'll asked to accept the key of the server. Press the p-button on your keyboard. Wait till all files are downloaded and remember the SVN number:

  A    blender/po/el.po
  A    blender/po/Makefile
  A    blender/po/zh_CN.po
  U   blender
 Checked out revision 17199.

Note: it is always good to remember the revisions number. You can use it later on for the versions number of the package

Do a export of the SVN to get a clean ground for a tarball:

 $ svn export blender blender-svn-r17199

Create a tarball:

 $ tar cfvj blender-2.48a-svn-r17199-20081027.tar.bz2 blender-svn-r17199

Note: in this example I use the versions number I used in the last spec

[edit] Create local repository

Create a local repo for paldo:

 $ mkdir -p specs "sources/blender"

Move tarball to the blender dir:

 $ mv blender-2.48a-svn-r17199-20081027.tar.bz2 sources/blender

Note: maybe your tarball is called differently

[edit] Create the spec

You can use this spec for your blender build:

blender.xml

Edit if needed:

Note: the release versions number is also included in the tarball-name, so call it here the same!

  <release version="2.48a-svn-r17199-20081027" revision="1" branch="testing">
    	<deps>
 		<dep name="x11"/>
 		<dep name="xext"/>
 		<dep name="xxf86vm"/>
 		<dep name="freetype"/>
 		<dep name="SDL"/>
 		<dep name="Python"/>
 		<dep name="jpeg"/>
 		<dep name="libpng"/>
 
 		<dep name="zlib"/>
 		<dep name="openal"/>
 		<dep name="scons"/>
 		<dep name="freealut"/>
 		<dep name="openexr"/>
 		<dep name="ffmpeg"/>
 		<dep name="gettext"/>
 		<dep name="mesa"/>
 	</deps>
 	<build>
 		<script>
 			<archive name="blender-$VERSION">
 				<cmd>scons -j 2 BF_PYTHON_VERSION=2.5 BF_BUILDDIR=blender-build BF_INSTALLDIR=blender-install WITH_BF_GAMEENGINE=true</cmd>
 				<cmd>install -D -m 755 blender-install/blender /usr/bin/blender-bin</cmd>
 				<cmd>mkdir -p /usr/lib/blender</cmd>
 				<cmd>cp -a blender-install/.blender/{locale,scripts} blender-install/plugins /usr/lib/blender</cmd>
   
 				<cmd>install -m 644 blender-install/.blender/.Blanguages /usr/lib/blender</cmd>
 				<cmd>install -m 644 blender-install/.blender/.bfont.ttf /usr/lib/blender</cmd>
 				<cmd check="no">cat > /usr/share/applications/blender.desktop << "EOF"
 [Desktop Entry]
 Name=Blender 3D Modeller
 Comment=Create and edit 3D models and animations
 Exec=blender
 Icon=blender
 Terminal=false
 Type=Application
 Categories=Application;Graphics;
 StartupNotify=false
 MimeType=application/x-blender;
 EOF</cmd>
 				<cmd>install -D release/freedesktop/icons/scalable/blender.svg /usr/share/pixmaps/blender.svg</cmd>
   						
 				
   
 				<text dest="/usr/bin/blender" mode="755"><![CDATA[#!/bin/sh
 # wrapper-script by Amnon82 - v1.1
 
 # check if ~/.blender dir exists
 if  [ -f ~/.blender/scripts/scripts-$VERSION-$REVISION.installed ] ; then
   #if yes run blender direct
   echo start blender directly
   blender-bin
 else
  #else create folder and copy the scripts to users home-dir
  echo copying scripts to home dir
  mkdir -p ~/.blender/scripts
  #remove any existing previous scripts
  echo removing scripts of previous blender install
  rm -rf ~/.blender/scripts/*
  cp /usr/lib/blender/scripts/* ~/.blender/scripts
  echo "blender scripts of blender-$VERSION-$REVISION installed" >> ~/.blender/scripts/scripts-$VERSION-$REVISION.installed
  echo start blender
  blender-bin
 fi
 ]]></text>
 			</archive>
 		</script>
 	</build>
 </release>

Save the blender.xml file into the specs dir. The folder structure should be looking like this:

   LOCAL_REPO ==> sources  ==>  blender.tar.bz2  (tarball name may differ)
                  specs    ==>  blender.xml

[edit] Add the local repo

Now you have to add your local repo to your /etc/upkg.conf-file:

Note: use the pwd-cmd to get your actual work-dir. Replace /PATH/TO/YOUR/LOCAL_REPO/ with your pwd-output

$ pwd
/home/amnon/local_repo/
$ sudo sed -i -e 's%<repositories>%&\n<repository>/PATH/TO/YOUR/LOCAL_REPO/</repository>%' /etc/upkg.conf

[edit] Build blender-svn package

Then you can build your new package with upkg:

Note: use the --verbose switch so you can find mistakes easier. Maybe you called the versions-number or the tarball differently...

$ sudo upkg-build --verbose blender

You can start blender with

$ blender

Have fun with the latest blender version.

[edit] Video tutorial

Also I created a video tutorial to show you how it gets done:

Codecs: x264, AAC Link: How to build blender-svn-r17199

[edit] Support thread at paldo.org

Sometimes you'll have still questions or troubles with this guide. You can tell them here so we can find a solution.

Personal tools