Setting Up A Development Environment

From LinuxMCE
Revision as of 02:44, 21 March 2008 by Jondecker76 (Talk | contribs) (Helpful Tools and Hints)

Jump to: navigation, search


Introduction

See also: Building_From_Source

I have seen a lot of questions on how to set up a development environment for LMCE. As a person with limited programming experience in c++, I can tell you that you don't have to be a master-level programmer to get your feet wet and examine the source code, and even make changes that add new features or fix existing bugs. It just takes a little patience, some help from experienced members, and a willingness to learn. There is a lot of information and help available in the forums, the wiki, and the linuxmce channel on IRC freenode servers.

That being said, dev work can also be risky business. You can seriously damage your installation compiling and testing changes, so USE THIS INFORMATION AT YOUR OWN RISK! If you really want to get started developing, the best advice I can give is to get a separate computer to set up as a development machine, so you don't damage your existing LinuxMCE installation accidentally! That way, if you make a change that LMCE really doesn't like, you won't trash your personally installation. (Too bad I don't follow my own advice, as I've done this before!)



The following tutorial represents my experiences only, and may not necessarily be the best or correct way to do things - though it has worked very well for me.

As I am a linux user, I am going to describe this process as I set up a development environment on my core from a computer running Ubuntu linux. Other linux variants will be very similar, if not the same. For Windows users, there is equivalent software that you can use, though I can't name any off of the top of my head - you will have to do your own research on that one.

Be sure to set aside a free evening to set up your development environment, as it can take several hours to complete!



Preface

The first thing I found surprising when I went to set up my first development environment is that it must be set up on your core. To my knowledge, you can't just make changes to the source on your desktop computer, compile them on your desktop computer, then upload them to the core. Everything must reside on the core, and you can have access to the source on your normal desktop over SSH (covered later). For those that aren't keen with working with a command line over ssh, this will take some getting used to (as was my case). But, once you get used to it, its not a bad development environment, and it even got me more familiar with the command line, and linux commands, which is something I've been meaning to do anyways. Lets get started...


Setting Up the Development Environment

Once you have a LinuxMCE Core up and running, the first thing we have to do is learn how to connect to it from our Desktop computer. On my Ubuntu desktop, I open a terminal via Applications->Accessories->Terminal. We will now use SSH to connect to out core - enter the following into the terminal:

ssh linuxmce@192.168.80.1

When prompted for a password, enter "linuxmce". (You may be prompted for a password several times during the setup of your development environment - this will always be "linuxmce")


Congratulations! You are now logged into the core over SSH from a remote computer! Now its time to install some packages needed for development. In the terminal, type:

sudo apt-get install subversion build-essential

This will install Subversion (SVN), which is needed to keep your local copy of the source code in sync with the latest changes, and well as some development libraries.


For my development environment, I decided to keep everything in my Home directory. The source can actually go many places, but I prefer using the Home directory. Lets go there now...

cd ~/


At this time, the source code is located at Charon Media (though it is supposed to be eventually hosted at svn.linuxmce.com). To download the most recent snapshot of the sourcecode that I know of, run the following:

wget http://www.charonmedia.org/lmce-1465.tbz

Once it downloads, test the checksum to make sure it didn't get corrupted during the download

md5sum lmce-1465.tbz

The checksum should be b3d4b3f6b33ff5e6c4641390f2314095

Now lets extract the source code:

tar xfj lmce-1465.tbz

And finally, lets download any changes that have been made since this snapshot was taken (this syncronizes your local copy of the source code with the most recent committed changes)

cd lmce
svn update

GREAT! You now have the most recent version of the source code available to you! You can run svn update at any time from within the lmce directory to get the latest changes that have been committed to SVN.


Now, before we can compile our own changes, lets build the most recent SVN version (this will not alter your current installation)

./configure
make

Note that you may get some warnings and errors, but they have never adversely affected me.

Once this is finished, you are now ready to compile changes in the source code! Please see my example #####################HERE##################


Helpful Tools and Hints

Getting latest svn.linuxmce.com changes (to be done)

Compiling changes and where to put them on the core (to be done)

Using VNC to remotely view the on-screen orbiter (to be done)

Navigating the core remotely with GUI (to be done)