Thursday Night

Paul Betts’s personal website / blog / what-have-you

How to contribute to Open Source on Ubuntu

Last night I did a presentation for the OSU Open Source club on how to contribute to Open Source software, and here are my notes / commands:

1. Search in Bugzilla, then make a post:

http://bugzilla.gnome.org/show_bug.cgi?id=392431

2. Download the source code:

## You only have to run this command once, not every time
# Install compiler + tools
sudo apt-get install build-essential fakeroot vim-full dpkg-dev

# Get the source, Luke!
apt-get source gnome-applets && sudo apt-get build-dep gnome-applets

3. Edit the code:

# Builds index of methods, constants, classes, etc
ctags -R .

# Use Control-], (Control-w, ]), and Ctrl-T to find definitions of functions in gVim
gvim

4. Create and test a patch:

To test:

# Installs app to /usr/local
./autogen.sh –prefix=/usr/local && make && sudo make install   

# Removes everything that was installed
sudo make uninstall && make distclean

To build and install packages:

# Build Debian / Ubuntu package
dpkg-buildpackages -rfakeroot                        

# Install it
sudo dpkg -i *.deb

To make a patch:

# Remove intermediate files
cd [The top directory]
sudo debian/rules clean  

# Make the patch                               
diff -ur gnome-applets-orig gnome-applets-modified > the-fix.patch

# Check for errors / clean up extra lines that aren’t needed
vim the-fix.patch

5. Send the patch back!

Tips:

  • Make patches clean and only do one thing, don’t clean up other misc. mistakes
  • Follow indentation rules (tab sizes, spacing, etc)
  • Read ./HACKING first and follow their naming conventions
  • Test your patch first!

Written by Paul Betts

January 17th, 2007 at 2:12 pm

Posted in Linux, Programming