Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Friday, March 16, 2007

Installing Trac on Mac OS X 10.4

Trac is a really cool project management tool that integrates with Subversion.

After using Trac for a little while I was impressed with how it worked, but not so much with the installation. So I compiled a list of things to do to make a smooth installation, and here's my instructions for Installing Trac on Mac OS X:

Download from here.

or copy and paste from below.

This requires an admin user, and you will be required to type in the admin password.

Enjoy.


#!/bin/sh
#
# installing trac on mac os x
#
# including subversion, and other needed components
#


# first clean out any of the old stuff.
sudo rm -rf /usr/local/apr
sudo rm -f /usr/local/lib/libneon*
sudo rm -f /usr/local/lib/libsvn*
sudo rm -f /usr/local/lib/pkgconfig/neon.pc
sudo rm -f /usr/local/bin/swig
sudo rm -f /usr/local/bin/neon-config
sudo rm -f /usr/local/bin/svn*


# make a new directory to download all the source into
cd
mkdir source
cd source

# download the source tarballs
curl http://apache.mirror.pacific.net.au/apr/apr-util-0.9.13.tar.gz > apr-util-0.9.13.tar.gz
curl http://apache.mirror.pacific.net.au/apr/apr-0.9.13.tar.gz > apr-0.9.13.tar.gz
curl http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz > subversion-1.4.3.tar.gz
curl http://downloads.sourceforge.net/swig/swig-1.3.31.tar.gz > swig-1.3.31.tar.gz
curl http://www.webdav.org/neon/neon-0.25.5.tar.gz > neon-0.25.5.tar.gz
curl http://www.clearsilver.net/downloads/clearsilver-0.9.14.tar.gz > clearsilver-0.9.14.tar.gz
curl http://optusnet.dl.sourceforge.net/sourceforge/docutils/docutils-0.4.tar.gz > docutils-0.4.tar.gz
curl http://ftp.edgewall.com/pub/trac/trac-0.10.3.tar.gz > trac-0.10.3.tar.gz

#expand them
tar -zxf apr-util-0.9.13.tar.gz
tar -zxf apr-0.9.13.tar.gz
tar -zxf subversion-1.4.3.tar.gz
tar -zxf swig-1.3.31.tar.gz
tar -zxf neon-0.25.5.tar.gz
tar -zxf clearsilver-0.9.14.tar.gz
tar -zxf docutils-0.4.tar.gz
tar -zxf trac-0.10.3.tar.gz


# make 'apr'
cd apr-0.9.13
./configure
make
sudo make install

cd ..


# make 'apr-util'

cd apr-util-0.9.13
./configure --with-apr=/usr/local/apr
sudo make
sudo make install

cd ..



# make 'neon'

cd neon-0.25.5
./configure --with-ssl
make
sudo make install

cd ..



# make 'swig'

cd swig-1.3.31
./configure --with-python=/usr/bin/python
make
sudo make install

cd ..



# make 'subverion'

cd subversion-1.4.3
./configure --with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr \
--with-zlib --with-ssl --with-neon=/usr/local \
--without-berkeley-db --enable-swig-bindings=python \
--with-swig=/usr/local/bin/swig PYTHON=/usr/bin/python
make
sudo make install

make swig-py
sudo make install-swig-py
echo /usr/local/lib/svn-python > /Library/Python/2.3/site-packages/svn-python.pth

cd ..



# make 'clearsilver'

cd clearsilver-0.9.14
./configure --prefix=/usr/local --with-python=/usr/bin/python --disable-ruby
make
# this is a hack to fix the files that want to run '/usr/local/bin/python'
# when it should just be '/usr/bin/python' as per the configure line above
if [ -f /usr/bin/python -a ! -e /usr/local/bin/python ];
then
sudo ln -s /usr/bin/python /usr/local/bin/python
fi
sudo make install

cd ..



# make 'docutils'

cd docutils-0.4
sudo python setup.py install

cd ..




# and now for the finale!!!
# making 'trac'

cd trac-0.10.3
sudo ./setup.py install

# make these available in '/usr/local/bin/'
# this assumes that '/usr/local/bin/' is in the user's path to run tracd / trac-admin
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/Current/bin/trac* /usr/local/bin






Wednesday, March 07, 2007

Intelligent Signal Display

I while ago, I came up with an idea for a better way to show audio signals as waveforms on a computer screen.

At the time, I was doing some dialogue editing on a television mini-series, and became increasingly frustrated at the amount of time I had to spend zooming in and zooming out on the waveform. I began experimenting, and Intelligent Signal Display (ISD) was born.

Intelligent Signal Display as an improved waveform display method where the waveform images are shaded to provide more detail. Here's an example image:



When the audio signal 'moves' faster (which happens with higher frequencies) the centre region of the waveform is shaded darker.

When the audio signal moves slower (ie: low frequencies) the centre region is shaded lighter. This actually corresponds to exactly what the waveform looks like when you zoom in on it so far that you can see the individual cycles.

For more information, go to the ISD page on the Sound Evolution web site.

Tuesday, July 25, 2006

XCode - copying Dynamic Libraries into Applications

I'm working on a Mac OS X application which uses a dynamic library (dylib) I'm building. I'd been having a problem where the application would launch perfectly if I launched it from the XCode, but it would never launch from the Finder.

I had the dylib in a Copy Phase copying the .dylib file into the './Contents/MacOS' directory in the application package.

I was trying all sorts of things, including copying the built dynamic library into '/usr/local/lib' which worked, but then I realised that the library was not within the application package so it would not be transportable.

So ultimately I wanted the dynamic library (dylib) copied into the application package, resulting in a completely transportable application.

I then figured out why it wasn't working. It has all to do with the search paths that 'dyld' uses when the application is launched. When XCode launched the application, it launches it from the common build directory (which I had manually set), and consequently the dynamic library (dylib) was in the current directory. dyld found it easily.

When my application was launched from the Finder, the working directory was set to something else... i don't know what.. but it's different, and 'dyld' couldn't find my dynamic library (dylib). I could prove this by opening a Terminal window, and launching the application from different working directories. When i 'cd' to the build directory where the .dylib is built, it works, but from any other directory, it fails.

Then i discovered, an interesting article http://developer.apple.com/releasenotes/DeveloperTools/dyld.html and the little gem "@executable_path/". So here's the solution:

Go to the XCode project for the dynamic library (dylib) and set the "Installation Directory" to "@executable_path/". Then rebuild it. In the main application XCode project, make a "Copy Files" build phase which copies the dynamic library (dylib) into the "Executables" directory. Now regardless of what the current directory is, 'dyld' will always find the dylib because it looks in the same directory as the application's executable file.

I hope this saves someone a little bit of time. It bugged me for hours.