Friday, January 27, 2012

Day Seven: How to Build a Project from Source

Teaching Open Source is one of our textbooks this semester. I mentioned it in an earlier blog post and commented on how different the approach is from what I am used to. In chapter 5, section 4, there is an exercise that walks the reader through all of the steps required to build Freeciv, a free open source strategy game, from source. The exercise goes into great detail, but does not always state the specific commands to use in Ubuntu. I will make my own walk-through as I attempt to build Freeciv on my own machine.

Step 1: Download the Source Code
Assuming that you already have Subversion installed on your machine, you can download the source code with the following command:

svn co svn://svn.gna.org/svn/freeciv/trunk freeciv

If everything goes smoothly, you should see a folder labeled freeciv in your home folder.

Step 2: Install Prerequisites
Freeciv has an INSTALL file that tells you all of the prerequisites that you need. The recommended prerequisites are libtool, g++, gcc, gmake, gettext, autoconf, automake, pkg-config, glib, atk, pango, and gtk+. A simple "sudo apt-get install *insert package name here*" works for most of these prerequisites. The package associated with gmake is simply "make". Glib, atk, pango, and gtk+ cannot be located. I found an ftp link to glib compressed as a bz2 file, but I am not sure what to do with it. I downloaded, extracted, and compiled it, but I do not know what directory it goes in. I put it in the etc folder because I noticed that a lot of other software use this folder. The building process might not work without these dependencies, but I am not sure what to do so I will just continue with the process.

Step 3: Configure
Navigate to your freeciv directory and run autogen.sh by typing "./autogen.sh" (minus the quotes). I received an error message at this point saying that libcurl development files are required. I installed curl, but I still get the same message after trying to run autogen.sh again. I am honestly beyond lost now. My understanding of Linux at the moment is far too limited to get past this point. I will ask my team members for some pointers and come back to this.

Step 4: Make
I cannot actually make Freeciv yet because my configuration failed. I will update this section once I make it through the configuration phase.

No comments:

Post a Comment