Difference between revisions of "Development Environment for Multiple Viewers"

From Second Life Wiki
Jump to navigation Jump to search
(Initial version (incomplete))
 
Line 72: Line 72:
Obvious, DEFAULTPATH may not depend on PATH.
Obvious, DEFAULTPATH may not depend on PATH.


If you intended to use cdeh also for libraries projects (ie, libraries in $ROOT) and you have multiple
If you intended to use cdeh also for library projects (ie, libraries in $ROOT) and you have multiple
compilers installed (ie, you use a special compiler version for the viewer) then you also should set
compilers installed (ie, you use a special compiler version for the viewer) then you also should set
<code>DEFAULT_TOPPROJECT</code> in your <code>.bashrc</code>. Set it to $ROOT/viewers, but expand $ROOT (type it out fully) because obviously ROOT is not set at the moment you log in.
<code>DEFAULT_TOPPROJECT</code> in your <code>.bashrc</code>. Set it to $ROOT/viewers, but expand $ROOT (type it out fully) because obviously ROOT is not set at the moment you log in.

Revision as of 03:28, 12 July 2010

Development Environment for Multiple Viewers

Highlights:

  • Productivity increase (automation of repetitive tasks)
  • Complete directory structure proposal
  • Directory Dependent History and Environment Switching
  • Support for development of multiple viewers on one host
  • quilt
  • ctags

Directory structure

The ROOT

Choose a directory that will contains everything related to SecondLife, OpenSim etc. In my case this directory contains (currently) 12 GB of data, so pick a place with space ;).

For the sake of copying and pasting commands, lets use an environment variable for this 'root' directory.

export ROOT=/usr/src/secondlife

I use /usr/src/secondlife, but you could of course use something else, like /opt/secondlife, or $HOME/SLroot or whatever.

$ROOT/viewers

The root directory will contain a subdirectory viewers.

mkdir $ROOT/viewers

viewers will contain any data related to viewer development (viewer build system configuration, patches, viewer source trees, viewer subprocesses (ie SLVoice), User Application Directories (AppDir), documentation...) while $ROOT itself will contain everything else (things that are less close to developing the viewers, like special/patched/custom libraries, custom scripts, uploaded assets (textures, sounds, animations), snapshots, third party projects related to SecondLife etc etc).

Purely as a suggestion, you could do

mkdir $ROOT/blender $ROOT/gimp $ROOT/libomv $ROOT/textures $ROOT/wav $ROOT/Snapshots

Viewer project base

Each viewer (version) needs it's own directory, not just for the source tree, but also for meta data (patches, quilt cache, build system configuration, etc). The below deals with a single viewer version, but you can repeat it for multiple viewers. For the sake of easy copy and pasting, lets give our first viewer version an environment variable too. For example,

export VIEWERNAME=snowglobe-1.x-svn

Then, for each such viewer create the following directories:

cd $ROOT/viewers
mkdir $VIEWERNAME
cd $VIEWERNAME
mkdir timestamps
mkdir quilt
mkdir quilt/patches
mkdir quilt/pc

The real source tree (the one containing the indra directory) should be called 'linden' and also goes here. For example,

svn checkout https://svn.secondlife.com/svn/linden/projects/2009/snowglobe/trunk linden

Directory dependent history and environment

Now to automate everything! First install cdeh.

Also set DEFAULTPATH in your .bashrc. For example,

export DEFAULTPATH="$HOME/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin"  # Or whatever your current PATH is!
export PATH="$DEFAULTPATH"

Obvious, DEFAULTPATH may not depend on PATH.

If you intended to use cdeh also for library projects (ie, libraries in $ROOT) and you have multiple compilers installed (ie, you use a special compiler version for the viewer) then you also should set DEFAULT_TOPPROJECT in your .bashrc. Set it to $ROOT/viewers, but expand $ROOT (type it out fully) because obviously ROOT is not set at the moment you log in.

Here it might be wise to reboot, so that every login shell has DEFAULTPATH set; or otherwise make sure to source .bashrc to set it until you have time to reboot. The effect of not having it set is getting an empty PATH so that you will have to type full paths to execute anything :p

Next install this file in the root (/) of your operating system, world readable, and rename it to /env.source. Yes, that is the real root, not $ROOT.

Congratulations! You now have directory dependend history and environment switching! Lets start with creating a separate history file for most of the core directories:

cd $ROOT
addhistory
cd viewers
addhistory
cd $VIEWERNAME
addhistory
cd linden
addhistory

As you can see I just love to have a different command history for every directory :)