Wednesday 18 May 2011

GPlates on Ubuntu

Ever wanted to watch plate evolution through time? Yes, of course you have.

GPlates on Ubuntu is great, but installing it at the moment takes a bit of know-how. Here's how I did it.

  • Visit http://www.gplates.org/
  • Download the .deb file
  • Attempt to install it, and find that the libicu42 dependency is 'unsatisfiable'.
  • Get annoyed, since libicu44 is already installed.

Here comes the hack to solve many of these dependency problems:
dpkg-deb -x ${debfile} tmpdir
dpkg-deb --control ${debfile} tmpdir/DEBIAN
sed 's/libicu42/libicu44/g' tmpdir/DEBIAN/control > tmp # Change this depending on the dependency issue you want to resolve.
mv tmp tmpdir/DEBIAN/control
dpkg -b tmpdir ${newdeb}

After this, run package manager with the new .deb file. You'll get a warning appearing telling you that the creator of the package (i.e. you) is not the same as the user who originally built the package. This warning is not usually to be taken lightly, and I take no responsibility for anyone screwing up their computer.

Anyway, the install should work fine. When you try to open gplates, it'll bring up an error:
gplates: error while loading shared libraries: libicuuc.so.42: cannot open shared object file: No such file or directory

There are a lot more icu libraries required too. Luckily, there's a quick way to solve this (though it is a horrible hack):
for file in /usr/lib/libicu*44*; do name=`echo ${file} | sed 's/44/42/g'`; sudo cp ${file} ${name}; done

Everything now works. If anyone can suggest a better way of doing this (by actually changing the hardwired libicu paths, for example), it would be great to hear from you!

No comments: