Gource on OSX (Snow Leopard)


Some months ago I played around with code_swarm by Michael Ogawa – partly for fun and partly to see what all the fuss was about with the Processing framework (something I have yet to really investigate). Last week I came across Gource another source code visualisation tool this time using 3D rendering.

Software projects are displayed by Gource as an animated tree with the root directory of the project at its centre. Directories appear as branches with files as leaves. Developers can be seen working on the tree at the times they contributed to the project.

Some recent commits to the project fixed build issues on OSX. Despite these fixes I still had trouble compiling. So in summary here’s what I did to get it working. Note that I did resort to installing mac ports (something I’d rather NOT do) – after many attempts to download and manually compile the prerequisites (FTGL 2.1.3~rc5-2 kept giving me problems)

# get mac ports

# get all the ports you need for gource
sudo port install pcre libsdl libsdl_image ftgl

# get and build Gource from github and follow the instructions in INSTALL
git clone git://github.com/acaudwell/Gource.git
cd Gource
autoreconf -f -i
./configure && make && sudo make install

# navigate to your project directory and type;

# have a look at all the options
man gource

# here are the settings I used (to get a large user icon and change the speed/size
gource ./ -s 0.5 -b 000000 --user-image-dir ~/images/avatars/ --user-scale 2.0 -800x600

# video it in h264 using ffmpeg, first install ffmpeg via mac ports (with codecs)
sudo port install ffmpeg +gpl +lame +x264 +xvid

# pipe PPM images to ffmpeg to generate a h264 encoded movie
gource ./ -s 0.5 -b 000000 --user-image-dir ~/images/avatars/ --user-scale 2.0 -800x600 --output-ppm-stream - | ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -vpre hq -crf 28 -threads 0 bugle.mp4

# finally, if you want to add some audio to the video (from an mp3)
ffmpeg -i audio.mp3 -i bugle.mp4 -vcodec libx264 -vpre hq -crf 28 -threads 0 bugle-with-audio.mp4
(this output will be the length of the video/audio track, whichever is longer)

# phew! - now go here to see how to remove macports when you're done :)

Bugle did exist (for a time) as an open source project on github before I moved it to be privately hosted. So here is the result; Bugle’s git log from April ’09 to the present parsed through Gource, with just one committer (me).

In summary you can see real bursts of activity at the start followed by some long periods of inactivity, and coming toward the present date renewed development and work going on. Gource is more impressive when visualising big projects with multiple committers over long periods, like the history of Git itself for example.

9 comments so far

  • photo of Matt Matt Dec 08, 2009

    music is Gui Boratto – No Turning Back

  • photo of Nat Brown Nat Brown Jun 12, 2010

    thanks for the instructions. I’ve had similar problems building gource manually on snow leopard, nothing has worked — now it is. Note the macports approach didn’t work for me the first run through as i was running macports in i386 (32-bit) instead of default x86_64 to accomodate some other macports project issues. i had to fully uninstall and reinstall macports :( to reset properly to pure 32-bit or else libsdl and libsdl_image were freaking out. Might be worth noting this in your post as failry common to use macports in x86_64 these days.

  • photo of Gordon Gordon Jul 08, 2010

    hi there, After running the git clone command, “configure” does not exist in the “Gource” directory…

  • photo of Matt Matt Jul 12, 2010

    Well spotted! It seems they changed their repository recently. If you follow the instructions in the INSTALL file, it explains the configure script needs to be rebuilt, using the command;

    autoreconf -f -i

    (i’ve updated the guide above to reflect this)

  • photo of bob bob Oct 12, 2010

    also if you prefer brew…

    brew install gource

  • photo of pop pop Apr 05, 2011

    You also need to install glew

    sudo port install glew

  • photo of max max Jun 12, 2011

    thanks – still worked like a charm with gource 0.34 on snow leopard.

    had to run autoreconf as sudo, though.

    “sudo autoreconf -f -i”

    otherwise i got some errors like: grep: reload-state: No such file or directory autom4te: need GNU m4 1.4 or later: /opt/local/bin/gm4 aclocal: /opt/local/bin/autom4te failed with exit status: 1 autoreconf: aclocal failed with exit status: 1

  • photo of Gazza Gazza Jul 20, 2011

    Nice music!

  • photo of Ravi Ravi Oct 06, 2011

    These additional steps were required for me to get it working

    sudo port install glew sudo port install opencv

    Thanks for the info

Leave a comment