Friday 25 June 2010

Downloading Source Code: Making an Arse of it.

I set out in my last post how to download and compile LZMA. It was, hopefully, relatively straightforwards. Now, what about when it goes wrong. I give you: compiling nano from source code.

Nano is a command line text editor. It is not OpenOffice.org. Is it easy to install? Let's see.

mkdir build-work
cd build-work/
wget http://www.nano-editor.org/dist/v2.1/nano-2.1.10.tar.gz
tar -xzvf nano-2.1.10.tar.gz
cd nano-2.1.10

So far, so LZMA. Let's have a look at the README and INSTALL files. Hmm, INSTALL is not much use:

"These are generic installation instructions."

In other words they are not tailored in anyway for nano, it is just telling you about configure/make/make install.

How about README?

How to compile and install nano

Download the nano source code, then:
tar zxvf nano-x.y.z.tar.gz
cd nano-x.y.z
./configure
make
make install

It's that simple.

Well that sounds promising! Hang on though, there is another README.SVN file; what's that?

GNU nano is available from SVN, but building this needs a bit more care
than the official stable and unstable tarballs.

Well, lets steer well clear of that then, sounds tricky. What ever SVN is. So:
./configure


configure: WARNING:
*** No curses lib available. Consider getting the official ncurses
*** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get
*** errors compiling nano.

Hmm. Not sure about this. However "if" you get errors. Let's leave this for now.

configure: WARNING: *** Couldn't successfully compile basic color test with or without _XOPEN_SOURCE_EXTENDED
configure: WARNING: *** This build may not compile. Consider configuring with --disable-color or installing ncurses

Ah, no ncurses = use the --disable-color option. Right-o.

checking for HTML support in groff... groff: can't find `DESC' file
groff:fatal error: invalid device `html' (try installing the `groff' package?)
no
*** Will not generate HTML version of man pages ***
*** Consider installing a newer version of groff with HTML support ***

No groff (whatever that is - sounds like something you tell your kids will come and eat them unless they behave themselves) = no manpages. Don't care about documentation - on we go!

So we need to clean up to do another configure with the no colour option? Sure.

make clean
./configure --disable-color

Result? It is still whining about the lack of a curses lib. Whatever that is. I have personally assembled a fucking large curses lib by now, I can tell you. Still - 'if' ... Let's make it.

make

Hmm. Doesn't seem to have worked - if you peer really closely you will see the following in the output:

makeinfo --no-split --html <> nano.html
/bin/bash: makeinfo: command not found

Right, so what the fuck is makeinfo then? I installed make, presumable makeinfo is something to do with it. Why isn't it installed?

sudo apt-get install makeinfo


E: Couldn't find package makeinfo

Fucking great. Gooooooooogle. Ah. Makeinfo is installed with the texinfo package. Of course it fucking is. Why not.

sudo apt-get install texinfo

Let's clean up and try again.

make clean
./configure --disable-color
make

Oh, for fuck's sake. In a word 'error'. In fact, in many words 'error error error' - just like a 1950's robot with smoke coming out of it's domed head about to go on a a rampage. Right, must be that ncurses nonsense then. Let's try and install it.

sudo apt-get install ncurses

Package ncurses is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ncurses has no installation candidate

FOR FUCK'S SAKE - don't tease me - tell me WHICH FUCKING PACKAGE REFERS TO IT! *give up* *try groff instead*

sudo apt-get install groff

SWEET JESUS - it worked! Right:

make clean
./configure --disable-color
make

Oh, fucking hell. Back to Google, where I find, eventually, that ncurses actually installed using:

sudo apt-get install libncurses5-dev

Well, clearly it is. I mean of course. The thing is that this is obviously the file that apt-get KNEW ABOUT BUT KEPT A FUCKING SECRET.

make clean
./configure --disable-color
make

It WORKED, it actually FUCKING WORKED! Hang on let's try

./src/nano

YES!

Remember:

It's that simple.

Bastards.

No comments:

Post a Comment